:root {
  --ink: #1e2631;
  --muted: #7c8693;
  --line: #e7e8e6;
  --paper: #f5f2ea;
  --panel: #fffdf8;
  --teal: #178c88;
  --teal-dark: #116a68;
  --coral: #ef6f5e;
  --yellow: #f5c95b;
  --blue: #5c91ce;
  --lilac: #a288cb;
  --shadow: 0 18px 50px rgba(31, 40, 45, .09);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Noto Sans SC", system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { background: #1e2b32; color: #f6f4ec; padding: 28px 18px; display: flex; flex-direction: column; gap: 34px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 11px; }
.brand-mark { width: 30px; height: 30px; border: 2px solid #e2b65c; transform: rotate(-9deg); position: relative; background: #f6f1e6; }
.brand-mark::after { content: ""; width: 14px; height: 14px; position: absolute; top: 5px; left: 5px; border: 2px solid #1e2b32; }
.brand strong { letter-spacing: .04em; font-size: 17px; }
.brand small { color: #9eaeb0; display: block; margin-top: 2px; font-size: 10px; letter-spacing: .12em; }
.nav { display: grid; gap: 8px; }
.nav button { border: 0; background: transparent; color: #aebec1; text-align: left; padding: 12px 14px; border-radius: 8px; display: flex; gap: 12px; align-items: center; font-size: 14px; }
.nav button.active, .nav button:hover { background: #30464b; color: white; }
.nav-icon { width: 19px; text-align: center; font-size: 16px; }
.side-foot { margin-top: auto; padding: 13px 12px; border: 1px solid #385056; border-radius: 8px; color: #aebec1; font-size: 12px; line-height: 1.55; }
.side-foot strong { color: #f7f2df; display: block; margin-bottom: 5px; }
.main { min-width: 0; padding: 34px 46px 50px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.eyebrow { color: var(--teal); font: 500 11px "DM Mono", monospace; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 7px 0 5px; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.04em; line-height: 1.15; }
.subtitle { color: var(--muted); font-size: 14px; margin: 0; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 7px; padding: 10px 14px; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { border-color: #b9c8c5; }
.btn.primary { background: var(--teal); color: white; border-color: var(--teal); }
.btn.primary:hover { background: var(--teal-dark); }
.btn.icon { width: 38px; height: 38px; padding: 0; justify-content: center; font-size: 17px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr); gap: 24px; align-items: start; }
.map-panel, .panel { background: var(--panel); border: 1px solid #ece9e1; border-radius: 9px; box-shadow: var(--shadow); }
.panel-head { padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.panel-head span { color: var(--muted); font-size: 12px; }
.map-wrap { height: 560px; position: relative; overflow: hidden; border-radius: 0 0 9px 9px; background: #dfe4df; }
.memory-map { width: 100%; height: 100%; z-index: 1; font-family: "Noto Sans SC", system-ui, sans-serif; }
.map-legend { position: absolute; left: 18px; bottom: 28px; z-index: 500; background: rgba(255,253,248,.94); border: 1px solid #ebe6db; border-radius: 7px; padding: 11px 13px; font-size: 11px; color: var(--muted); display: flex; gap: 14px; box-shadow: 0 5px 18px rgba(31,40,45,.12); pointer-events: none; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.legend-dot.route-dot { background: var(--coral); } .legend-dot.pin-dot { background: var(--teal); }
.memory-index { background: transparent; border: 0; box-shadow: none; color: white; font: 700 9px "DM Mono", monospace; }
.memory-index::before { display: none; }
.memory-popup { display: grid; grid-template-columns: 56px minmax(100px, 1fr); gap: 10px; align-items: center; min-width: 180px; }
.memory-popup img { width: 56px; height: 50px; object-fit: cover; border-radius: 4px; background: #ecebe6; }
.memory-popup strong, .memory-popup span { display: block; }
.memory-popup strong { color: var(--ink); font-size: 12px; }
.memory-popup span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.leaflet-popup-content-wrapper { border-radius: 7px; }
.leaflet-control-attribution { font-size: 9px; }
.right-col { display: grid; gap: 24px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; }
.stat { padding: 20px; border-right: 1px solid var(--line); } .stat:last-child { border: 0; }
.stat b { display: block; font-size: 28px; letter-spacing: -.06em; } .stat span { color: var(--muted); font-size: 12px; }
.activity { padding: 4px 20px 18px; }
.activity-item { display: flex; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.activity-item:last-child { border-bottom: 0; }
.activity-thumb { width: 46px; height: 46px; border-radius: 5px; object-fit: cover; background: #eee; }
.activity-copy { min-width: 0; } .activity-copy b { font-size: 13px; display: block; } .activity-copy p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.status { margin-left: auto; font: 11px "DM Mono", monospace; color: var(--teal); white-space: nowrap; }
.status.pending { color: #b58b22; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; padding: 18px 20px; }
.quick .btn { flex: 1; justify-content: center; min-width: 130px; }
.import-state { padding: 14px 20px 0; border-top: 1px solid var(--line); }
.import-state strong, .import-state span { display: block; }
.import-state strong { font-size: 12px; }
.import-state span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.import-state.working strong { color: var(--teal-dark); }
.section { margin-top: 28px; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.sticker-card { background: var(--panel); border: 1px solid #ebe8e0; border-radius: 8px; padding: 9px; position: relative; transition: transform .18s, box-shadow .18s; }
.sticker-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(31,40,45,.1); }
.sticker-image-frame { aspect-ratio: 1.05; display: grid; place-items: center; overflow: hidden; border-radius: 5px; }
.sticker-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sticker-card.generated .sticker-image-frame { background: #dfe8e3; }
.sticker-card.generated img { width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 0 4px #fffdf8) drop-shadow(0 8px 8px rgba(44,54,50,.2)); }
.sticker-name { font-size: 12px; margin: 9px 2px 1px; font-weight: 600; } .sticker-meta { font-size: 10px; color: var(--muted); margin: 0 2px; }
.sticker-chip { position: absolute; top: 15px; left: 15px; border-radius: 3px; padding: 3px 6px; font-size: 10px; color: #fff; background: var(--teal); }
.sticker-chip.coral { background: var(--coral); } .sticker-chip.yellow { background: #bf8f21; }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed #d4d6cf; border-radius: 8px; grid-column: 1 / -1; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(27, 37, 41, .48); display: grid; place-items: center; z-index: 20; padding: 20px; }
.modal { width: min(660px, 100%); background: var(--panel); border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.24); overflow: hidden; }
.modal-head { padding: 19px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; } .modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 22px; }
.permission { display: grid; grid-template-columns: 70px 1fr; gap: 16px; align-items: center; background: #f0f5f1; border: 1px solid #dce8df; padding: 15px; border-radius: 8px; }
.permission-icon { width: 58px; height: 58px; border-radius: 13px; display: grid; place-items: center; background: var(--teal); color: white; font-size: 27px; }
.permission p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.modal-foot { padding: 14px 22px; background: #faf8f2; display: flex; justify-content: flex-end; gap: 9px; }
.segment-modal { width: min(760px, 100%); }
.segmentation-stage { background: #202a2d; border-radius: 7px; padding: 14px; }
.seg-photo { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 5px; background: #d7cec0; }
.seg-photo > img { width: 100%; height: 100%; object-fit: cover; opacity: .83; display: block; }
.seg-photo > canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.segment-loading { position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: 8px; color: white; background: rgba(25, 35, 38, .45); font-size: 11px; pointer-events: none; }
.segment-loading.visible { display: grid; }
.segment-spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: segment-spin .8s linear infinite; }
@keyframes segment-spin { to { transform: rotate(360deg); } }
.mask { position: absolute; border: 0; padding: 0; cursor: pointer; opacity: .7; transition: opacity .15s, filter .15s, transform .15s; mix-blend-mode: screen; }
.mask:hover { opacity: .9; }
.mask.selected { opacity: .78; filter: drop-shadow(0 0 3px white) drop-shadow(0 0 7px currentColor); transform: scale(1.025); }
.mask.m1 { color: #ef6f5e; left: 4%; top: 5%; width: 48%; height: 76%; background: rgba(239,111,94,.6); clip-path: polygon(8% 8%, 39% 0, 62% 14%, 92% 7%, 100% 40%, 82% 63%, 95% 91%, 53% 100%, 18% 88%, 0 58%); }
.mask.m2 { color: #4b9eb0; left: 36%; top: 30%; width: 38%; height: 32%; background: rgba(75,158,176,.68); clip-path: polygon(8% 25%, 44% 0, 92% 14%, 100% 74%, 63% 100%, 4% 83%); }
.mask.m3 { color: #d5a62e; right: 1%; top: 10%; width: 41%; height: 84%; background: rgba(213,166,46,.58); clip-path: polygon(18% 2%, 94% 8%, 100% 92%, 34% 100%, 0 74%, 8% 28%); }
.seg-tools { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; color: #c9d1ce; font-size: 11px; } .seg-tools strong { color: white; }
.subject-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.subject-chip { min-width: 138px; border: 1px solid #dddeda; background: transparent; border-radius: 6px; padding: 9px 10px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.subject-chip i, .selected-subjects i { width: 10px; height: 10px; border-radius: 2px; background: var(--subject); }
.subject-chip span { margin-left: auto; font-weight: 700; }
.subject-chip.selected { color: var(--ink); border-color: var(--subject); background: color-mix(in srgb, var(--subject) 9%, white); }
.segment-empty { color: var(--muted); font-size: 11px; padding: 10px 0; }
.segment-error { margin: 13px 0 0; color: #b5473b; font-size: 11px; line-height: 1.5; }
.segment-note { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 14px 0 0; }
.segment-result { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(220px, .8fr); gap: 24px; align-items: center; }
.cutout-stage { min-height: 330px; display: grid; place-items: center; border-radius: 7px; background-color: #d9d5ca; background-image: linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px); background-size: 22px 22px; }
.cutout-preview { width: 78%; transform: rotate(-3deg); filter: drop-shadow(0 13px 13px rgba(46,50,46,.22)); }
.cutout-preview img { display: block; width: 100%; aspect-ratio: 1.08; object-fit: cover; clip-path: polygon(9% 13%, 36% 5%, 64% 12%, 91% 5%, 96% 35%, 87% 64%, 94% 90%, 58% 95%, 31% 89%, 6% 96%, 10% 57%, 3% 32%); filter: drop-shadow(0 0 5px white); }
.result-copy h3 { margin: 8px 0 8px; font-size: 19px; line-height: 1.35; }
.result-copy p { color: var(--muted); font-size: 11px; line-height: 1.7; }
.selected-subjects { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.selected-subjects span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; font-size: 10px; }
.collage { min-height: 420px; aspect-ratio: 4 / 3; background: #e7dfcf; position: relative; overflow: hidden; }
.collage::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(74,71,62,.12); pointer-events: none; }
.collage-piece { position: absolute; border: 5px solid #fffdf8; box-shadow: 0 8px 14px rgba(59,49,36,.15); object-fit: cover; cursor: grab; touch-action: none; user-select: none; transition: transform .16s ease, box-shadow .16s ease, filter .16s ease; } .collage-piece:active { cursor: grabbing; } .collage-piece.peeled { filter: saturate(1.08); box-shadow: 12px 18px 22px rgba(59,49,36,.25); z-index: 3; } .cp1 { width: 140px; height: 110px; right: 33px; top: 72px; transform: rotate(7deg); } .cp2 { width: 105px; height: 110px; right: 144px; bottom: 26px; transform: rotate(-8deg); } .cp3 { width: 80px; height: 80px; right: 28px; bottom: 23px; transform: rotate(13deg); border-radius: 50%; }
.editor-canvas { width: min(760px, 100%); min-height: 560px; margin: auto; border: 1px solid rgba(255,255,255,.22); box-shadow: 0 24px 58px rgba(0,0,0,.28); }
.editor-canvas .cp1 { width: 232px; height: 182px; right: 72px; top: 98px; transform: rotate(7deg); }
.editor-canvas .cp2 { width: 164px; height: 172px; right: 264px; bottom: 58px; transform: rotate(-8deg); }
.editor-canvas .collage-badge-piece { width: 132px; height: 132px; }
.editor-canvas .collage-badge-piece.cb1 { left: 72px; bottom: 62px; }
.editor-canvas .collage-badge-piece.cb2 { left: 192px; bottom: 98px; }
.collage-badge-piece { width: 104px; height: 104px; padding: 0; background: #fffdf8; border-radius: 50%; }
.collage-badge-piece.cb1 { left: 32px; bottom: 28px; transform: rotate(-7deg); }
.collage-badge-piece.cb2 { left: 126px; bottom: 54px; transform: rotate(8deg); }
.peel-toolbar { display: flex; gap: 8px; align-items: center; padding-top: 15px; }
.compose-modal { width: min(1120px, 100%); background: #1e292e; overflow: hidden; }
.editor-chrome, .editor-bottom { min-height: 58px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; color: #eaf0ed; background: #1e292e; }
.editor-left, .editor-right { display: flex; align-items: center; gap: 8px; }
.editor-divider { width: 1px; height: 22px; background: rgba(255,255,255,.16); margin: 0 5px; }
.editor-icon, .editor-rail-tool { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 6px; color: #dce8e4; background: rgba(255,255,255,.05); font-size: 18px; }
.editor-icon:hover, .editor-rail-tool:hover { color: white; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.24); }
.editor-icon.accent { background: var(--teal); border-color: var(--teal); color: white; }
.editor-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 16px; min-height: 640px; padding: 26px; background: #131b1f; }
.editor-rail { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.editor-rail-tool { width: 42px; height: 42px; }
.editor-bottom { border-top: 1px solid rgba(255,255,255,.08); justify-content: flex-start; gap: 8px; }
.editor-spacer { flex: 1; }
.badge-section { max-width: 1240px; }
.badge-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; border-bottom: 1px solid #dcded7; padding-bottom: 22px; }
.badge-hero h2 { margin: 7px 0 4px; font-size: 28px; letter-spacing: -.04em; }
.badge-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.badge-count { min-width: 108px; text-align: right; }
.badge-count b { display: block; font-size: 34px; letter-spacing: -.06em; }
.badge-count b small { font-size: 16px; color: var(--muted); letter-spacing: 0; }
.badge-count span { color: var(--muted); font-size: 11px; }
.badge-controls { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin: 19px 0; }
.badge-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip { border: 1px solid #d9dbd5; background: transparent; color: var(--muted); padding: 6px 10px; border-radius: 5px; font-size: 11px; }
.filter-chip.active, .filter-chip:hover { border-color: var(--teal); color: var(--teal-dark); background: #edf6f3; }
.badge-search { min-width: 210px; background: var(--panel); border: 1px solid #d9dbd5; border-radius: 6px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; color: var(--muted); }
.badge-search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 12px; color: var(--ink); }
.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.badge-card { position: relative; display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; min-height: 128px; background: var(--panel); border: 1px solid #e5e4de; border-radius: 8px; padding: 13px; overflow: hidden; }
.badge-card.unlocked { border-color: #b8d5ce; box-shadow: 0 9px 22px rgba(31, 70, 66, .08); }
.badge-card.locked .badge-art { filter: grayscale(.85); opacity: .58; }
.badge-art { width: 88px; height: 96px; display: grid; place-items: center; align-content: center; gap: 6px; background: color-mix(in srgb, var(--badge-a) 10%, white); border-radius: 6px; }
.badge-ring { width: 62px; height: 62px; border-radius: 50%; padding: 5px; background: var(--badge-a); border: 4px solid #fff9ea; box-shadow: 0 0 0 3px var(--badge-b), 0 5px 10px rgba(33,39,38,.16); display: grid; place-items: center; }
.badge-ring span { color: #fff9ea; font-size: 24px; font-weight: 800; }
.badge-art small { font-size: 9px; color: var(--muted); }
.badge-copy { align-self: start; padding: 5px 0 34px; min-width: 0; }
.badge-province { color: var(--teal); font: 500 9px "DM Mono", monospace; letter-spacing: .08em; }
.badge-copy h3 { margin: 5px 0 4px; font-size: 14px; letter-spacing: -.02em; }
.badge-copy p { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 0; }
.badge-action { position: absolute; right: 13px; bottom: 12px; border: 0; color: var(--teal-dark); background: #e7f3f0; border-radius: 4px; padding: 5px 8px; font-size: 10px; }
.badge-action.ghost { color: var(--muted); background: #efefec; }
.badge-modal { width: min(720px, 100%); }
.forge-stage { height: 330px; background: #d9d5ca; border-radius: 7px; overflow: hidden; position: relative; background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px); background-size: 24px 24px; }
.forge-stage sticker-forge { cursor: grab; }
.forge-stage sticker-forge:active { cursor: grabbing; }
.badge-modal-meta { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-top: 14px; }
.badge-modal-meta strong, .badge-modal-meta span { display: block; }
.badge-modal-meta strong { color: var(--teal-dark); font-size: 13px; }
.badge-modal-meta span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.badge-note { color: var(--muted); font-size: 11px; line-height: 1.6; border-top: 1px solid var(--line); padding-top: 12px; margin: 13px 0 0; }
.awards-section { max-width: 1180px; }
.awards-hero { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 4px 0 24px; border-bottom: 1px solid #dcded7; }
.awards-hero h2 { margin: 6px 0 5px; font-size: 29px; }
.awards-hero p { margin: 0; color: var(--muted); font-size: 12px; }
.award-progress { --progress: 10deg; width: 94px; height: 94px; border-radius: 50%; padding: 8px; background: conic-gradient(var(--coral) var(--progress), #e2e4df 0); }
.award-progress > div { width: 100%; height: 100%; border-radius: 50%; background: var(--paper); display: grid; place-items: center; align-content: center; }
.award-progress b, .award-progress span { display: block; text-align: center; }
.award-progress b { font-size: 25px; }
.award-progress span { color: var(--muted); font-size: 9px; }
.featured-award { display: grid; grid-template-columns: 250px 1fr; gap: 42px; align-items: center; padding: 34px 7%; margin: 22px 0 0; background: #202c31; color: white; border-radius: 8px; overflow: hidden; }
.medal-display { width: 220px; height: 220px; border: 10px solid #fff5dc; border-radius: 50%; position: relative; display: grid; place-items: center; align-content: center; background: radial-gradient(circle at 36% 28%, #fff7d5 0 3%, transparent 4%), conic-gradient(from 210deg, var(--medal-a), var(--medal-b), var(--medal-a)); box-shadow: 0 0 0 6px var(--medal-b), 0 22px 34px rgba(0,0,0,.32), inset 0 0 0 12px rgba(255,255,255,.2); color: #fff9e8; }
.medal-display strong { font-size: 74px; line-height: 1; text-shadow: 0 3px 0 rgba(0,0,0,.14); }
.medal-display small { margin-top: 12px; font: 500 11px "DM Mono", monospace; letter-spacing: .12em; }
.medal-shine { position: absolute; inset: 13%; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); }
.featured-copy { max-width: 470px; }
.featured-copy .eyebrow { color: #81c7c1; }
.featured-copy h3 { margin: 8px 0 8px; font-size: 25px; }
.featured-copy p { margin: 0 0 18px; color: #bac6c5; font-size: 12px; line-height: 1.75; }
.award-heading { margin-top: 30px; }
.award-shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.award-tile { min-height: 136px; display: grid; grid-template-columns: 76px 1fr; gap: 14px; align-items: center; position: relative; padding: 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.mini-medal { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 50%; border: 5px solid #fff5dc; background: conic-gradient(from 210deg, var(--medal-a), var(--medal-b), var(--medal-a)); box-shadow: 0 0 0 3px var(--medal-b), 0 7px 14px rgba(34,43,42,.18); filter: grayscale(.7); opacity: .62; }
.award-tile.unlocked .mini-medal { filter: none; opacity: 1; }
.mini-medal span { color: #fff9e8; font-size: 24px; font-weight: 800; }
.award-tile small { color: var(--teal-dark); font-size: 9px; }
.award-tile h3 { margin: 3px 0; font-size: 14px; }
.award-tile p { margin: 0; color: var(--muted); font-size: 9px; }
.award-tile .btn { position: absolute; right: 12px; bottom: 11px; padding: 5px 8px; font-size: 9px; }
.region-progress-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.region-progress-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line); }
.region-mini-ring { --region-progress: 6deg; width: 44px; height: 44px; padding: 4px; border-radius: 50%; background: conic-gradient(var(--teal) var(--region-progress), #dfe2dd 0); }
.region-mini-ring span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--paper); font: 600 10px "DM Mono", monospace; }
.region-progress-item strong, .region-progress-item small { display: block; }
.region-progress-item strong { font-size: 12px; }
.region-progress-item small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.hidden { display: none !important; }
@media (max-width: 1100px) { .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .app-shell { grid-template-columns: 78px 1fr; } .sidebar { padding: 25px 11px; } .brand { padding: 0; justify-content: center; } .brand > div:not(.brand-mark), .nav button span:not(.nav-icon), .side-foot { display: none; } .nav button { justify-content: center; padding: 12px 6px; } .main { padding: 28px 24px 40px; } .content-grid { grid-template-columns: 1fr; } .right-col { grid-template-columns: 1fr 1fr; } .region-progress-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .main { padding: 22px 15px 35px; } .topbar { display: block; } .top-actions { margin-top: 16px; } .top-actions .btn:not(.primary) { display: none; } .map-wrap { height: 390px; } .right-col { grid-template-columns: 1fr; } .sticker-grid, .badge-grid { grid-template-columns: repeat(2, 1fr); } .badge-card { display: block; min-height: 220px; } .badge-art { width: 100%; } .badge-controls { align-items: stretch; flex-direction: column; } .badge-search { min-width: 0; } .segment-result, .featured-award { grid-template-columns: 1fr; } .featured-award { justify-items: center; padding: 26px 20px; } .medal-display { width: 180px; height: 180px; } .award-shelf { grid-template-columns: 1fr; } .region-progress-grid { grid-template-columns: repeat(2, 1fr); } .cutout-stage { min-height: 240px; } h1 { font-size: 31px; } }
@media (max-width: 680px) { .editor-workspace { grid-template-columns: 1fr; min-height: 0; padding: 14px; } .editor-canvas { min-height: 390px; } .editor-rail { flex-direction: row; justify-content: center; } .editor-canvas .cp1 { width: 150px; height: 120px; right: 24px; top: 60px; } .editor-canvas .cp2 { width: 112px; height: 118px; right: 134px; bottom: 30px; } .editor-canvas .collage-badge-piece { width: 92px; height: 92px; } .editor-canvas .collage-badge-piece.cb1 { left: 24px; bottom: 28px; } .editor-canvas .collage-badge-piece.cb2 { left: 92px; bottom: 50px; } .editor-bottom { padding: 8px 12px; } }

/* Mobile-first product surface: a collection shelf, a loose sticker field and a bottom tab bar. */
.mobile-tabbar { display: none; }
.mobile-home { max-width: 720px; margin: 0 auto; }
.home-filter, .library-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 12px; }
.home-filter::-webkit-scrollbar, .library-tabs::-webkit-scrollbar { display: none; }
.home-filter button, .library-tabs button { flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); padding: 8px 13px; border-radius: 999px; font-size: 12px; }
.home-filter button.active, .library-tabs button.active { background: #dfe9e3; color: var(--teal-dark); font-weight: 700; }
.home-board { min-height: 490px; position: relative; overflow: hidden; border: 1px solid rgba(222, 224, 215, .9); border-radius: 28px; background: #fbfaf5; box-shadow: 0 18px 50px rgba(57, 61, 53, .08); }
.home-board::before { content: ""; position: absolute; inset: 0; opacity: .25; background-image: radial-gradient(#d9d7cd .8px, transparent .8px); background-size: 18px 18px; pointer-events: none; }
.home-board-meta { position: relative; z-index: 4; display: flex; justify-content: space-between; padding: 20px 22px; color: #9a9d91; font: 600 10px "DM Mono", monospace; letter-spacing: .08em; }
.home-board-meta strong { color: #6e776e; font-size: 11px; letter-spacing: 0; }
.loose-pile { position: absolute; inset: 64px 20px 35px; }
.home-loose-piece { position: absolute; width: 100px; height: 88px; padding: 5px; object-fit: cover; background: #fffefa; box-shadow: 0 10px 16px rgba(69, 64, 52, .18); clip-path: polygon(7% 5%, 39% 2%, 66% 7%, 95% 4%, 97% 35%, 93% 70%, 98% 95%, 61% 92%, 30% 98%, 4% 93%, 7% 62%, 2% 30%); cursor: grab; touch-action: none; user-select: none; transition: transform .18s ease, filter .18s ease; }
.home-loose-piece:active { cursor: grabbing; filter: saturate(1.08); }
.home-loose-piece.piece-1 { left: 12%; top: 27%; width: 108px; height: 116px; transform: rotate(-13deg); z-index: 2; }
.home-loose-piece.piece-2 { left: 35%; top: 18%; width: 115px; height: 98px; transform: rotate(7deg); z-index: 4; }
.home-loose-piece.piece-3 { left: 58%; top: 27%; width: 92px; height: 102px; transform: rotate(14deg); z-index: 3; }
.home-loose-piece.piece-4 { left: 23%; top: 50%; width: 122px; height: 94px; transform: rotate(8deg); z-index: 5; }
.home-loose-piece.piece-5 { left: 47%; top: 49%; width: 105px; height: 118px; transform: rotate(-11deg); z-index: 6; }
.home-loose-piece.piece-6 { left: 68%; top: 52%; width: 92px; height: 90px; transform: rotate(4deg); z-index: 3; }
.home-loose-piece.piece-7 { left: 7%; top: 67%; width: 90px; height: 82px; transform: rotate(13deg); z-index: 1; }
.home-loose-piece.piece-8 { left: 66%; top: 73%; width: 104px; height: 80px; transform: rotate(-15deg); z-index: 4; }
.loose-pile .collage-badge-piece { position: absolute; width: 82px; height: 82px; border: 4px solid #fffdf8; box-shadow: 0 9px 14px rgba(69, 64, 52, .2); z-index: 7; }
.loose-pile .collage-badge-piece.cb1 { left: 39%; bottom: 4%; transform: rotate(-8deg); }
.loose-pile .collage-badge-piece.cb2 { left: 53%; bottom: 1%; transform: rotate(9deg); }
.magic-action, .board-add { position: absolute; z-index: 9; border: 0; display: grid; place-items: center; border-radius: 50%; box-shadow: 0 8px 18px rgba(39, 61, 57, .2); }
.magic-action { top: 20px; right: 20px; width: 42px; height: 42px; color: #fff; background: #78928a; font-size: 19px; }
.board-add { right: 20px; bottom: 19px; width: 51px; height: 51px; color: white; background: #1f4f4a; font-size: 29px; font-weight: 300; }
.home-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 28px; }
.home-actions button { min-height: 62px; border: 1px solid #e8e7df; border-radius: 17px; background: rgba(255, 253, 248, .76); color: var(--muted); display: grid; justify-items: center; align-content: center; gap: 3px; }
.home-actions button:first-child { color: var(--teal-dark); background: #e4eee8; border-color: #d4e3da; }
.home-actions span { font-size: 20px; line-height: 1; }
.home-actions strong { font-size: 10px; font-weight: 600; }
.home-series-head { display: flex; align-items: end; justify-content: space-between; margin: 0 2px 12px; }
.home-series-head span { color: var(--teal); font: 500 9px "DM Mono", monospace; letter-spacing: .14em; }
.home-series-head h2 { margin: 4px 0 0; font-size: 21px; letter-spacing: -.04em; }
.home-series-head button { border: 0; background: transparent; color: var(--teal-dark); font-size: 11px; padding: 5px 0; }
.home-series-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 16px; }
.home-series-item { min-width: 0; border: 1px solid #e8e7df; border-radius: 19px; background: #fffdf8; padding: 12px; text-align: left; }
.home-series-item.coral { background: #fff6f0; }
.series-preview-images { display: flex; height: 74px; align-items: end; padding: 0 7px 5px; }
.series-preview-images img { width: 57px; height: 57px; object-fit: cover; border: 3px solid #fffdf8; box-shadow: 0 4px 8px rgba(61, 59, 50, .17); margin-left: -15px; transform: rotate(calc(var(--stack, 0) * 3deg)); }
.series-preview-images img:first-child { margin-left: 0; transform: rotate(-7deg); }
.home-series-item strong, .home-series-item small { display: block; }
.home-series-item strong { margin-top: 8px; font-size: 12px; }
.home-series-item small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.library-page { max-width: 720px; margin: 0 auto; }
.library-tabs { margin-bottom: 9px; }
.series-list { display: grid; gap: 14px; }
.series-card { min-height: 184px; position: relative; overflow: hidden; border: 1px solid #e7e6dd; border-radius: 26px; background: #fcfbf7; padding: 20px 20px 12px; }
.series-card-head { position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: start; }
.series-card-head span { color: #aaa99e; font: 500 10px "DM Mono", monospace; }
.series-card-head h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.045em; }
.series-count { border: 0; background: transparent; color: #6b6d66; font: 500 14px "DM Mono", monospace; padding: 2px 0; }
.series-count i { display: inline-block; margin-left: 5px; color: #85867c; font-style: normal; font-size: 14px; }
.series-stack { position: absolute; left: 18px; right: 18px; bottom: -6px; height: 106px; }
.series-stack img { position: absolute; bottom: 0; left: calc(30% + (var(--stack) * 14%)); width: 94px; height: 92px; padding: 5px; object-fit: cover; border: 2px solid #fffefa; box-shadow: 0 8px 15px rgba(54, 53, 45, .18); transform: translateX(-50%) rotate(calc((var(--stack) - 2) * 4deg)); }
.series-stack img:nth-child(1) { width: 103px; height: 98px; }
.series-stack img:nth-child(2) { width: 100px; height: 92px; }
.series-stack img:nth-child(3) { width: 92px; height: 88px; }
.series-stack img:nth-child(4) { width: 84px; height: 82px; }
.series-stack img:nth-child(5) { width: 78px; height: 78px; }
.paper-stack img { border-radius: 5px; }
.badge-stack img { object-fit: contain; border-radius: 50%; background: #fffdf8; }
.floating-add { position: fixed; right: 21px; bottom: calc(91px + env(safe-area-inset-bottom)); z-index: 12; width: 52px; height: 52px; border: 0; border-radius: 17px; background: #1f4f4a; color: white; font-size: 29px; box-shadow: 0 11px 24px rgba(30, 74, 68, .22); }

@media (max-width: 680px) {
  :root { --paper: #f7f6f0; }
  html { background: var(--paper); }
  body { min-width: 320px; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
  .app-shell { display: block; min-height: 100dvh; }
  .sidebar { display: none; }
  .main { padding: max(12px, env(safe-area-inset-top)) 16px calc(102px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 72px; align-items: center; margin: 0 0 8px; padding: 8px 2px 4px; }
  .topbar-copy { min-width: 0; }
  .topbar .eyebrow { font-size: 9px; letter-spacing: .12em; }
  h1 { margin: 5px 0 0; font-size: 31px; line-height: 1.08; letter-spacing: -.06em; }
  .subtitle { display: none; }
  .top-actions { gap: 7px; }
  .top-icon { display: inline-grid !important; border: 1px solid #e2e3dc; border-radius: 50%; width: 42px !important; height: 42px !important; background: #fffdf8; color: var(--ink); font-size: 22px; }
  .top-compose { width: 42px; height: 42px; padding: 0; border-radius: 50%; justify-content: center; font-size: 18px; }
  .top-compose span { display: none; }
  .mobile-tabbar { position: fixed; left: 16px; right: 16px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 18; display: flex; gap: 4px; padding: 5px; border: 1px solid rgba(221, 222, 214, .9); border-radius: 28px; background: rgba(255, 254, 250, .9); box-shadow: 0 12px 34px rgba(48, 52, 45, .16); backdrop-filter: blur(20px); }
  .mobile-tab { flex: 1; min-width: 0; min-height: 53px; border: 0; border-radius: 22px; background: transparent; color: #96998f; display: grid; place-items: center; align-content: center; gap: 2px; font-size: 10px; }
  .mobile-tab.active { color: var(--teal-dark); background: #e5eee9; font-weight: 700; }
  .mobile-tab-icon { font-size: 20px; line-height: 1; }
  .content-grid { display: block; }
  .map-panel, .panel { border: 0; border-radius: 22px; box-shadow: none; }
  .panel-head { padding: 16px 17px; }
  .map-wrap { height: min(58dvh, 480px); border-radius: 0 0 22px 22px; }
  .map-legend { left: 12px; right: 12px; bottom: 16px; justify-content: space-between; border-radius: 13px; padding: 10px 11px; }
  .right-col { gap: 12px; margin-top: 12px; }
  .stats { border-top: 1px solid var(--line); }
  .stat { padding: 15px 17px; }
  .stat b { font-size: 25px; }
  .quick { padding: 12px 15px 15px; gap: 7px; }
  .quick .btn { min-width: 0; padding: 10px 9px; }
  .section { margin-top: 16px; }
  .section-head h2 { font-size: 19px; }
  .sticker-grid { gap: 9px; }
  .sticker-card { border-radius: 16px; padding: 7px; }
  .sticker-chip { top: 11px; left: 11px; font-size: 9px; }
  .sticker-name { font-size: 11px; margin-top: 7px; }
  .sticker-meta { font-size: 9px; }
  .awards-section { margin-top: 0 !important; }
  .awards-hero { padding: 0 0 15px; }
  .awards-hero h2 { font-size: 28px; }
  .award-progress { width: 76px; height: 76px; }
  .featured-award { border-radius: 22px; margin-top: 14px; }
  .award-shelf { gap: 9px; }
  .award-tile { border-radius: 18px; }
  .region-progress-grid { gap: 0 7px; }
  .region-progress-item { padding: 11px 5px; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 27px 27px 0 0; overflow: auto; }
  .modal-head { padding: 18px 18px 15px; }
  .modal-body { padding: 17px; }
  .modal-foot { padding: 12px 17px calc(14px + env(safe-area-inset-bottom)); }
  .permission { grid-template-columns: 53px 1fr; gap: 12px; border-radius: 18px; padding: 12px; }
  .permission-icon { width: 46px; height: 46px; border-radius: 12px; font-size: 22px; }
  .segment-modal { max-height: 96dvh; }
  .segmentation-stage { padding: 9px; border-radius: 18px; }
  .seg-tools { margin-top: 9px; }
  .subject-chip { min-width: 0; flex: 1 1 42%; border-radius: 11px; }
  .segment-note { font-size: 10px; }
  .segment-result { gap: 13px; }
  .cutout-stage { min-height: 220px; border-radius: 17px; }
  .compose-modal { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .editor-workspace { min-height: calc(100dvh - 126px); padding: 10px; }
  .editor-canvas { min-height: 0; height: 100%; border-radius: 17px; }
  .editor-bottom { padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
  .badge-modal { max-height: 94dvh; }
}

@media (min-width: 681px) {
  .mobile-home, .library-page { max-width: none; }
  .home-board { min-height: 520px; }
  .home-loose-piece { width: 130px; height: 110px; }
  .home-loose-piece.piece-1 { width: 160px; height: 140px; }
  .home-loose-piece.piece-2 { width: 165px; height: 126px; }
  .home-loose-piece.piece-3 { width: 132px; height: 138px; }
  .home-loose-piece.piece-4 { width: 172px; height: 122px; }
  .home-loose-piece.piece-5 { width: 148px; height: 150px; }
  .home-loose-piece.piece-6 { width: 132px; height: 118px; }
}
