/* Keep hash navigation clear of the sticky header while using the available height. */
html:root { scroll-padding-top: 72px; }
.screen, .nika-stories, .donation h2 { scroll-margin-top: 8px; }
.studio { padding-block: clamp(14px, 2.1vh, 30px); }
.studio > h2 { font-size: clamp(32px, 3.5vw, 53px); margin-bottom: 4px; }
.studio-intro { margin-bottom: 13px; }
.studio .card-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  min-height: 36px;
  margin-bottom: 10px;
}
.studio .pager {
  grid-column: 2;
  grid-row: 1;
  gap: 6px;
  padding: 3px;
  border: 1px solid #cad8c4;
  border-radius: 100px;
  background: #f7faf2;
  color: var(--pine-ink);
}
.studio .pager .round {
  width: 30px;
  height: 30px;
  border: 0;
}
.studio .pager .round:hover { background: #e4eddb; }
.studio .pager .round img { width: 16px; height: 16px; }
.studio #card-counter { min-width: 37px; text-align: center; white-space: nowrap; }
.card-picker-text { grid-column: 1; grid-row: 1; }
.editor-tools { padding-top: 16px; }
.studio .sticker-tools { padding: 2px; }
.actions { margin-top: 12px; }
.actions .outline { min-height: 38px; }
.editor .hint { margin-top: 5px; font-size: 12px; }
.mobile-help { display: none; }

.workbench .donation { margin-top: 40px; }
.donation { padding-block: 18px; }
.donation h2 { margin-bottom: 6px; }
.bag-cost { margin-bottom: 12px; }
.donation .presets label { min-height: 41px; padding-block: 6px; }
.donation .amount-input { margin-top: 8px; }
.amount-input input { font-size: 16px; padding-block: 8px; }
.bag-meter { margin-top: 11px; }
.donation .amount-summary { padding: 4px 0; margin-bottom: 5px; }
.stamp-option { margin-bottom: 10px; }
.payment-note { margin-top: 7px; }
#submit-donation { min-height: 44px; }

@media (min-width: 1280px) {
  .studio .sticker-tools { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 5px; }
  .studio .sticker-tools button { width: 100%; height: clamp(37px, 3.25vw, 49px); padding: 7px; }
}

@media (max-width: 800px) {
  .workbench .donation { margin-top: 0; }
  .studio .mobile-help {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 42px; margin-top: 8px;
    background: #cee1c6; border-radius: 12px; color: var(--pine-ink);
    font-size: 14px; font-weight: 750; text-decoration: none;
  }
}

@media (max-width: 720px) {
  html:root { scroll-padding-top: 62px; }
  .screen, .nika-stories, .donation h2 { scroll-margin-top: 4px; }
  .studio { padding-block: 14px 16px; }
  .studio-intro { font-size: 14px; margin-bottom: 7px; }
  .studio .workbench { gap: 15px; }
  .studio .sticker-tools { gap: 6px; padding-block: 2px 4px; }
  .studio .sticker-tools button { width: 44px; height: 44px; flex-basis: 44px; padding: 6px; }
  .studio .actions { margin-top: 9px; }
  .studio .actions .outline { min-height: 42px; }
  .studio .keyboard-hint { display: none; }
  .editor .hint { font-size: 12px; margin-top: 5px; }
  .mast { min-height: clamp(484px, 76svh, 590px); }
  .mast::before { height: 55%; }
}

@media (max-width: 360px) {
  .studio .actions { gap: 3px; }
  .studio .actions .outline { padding-inline: 7px; }
  .studio .actions #save-card img { width: 14px; }
}

@media (prefers-reduced-motion: no-preference) {
  .studio-intro.arrived { animation: workshop-enter .42s ease-out both; }
  .sticker-tools.arrived img { animation: sticker-pop .42s cubic-bezier(.18,.73,.32,1.3) both; }
  .sticker-tools.arrived button:nth-child(2n) img { animation-delay: .07s; }
  .sticker-tools.arrived button:nth-child(3n) img { animation-delay: .13s; }
  @keyframes workshop-enter { from { opacity: .52; translate: 0 6px; } to { opacity: 1; translate: 0; } }
  @keyframes sticker-pop { from { scale: .7; opacity: .45; } to { scale: 1; opacity: 1; } }
}

.postage-album {
  display: grid;
  grid-template: auto / repeat(2, minmax(0, 1fr));
  align-items: center;
  aspect-ratio: auto;
  gap: clamp(10px, 2vw, 30px);
  padding: 12px 6px;
}
.postage {
  --dot: 4px;
  min-width: 0;
  padding: 13px;
  background: #fff1d5;
  color: #194638;
  filter: drop-shadow(0 3px 9px #06271f4f);
  mask: radial-gradient(circle at 50% 0,transparent var(--dot),#000 calc(var(--dot) + 1px)) 0 0 / 15px 53% repeat-x,
        radial-gradient(circle at 50% 100%, transparent var(--dot),#000 calc(var(--dot) + 1px)) 0 100% / 15px 53% repeat-x;
  rotate: -7deg;
}
.postage:nth-child(2) { background: #ffe0b6; rotate: 8deg; margin-top: 32px; }
.postage a { display: block; text-decoration: none; color: inherit; }
.postage a:focus-visible { outline-offset: -2px; }
.postage img { width: 100%; height: auto; aspect-ratio: 1 / 1.05; object-fit: cover; border: 1px solid #704a3824; }
.postage span { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 0 4px; padding: 6px 1px 1px; font-weight: 750; }
.postage small { font-size: 10px; letter-spacing: .04em; font-weight: 550; }
@media (max-width: 720px) {
  .postage-album { width: 93%; }
  .postage { --dot: 3px; padding: 9px; }
}
@media (prefers-reduced-motion: no-preference) {
  .postage-album.arrived .postage { animation: stamp-enter .58s cubic-bezier(.18,.76,.26,1.1) both; transition: rotate .22s ease; }
  .postage-album.arrived .postage:nth-child(2) { animation-delay: .12s; }
  .postage-album .postage:hover { rotate: 0deg; }
  @keyframes stamp-enter { from { opacity: .48; translate: 0 20px; scale: .93; } to { opacity: 1; translate: 0; scale: 1; } }
}
.desktop-editor-hint { display: none; }
@media (min-width: 1280px) and (max-height: 900px) {
  #cards { scroll-margin-top: 2px; padding-block: 10px 14px; }
  .studio > h2 { font-size: clamp(32px, 2.65vw, 43px); margin-bottom: 3px; }
  .studio-intro { max-width: none; margin-bottom: 5px; font-size: 15px; line-height: 1.3; }
  .studio .card-caption { margin-bottom: 9px; }
  .desktop-editor-hint { display: inline; font-size: 13px; font-weight: 550; }
  .card-picker-text, .editor .hint { display: none; }
  .editor-tools { padding-top: 13px; }
  .studio .sticker-tools button { height: 43px; }
  .actions { margin-top: 10px; }
  .actions .outline { min-height: 34px; padding-block: 6px; }

}
@media (max-width: 390px) {
  .page-header .menu a { padding-inline: clamp(4px, 1.5vw, 6px); }
  .page-header .partners img:first-child { width: clamp(34px, 10.3vw, 41px); }
  .page-header .partners img:last-child { width: clamp(29px, 9.2vw, 37px); }
}
@media (max-width: 350px) {
  .studio-intro { font-size: 13px; }
  .actions { flex-wrap: nowrap; }
  .studio .actions .outline { font-size: 12px; }
  .studio .tool-icon { flex-shrink: 0; }
}

.editor .status:not(.sr-only) { color: #8d2240; margin-top: 7px; }
@media (max-width: 350px) {
  .page-header .menu { padding: 3px 2px; gap: 0; }
  .page-header .menu a { padding-inline: 3px; font-size: 10px; }
  .page-header .partners { gap: 3px; }
  .page-header .partners span { font-size: 13px; }
  .studio > h2 { font-size: 30px; }
  .studio .mobile-help { margin-top: 5px; }
  .studio .card-caption { margin-bottom: 7px; }
  .studio .pager .round { width: 28px; height: 28px; }
  .studio .editor-tools { padding-top: 10px; }
  .studio .actions { margin-top: 6px; }
  .card-picker-text { visibility: hidden; }
}
.touch-hint { display: none; }
@media (pointer: coarse) and (min-width: 351px) {
  .touch-hint { display: inline; }
}

/* The middle grid row is shared by the postcard and the donation panel. */
@media (min-width: 1280px) {
  .studio .workbench {
    grid-template-rows: auto auto auto;
    row-gap: 0;
  }
  .studio .editor {
    display: grid;
    grid-column: 1;
    grid-row: 1 / span 3;
    grid-template-rows: subgrid;
  }
  .studio .workbench .donation {
    grid-column: 2;
    grid-row: 2;
    align-self: stretch;
    margin: 0;
    padding-block: clamp(13px, calc(5.5vw - 57px), 22px);
    display: flex;
    flex-direction: column;
  }
  .studio .donation .bag-cost { margin-bottom: 15px; }
  .studio .donation #submit-donation { margin-top: auto; }
  .studio .donation .stamp-option { margin-bottom: 13px; }
}
@media (min-width: 1280px) and (max-height: 790px) {
  #cards { padding-block: 6px 6px; }
  .studio > h2 { font-size: 32px; }
  .studio-intro { margin-bottom: 4px; }
  .studio .card-caption { margin-bottom: 6px; }
  .studio .editor-tools { padding-top: 10px; }
  .studio .actions { margin-top: 7px; }
}

@media (min-width: 1280px) and (max-width: 1360px) {
  .studio .donation h2 { font-size: 32px; }
  .studio .donation .bag-cost { margin-bottom: 10px; }
  .studio .donation .stamp-option { margin-bottom: 8px; }
  .studio .donation .presets label { min-height: 37px; padding-block: 4px; }
  .studio .donation .bag-meter { margin-top: 7px; }
  .studio .donation .amount-summary { padding-block: 2px; }
  .studio .donation .payment-note { margin-top: 5px; }
}
