/* Snapmatic — "Polaroid Palm" brand (see brand/BRAND.md). Dark by default,
   light theme follows the system. */
:root {
  /* brand palette */
  --brand-orange: #F56934;
  --brand-amber: #F58A35;
  --brand-yellow: #F7D047;
  --brand-cream: #F6F0F2;
  --brand-steel: #C9D4E5;
  --brand-slate: #5A6680;
  --brand-ink: #2E3550;
  --brand-red: #F7382D;
  --vi: linear-gradient(120deg, #F56934 0%, #F58A35 48%, #F7D047 100%);

  /* dark theme (default): ink/slate neutrals */
  --bg: #121624;
  --bg-2: #171c2c;
  --surface: #1b2133;
  --surface-2: #252c41;
  --line: #313a53;
  --text: #F6F0F2;
  --text-2: #B8C0D2;
  --text-3: #8891A9;
  --accent: #F56934;        /* fills */
  --accent-text: #F7A35C;   /* small text on this background */
  --on-accent: #2E3550;     /* text on orange / gradient */
  --pink: var(--accent);    /* legacy alias */
  --like: #F7382D;
  --danger: #FF5A4E;
  --scrim: rgb(14 17 28 / .78);
  --shadow: 0 20px 60px rgb(0 0 0 / .45);
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fredoka', 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #FBF8F4;
    --bg-2: #F4EFE8;
    --surface: #ffffff;
    --surface-2: #F3EEE7;
    --line: #E6DFD5;
    --text: #2E3550;
    --text-2: #5A6680;
    --text-3: #7C859B;
    --accent-text: #C2410C;
    --danger: #D92D20;
    --shadow: 0 20px 60px rgb(46 53 80 / .16);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #FBF8F4; --bg-2: #F4EFE8; --surface: #fff; --surface-2: #F3EEE7; --line: #E6DFD5;
  --text: #2E3550; --text-2: #5A6680; --text-3: #7C859B; --accent-text: #C2410C; --danger: #D92D20;
  --shadow: 0 20px 60px rgb(46 53 80 / .16);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
/* iOS Safari zooms into any field under 16px on focus and leaves the page
   wider than the screen (it can then be dragged sideways). */
@media (max-width: 900px), (pointer: coarse) { input, textarea, select { font-size: 16px; } }
img { display: block; max-width: 100%; }
svg.i { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; color: var(--text-3); }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--line);
  padding: 22px 12px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 12px 26px; }
.brand img { width: 40px; height: 40px; }
.wordmark {
  font: 700 26px/1 var(--display);
  color: var(--text); /* solid: ink on light, cream on dark (brand/BRAND.md) */
  letter-spacing: -.01em;
}
.nav a, .nav button {
  position: relative; display: flex; align-items: center; gap: 16px;
  width: 100%; padding: 12px; border-radius: 10px;
  font-size: 15px; text-align: left; color: var(--text-2);
  transition: background .15s, color .15s;
}
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--text); }
/* selected: orange tint, orange text/icon, a bar on the left edge */
.nav a.on { background: color-mix(in oklab, var(--accent) 14%, transparent); color: var(--accent-text); font-weight: 700; }
.nav a.on:hover { background: color-mix(in oklab, var(--accent) 20%, transparent); color: var(--accent-text); }
.nav a.on svg.i { stroke-width: 2.6; }
.nav a.on::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a.on .avatar, .bottom a.on .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.nav .avatar { width: 26px; height: 26px; font-size: 11px; }
.side .spacer { flex: 1; }
.main { min-width: 0; }

.bottom { display: none; }
.topbar { display: none; }

@media (max-width: 1100px) {
  .app { grid-template-columns: 76px 1fr; }
  .side { padding: 22px 10px; align-items: center; }
  .side .label, .wordmark { display: none; }
  .brand { padding: 6px 0 26px; }
  .nav a, .nav button { justify-content: center; padding: 12px; }
  .nav a.on::before { left: -10px; }
}
@media (max-width: 720px) {
  .app { display: block; padding-bottom: 60px; }
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 10;
    padding: 10px 16px; background: color-mix(in oklab, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
  }
  .topbar .brand { padding: 0; }
  .topbar .brand img { width: 30px; height: 30px; }
  .topbar .wordmark { display: inline; font-size: 22px; }
  .bottom {
    display: flex; justify-content: space-around; align-items: center;
    position: fixed; inset: auto 0 0; height: 56px; z-index: 10;
    background: color-mix(in oklab, var(--bg) 92%, transparent); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .bottom a, .bottom button { position: relative; padding: 10px 14px; color: var(--text-3); transition: color .15s; }
  .bottom a.on { color: var(--accent-text); }
  .bottom a.on svg.i { stroke-width: 2.6; }
  .bottom a.on::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
  .bottom .avatar { width: 26px; height: 26px; }
}

/* ---------------------------------------------------------------- avatar */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  font-weight: 700; font-size: 13px; color: #fff; text-transform: uppercase;
  background: var(--c, var(--pink));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.ring { padding: 2px; border-radius: 50%; background: var(--vi); display: inline-grid; }
.ring > .avatar { border: 2px solid var(--bg); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 10px;
  font-weight: 600; background: var(--surface-2); transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--vi); color: var(--on-accent); }
.btn.blue { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.wide { width: 100%; height: 42px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link { color: var(--accent-text); font-weight: 600; }
.icon-btn { display: grid; place-items: center; padding: 8px; border-radius: 50%; }
.icon-btn:hover { color: var(--text-2); }

/* ---------------------------------------------------------------- home */
.home { display: flex; justify-content: center; gap: 64px; padding: 28px 24px 80px; }
.feed { width: 100%; max-width: 470px; }
.home-intro { padding: 0 4px 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.home-intro h1 { font: 700 22px/1.2 var(--display); margin: 0; }
@media (max-width: 720px) { .home-intro { padding: 14px 12px 14px; margin-bottom: 8px; } .home-intro h1 { font-size: 19px; } }
.rail { width: 320px; padding-top: 8px; }
@media (max-width: 1200px) { .rail { display: none; } }
@media (max-width: 720px) { .home { padding: 0 0 40px; } }

.tabs-row { display: flex; gap: 18px; margin: 0 4px 18px; font-weight: 600; }
.tabs-row button { color: var(--text-3); padding-bottom: 6px; border-bottom: 2px solid transparent; }
.tabs-row button.on { color: var(--text); border-color: var(--pink); }

/* post card */
.post { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }
@media (max-width: 720px) { .post { margin-bottom: 8px; } }
/* feed ads: 250 px placeholder until the ad page reports its height; collapsed if no ad */
.ad-slot { border-bottom: 1px solid var(--line); padding: 0 0 16px; margin-bottom: 20px; }
.ad-slot.empty { display: none; }
.ad-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 6px 4px 8px; }
.ad-body { min-height: 250px; }
.ad-slot.filled .ad-body { min-height: 0; }
.ad-body iframe { display: block; width: 100%; height: 250px; border: 0; overflow: hidden; }
@media (max-width: 720px) { .ad-slot { margin-bottom: 8px; } .ad-label { padding-left: 12px; } }
.post-head { display: flex; align-items: center; gap: 10px; padding: 6px 4px 10px; }
@media (max-width: 720px) { .post-head, .post-body { padding-left: 12px !important; padding-right: 12px !important; } }
.post-head .who { min-width: 0; flex: 1; line-height: 1.25; }
.post-head .name { font-weight: 700; }
.post-head .why { font-size: 12px; color: var(--text-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-head .why b { font-weight: 600; color: var(--text); }
/* name • time: a flex row with a real gap (no reliance on whitespace or font metrics) */
.post-head .line { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.post-head .line .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* drawn, not a "•" glyph: the glyph sits at different heights in different fonts (looked raised on macOS) */
.post-head .dot { flex: none; position: relative; font-size: 13px; bottom: calc(0.5ex - 1.5px); width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); } /* sits on the baseline, lifted to half the font's x-height: centred on lowercase letters in any font */
.post-head .time { flex: none; color: var(--text-3); font-size: 13px; font-weight: 400; white-space: nowrap; }
.post-head .follow-inline { color: var(--accent-text); font-weight: 700; margin-left: 6px; }

.media {
  position: relative; overflow: hidden; border-radius: 6px;
  background-color: var(--surface-2); background-size: cover; background-position: center;
  aspect-ratio: var(--ar, 1);
  max-height: 600px;
}
@media (max-width: 720px) { .media { border-radius: 0; } }
.media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.media img.ok { opacity: 1; }
.media .burst {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.media .burst svg { width: 110px; height: 110px; fill: #fff; stroke: none; filter: drop-shadow(0 6px 24px rgb(245 105 52 / .7)); animation: burst .8s ease-out forwards; }
@keyframes burst { 0% { transform: scale(0); opacity: 0 } 15% { transform: scale(1.2); opacity: 1 } 30% { transform: scale(.95) } 45% { transform: scale(1) } 80% { opacity: 1 } 100% { transform: scale(1); opacity: 0 } }

.flag {
  position: absolute; left: 10px; bottom: 10px; right: 10px;
  background: rgb(14 17 28 / .8); color: #FFE2D2; backdrop-filter: blur(6px);
  padding: 8px 12px; border-radius: 10px; font-size: 12px;
}
.actions { display: flex; align-items: center; gap: 4px; padding: 8px 0 4px; margin-left: -8px; }
.actions .grow { flex: 1; }
.actions button { padding: 8px; border-radius: 50%; transition: transform .12s; }
.actions button:active { transform: scale(.85); }
.actions .liked svg { fill: var(--like); stroke: var(--like); animation: pop .35s; }
.actions .saved svg { fill: currentColor; }
@keyframes pop { 50% { transform: scale(1.25) } }
.likes { font-weight: 700; }
.caption { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.caption .name { font-weight: 700; margin-right: 6px; }
.caption a.tag, .tag-link { color: var(--accent-text); }
.comment-preview { margin-top: 2px; }
.comment-preview .name { font-weight: 700; margin-right: 6px; }
.view-comments { color: var(--text-3); margin-top: 4px; display: block; }
.add-comment { display: flex; gap: 8px; margin-top: 8px; border-top: 0; }
.add-comment input { flex: 1; background: transparent; border: 0; outline: 0; padding: 6px 0; }
.add-comment button { color: var(--accent-text); font-weight: 700; }
.add-comment button[disabled] { opacity: .4; }

.debug-box { margin-top: 8px; padding: 10px; background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; font: 11px/1.5 ui-monospace, monospace; color: var(--text-2); white-space: pre-wrap; }

/* rail */
.me-row, .sug-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.me-row .avatar { width: 44px; height: 44px; font-size: 16px; }
.sug-row .avatar { width: 36px; height: 36px; }
.me-row .who, .sug-row .who { flex: 1; min-width: 0; line-height: 1.25; }
.sug-row .who .tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.rail h4 { display: flex; justify-content: space-between; color: var(--text-2); font-size: 14px; margin: 22px 0 8px; }
.rail .foot { margin-top: 26px; font-size: 11px; color: var(--text-3); line-height: 1.8; }
.rail .foot a:hover { text-decoration: underline; }

.end { text-align: center; padding: 40px 0; color: var(--text-2); }
.end .check, .empty .brand-badge { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--vi); }
.end .check img, .empty .brand-badge img { width: 54px; height: 54px; }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0 } }

/* ---------------------------------------------------------------- grids */
.page { max-width: 975px; margin: 0 auto; padding: 28px 20px 80px; }
@media (max-width: 720px) { .page { padding: 12px 0 40px; } }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tile { position: relative; aspect-ratio: 1; overflow: hidden; background-color: var(--surface-2); background-size: cover; background-position: center; }
.tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s, transform .4s; }
.tile img.ok { opacity: 1; }
.tile:hover img { transform: scale(1.03); }
.tile .over {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 22px;
  background: rgb(14 17 28 / .45); color: #fff; font-weight: 700; opacity: 0; transition: opacity .15s;
}
.tile:hover .over { opacity: 1; }
.tile .over span { display: flex; align-items: center; gap: 6px; }
.tile .over svg { fill: #fff; stroke: #fff; width: 20px; height: 20px; }
.explore-grid { grid-auto-flow: dense; }
.explore-grid .tile.big { grid-column: span 1; grid-row: span 2; aspect-ratio: auto; }

.search-box { position: relative; margin: 0 0 18px; }
@media (max-width: 720px) { .search-box { margin: 0 12px 12px; } }
.search-box input {
  width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); padding: 0 16px 0 42px; outline: 0;
}
.search-box input:focus { border-color: var(--pink); }
.search-box svg { position: absolute; left: 12px; top: 9px; color: var(--text-3); }
.search-results { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; overflow: hidden; }
.search-results a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.search-results a:hover { background: var(--surface-2); }
.hash { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 16px; scrollbar-width: none; }
@media (max-width: 720px) { .chips { padding: 2px 12px 12px; } }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 13px; }
.chip:hover { filter: brightness(1.15); }

/* ---------------------------------------------------------------- profile */
.profile-head { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; padding: 0 20px 36px; }
.profile-head .big { width: 150px; height: 150px; margin: 0 auto; font-size: 54px; }
.profile-head .ring { justify-self: center; }
.profile-head h1 { font-size: 20px; font-weight: 500; margin: 0; }
.profile-head .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stats { display: flex; gap: 36px; margin-bottom: 14px; font-size: 15px; }
.stats b { font-weight: 700; }
.bio .dn { font-weight: 700; }
@media (max-width: 720px) {
  .profile-head { grid-template-columns: 96px 1fr; gap: 18px; padding: 8px 16px 20px; }
  .profile-head .big { width: 86px; height: 86px; font-size: 32px; }
  .stats { gap: 18px; font-size: 13px; }
}
.ptabs { display: flex; justify-content: center; gap: 56px; border-top: 1px solid var(--line); margin-bottom: 4px; }
.ptabs button { display: flex; align-items: center; gap: 6px; padding: 16px 0; color: var(--text-3); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-top: 1px solid transparent; margin-top: -1px; }
.ptabs button.on { color: var(--text); border-color: var(--text); }
.ptabs svg.i { width: 14px; height: 14px; }
.empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty h3 { color: var(--text); font-size: 22px; margin: 12px 0 4px; }

/* ---------------------------------------------------------------- modal */
.modal-bg {
  position: fixed; inset: 0; z-index: 50; background: var(--scrim);
  display: grid; place-items: center; padding: 30px; animation: fade .15s;
}
@keyframes fade { from { opacity: 0 } }
.modal-x { position: fixed; top: 14px; right: 18px; color: #fff; z-index: 51; }
.detail {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; max-width: 1200px; width: 100%;
  max-height: calc(100vh - 60px); background: var(--surface); border-radius: 6px; overflow: hidden;
}
.detail .media { max-height: calc(100vh - 60px); border-radius: 0; background-color: #000; }
.detail .media img { object-fit: contain; }
.detail .pane { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); }
.detail .pane .post-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.detail .comments { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 16px; }
.comment { display: flex; gap: 12px; }
.comment .body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.comment .name { font-weight: 700; margin-right: 6px; }
.detail .foot { border-top: 1px solid var(--line); padding: 6px 16px 12px; }
.detail .add-comment { border-top: 1px solid var(--line); margin: 8px -16px -12px; padding: 10px 16px; }
@media (max-width: 900px) {
  .modal-bg { padding: 0; place-items: stretch; }
  .detail { grid-template-columns: 1fr; max-height: none; height: 100%; overflow-y: auto; border-radius: 0; }
  .detail .media { max-height: 70vh; }
  .detail .pane { border-left: 0; }
  .detail .comments { overflow: visible; }
}
.related { padding: 28px 0; }
.related h4 { color: var(--text-2); margin: 0 0 12px; border-top: 1px solid var(--line); padding-top: 24px; }

.sheet {
  background: var(--surface); border-radius: 14px; width: min(400px, calc(100vw - 32px)); place-self: center; overflow: hidden; box-shadow: var(--shadow);
}
.sheet h3 { margin: 0; padding: 18px; text-align: center; font-size: 16px; border-bottom: 1px solid var(--line); }
.sheet p { margin: 0; padding: 12px 20px 0; color: var(--text-2); text-align: center; }
.sheet button.opt { display: block; width: 100%; padding: 14px; border-bottom: 1px solid var(--line); text-align: center; }
.sheet button.opt:last-child { border-bottom: 0; }
.sheet button.opt:hover { background: var(--surface-2); }
.sheet .danger { color: var(--danger); font-weight: 700; }
.sheet .opt-left { text-align: left !important; padding-left: 20px !important; }

.toast {
  position: fixed; left: 50%; bottom: 80px; translate: -50% 0; z-index: 99;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600;
  animation: fade .2s; box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- auth */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 360px); place-content: center; padding: 24px; background:
  radial-gradient(1200px 600px at 80% -10%, rgb(245 105 52 / .22), transparent 60%),
  radial-gradient(900px 500px at -10% 110%, rgb(247 208 71 / .16), transparent 60%), var(--bg); }
.auth-close { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); z-index: 5; }
.auth-close:hover { color: var(--text); }
.auth-close svg { width: 20px; height: 20px; }
.auth-card { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 36px 32px; box-shadow: var(--shadow); }
.auth-card .brand { justify-content: center; padding: 0 0 8px; }
@media (max-width: 480px) { .auth { padding: 64px 16px; } .auth-card { padding: 28px 20px; } }
.auth-card .brand img { width: 88px; height: 88px; }
.auth-card .wordmark { display: block; text-align: center; font-size: 40px; margin-bottom: 6px; }
.auth-card .tagline { text-align: center; color: var(--text-2); margin: 0 0 24px; }
.field { display: block; margin-bottom: 10px; }
.field input, .field textarea, .field select {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); outline: 0;
}
.field textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--pink); }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; font-weight: 700; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gbtn { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.gbtn svg { width: 18px; height: 18px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0; text-align: center; }
.switch { text-align: center; margin-top: 18px; color: var(--text-2); }

/* ---------------------------------------------------------------- info pages */
.info { max-width: 760px; }
@media (max-width: 720px) { .info { padding: 16px 16px 40px; } }
.info-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 28px; }
.info-nav a { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text-2); }
.info-nav a.on { background: var(--accent); color: var(--on-accent); }
.info .eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }
.info h1 { font: 700 38px/1.1 var(--display); margin: 0 0 14px; }
.info .lead { font-size: 17px; color: var(--text-2); margin: 0 0 30px; }
.info section { margin-bottom: 26px; }
.info h2 { font-size: 18px; margin: 0 0 8px; }
.info p, .info li { font-size: 15px; line-height: 1.65; }
.info ul { padding-left: 20px; margin: 8px 0; }
.info li { margin-bottom: 6px; }
.info ol.steps { padding-left: 22px; }
.info ol.steps li { margin-bottom: 10px; padding-left: 4px; }
.info kbd { font: 600 12px/1 var(--font); padding: 3px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; white-space: nowrap; }
.shot { margin: 18px 0 22px; }
.shot img { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.shot figcaption { font-size: 13px; color: var(--text-3); margin-top: 8px; text-align: center; }
.info code { font-size: 13px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.page-foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); line-height: 1.9; text-align: center; }
.foot a:hover { text-decoration: underline; }
.legal-note { text-align: center; margin: 16px 0 0; line-height: 1.6; }
.legal-note a { color: var(--text-2); text-decoration: underline; }

/* ---------------------------------------------------------------- create / editor */
.create { max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }
.create h1 { font: 700 30px/1 var(--display); margin: 0 0 18px; }
.modes { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 18px; flex-wrap: wrap; }
.modes button { padding: 8px 16px; border-radius: 9px; font-weight: 600; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.modes button.on { background: var(--surface-2); color: var(--text); }
.modes svg.i { width: 18px; height: 18px; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.stage {
  background: repeating-conic-gradient(var(--surface) 0 25%, var(--bg-2) 0 50%) 0 0 / 22px 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 420px; display: grid; place-items: center; padding: 18px; position: relative;
}
.stage canvas { max-width: 100%; max-height: 72vh; border-radius: 4px; box-shadow: var(--shadow); touch-action: none; }
.stage canvas.pan { cursor: grab; }
.stage canvas.pan:active { cursor: grabbing; }
.drop {
  display: grid; place-items: center; gap: 10px; text-align: center; color: var(--text-2);
  border: 2px dashed var(--line); border-radius: 14px; padding: 50px 30px; width: min(100%, 520px); cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--pink); color: var(--text); }
.drop svg.i { width: 54px; height: 54px; stroke-width: 1.2; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 14px; }
.panel h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 6px 11px; border-radius: 8px; background: var(--surface-2); font-size: 13px; font-weight: 600; }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.slider { display: grid; grid-template-columns: 86px 1fr 36px; align-items: center; gap: 8px; font-size: 13px; }
.slider input { width: 100%; min-width: 0; accent-color: var(--pink); }
.panel { min-width: 0; }
.slider output { text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }
.layouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.layouts button { aspect-ratio: 1; border-radius: 8px; background: var(--surface-2); padding: 6px; border: 2px solid transparent; }
.layouts button.on { border-color: var(--pink); }
.layouts svg { width: 100%; height: 100%; }
.layouts rect { fill: var(--text-3); }
.layouts button.on rect { fill: var(--pink); }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs .t { position: relative; width: 54px; height: 54px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.thumbs .t img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .t button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgb(0 0 0 / .7); color: #fff; font-size: 12px; line-height: 18px; }
.thumbs .add { display: grid; place-items: center; border: 2px dashed var(--line); color: var(--text-3); cursor: pointer; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 2px var(--surface); }
.swatches button.on { border-color: var(--text); }
.hint { font-size: 12px; color: var(--text-3); margin: -6px 0 0; }
.publish { margin-top: 22px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; }
@media (max-width: 900px) { .publish { grid-template-columns: 1fr; } }
.publish .panel { gap: 10px; }
.progress { font-size: 13px; color: var(--text-2); }

/* ---------------------------------------------------------------- 小红书-style waterfall */
.masonry { display: flex; gap: 14px; align-items: flex-start; }
.masonry .col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 720px) { .masonry { gap: 6px; padding: 0 6px; } .masonry .col { gap: 8px; } }
.note { display: block; cursor: pointer; }
.note .cover {
  position: relative; overflow: hidden; border-radius: 14px;
  background-color: var(--surface-2); background-size: cover; background-position: center;
  aspect-ratio: var(--ar);
}
.note .cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s, transform .5s cubic-bezier(.2,.8,.2,1); }
.note .cover img.ok { opacity: 1; }
.note:hover .cover img { transform: scale(1.025); }
.note .cover .src { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgb(14 17 28 / .55); color: #fff; backdrop-filter: blur(6px); }
.note .t { font-weight: 600; font-size: 14px; line-height: 1.35; margin: 8px 4px 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.note .meta { display: flex; align-items: center; gap: 6px; margin: 0 4px; font-size: 12px; color: var(--text-2); }
.note .meta .avatar { width: 20px; height: 20px; font-size: 9px; }
.note .meta .u { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note .meta .lk { display: flex; align-items: center; gap: 3px; }
.note .meta .lk svg { width: 15px; height: 15px; }
.note .meta .lk.on svg { fill: var(--like); stroke: var(--like); }
.note.hidden-origin .cover { visibility: hidden; }
.post-title { font-weight: 700; font-size: 15px; margin: 2px 0 2px; cursor: pointer; }
.post .media { cursor: zoom-in; }

/* detail overlay: shared-element zoom from the clicked cover */
.ov { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 28px; }
.ov-bg { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(6px); }
.ov .detail { position: relative; z-index: 1; height: min(860px, calc(100vh - 56px)); max-height: none; width: auto; max-width: calc(100vw - 56px); grid-template-columns: auto 420px; border-radius: 18px; will-change: clip-path; }
.ov .detail .media { height: 100%; max-height: none; aspect-ratio: var(--ar); max-width: calc(100vw - 56px - 420px); border-radius: 0; will-change: transform; transform-origin: 0 0; }
.ov .detail .media img { object-fit: cover; }
.ov .detail .pane { width: 420px; }
.ov .detail .pane-body { flex: 1; overflow-y: auto; }
.ov .detail .note-text { padding: 16px 16px 4px; }
.ov .detail .note-text h2 { font-size: 18px; margin: 0 0 8px; line-height: 1.35; }
.ov .detail .note-text .caption { font-size: 15px; }
.ov .detail .note-text .tiny { margin-top: 10px; }
.ov .detail .comments { overflow: visible; border-top: 1px solid var(--line); margin: 12px 16px 0; padding: 14px 0; }
.ov .detail .rel { padding: 4px 16px 18px; }
.ov .detail .rel h4 { margin: 8px 0 10px; color: var(--text-2); font-size: 13px; }
.ov .detail .rel .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ov .detail .rel .row a { aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; background: var(--surface-2) center/cover; }
.ov .detail .rel .row img { width: 100%; height: 100%; object-fit: cover; }
.ov .close { position: absolute; top: 14px; left: 16px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; background: rgb(255 255 255 / .12); color: #fff; display: grid; place-items: center; backdrop-filter: blur(8px); }
.ov .close:hover { background: rgb(255 255 255 / .22); }
@media (max-width: 900px) {
  .ov { padding: 0; place-items: stretch; }
  .ov .detail { height: 100%; width: 100%; max-width: none; grid-template-columns: 1fr; grid-template-rows: auto 1fr; border-radius: 0; overflow-y: auto; }
  .ov .detail .media { width: 100%; height: auto; max-width: none; max-height: 72vh; }
  .ov .detail .pane { width: auto; border-left: 0; }
  .ov .detail .pane-body { overflow: visible; }
  .ov .close { position: fixed; top: 10px; left: 10px; }
}
@media (prefers-reduced-motion: reduce) { .ov .detail, .ov .detail .media { will-change: auto; } }

/* home re-tap refresh: thin brand bar sliding across the top */
.refresh-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80; overflow: hidden; pointer-events: none; }
.refresh-bar::after { content: ''; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, var(--brand-orange), var(--brand-amber), var(--brand-yellow)); animation: refresh-slide 0.9s ease-in-out infinite; }
@keyframes refresh-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .refresh-bar::after { animation: none; width: 100%; opacity: .7; } }
