/* WonderPost – a little paper world, made for small screens first. */
:root {
  color-scheme: light;
  --bg: #f7f3ec;
  --paper: #fffdf8;
  --white: #ffffff;
  --ink: #403447;
  --muted: #776d7a;
  --subtle: #998d99;
  --line: #e6dedf;
  --line-soft: #eee7e3;
  --accent: #7456c9;
  --accent-hover: #6243b6;
  --accent-ink: #6345ad;
  --accent-soft: #eee7fa;
  --accent-pale: #f5f0fc;
  --accent-rgb: 116, 86, 201;
  --peach: #f4c8af;
  --peach-soft: #fff0e5;
  --sage: #bad2bd;
  --sage-soft: #eaf3e8;
  --success: #37634e;
  --success-soft: #eaf4eb;
  --danger: #a83d4e;
  --danger-soft: #fff0f0;
  --gold: #bb883c;
  --shadow-sm: 0 3px 9px rgb(62 42 57 / 4%);
  --shadow: 0 8px 25px rgb(62 42 57 / 6%);
  --shadow-lg: 0 18px 55px rgb(62 42 57 / 12%);
  --radius: 22px;
  --font: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="peach"] {
  --accent: #a34c36;
  --accent-hover: #8c3e2a;
  --accent-ink: #95432f;
  --accent-soft: #fce7d9;
  --accent-pale: #fff3ea;
  --accent-rgb: 163, 76, 54;
}

body[data-theme="mint"] {
  --accent: #376e5b;
  --accent-hover: #295947;
  --accent-ink: #315f50;
  --accent-soft: #e1eee3;
  --accent-pale: #f0f7ef;
  --accent-rgb: 55, 110, 91;
}

body[data-theme="lavender"] {
  --accent: #7456c9;
  --accent-hover: #6243b6;
  --accent-ink: #6345ad;
  --accent-soft: #eee7fa;
  --accent-pale: #f5f0fc;
  --accent-rgb: 116, 86, 201;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, select, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button, a, input, select, textarea, summary { touch-action: manipulation; }
button, a { -webkit-user-select: none; user-select: none; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; }
button:disabled { opacity: .48; }
button::-moz-focus-inner { border: 0; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
::selection { color: var(--ink); background: var(--peach); }
img, svg { max-width: 100%; }
img { height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 850; letter-spacing: -.9px; }
h2 { font-size: clamp(21px, 2.5vw, 27px); font-weight: 800; letter-spacing: -.6px; }
h3 { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
h4 { font-size: 16px; font-weight: 800; }
p { text-wrap: pretty; }
p + p { margin-top: 12px; }
small { font-size: 12px; line-height: 1.45; }
strong { font-weight: 800; }
hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line-soft); }
ul, ol { padding-left: 23px; }
li + li { margin-top: 6px; }
.sr-only, .screen-reader-only {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.text-small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--success); }

/* The little post office's navigation. */
.app-shell { min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed;
  z-index: 80;
  inset: auto 0 0;
  background: rgb(255 253 248 / 96%);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 30px rgb(64 52 71 / 4%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.brand, .sidebar-foot { display: none; }
.nav-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(49px, 1fr);
  gap: 2px;
  margin: 0;
  padding: 6px 5px max(8px, env(safe-area-inset-bottom));
  overflow-x: auto;
  scrollbar-width: none;
  list-style: none;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-list li { min-width: 0; margin: 0; }
.nav-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-width: 44px;
  min-height: 58px;
  padding: 7px 3px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 14px;
  text-decoration: none;
  transition: color .18s ease, background .18s ease;
}
.nav-button:hover { color: var(--accent-ink); background: var(--accent-pale); }
.nav-button[aria-current="page"], .nav-button[aria-pressed="true"],
.nav-button.active, .nav-button.is-selected { color: var(--accent-ink); background: var(--accent-soft); }
.nav-icon { display: grid; place-items: center; width: 25px; height: 25px; font-size: 21px; line-height: 1; }
.nav-icon svg { width: 23px; height: 23px; stroke-width: 1.8; }
.nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 10px; font-weight: 750; white-space: nowrap; }
.nav-badge, .nav-item-count {
  position: absolute; top: 4px; right: calc(50% - 24px);
  display: grid; place-items: center;
  min-width: 17px; height: 17px; padding: 0 4px;
  color: var(--white); background: var(--accent);
  border: 2px solid var(--paper); border-radius: 999px;
  font-family: system-ui, sans-serif; font-size: 9px; font-weight: 800;
}
.main-wrap { width: 100%; min-width: 0; margin: 0 auto; padding: 0 18px calc(110px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 73px; border-bottom: 1px solid var(--line-soft); }
.crumb { min-width: 0; color: var(--muted); font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb strong { color: var(--ink); }
.profile-switch { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.profile-switch select { width: auto; max-width: 168px; padding: 10px 28px 10px 11px; font-size: 12px; font-weight: 750; background-color: var(--paper); border-color: var(--line-soft); border-radius: 13px; }
.profile-avatar { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; color: var(--accent-ink); background: var(--accent-soft); border: 2px solid var(--paper); border-radius: 50%; font-size: 20px; box-shadow: var(--shadow-sm); }
.profile-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.icon-button { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; min-height: 44px; padding: 10px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; transition: background .18s, border-color .18s; }
.icon-button:hover { color: var(--accent-ink); background: var(--accent-pale); border-color: rgb(var(--accent-rgb), .25); }
.icon-button svg { width: 20px; height: 20px; }
.prototype-note { display: flex; align-items: center; gap: 9px; margin: 15px 0 25px; padding: 9px 12px; color: #7a6c79; background: rgb(255 253 248 / 62%); border: 1px dashed #dbd1dc; border-radius: 12px; font-size: 11px; line-height: 1.5; }
.prototype-note strong { color: #62526a; }
.prototype-note svg { width: 16px; height: 16px; flex: 0 0 16px; }
#main { width: 100%; max-width: 1120px; min-width: 0; margin: 0 auto; animation: page-in .25s ease both; }

/* Type, actions and generous paper surfaces. */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.page-header > div:first-child { flex: 1 1 260px; min-width: 0; }
.page-header h1 + p { margin-top: 10px; }
.page-header p { max-width: 630px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--accent-ink); font-size: 10px; font-weight: 850; line-height: 1.4; letter-spacing: 1.8px; text-transform: uppercase; }
.header-action { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; max-width: 100%; padding: 12px 19px;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  font-size: 14px; font-weight: 800; line-height: 1.25; text-align: center; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: background .18s ease, box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.button svg { width: 18px; height: 18px; flex: 0 0 18px; }
.button:hover:not(:disabled) { background: var(--accent-pale); border-color: rgb(var(--accent-rgb), .3); box-shadow: 0 5px 14px rgb(62 42 57 / 8%); transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.button.primary { color: var(--white); background: var(--accent); border-color: var(--accent); box-shadow: 0 4px 0 rgb(var(--accent-rgb), .16), 0 6px 16px rgb(var(--accent-rgb), .13); }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.button.secondary:hover:not(:disabled) { background: var(--accent-pale); border-color: rgb(var(--accent-rgb), .3); }
.button.ghost { color: var(--accent-ink); background: transparent; border-color: transparent; box-shadow: none; }
.button.ghost:hover:not(:disabled) { background: var(--accent-soft); border-color: transparent; }
.button.small { min-height: 44px; padding: 10px 13px; font-size: 12px; border-radius: 11px; }
.button.danger { color: var(--danger); background: var(--danger-soft); border-color: #efced2; box-shadow: none; }
.button.danger:hover:not(:disabled) { background: #ffe2e4; border-color: #dca5ad; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 29px 0 16px; }
.section-heading h2 { font-size: 21px; }
.section-heading p { color: var(--muted); font-size: 13px; }
.section-heading .button { flex-shrink: 0; }
.section-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.two-cols, .three-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.section-grid > *, .two-cols > *, .three-cols > * { min-width: 0; }
.paper-card { position: relative; min-width: 0; padding: 23px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.paper-card > p { margin-top: 9px; color: var(--muted); font-size: 14px; }
.paper-card > .button:last-child { margin-top: 20px; }

/* A large illustrated scene gives the world room to breathe. */
.home-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; background: linear-gradient(115deg, #f0e8f7, #f9eee5 78%); border: 1px solid rgb(142 109 156 / 9%); border-radius: 27px; box-shadow: var(--shadow-sm); isolation: isolate; }
.hero-copy { position: relative; z-index: 2; padding: 28px 25px 12px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 13px; color: #735385; font-size: 10px; font-weight: 850; letter-spacing: 1.35px; text-transform: uppercase; }
.hero-copy h1, .hero-copy h2 { max-width: 440px; font-size: clamp(29px, 4.2vw, 43px); font-weight: 850; line-height: 1.12; letter-spacing: -1.1px; }
.hero-copy p { max-width: 440px; margin-top: 14px; color: #79677a; font-size: 14px; line-height: 1.65; }
.hero-copy .button { margin-top: 22px; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 17px; margin-top: 18px; color: #79677a; font-size: 11px; }
.hero-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.hero-meta strong { color: #574260; }
.hero-art { position: relative; display: grid; place-items: center; min-width: 0; min-height: 200px; margin: 8px 0 0; overflow: hidden; align-self: stretch; }
.hero-art img { display: block; width: 100%; height: 100%; min-height: 220px; max-height: 350px; object-fit: cover; object-position: center; }
.hero-art svg { width: 100%; height: 100%; max-height: 380px; }
.hero-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 8px 18px rgb(249 238 229 / 12%); }
.quest-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 13px; min-width: 0; min-height: 210px; padding: 24px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.quest-card > img { width: 60px; height: 60px; object-fit: contain; }
.quest-card h3 { font-size: 19px; }
.quest-card p { color: var(--muted); font-size: 13px; }
.quest-card > .button { margin-top: auto; }
.quest-card .pill { margin-bottom: 2px; }
.quest-card:nth-child(3n + 1) { background: linear-gradient(145deg, #fffdf8 50%, #f5effb); }
.quest-card:nth-child(3n + 2) { background: linear-gradient(145deg, #fffdf8 50%, #f3f7ed); }
.quest-card:nth-child(3n) { background: linear-gradient(145deg, #fffdf8 50%, #fff0e4); }
.series-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 22px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
button.series-card { width: 100%; text-align: left; transition: transform .18s, border-color .18s; }
button.series-card:hover { border-color: rgb(var(--accent-rgb), .35); transform: translateY(-2px); }
.series-card > img { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: 13px; }
.series-card h3 { font-size: 18px; }
.series-card p { color: var(--muted); font-size: 12px; }
.series-progress { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 12px; }
.series-progress .progress-track { flex: 1 1 85px; }
.series-progress strong { color: var(--accent-ink); }
.progress-track { height: 7px; overflow: hidden; background: #ece5ed; border-radius: 999px; }
.progress-fill { height: 100%; min-width: 0; max-width: 100%; background: var(--accent); border-radius: inherit; transition: width .45s cubic-bezier(.2, .8, .2, 1); }

/* Perforated stamps retain a real paper edge, including without masks. */
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 23px; }
.filter-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 16px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 750; transition: background .18s, color .18s, border-color .18s; }
.filter-button:hover { color: var(--accent-ink); background: var(--accent-pale); }
.filter-button[aria-pressed="true"], .filter-button.active, .filter-button.is-selected { color: var(--accent-ink); background: var(--accent-soft); border-color: rgb(var(--accent-rgb), .24); }
.stamp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 10px; }
.stamp-card { position: relative; display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 9px; background: transparent; border: 1px solid transparent; border-radius: 19px; text-align: left; transition: background .18s, border-color .18s, transform .18s; }
button.stamp-card { width: 100%; min-height: 44px; }
.stamp-card:hover { background: rgb(255 253 248 / 72%); }
button.stamp-card:hover:not(:disabled) { transform: translateY(-3px); }
.stamp-card.selected, .stamp-card.is-selected, .stamp-card[aria-pressed="true"] { background: var(--accent-soft); border-color: rgb(var(--accent-rgb), .48); }
.stamp-frame { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; width: 100%; min-width: 0; margin-bottom: 12px; padding: 12px; overflow: hidden; background: #fffefb; border: 1px solid #e9e1de; box-shadow: 0 4px 8px rgb(64 52 71 / 9%); }
@supports (mask-image: linear-gradient(#000, #000)) {
  .stamp-frame {
    border: 0;
    -webkit-mask: linear-gradient(#000 0 0) center / calc(100% - 14px) calc(100% - 14px) no-repeat, radial-gradient(circle at 7px 7px, transparent 4px, #000 4.5px) -7px -7px / 14px 14px repeat;
    mask: linear-gradient(#000 0 0) center / calc(100% - 14px) calc(100% - 14px) no-repeat, radial-gradient(circle at 7px 7px, transparent 4px, #000 4.5px) -7px -7px / 14px 14px repeat;
  }
}
.stamp-frame img { display: block; width: 100%; height: 100%; min-width: 0; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 2px; background: var(--accent-pale); }
.stamp-frame > svg { width: 100%; height: 100%; }
.stamp-number { display: block; margin-bottom: 3px; color: var(--subtle); font-size: 9px; font-weight: 850; letter-spacing: 1.1px; text-transform: uppercase; }
.stamp-name { display: block; color: var(--ink); font-size: 13px; font-weight: 850; line-height: 1.35; overflow-wrap: anywhere; }
.stamp-desc { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.stamp-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 9px; color: var(--muted); font-size: 10px; }
.stamp-footer .button { padding: 8px 10px; }
.stamp-badge { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 7px; color: var(--accent-ink); background: var(--accent-soft); border-radius: 7px; font-size: 9px; font-weight: 850; line-height: 1.4; }
.stamp-frame .stamp-badge { position: absolute; z-index: 2; right: 12px; bottom: 12px; color: var(--ink); background: rgb(255 253 248 / 95%); box-shadow: var(--shadow-sm); }
.stamp-card.locked .stamp-frame { background: #ece7e6; box-shadow: none; }
.stamp-card.locked .stamp-frame img { filter: saturate(.12); opacity: .36; }
.stamp-card.locked .stamp-name { color: #817580; }
.stamp-card.locked .stamp-desc { color: #817580; }
.stamp-card.locked .stamp-badge { color: #796c79; background: #e9e2e7; }
.stamp-card.locked .stamp-frame::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; color: #827383; font-size: 38px; font-weight: 800; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 13px; padding: 44px 24px; text-align: center; background: rgb(255 253 248 / 60%); border: 1px dashed #d9ccdb; border-radius: var(--radius); }
.empty-state > img, .empty-state > svg { width: 82px; height: 82px; object-fit: contain; opacity: .85; }
.empty-state h2, .empty-state h3 { font-size: 21px; }
.empty-state p { max-width: 420px; color: var(--muted); font-size: 14px; }
.empty-state .button { margin-top: 6px; }

/* A postcard workshop, with a real card on the desk. */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 23px; align-items: start; }
.editor-preview { display: flex; flex-direction: column; align-items: center; gap: 15px; min-width: 0; padding: 29px 20px; overflow: hidden; background: #eee8e5; border: 1px solid #e4dbda; border-radius: 25px; }
.editor-preview > .hint { text-align: center; }
.editor-controls { min-width: 0; padding: 25px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.editor-controls h2, .editor-controls h3 { margin-bottom: 20px; }
.editor-controls > .button:last-child { width: 100%; margin-top: 8px; }
.postcard { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 540px; min-height: 230px; padding: 14px; overflow: hidden; color: var(--ink); background: #fffef9; border: 1px solid #e7dbd2; border-radius: 5px; box-shadow: 2px 9px 24px rgb(71 43 61 / 11%); transform: rotate(-1.6deg); }
.postcard::after { content: "WONDERPOST"; position: absolute; right: 17px; bottom: 12px; color: #ae9293; font-family: system-ui, sans-serif; font-size: 7px; font-weight: 700; letter-spacing: 1.7px; opacity: .8; }
.postcard-art { position: relative; display: grid; place-items: center; min-height: 150px; aspect-ratio: 1.5 / 1; width: 100%; overflow: hidden; background: var(--accent-soft); border-radius: 2px; font-size: clamp(58px, 12vw, 105px); line-height: 1.1; }
.postcard-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.postcard-art svg { width: 80%; height: 80%; }
.postcard-message { position: relative; min-height: 90px; padding: 23px 76px 27px 11px; color: #655169; font-size: clamp(14px, 2vw, 19px); font-weight: 750; line-height: 1.5; overflow-wrap: anywhere; }
.postcard-stamp { position: absolute; right: 23px; bottom: 39px; display: grid; place-items: center; width: 50px; height: 60px; padding: 5px; overflow: hidden; color: var(--accent-ink); background: var(--accent-soft); border: 2px dashed #baa1c3; transform: rotate(7deg); font-size: 26px; }
.postcard-stamp img { width: 100%; height: 100%; object-fit: cover; }
.form-field { display: flex; flex-direction: column; gap: 9px; min-width: 0; margin-bottom: 23px; }
.field-label, .form-field > label { display: block; color: var(--ink); font-size: 13px; font-weight: 800; }
.field-label small { margin-left: 6px; color: var(--muted); font-weight: 500; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), select, textarea {
  width: 100%; min-width: 0; min-height: 46px; padding: 12px 13px;
  color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 11px;
  font-size: 14px; line-height: 1.4; transition: border-color .18s, box-shadow .18s;
}
input::placeholder, textarea::placeholder { color: #9c909c; opacity: 1; }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: #c6b7ce; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled { color: #8a7f8a; background: #f1edeb; }
select { padding-right: 34px; }
textarea { resize: vertical; min-height: 105px; }
input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: 23px; height: 23px; margin: 0; accent-color: var(--accent); }
input[type="color"] { min-width: 46px; min-height: 46px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; }
.option-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.option-row > label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; cursor: pointer; }
.color-swatch { position: relative; display: inline-grid; place-items: center; flex: 0 0 46px; width: 46px; min-height: 46px; padding: 0; background: var(--swatch, var(--accent-soft)); border: 4px solid var(--paper); outline: 1px solid var(--line); outline-offset: 0; border-radius: 50%; transition: transform .16s, outline-color .16s; }
.color-swatch:hover { transform: scale(1.08); }
.color-swatch[aria-pressed="true"], .color-swatch.active, .color-swatch.is-selected, .color-swatch.selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.color-swatch[aria-pressed="true"]::after, .color-swatch.is-selected::after, .color-swatch.selected::after { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; color: var(--ink); background: rgb(255 253 248 / 82%); border-radius: 50%; font-size: 13px; font-weight: 850; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 62px; padding: 10px 8px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 13px; font-size: 12px; font-weight: 750; line-height: 1.35; text-align: center; transition: background .18s, border-color .18s; }
.choice-button > img { width: 39px; height: 39px; object-fit: contain; }
.choice-button > span:first-child:not(:only-child) { font-size: 25px; }
.choice-button:hover { background: var(--accent-pale); border-color: rgb(var(--accent-rgb), .3); }
.choice-button[aria-pressed="true"], .choice-button.active, .choice-button.is-selected, .choice-button.selected { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.hint { color: var(--muted); font-size: 11px; line-height: 1.6; }
.hint a { font-weight: 700; }

/* The mailbox, safe exchanges, and familiar faces. */
.mail-list { display: flex; flex-direction: column; gap: 14px; }
.mail-card { position: relative; display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 15px; min-width: 0; padding: 20px 17px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 20px; box-shadow: var(--shadow-sm); }
button.mail-card { width: 100%; color: inherit; text-align: left; transition: border-color .18s, transform .18s; }
button.mail-card:hover { border-color: rgb(var(--accent-rgb), .35); transform: translateY(-1px); }
.mail-card.unread { background: #fdfaff; border-color: #ded1f0; }
.mail-card.unread::before { content: ""; position: absolute; top: 20px; right: 19px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.mail-illustration { display: grid; place-items: center; width: 60px; height: 65px; overflow: hidden; background: var(--accent-pale); border-radius: 15px; font-size: 32px; }
.mail-illustration img { width: 100%; height: 100%; object-fit: cover; }
.mail-copy { min-width: 0; padding-right: 10px; }
.mail-copy h3 { font-size: 15px; }
.mail-copy p { margin-top: 5px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.mail-copy small { display: block; margin-top: 7px; color: var(--subtle); font-size: 10px; }
.mail-card > .button, .mail-card > .trade-actions { grid-column: 2; justify-self: start; }
.trade-card { min-width: 0; padding: 22px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.trade-card h3 { font-size: 18px; }
.trade-card > p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.trade-pair { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: center; gap: 9px; margin: 21px 0; }
.trade-stamp { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; padding: 11px 7px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 14px; text-align: center; }
.trade-stamp > img { display: block; width: 72px; height: 72px; object-fit: cover; border: 6px solid var(--white); box-shadow: var(--shadow-sm); }
.trade-stamp .stamp-frame { max-width: 112px; margin: 0; padding: 9px; }
.trade-stamp strong, .trade-stamp .stamp-name { font-size: 11px; }
.trade-stamp small { color: var(--muted); font-size: 10px; }
.trade-arrow { align-self: center; color: var(--accent); font-size: 24px; line-height: 1; text-align: center; }
.trade-arrow svg { width: 24px; height: 24px; }
.trade-status { display: flex; align-items: center; gap: 8px; margin: 14px 0; padding: 10px 12px; color: var(--accent-ink); background: var(--accent-pale); border-radius: 10px; font-size: 11px; }
.trade-status.success { color: var(--success); background: var(--success-soft); }
.trade-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.trade-actions > .button { flex: 1 1 112px; }
.pill { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 9px; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 1.4; }
.pill.success { color: var(--success); background: var(--success-soft); }
.pill.peach { color: #a15f3f; background: var(--peach-soft); }
.pill.muted { color: var(--muted); background: #eee8eb; }
.friend-card { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; min-width: 0; padding: 18px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: 18px; box-shadow: var(--shadow-sm); }
.friend-card > .profile-avatar { flex-basis: 49px; width: 49px; height: 49px; font-size: 27px; }
.friend-card > div:not(.profile-avatar) { min-width: 0; flex: 1 1 130px; }
.friend-card h3 { font-size: 15px; }
.friend-card p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.friend-card > .button { margin-left: auto; }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.theme-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 93px; padding: 11px 6px; color: var(--ink); background: var(--accent-pale); border: 1px solid var(--line); border-radius: 13px; font-size: 10px; font-weight: 800; text-align: center; }
.theme-card[data-theme="peach"] { background: #fff0e5; }
.theme-card[data-theme="mint"] { background: #eaf3e8; }
.theme-card[data-theme="lavender"] { background: #eee7fa; }
.theme-card > span:first-child:not(:only-child) { font-size: 28px; }
.theme-card[aria-pressed="true"], .theme-card.active, .theme-card.is-selected, .theme-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-card:hover { border-color: var(--accent); }

/* Everyone's tiny contribution makes a complete exhibition. */
.exhibition-board { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; padding: 27px 20px; overflow: hidden; background: #ebe2d6; background-image: radial-gradient(#d9cbbd 0.65px, transparent 0.65px); background-size: 5px 5px; border: 8px solid #d9c8b9; border-radius: 18px; box-shadow: inset 0 0 20px rgb(103 70 42 / 5%), var(--shadow-sm); }
.exhibit-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 0; min-height: 160px; padding: 15px 10px; color: #8d7974; background: rgb(255 253 248 / 24%); border: 1.5px dashed #bdaba0; border-radius: 8px; font-size: 11px; text-align: center; }
button.exhibit-slot { min-height: 160px; }
.exhibit-slot:hover { background: rgb(255 253 248 / 45%); border-color: #987f8d; }
.exhibit-slot > span:first-child:not(:only-child) { font-size: 28px; }
.exhibit-slot .button { min-width: 0; padding: 9px; font-size: 10px; }
.exhibit-item { position: relative; min-width: 0; padding: 9px 9px 13px; background: #fffdf7; border: 1px solid #e1d2c6; border-radius: 3px; box-shadow: 2px 5px 9px rgb(71 43 40 / 11%); text-align: center; transform: rotate(-3deg); }
.exhibit-item::before { content: ""; position: absolute; z-index: 2; top: -9px; left: calc(50% - 24px); width: 48px; height: 19px; background: rgb(248 232 190 / 73%); box-shadow: 0 1px 2px rgb(68 46 28 / 4%); transform: rotate(-5deg); }
.exhibit-item:nth-child(2n) { transform: rotate(3deg); }
.exhibit-item:nth-child(3n) { transform: rotate(-1deg); }
.exhibit-item > img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; margin-bottom: 8px; }
.exhibit-item .stamp-frame { margin-bottom: 7px; padding: 7px; box-shadow: none; }
.exhibit-item strong { display: block; font-size: 11px; }
.exhibit-item small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.reward-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 23px; padding: 23px; color: var(--success); background: var(--sage-soft); border: 1px solid #d1e2cd; border-radius: 20px; }
.reward-banner > img { width: 68px; height: 68px; object-fit: contain; }
.reward-banner > div { min-width: 0; flex: 1 1 180px; }
.reward-banner h3 { font-size: 19px; }
.reward-banner p { margin-top: 5px; color: #617967; font-size: 13px; }
.reward-banner .button { margin-left: auto; }

/* Adult controls stay calm and easy to read. */
.settings-card { min-width: 0; padding: 24px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.settings-card + .settings-card { margin-top: 18px; }
.settings-card > h2, .settings-card > h3 { margin-bottom: 8px; }
.settings-card > p { margin-bottom: 17px; color: var(--muted); font-size: 13px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 77px; padding: 17px 0; border-bottom: 1px solid var(--line-soft); }
.setting-row:last-child { padding-bottom: 0; border-bottom: 0; }
.setting-row:first-child { padding-top: 0; }
.setting-row > div:first-child, .setting-row > label:first-child { min-width: 0; }
.setting-row strong, .setting-row label { font-size: 13px; font-weight: 800; }
.setting-row p, .setting-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.setting-row > select { width: auto; max-width: 150px; flex: 0 1 150px; }
.toggle-switch, input.toggle-switch[type="checkbox"] { position: relative; display: inline-block; flex: 0 0 59px; width: 59px; height: 44px; min-height: 44px; margin: 0; padding: 0; appearance: none; -webkit-appearance: none; background: #ddd5de; border: 2px solid transparent; border-radius: 999px; transition: background .2s; cursor: pointer; }
.toggle-switch::before { content: ""; position: absolute; top: 5px; left: 5px; width: 30px; height: 30px; background: var(--white); border-radius: 50%; box-shadow: 0 2px 5px rgb(52 39 62 / 15%); transition: transform .2s; }
.toggle-switch[aria-checked="true"], .toggle-switch.active, .toggle-switch.is-selected, .toggle-switch:checked { background: var(--accent); }
.toggle-switch[aria-checked="true"]::before, .toggle-switch.active::before, .toggle-switch.is-selected::before, .toggle-switch:checked::before { transform: translateX(15px); }
details { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
summary { min-height: 48px; padding: 14px 17px; font-size: 13px; font-weight: 800; cursor: pointer; }
summary::marker { color: var(--accent); }
details[open] > summary { border-bottom: 1px solid var(--line-soft); }
details > :not(summary) { margin: 15px 17px; }
.prototype-panel { margin-top: 26px; color: var(--muted); background: rgb(255 253 248 / 63%); border: 1px dashed #d8cdda; border-radius: 15px; font-size: 12px; line-height: 1.65; }
.prototype-panel:not(details) { padding: 18px; }
.prototype-panel summary { color: #75617d; }
.prototype-panel h3 { font-size: 14px; }
.prototype-panel p + p { margin-top: 8px; }
.prototype-panel code { padding: 2px 4px; background: var(--accent-pale); border-radius: 4px; font-size: 11px; overflow-wrap: anywhere; }

/* Dialogs and little moments of feedback. */
.modal-backdrop { position: fixed; z-index: 1000; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgb(42 30 52 / 46%); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fade-in .18s ease both; }
.modal { width: min(100%, 600px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); min-width: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border: 1px solid rgb(255 255 255 / 65%); border-radius: 25px; box-shadow: 0 25px 80px rgb(30 19 41 / 25%); animation: dialog-in .23s cubic-bezier(.2, .8, .2, 1) both; }
dialog.modal { padding: 0; color: var(--ink); }
.modal-header { position: sticky; z-index: 3; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 21px 23px; background: var(--paper); border-bottom: 1px solid var(--line-soft); }
.modal-header h2, .modal-header h3 { min-width: 0; font-size: 21px; }
.modal-header .icon-button { flex-basis: 40px; width: 44px; background: transparent; border-color: transparent; }
.modal-body { padding: 23px; }
.modal-body > p { color: var(--muted); font-size: 14px; }
.modal-body > p + .form-field, .modal-body > p + .stamp-grid { margin-top: 21px; }
.modal-body .postcard { width: calc(100% - 10px); margin: 8px auto 20px; }
.modal-body .stamp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modal-body .stamp-card { padding: 9px; }
.modal-body .stamp-frame { max-height: 175px; }
.modal-body .empty-state { padding: 25px 18px; }
.modal-actions { position: sticky; z-index: 3; bottom: 0; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 17px 23px 21px; background: var(--paper); border-top: 1px solid var(--line-soft); }
.modal-actions .button { flex: 1 1 110px; }
.toast-stack { position: fixed; z-index: 1400; right: 15px; bottom: calc(94px + env(safe-area-inset-bottom)); left: 15px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 14px 17px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 650; line-height: 1.5; pointer-events: auto; animation: toast-in .23s ease both; overflow-wrap: anywhere; }
.toast.success { color: var(--success); background: #f3fbef; border-color: #c7dfc5; }
.toast.error { color: var(--danger); background: #fff5f3; border-color: #efcdd1; }
.toast > svg { flex: 0 0 20px; width: 20px; height: 20px; }
.confetti { position: fixed; z-index: 1300; inset: 0; overflow: hidden; pointer-events: none; }
.confetti > span, .confetti > i { position: absolute; top: -18px; left: var(--x, 50%); width: 9px; height: 14px; background: var(--color, var(--peach)); border-radius: 2px; animation: confetti-fall var(--duration, 2.8s) var(--delay, 0s) ease-in both; }
.confetti > :nth-child(3n) { background: var(--sage); border-radius: 50%; }
.confetti > :nth-child(3n + 1) { background: #b499e3; }
.confetti > :nth-child(3n + 2) { background: #f5cd75; }

@keyframes page-in { from { opacity: .2; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes confetti-fall { 0% { opacity: 0; transform: translate3d(0, -20px, 0) rotate(0); } 8% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; transform: translate3d(var(--drift, 80px), 105vh, 0) rotate(620deg); } }

/* Compact phones remain comfortable at 320 px. */
@media (max-width: 359px) {
  .main-wrap { padding-right: 13px; padding-left: 13px; }
  .topbar { gap: 7px; }
  .profile-switch { gap: 5px; }
  .profile-switch select { max-width: 134px; padding-left: 8px; font-size: 11px; }
  .profile-avatar { flex-basis: 31px; width: 31px; height: 31px; font-size: 18px; }
  .crumb { font-size: 10px; }
  .hero-copy { padding: 25px 21px 10px; }
  .stamp-grid { gap: 13px 4px; }
  .stamp-card { padding: 7px; }
  .stamp-frame { padding: 10px; }
  .stamp-name { font-size: 12px; }
  .filter-button { padding: 10px 12px; font-size: 11px; }
  .paper-card, .quest-card, .series-card, .settings-card, .editor-controls, .trade-card { padding: 19px; }
  .mail-card { grid-template-columns: 48px minmax(0, 1fr); gap: 11px; padding: 17px 14px; }
  .mail-illustration { width: 48px; height: 57px; font-size: 27px; }
  .exhibition-board { gap: 17px 10px; padding: 23px 13px; border-width: 6px; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100dvh - 20px); border-radius: 21px; }
  .modal-header, .modal-body, .modal-actions { padding-left: 18px; padding-right: 18px; }
}

@media (min-width: 480px) and (max-width: 719px) {
  .main-wrap { padding-right: 25px; padding-left: 25px; }
  .stamp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px 10px; }
  .home-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .hero-copy { padding: 31px 0 31px 28px; }
  .hero-copy h1, .hero-copy h2 { font-size: 30px; }
  .hero-art { margin: 0; }
  .hero-art img { min-height: 100%; object-position: 56% center; }
  .nav-label { font-size: 11px; }
}

/* Tablet keeps bottom navigation and expands the creative workbench. */
@media (min-width: 720px) {
  .main-wrap { padding-right: 34px; padding-left: 34px; }
  .topbar { min-height: 84px; }
  .crumb { font-size: 13px; }
  .profile-switch select { max-width: 210px; font-size: 13px; }
  .profile-avatar { flex-basis: 40px; width: 40px; height: 40px; font-size: 23px; }
  .prototype-note { margin-top: 18px; margin-bottom: 29px; padding: 10px 14px; font-size: 12px; }
  .page-header { margin-bottom: 29px; }
  .page-header p { font-size: 15px; }
  .eyebrow { font-size: 11px; }
  .two-cols, .section-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; }
  .three-cols, .section-grid.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .section-grid .two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-grid .three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-hero { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); min-height: 355px; }
  .hero-copy { padding: 36px 0 37px 34px; align-self: center; }
  .hero-copy h1, .hero-copy h2 { font-size: 36px; }
  .hero-copy p { font-size: 14px; }
  .hero-art { min-height: 345px; margin: 0; }
  .hero-art img { height: 100%; max-height: none; min-height: 355px; object-position: center; }
  .hero-meta { font-size: 11px; }
  .section-heading { margin-top: 33px; margin-bottom: 20px; }
  .section-heading h2 { font-size: 23px; }
  .stamp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 23px 14px; }
  .stamp-card { padding: 10px; }
  .stamp-name { font-size: 14px; }
  .stamp-desc { font-size: 11px; }
  .stamp-number { font-size: 10px; }
  .stamp-footer { font-size: 11px; }
  .stamp-badge { font-size: 10px; }
  .filter-button { font-size: 13px; }
  .editor-layout { grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); gap: 23px; }
  .editor-preview { position: sticky; top: 24px; min-height: 430px; justify-content: center; padding: 38px 22px; }
  .editor-controls { padding: 25px; }
  .mail-card { grid-template-columns: 75px minmax(0, 1fr) auto; padding: 23px; gap: 20px; }
  .mail-illustration { width: 75px; height: 77px; font-size: 40px; }
  .mail-copy h3 { font-size: 17px; }
  .mail-copy p { font-size: 13px; }
  .mail-card > .button, .mail-card > .trade-actions { grid-column: 3; }
  .mail-card.unread::before { top: 17px; right: 17px; }
  .trade-pair { gap: 12px; }
  .trade-stamp { padding: 14px 10px; }
  .trade-stamp strong, .trade-stamp .stamp-name { font-size: 12px; }
  .trade-stamp small { font-size: 11px; }
  .exhibition-board { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding: 36px 27px; }
  .exhibit-slot { min-height: 180px; }
  .settings-card { padding: 28px; }
  .setting-row strong, .setting-row label { font-size: 14px; }
  .setting-row p, .setting-row small { font-size: 12px; }
  .modal-backdrop { padding: 28px; }
  .modal { max-height: calc(100dvh - 56px); }
  .modal-header { padding: 24px 29px; }
  .modal-body { padding: 27px 29px; }
  .modal-actions { padding: 19px 29px 25px; }
  .modal-actions .button { flex: 0 1 auto; }
  .modal-body .stamp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toast-stack { right: 25px; left: auto; width: min(400px, calc(100vw - 50px)); }
  .nav-list { max-width: 760px; margin: 0 auto; padding-top: 8px; }
  .nav-label { font-size: 11px; }
}

/* Desktop is an illustrated world with a quiet, persistent side rail. */
@media (min-width: 1020px) {
  .app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); }
  .sidebar { position: sticky; inset: auto; top: 0; display: flex; flex-direction: column; width: 230px; height: 100vh; height: 100dvh; padding: 34px 18px 20px; background: #fffdf8; border-top: 0; border-right: 1px solid var(--line-soft); box-shadow: none; backdrop-filter: none; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--ink); text-decoration: none; font-size: 23px; font-weight: 850; letter-spacing: -.9px; }
  .brand-mark { display: grid; place-items: center; flex: 0 0 37px; width: 37px; height: 42px; color: var(--accent); font-size: 29px; transform: rotate(-7deg); }
  .brand-mark img, .brand-mark svg { width: 100%; height: 100%; object-fit: contain; }
  .brand > div small { display: block; margin-top: 2px; color: var(--subtle); font-size: 8px; font-weight: 750; letter-spacing: 1.7px; text-transform: uppercase; }
  .nav-list { display: flex; flex-direction: column; flex: 0 1 auto; gap: 7px; width: 100%; max-width: none; margin: 39px 0 0; padding: 0; overflow-x: visible; overflow-y: auto; }
  .nav-button { flex-direction: row; justify-content: flex-start; gap: 13px; min-height: 49px; padding: 13px 15px; border-radius: 13px; }
  .nav-icon { flex: 0 0 23px; width: 23px; height: 23px; font-size: 20px; }
  .nav-label { font-size: 12px; font-weight: 750; }
  .nav-badge, .nav-item-count { position: static; min-width: 20px; height: 20px; margin-left: auto; border: 0; font-size: 10px; }
  .sidebar-foot { display: block; margin-top: auto; padding: 25px 12px 1px; color: var(--subtle); font-size: 10px; line-height: 1.75; }
  .sidebar-foot p + p { margin-top: 8px; }
  .sidebar-foot strong { color: #78637f; font-size: 11px; }
  .sidebar-foot .pill { margin-bottom: 12px; }
  .sidebar-foot .button { width: 100%; justify-content: flex-start; margin-bottom: 10px; padding-left: 0; color: var(--muted); font-size: 11px; }
  .main-wrap { max-width: 1320px; padding: 0 38px 60px; }
  .topbar { min-height: 82px; max-width: 1120px; margin: 0 auto; }
  .prototype-note { max-width: 1120px; margin-right: auto; margin-left: auto; }
  .home-hero { min-height: 360px; }
  .hero-copy { padding: 37px 0 38px 36px; }
  .hero-copy h1, .hero-copy h2 { font-size: clamp(34px, 3vw, 43px); }
  .hero-copy p { max-width: 365px; font-size: 14px; }
  .hero-art { min-height: 360px; }
  .hero-art img { min-height: 360px; }
  .quest-card { padding: 23px; }
  .stamp-grid { gap: 24px 15px; }
  .editor-layout { grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr); }
  .editor-preview { min-height: 470px; }
  .toast-stack { bottom: 27px; right: 27px; }
}

@media (min-width: 1280px) {
  .main-wrap { padding-right: 46px; padding-left: 46px; }
  .home-hero { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  .hero-copy { padding-left: 41px; }
  .hero-copy p { font-size: 15px; }
  .hero-kicker { font-size: 11px; }
  .hero-meta { font-size: 12px; }
  .stamp-grid { gap: 27px 21px; }
  .stamp-card { padding: 12px; }
  .stamp-frame { padding: 14px; }
  .stamp-name { font-size: 15px; }
  .stamp-desc { font-size: 12px; }
  .paper-card, .series-card, .quest-card { padding: 26px; }
  .editor-layout { grid-template-columns: minmax(0, 1.25fr) minmax(310px, .85fr); gap: 28px; }
  .editor-preview { padding: 47px 32px; }
  .editor-controls { padding: 28px; }
  .exhibition-board { padding: 41px 32px; gap: 26px; }
  .exhibit-item strong { font-size: 12px; }
  .exhibit-slot { min-height: 205px; }
}

/* Integration with the interactive application's real element structure. */
svg.ui-icon { display: inline-block; flex: 0 0 20px; width: 20px; height: 20px; vertical-align: middle; }
.nav-icon .ui-icon { width: 23px; height: 23px; }
.brand-mark .ui-icon { width: 33px; height: 33px; }
.profile-avatar .ui-icon { width: 21px; height: 21px; }
.profile-avatar.large .ui-icon { width: 27px; height: 27px; }
.profile-avatar.mint { color: #376e5b; background: #e1eee3; }
.profile-avatar.peach { color: #a34c36; background: #fce7d9; }
.profile-avatar.lavender { color: #7456c9; background: #eee7fa; }
.hero-kicker .ui-icon, .hero-meta .ui-icon { flex-basis: 14px; width: 14px; height: 14px; }
.pill .ui-icon { flex-basis: 12px; width: 12px; height: 12px; }
.button .ui-icon { flex-basis: 18px; width: 18px; height: 18px; }
.empty-state > .ui-icon { flex-basis: auto; width: 64px; height: 64px; padding: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 20px; }
.topbar-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 10px; min-width: 0; }
.crumb { display: flex; align-items: center; flex: 1 1 auto; gap: 8px; }
.crumb > .ui-icon { flex-basis: 17px; width: 17px; height: 17px; color: var(--accent); }
.crumb > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-switch select { max-width: 146px; }
.brand-soft { color: var(--accent); }
.brand small { display: block; margin-top: 3px; color: var(--subtle); font-size: 8px; font-weight: 700; line-height: 1.4; letter-spacing: 1px; }
.skip-link { position: fixed; z-index: 1800; top: 12px; left: 12px; display: inline-flex; align-items: center; min-height: 46px; max-width: calc(100vw - 24px); padding: 12px 18px; color: var(--white); background: var(--accent); border-radius: 12px; font-size: 14px; font-weight: 800; box-shadow: var(--shadow-lg); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.text-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 44px; padding: 8px 3px; color: var(--accent-ink); background: transparent; border: 0; border-radius: 6px; font-size: 11px; font-weight: 800; line-height: 1.4; text-decoration: underline; text-decoration-color: rgb(var(--accent-rgb), .35); text-underline-offset: 4px; }
.text-button:hover { text-decoration-color: currentColor; }
.prototype-note { padding-top: 5px; padding-bottom: 5px; }
.prototype-note > span { flex: 1 1 auto; min-width: 0; }
.prototype-note > .text-button { margin-left: auto; }
.prototype-note > .ui-icon { flex-basis: 16px; width: 16px; height: 16px; }
.progress-fill { display: block; }
img.hero-art { display: block; width: 100%; height: auto; min-height: 0; aspect-ratio: 5 / 3; object-fit: cover; object-position: center; }
.series-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.series-symbol { display: grid; place-items: center; width: 32px; height: 32px; }
.series-symbol .ui-icon { width: 26px; height: 26px; }
.series-art-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; gap: 8px; width: 100%; padding: 7px 0 6px; }
.series-art-row img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; padding: 4px; object-fit: cover; background: var(--white); border: 1px solid #e8e0de; border-radius: 2px; box-shadow: 1px 3px 7px rgb(64 52 71 / 7%); transform: rotate(-5deg); }
.series-art-row img:nth-child(2) { transform: translateY(-3px) rotate(2deg); }
.series-art-row img:nth-child(3) { transform: rotate(6deg); }
.series-card .progress-track { width: 100%; margin-top: auto; }
.series-card p { min-height: 2.8em; }
.home-shortcuts { margin-top: 24px; }
.shortcut-card { display: flex; align-items: flex-start; gap: 15px; }
.shortcut-icon { display: grid; place-items: center; flex: 0 0 45px; width: 45px; height: 48px; color: var(--accent-ink); background: var(--accent-soft); border-radius: 15px; }
.shortcut-icon .ui-icon { width: 24px; height: 24px; }
.shortcut-icon.sage { color: #4d785f; background: #e8f0e3; }
.shortcut-card > div:last-child { min-width: 0; }
.shortcut-card h3 { font-size: 16px; line-height: 1.35; }
.shortcut-card p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.shortcut-card .button { margin-top: 12px; padding-right: 0; padding-left: 0; text-align: left; }
.album-count { display: flex; flex-direction: column; align-items: flex-end; min-width: 108px; padding: 9px 0 3px; }
.album-count > strong { color: var(--accent-ink); font-size: 31px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.album-count > strong > span { color: var(--subtle); font-size: 18px; font-weight: 600; }
.album-count small { margin-top: 6px; color: var(--muted); font-size: 10px; }
.album-tip { display: flex; align-items: flex-start; gap: 15px; margin-top: 27px; background: var(--accent-pale); border-color: rgb(var(--accent-rgb), .1); }
.album-tip > .ui-icon { flex-basis: 26px; width: 26px; height: 26px; color: var(--accent); }
.album-tip > p { margin: 0; color: #7b6c82; font-size: 12px; line-height: 1.7; }
.album-tip strong { color: var(--accent-ink); }
.stamp-frame { display: block; }
.stamp-frame > .stamp-number { position: absolute; z-index: 1; right: 14px; bottom: 3px; left: 14px; margin: 0; color: #8a768a; font-family: system-ui, sans-serif; font-size: 6px; line-height: 1; letter-spacing: 1px; text-align: right; }
.stamp-footer { justify-content: flex-start; gap: 5px; }
.stamp-footer > span:not(.stamp-badge) { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.stamp-footer .ui-icon { flex-basis: 11px; width: 11px; height: 11px; }
.stamp-footer > .stamp-badge { margin-left: auto; }
.stamp-mini { display: inline-block; flex: 0 0 66px; width: 66px; height: 66px; padding: 6px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 3px 7px rgb(64 52 71 / 7%); transform: rotate(-4deg); }
.stamp-mini img { display: block; width: 100%; height: 100%; object-fit: cover; }
.workshop-intro { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 25px; background: var(--accent-pale); }
.workshop-intro > div { display: grid; grid-template-columns: 29px minmax(0, 1fr); align-items: start; gap: 6px 12px; flex: 1 1 250px; min-width: 0; }
.workshop-intro > div > .ui-icon { grid-row: 1 / span 2; width: 27px; height: 27px; color: var(--accent); }
.workshop-intro h3 { font-size: 17px; line-height: 1.4; }
.workshop-intro p { grid-column: 2; color: var(--muted); font-size: 12px; line-height: 1.65; }
.workshop-intro > .pill { flex-shrink: 0; }
.field-label { line-height: 1.8; }
.step-number { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 7px; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid rgb(var(--accent-rgb), .14); border-radius: 50%; font-size: 11px; font-weight: 850; vertical-align: middle; }
.step-number.done { color: var(--white); background: var(--accent); border-color: var(--accent); }
.quest-reward { display: flex; align-items: center; gap: 15px; width: 100%; max-width: 430px; margin-top: 12px; padding: 16px; background: rgb(255 253 248 / 85%); border: 1px solid #e0d5df; border-radius: 15px; }
.quest-reward > div { min-width: 0; }
.quest-reward .eyebrow { margin-bottom: 5px; font-size: 8px; letter-spacing: 1.2px; }
.quest-reward strong { display: block; font-size: 13px; line-height: 1.4; }
.quest-reward small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.quest-reward .stamp-mini { flex-basis: 59px; width: 59px; height: 59px; }
.editor-action { padding-top: 18px; border-top: 1px solid var(--line-soft); }
.editor-action > .button { width: 100%; }
.editor-action .hint { margin-top: 12px; text-align: center; }
.motif-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.motif-grid > .choice-button { aspect-ratio: 1 / 1; min-height: 50px; padding: 4px; border-radius: 10px; }
.motif-grid > .choice-button > img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.color-swatch > .ui-icon { position: relative; z-index: 2; width: 18px; height: 18px; color: var(--ink); }
.color-swatch:has(> .ui-icon)::after { content: none; }
.postcard { background: var(--card-color, #eee7fa); border-color: #ddcdd8; }
.postcard-label { position: relative; z-index: 1; display: block; padding: 0 3px 11px; color: #70576f; font-family: system-ui, sans-serif; font-size: 7px; font-weight: 750; letter-spacing: 1.25px; }
.postcard-art { min-height: 0; aspect-ratio: 1.4 / 1; background: rgb(255 253 248 / 50%); border: 4px solid rgb(255 253 248 / 60%); }
.postcard-art > img { min-width: 0; height: 100%; aspect-ratio: auto; object-fit: contain; }
.postcard-message { padding-top: 22px; padding-bottom: 30px; color: #59465e; font-size: 15px; }
.postcard-stamp { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; right: 22px; bottom: 37px; width: 49px; height: 59px; color: #86617c; background: rgb(255 253 248 / 60%); border-color: #ab849f; }
.postcard-stamp .ui-icon { flex-basis: 22px; width: 22px; height: 22px; }
.postcard-stamp span { font-family: system-ui, sans-serif; font-size: 5px; font-weight: 850; letter-spacing: .5px; }
.postcard-postmark { position: absolute; top: 37px; right: 22px; display: grid; place-items: center; width: 59px; height: 59px; color: #825575; background: rgb(255 253 248 / 30%); border: 2px double #956580; border-radius: 50%; font-family: system-ui, sans-serif; font-size: 7px; font-weight: 800; letter-spacing: .8px; opacity: .62; transform: rotate(15deg); pointer-events: none; }
.postcard-large { max-width: 480px; }
.postcard-large .postcard-message { font-size: 16px; }
.mail-card { grid-template-columns: 54px minmax(0, 1fr) 18px; gap: 12px; }
.mail-illustration { width: 54px; height: 60px; padding: 5px; background: var(--card-color, var(--accent-pale)); border: 1px solid #e7d9e5; border-radius: 9px; transform: rotate(-4deg); }
.mail-illustration img { object-fit: contain; border-radius: 4px; }
.mail-copy { padding-right: 0; }
.mail-copy .eyebrow { margin-bottom: 5px; font-size: 8px; letter-spacing: 1.4px; }
.mail-copy h3 { line-height: 1.4; }
.mail-copy p .ui-icon { width: 13px; height: 13px; vertical-align: -2px; }
.mail-card.unread::before { content: none; }
.mail-indicator { display: grid; place-items: center; width: 18px; min-height: 24px; color: var(--accent); }
.mail-indicator .ui-icon { width: 17px; height: 17px; }
.mail-indicator .status-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.trade-intro { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 23px; }
.trade-intro > div { min-width: 0; flex: 1 1 210px; }
.trade-intro h3 { font-size: 17px; }
.trade-intro p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.trade-intro > .button { margin-top: 0; }
.trade-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.trade-list > * { min-width: 0; }
.trade-card .trade-status { justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; background: transparent; }
.trade-card .trade-status .text-small { font-size: 10px; }
.trade-stamp > .stamp-mini { flex-basis: auto; width: 68px; height: 68px; margin-bottom: 3px; }
.trade-stamp > small { overflow-wrap: anywhere; }
.confirmation { display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 28px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.confirmation .ui-icon { flex-basis: 11px; width: 11px; height: 11px; color: var(--success); }
.confirmation:has(.ui-icon) { color: var(--success); }
.trade-card > .hint { margin-top: 13px; }
.trade-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 24px; }
.trade-form .form-field { margin: 0; }
.trade-form select { font-size: 13px; }
.exhibition-card > .section-heading { margin-top: 0; }
.exhibition-card .section-heading p { margin-top: 10px; font-size: 13px; }
.exhibition-board { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 27px 21px; }
.exhibit-slot { justify-content: flex-start; min-height: 167px; padding: 16px 13px; background: rgb(255 253 248 / 20%); }
.exhibit-slot.filled { border-style: solid; border-color: #c2b1a5; background: rgb(255 253 248 / 42%); }
.exhibit-label { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; color: #7b6276; }
.exhibit-label > .ui-icon { flex-basis: 17px; width: 17px; height: 17px; }
.exhibit-label strong { font-size: 11px; line-height: 1.35; }
.exhibit-placeholder { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 11px; min-height: 96px; padding: 10px; color: #9d8684; }
.exhibit-placeholder .ui-icon { width: 27px; height: 27px; color: #a88aa1; }
.exhibit-placeholder span { max-width: 140px; font-size: 11px; }
.exhibit-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(67px, 1fr)); align-items: start; gap: 16px 12px; width: 100%; padding-top: 12px; }
.exhibit-item { width: 100%; max-width: 145px; margin: 0 auto; padding: 7px 7px 9px; }
.exhibit-item > img { margin-bottom: 6px; object-fit: contain; }
.exhibit-item > span { display: block; color: #816b80; font-size: 9px; line-height: 1.4; }
.exhibition-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 17px; margin-top: 23px; }
.exhibition-footer p { flex: 1 1 220px; max-width: 600px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.exhibition-footer p .ui-icon { width: 16px; height: 16px; margin-right: 4px; }
.reward-banner > .ui-icon { flex-basis: 33px; width: 33px; height: 33px; }
.reward-banner strong { font-size: 16px; }
.commemorative-stamp { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: 0 0 74px; width: 74px; height: 74px; color: var(--success); border: 2px dashed #6e9476; border-radius: 50%; font-size: 9px; font-weight: 850; letter-spacing: 1.4px; transform: rotate(11deg); }
.commemorative-stamp .ui-icon { width: 23px; height: 23px; }
.theme-card { justify-content: flex-start; gap: 8px; padding: 9px 9px 13px; min-height: 143px; background: var(--paper); }
.theme-preview { display: grid; place-items: center; width: 100%; height: 73px; background: var(--swatch, var(--accent-soft)); border-radius: 8px; }
.theme-preview > .ui-icon { width: 31px; height: 31px; color: #756077; }
.theme-card > strong { font-size: 11px; }
.theme-card > small { margin-top: -3px; color: var(--muted); font-size: 9px; }
.theme-card[aria-pressed="true"] { background: var(--accent-pale); }
.stamp-detail { display: flex; flex-direction: column; align-items: center; gap: 19px; }
.stamp-detail > .stamp-frame { width: min(225px, 80%); max-height: none; margin: 0; }
.stamp-detail > p { max-width: 450px; color: var(--muted); font-size: 14px; text-align: center; }
.stamp-detail > .option-row { justify-content: center; }
.reward-illustration { position: relative; display: grid; place-items: center; width: 220px; max-width: 100%; min-height: 225px; margin: 0 auto 15px; }
.reward-illustration::before { content: ""; position: absolute; z-index: 0; width: 155px; height: 165px; background: #f9f0f4; border: 1px solid #e0d2da; box-shadow: 2px 6px 10px rgb(64 52 71 / 8%); transform: translate(17px, 0) rotate(9deg); }
.reward-illustration > img { position: relative; z-index: 1; width: 172px; height: 172px; padding: 10px; object-fit: contain; background: var(--white); border: 1px solid #e7dce2; box-shadow: 2px 6px 14px rgb(64 52 71 / 11%); transform: rotate(-8deg); }
.reward-count { position: absolute; z-index: 2; right: 4px; bottom: 24px; display: grid; place-items: center; width: 53px; height: 53px; color: var(--white); background: var(--accent); border: 4px solid var(--paper); border-radius: 50%; font-size: 22px; font-weight: 850; }
.center { text-align: center; }
p.center { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.confirmation-summary { margin-top: 19px; padding: 17px; color: #685570; background: var(--accent-pale); border: 1px solid rgb(var(--accent-rgb), .1); border-radius: 13px; }
.confirmation-summary p { font-size: 13px; line-height: 1.6; }
.confirmation-summary p + p { margin-top: 7px; }
.confirmation-summary p.hint { color: var(--muted); font-size: 11px; }
.confirmation-summary .ui-icon { width: 17px; height: 17px; }
.how-to-steps { display: grid; gap: 11px; }
.how-to-steps > p { margin: 0; padding: 14px 16px; color: var(--muted); background: var(--white); border: 1px solid var(--line-soft); border-radius: 12px; font-size: 13px; line-height: 1.7; }
.how-to-steps strong { color: var(--accent-ink); }
.contribution-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 23px; }
.contribution-grid > .choice-button { gap: 9px; padding: 10px; font-size: 11px; }
.contribution-grid > .choice-button > img { width: 100%; height: auto; max-width: 125px; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 4px; }
.modal-body > .prototype-panel:first-child { margin-top: 0; margin-bottom: 18px; }
.modal-body > .settings-card { padding: 21px; }
.modal-body > .settings-card + .hint { margin-top: 17px; }
.modal-body > .modal-actions { margin: 23px -23px -23px; padding-top: 19px; }
.modal-header > .icon-button { flex-basis: 44px; }
label.toggle-switch { isolation: isolate; border: 0; }
label.toggle-switch::before { content: none; }
label.toggle-switch > input[type="checkbox"] { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; min-height: 44px; margin: 0; opacity: 0; cursor: pointer; }
label.toggle-switch > span { position: absolute; inset: 0; background: #ddd5de; border: 2px solid transparent; border-radius: inherit; transition: background .2s; pointer-events: none; }
label.toggle-switch > span::before { content: ""; position: absolute; top: 5px; left: 5px; width: 30px; height: 30px; background: var(--white); border-radius: 50%; box-shadow: 0 2px 5px rgb(52 39 62 / 15%); transition: transform .2s; }
label.toggle-switch:has(input:checked), label.toggle-switch > input:checked + span { background: var(--accent); }
label.toggle-switch > input:checked + span::before { transform: translateX(15px); }
label.toggle-switch:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 4px; }
label.toggle-switch:has(input:disabled) { opacity: .5; cursor: not-allowed; }

@media (max-width: 419px) {
  .topbar { gap: 9px; }
  .topbar-actions { gap: 6px; }
  .profile-switch .profile-avatar { display: none; }
  .profile-switch { gap: 0; }
  .profile-switch select { width: 111px; max-width: 111px; padding: 11px 20px 11px 9px; font-size: 11px; }
  .crumb { gap: 6px; font-size: 11px; }
  .crumb > .ui-icon { flex-basis: 15px; width: 15px; height: 15px; }
  .prototype-note { gap: 7px; }
  .prototype-note > .text-button { font-size: 10px; }
  .prototype-note > span { font-size: 10px; }
  .quest-reward { gap: 11px; padding: 13px; }
  .quest-reward .stamp-mini { flex-basis: 49px; width: 49px; height: 49px; }
  .quest-reward strong { font-size: 12px; }
  .quest-reward small { font-size: 9px; }
  .workshop-intro h3 { font-size: 16px; }
  .mail-card { grid-template-columns: 47px minmax(0, 1fr) 16px; gap: 10px; }
  .mail-illustration { width: 47px; height: 54px; }
  .mail-copy h3 { font-size: 13px; }
  .mail-copy p { font-size: 11px; }
  .mail-indicator { width: 16px; }
  .theme-card { padding: 7px 7px 11px; }
  .theme-card > strong { font-size: 10px; }
  .exhibition-card { padding: 18px; }
  .exhibition-board { padding: 22px 14px; }
  .stamp-footer { font-size: 9px; }
  .shortcut-card { gap: 12px; }
  .shortcut-icon { flex-basis: 39px; width: 39px; height: 43px; }
  .modal-body > .settings-card { padding: 18px; }
}

@media (max-width: 359px) {
  .profile-switch select { width: 104px; max-width: 104px; padding-left: 8px; }
  .crumb { font-size: 10px; }
  .modal-body > .modal-actions { margin-right: -18px; margin-left: -18px; }
  .step-number { width: 22px; height: 22px; margin-right: 4px; }
  .field-label { font-size: 12px; }
  .postcard-large .postcard-message { font-size: 14px; }
  .postcard-stamp { right: 20px; width: 44px; height: 56px; }
}

@media (min-width: 480px) and (max-width: 719px) {
  img.hero-art { height: 100%; min-height: 315px; margin: 0; aspect-ratio: auto; object-position: 53% center; }
}

@media (min-width: 720px) {
  .profile-switch select { max-width: 172px; }
  img.hero-art { height: 100%; min-height: 355px; margin: 0; aspect-ratio: auto; object-position: 53% center; }
  .series-art-row { gap: 6px; }
  .series-card p { min-height: 3em; }
  .shortcut-card h3 { font-size: 17px; }
  .shortcut-card p { font-size: 13px; }
  .album-count > strong { font-size: 36px; }
  .album-count small { font-size: 11px; }
  .postcard-large .postcard-message { font-size: 17px; }
  .mail-card { grid-template-columns: 72px minmax(0, 1fr) 24px; gap: 20px; }
  .mail-illustration { width: 72px; height: 76px; padding: 6px; }
  .mail-copy h3 { font-size: 17px; }
  .mail-copy .eyebrow { font-size: 9px; }
  .mail-indicator { width: 24px; }
  .trade-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trade-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
  .exhibition-board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 29px 21px; }
  .exhibit-slot { min-height: 193px; padding: 17px 11px; }
  .exhibit-label { flex-direction: column; gap: 7px; }
  .exhibit-label strong { font-size: 12px; }
  .exhibit-items { gap: 15px 9px; }
  .exhibit-item { padding: 5px 5px 8px; }
  .exhibit-item > span { font-size: 8px; }
  .exhibit-placeholder { min-height: 109px; }
  .theme-card { gap: 10px; min-height: 159px; padding: 12px 12px 17px; }
  .theme-preview { height: 88px; }
  .theme-card > strong { font-size: 13px; }
  .theme-card > small { font-size: 10px; }
  .contribution-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .modal-body > .modal-actions { margin-right: -29px; margin-bottom: -27px; margin-left: -29px; }
}

@media (min-width: 1020px) {
  .profile-switch select { max-width: 174px; }
  img.hero-art { min-height: 360px; }
  .brand { gap: 8px; padding-right: 4px; padding-left: 7px; font-size: 21px; }
  .brand-mark { flex-basis: 32px; width: 32px; height: 37px; }
  .brand-mark .ui-icon { width: 30px; height: 30px; }
  .sidebar-foot .pill { padding-right: 8px; padding-left: 8px; font-size: 9px; }
  .sidebar-foot .pill .ui-icon { flex-basis: 11px; width: 11px; height: 11px; }
}

@media (min-width: 1280px) {
  .series-art-row { gap: 10px; padding-top: 10px; padding-bottom: 9px; }
  .series-art-row img { padding: 5px; }
  .exhibition-board { gap: 23px; padding: 32px 27px; }
  .exhibit-label { flex-direction: row; }
  .exhibit-slot { min-height: 205px; padding: 19px 14px; }
  .exhibit-item > span { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .confetti { display: none; }
  button.stamp-card:hover, button.series-card:hover, .button:hover, button.mail-card:hover { transform: none; }
}

@media (prefers-contrast: more) {
  :root { --muted: #62556a; --subtle: #746579; --line: #b7a9bc; --line-soft: #cfc2d0; }
  .stamp-desc, .hint, .hero-copy p, .hero-meta, .prototype-note, .sidebar-foot { color: #635369; }
  .button, .filter-button, .nav-button[aria-current="page"], .nav-button.active { border: 1px solid currentColor; }
  .stamp-card.locked .stamp-frame img { opacity: .55; }
  .stamp-card.locked .stamp-name, .stamp-card.locked .stamp-desc { color: #66576a; }
  .paper-card, .quest-card, .series-card, .settings-card, .mail-card, .trade-card { border-color: #c3b4c6; }
}

@media (forced-colors: active) {
  .progress-fill, .status-dot, .toggle-switch[aria-checked="true"], .toggle-switch:checked { background: Highlight; }
  .toggle-switch, .stamp-card, .button, .pill, .choice-button, .color-swatch { border: 1px solid ButtonText; }
  .nav-button[aria-current="page"], .filter-button[aria-pressed="true"], .stamp-card[aria-pressed="true"], .choice-button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .stamp-frame { -webkit-mask: none; mask: none; }
}
