/* Lupa: photo-first card reader. Phones: top bar, topic stories, edge-to-edge 4:5 posts, bottom tab bar.
   Desktop: left nav, centre feed, right rail. Watch is a full-screen vertical viewer with captions. */
:root {
  color-scheme: light;
  --bg: oklch(0.985 0.004 255);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.953 0.01 255);
  --ink: oklch(0.22 0.035 265);
  --ink-2: oklch(0.48 0.03 260);
  --line: oklch(0.905 0.012 255);
  --accent: oklch(0.63 0.2 32);
  --accent-ink: oklch(0.99 0.01 60);
  --accent-soft: oklch(0.945 0.04 40);
  --focus: oklch(0.58 0.16 250);
  --danger: oklch(0.55 0.2 25);
  --shadow: 0 1px 2px oklch(0.22 0.035 265 / 0.06), 0 12px 32px -16px oklch(0.22 0.035 265 / 0.24);
  --scrim: oklch(0.18 0.03 265 / 0.55);
  --cover-ink: oklch(0.22 0.04 265);
  --c-environment: oklch(0.8 0.14 150);
  --c-science: oklch(0.8 0.11 230);
  --c-health: oklch(0.8 0.12 10);
  --c-money: oklch(0.86 0.14 92);
  --c-tech: oklch(0.78 0.12 292);
  --c-language: oklch(0.82 0.12 55);
  --c-history: oklch(0.83 0.07 70);
  --c-life: oklch(0.83 0.1 178);
  --c-other: oklch(0.84 0.03 260);
  --c-good: oklch(0.87 0.15 105);
  --c-space: oklch(0.78 0.12 268);
  --c-nature: oklch(0.85 0.14 128);
  --c-food: oklch(0.86 0.11 40);
  --c-mind: oklch(0.82 0.1 312);
  --c-society: oklch(0.83 0.11 332);
  --c-culture: oklch(0.85 0.09 350);
  --c-world: oklch(0.84 0.09 200);
  --w-bg: oklch(0.13 0.015 265);
  --on-photo: oklch(0.99 0 0);
  --on-photo-2: oklch(0.99 0 0 / 0.78);
  --w-track: oklch(1 0 0 / 0.32);
  --w-glass: oklch(0.15 0.02 265 / 0.45);
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: oklch(0.165 0.018 265); --surface: oklch(0.21 0.02 265); --surface-2: oklch(0.255 0.022 265);
  --ink: oklch(0.95 0.01 255); --ink-2: oklch(0.73 0.02 255); --line: oklch(0.3 0.02 265);
  --accent: oklch(0.72 0.18 35); --accent-ink: oklch(0.18 0.03 40); --accent-soft: oklch(0.31 0.07 38);
  --focus: oklch(0.75 0.13 250); --danger: oklch(0.72 0.16 25);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 12px 32px -16px oklch(0 0 0 / 0.7); --scrim: oklch(0.08 0.02 265 / 0.72);
  color-scheme: dark;
} }
* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--bg); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
p { margin: 0; } ul { margin: 0; padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: 0.5; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; } .ico.md { width: 20px; height: 20px; }
.ico.solid { fill: currentColor; stroke: none; }
.muted { color: var(--ink-2); }

/* Logo + language */
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(from 210deg, var(--c-good), var(--accent), var(--c-tech), var(--c-science), var(--c-good)); display: grid; place-items: center; }
.logo-mark i { width: 12px; height: 12px; border-radius: 50%; background: var(--bg); }
.logo b { font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; letter-spacing: -0.035em; }
.lang { display: flex; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 3px; flex: none; width: max-content; }
.lang button { min-width: 34px; padding: 5px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: var(--ink-2); }
.lang button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px oklch(0 0 0 / 0.14); }

/* Phone top bar */
.head { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: color-mix(in oklch, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.head-in { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
.head-r { display: flex; align-items: center; gap: 4px; }

/* Shell */
.shell { max-width: 1180px; margin: 0 auto; display: grid; gap: 32px; overflow-x: clip; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 14px calc(96px + env(safe-area-inset-bottom, 0px)); }
.side, .rail { display: none; }
.main { min-width: 0; width: 100%; max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.shell[data-view="explore"] .main, .shell[data-view="saved"] .main { max-width: 935px; }
@media (min-width: 780px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); padding-block: 28px 56px; }
  .head, .tabbar { display: none !important; }
  .side { display: block; }
}
@media (min-width: 1180px) {
  .shell[data-view="home"] { grid-template-columns: 220px minmax(0, 540px) 300px; justify-content: space-between; }
  .shell[data-view="home"] .rail { display: block; }
}
.side-in { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 28px); display: flex; flex-direction: column; gap: 4px; min-height: calc(100vh - 56px); }
.side-in .logo { padding: 4px 12px 22px; }
.nav-link { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 12px; font-size: 1rem; font-weight: 600; text-decoration: none; color: var(--ink-2); text-align: left; width: 100%; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav-link[aria-current="page"] .ico { stroke-width: 2.4; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding: 12px; }
.side-foot p { font-size: 0.78rem; color: var(--ink-2); overflow-wrap: anywhere; }
.link-btn { font-size: 0.85rem; font-weight: 700; color: var(--ink-2); text-align: left; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 30; background: color-mix(in oklch, var(--bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.tabbar ul { display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; }
.tabbar li { display: flex; justify-content: center; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 6px; width: 100%; font-size: 10.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] .ico { stroke-width: 2.4; }

/* Page heads, chips, notes */
.page-h { display: flex; flex-direction: column; gap: 4px; }
.page-h h1 { font-size: clamp(1.7rem, 5vw, 2.2rem); font-weight: 800; line-height: 1.05; }
.page-h-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); padding: 2px max(16px, env(safe-area-inset-right, 0px)) 4px max(16px, env(safe-area-inset-left, 0px)); }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 780px) { .chips { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; } }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 0.85rem; font-weight: 600; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.note { border-radius: var(--r-md); background: var(--surface-2); padding: 12px 14px; font-size: 0.9rem; color: var(--ink-2); }
.note.warn { background: var(--accent-soft); color: var(--ink); }

/* Stories */
.stories { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); padding: 4px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); }
.stories::-webkit-scrollbar { display: none; }
@media (min-width: 780px) { .stories { margin-inline: 0; padding-inline: 2px; border-bottom: 0; } }
.story { flex: none; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 600; color: var(--ink); }
.story .ring { width: 70px; height: 70px; border-radius: 50%; padding: 3px; background: conic-gradient(from 220deg, var(--ring), var(--accent), var(--ring)); transition: transform 0.15s; }
.story:hover .ring { transform: scale(1.04); }
.story.seen .ring { background: var(--line); padding: 2px; }
.story .ring > span { display: block; width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--bg); overflow: hidden; background: var(--surface-2); position: relative; }
.story img, .story svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story .lbl { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story.seen .lbl { color: var(--ink-2); font-weight: 500; }

/* Posts */
.feed { display: flex; flex-direction: column; gap: 6px; }
.post { display: flex; flex-direction: column; gap: 10px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.post + .post { padding-top: 14px; }
.post-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--tc); color: var(--cover-ink); font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--tc); }
.who { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1; font-size: 0.875rem; }
.who button { font-weight: 700; white-space: nowrap; }
.who button:hover { text-decoration: underline; text-underline-offset: 3px; }
.who span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.on { color: var(--accent); }
.icon-btn.on .ico { fill: var(--accent); stroke: var(--accent); }
.photo { position: relative; aspect-ratio: 4 / 5; max-width: 100%; overflow: hidden; border-radius: 6px; background: var(--surface-2); user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; color: var(--cover-ink); }
@media (max-width: 559px) { .photo { max-width: none; border-radius: 0; margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); } }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.photo svg.pat { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo .cover-text { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 26px; }
.photo .cover-text p { font-family: var(--font-display); font-weight: 650; font-size: clamp(1.6rem, 6vw, 2.3rem); line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
.acts { display: flex; align-items: center; gap: 2px; margin: -4px -8px -2px; }
.acts .push { margin-left: auto; }
.got-btn { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px 0 9px; margin-left: 4px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 0.82rem; font-weight: 700; color: var(--ink); flex: none; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.got-btn:hover { background: color-mix(in oklch, var(--c-good) 35%, transparent); border-color: var(--c-good); }
.got-btn:active { transform: scale(0.95); }
.post h3 { font-size: 1.12rem; font-weight: 650; line-height: 1.25; }
.post h3 button { text-align: left; }
.post h3 button:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.post-body { color: var(--ink); overflow-wrap: anywhere; line-height: 1.55; }
.post-body.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.more-btn { color: var(--ink-2); font-weight: 600; align-self: flex-start; margin-top: -6px; }
.more-btn:hover { color: var(--ink); }
.key-line { font-size: 0.93rem; line-height: 1.45; }
.key-line b { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); margin-right: 6px; }
.post-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 0.85rem; }
.tag { font-weight: 600; color: var(--focus); }
.tag:hover { text-decoration: underline; }
.src { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-weight: 600; text-decoration: none; max-width: 100%; overflow: hidden; }
.src span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src:hover { color: var(--ink); text-decoration: underline; }

/* Double-tap heart */
.burst { position: fixed; z-index: 70; width: 104px; height: 104px; margin: -52px 0 0 -52px; pointer-events: none; color: var(--on-photo); filter: drop-shadow(0 6px 18px oklch(0 0 0 / 0.35)); animation: burst 0.9s cubic-bezier(.2,.8,.3,1) forwards; }
.burst svg { width: 100%; height: 100%; fill: currentColor; }
@keyframes burst { 0% { transform: scale(0.2); opacity: 0; } 15% { transform: scale(1.15); opacity: 1; } 30% { transform: scale(0.94); } 45% { transform: scale(1); } 75% { opacity: 1; } 100% { transform: scale(1) translateY(-26px); opacity: 0; } }

/* Explore / Saved grid */
.search { position: relative; }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.search input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); padding: 0 14px 0 42px; font-size: 1rem; }
.search input:focus { outline: none; border-color: var(--focus); background: var(--surface); }
.search input::placeholder { color: var(--ink-2); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); }
@media (min-width: 560px) { .grid { margin-inline: 0; gap: 4px; } }
.tile { position: relative; aspect-ratio: 4 / 5; max-width: 100%; overflow: hidden; background: var(--surface-2); color: var(--cover-ink); display: block; width: 100%; text-align: left; }
@media (min-width: 560px) { .tile { border-radius: 4px; } }
.tile img, .tile svg.pat { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.tile:hover img { transform: scale(1.04); }
.tile .tile-t { position: absolute; inset: auto 0 0; padding: 26px 10px 9px; font-family: var(--font-display); font-weight: 650; font-size: clamp(0.72rem, 2.4vw, 0.95rem); line-height: 1.15; color: var(--on-photo); background: linear-gradient(to top, oklch(0.12 0.02 265 / 0.78), transparent); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-wrap: balance; }
.tile.no-photo .tile-t { color: var(--cover-ink); background: none; }
.tile .tdot { position: absolute; top: 9px; left: 9px; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px oklch(1 0 0 / 0.8); }
.tile .tgot { position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--c-good); color: oklch(0.22 0.04 265); box-shadow: 0 0 0 2px oklch(1 0 0 / 0.8); }
.tile .tgot .ico { stroke-width: 3; }
.count { font-size: 0.85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Rail */
.rail-in { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 28px); display: flex; flex-direction: column; gap: 22px; }
.rail h2 { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); font-family: var(--font-text); }
.rail section { display: flex; flex-direction: column; gap: 12px; }
.mini { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; }
.mini-cover { width: 56px; height: 70px; border-radius: 8px; flex: none; position: relative; overflow: hidden; background: var(--surface-2); }
.mini-cover img, .mini-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini b { display: block; font-family: var(--font-display); font-weight: 650; line-height: 1.2; }
.mini span { font-size: 0.8rem; color: var(--ink-2); }
.mini > div { min-width: 0; }
.mini:hover b { text-decoration: underline; text-underline-offset: 3px; }
.bars { display: flex; flex-direction: column; gap: 9px; font-size: 0.85rem; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; }
.bar-row button { text-align: left; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row button:hover { text-decoration: underline; }
.bar-row span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar-track { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }

/* Skeleton / empty */
.skel { border-radius: 6px; background: linear-gradient(100deg, var(--surface-2) 40%, color-mix(in oklch, var(--surface-2) 60%, var(--bg)) 50%, var(--surface-2) 60%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skel.photo-s { aspect-ratio: 4 / 5; max-width: 100%; }
.skel.ring-s { width: 70px; height: 70px; border-radius: 50%; flex: none; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h2 { font-size: 1.35rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 700; background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--danger); color: var(--bg); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 0.875rem; }
.btn.wide { width: 100%; height: 46px; }
.btn.on .ico { fill: var(--accent); stroke: var(--accent); }

/* Toast */
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 0.9rem; font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.show.has-act { pointer-events: auto; }
.toast-act { margin-left: 10px; color: var(--c-good); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 780px) { .toast { bottom: 32px; } }

/* Sheet (modal) */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .sheet-wrap { align-items: center; padding: 24px; } }
.sheet { width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow); animation: up 0.25s ease-out both; padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (min-width: 700px) { .sheet { border-radius: var(--r-lg); max-height: 90vh; } }
@keyframes up { from { transform: translateY(24px); opacity: 0.001; } to { transform: none; opacity: 1; } }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 1.1rem; font-weight: 650; }
.sheet-head .post-head { flex: 1; }
.round { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); flex: none; }
.sheet-body { padding: 18px; display: flex; flex-direction: column; gap: 16px; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
.d-photo { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); color: var(--cover-ink); }
.d-photo img, .d-photo svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail h1 { font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 800; line-height: 1.1; }
.detail .full { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.key { border-radius: var(--r-md); padding: 14px 16px; background: var(--accent-soft); }
.key small { display: block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); }
.key p { margin-top: 4px; font-family: var(--font-display); font-size: 1.15rem; font-weight: 650; line-height: 1.3; }
.deeper { border-left: 3px solid var(--line); padding-left: 14px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); line-height: 1.65; }
.deeper-k { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-radius: var(--r-md); padding: 12px 14px; background: var(--surface-2); }
.confirm p { flex: 1 1 200px; font-weight: 600; }

/* Form */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .lab { font-size: 0.85rem; font-weight: 700; }
.input { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 11px 13px; font-size: 1rem; }
.input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 25%, transparent); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.55; }
.cat-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.two { display: grid; gap: 16px; }
@media (min-width: 560px) { .two { grid-template-columns: 1fr 1fr; } }
.photo-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-prev { width: 72px; height: 90px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: none; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.assist { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-radius: var(--r-md); border: 1px dashed var(--line); padding: 12px 14px; }
.assist p { flex: 1 1 220px; font-size: 0.875rem; color: var(--ink-2); }
.sheet-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; background: var(--surface); border-top: 1px solid var(--line); flex-wrap: wrap; }
.err { color: var(--danger); font-size: 0.875rem; font-weight: 600; }
.err:empty { display: none; }
.ok { color: var(--ink); font-size: 0.9rem; font-weight: 600; background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; }
.ok:empty { display: none; }

/* Sign-in screen */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .auth { grid-template-columns: 1.1fr 1fr; } }
.auth-art { display: none; position: relative; overflow: hidden; background: var(--c-good); }
@media (min-width: 900px) { .auth-art { display: block; } }
.auth-art .stack { position: absolute; inset: 0; display: grid; place-items: center; }
.auth-card-demo { position: absolute; width: 46%; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; box-shadow: 0 30px 60px -30px oklch(0.2 0.04 265 / 0.5); color: var(--cover-ink); }
.auth-card-demo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-card-demo p { position: absolute; inset: auto 0 0; padding: 22px; font-family: var(--font-display); font-weight: 650; font-size: clamp(1.1rem, 1.8vw, 1.6rem); line-height: 1.15; letter-spacing: -0.02em; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; gap: 22px; width: 100%; max-width: 440px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 28px) 22px calc(env(safe-area-inset-bottom, 0px) + 28px); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth h1 { font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth .or { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 0.8rem; font-weight: 600; }
.auth .or::before, .auth .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-switch { font-size: 0.92rem; color: var(--ink-2); }
.auth-switch button { font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Watch viewer */
.watch { position: fixed; inset: 0; z-index: 60; background: var(--w-bg); color: var(--on-photo); display: flex; align-items: center; justify-content: center; gap: 18px; animation: fadein 0.2s ease-out both; }
@keyframes fadein { from { opacity: 0.001; } to { opacity: 1; } }
.stage { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--w-bg); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
@media (min-width: 700px) { .stage { width: auto; height: calc(100% - 40px); aspect-ratio: 9 / 16; max-width: calc(100% - 140px); border-radius: 16px; } }
.w-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 40%; will-change: transform; -webkit-user-drag: none; }
.w-pat { position: absolute; inset: 0; }
.w-pat svg { width: 100%; height: 100%; }
.w-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, oklch(0.1 0.02 265 / 0.6), transparent 22%, transparent 42%, oklch(0.1 0.02 265 / 0.86) 78%, oklch(0.1 0.02 265 / 0.94)); }
.w-top { position: absolute; inset: 0 0 auto; z-index: 2; padding: calc(env(safe-area-inset-top, 0px) + 10px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 10px; transition: opacity 0.2s; }
@media (min-width: 700px) { .w-top { padding-top: 12px; } }
.w-bars { display: flex; gap: 3px; }
.w-bars span { flex: 1; height: 2.5px; border-radius: 2px; background: var(--w-track); overflow: hidden; }
.w-bars i { display: block; height: 100%; width: 0; background: var(--on-photo); }
.w-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.w-head .av { width: 32px; height: 32px; font-size: 0.85rem; box-shadow: none; }
.w-who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; text-shadow: 0 1px 6px oklch(0 0 0 / 0.4); }
.w-who b { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-who span { font-size: 0.75rem; color: var(--on-photo-2); font-variant-numeric: tabular-nums; }
.w-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--on-photo); flex: none; }
.w-btn:hover { background: var(--w-glass); }
.w-btn .ico { filter: drop-shadow(0 1px 4px oklch(0 0 0 / 0.4)); }
.w-btn.on .ico { fill: var(--accent); stroke: var(--accent); }
.w-bottom { position: absolute; inset: auto 0 0; z-index: 2; pointer-events: none; padding: 0 max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 16px) max(18px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 12px; transition: opacity 0.2s; }
.w-title { font-size: clamp(1.35rem, 5.4vw, 1.75rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.025em; text-shadow: 0 2px 14px oklch(0 0 0 / 0.35); }
.w-cap { min-height: 5.4em; font-size: clamp(1.02rem, 4vw, 1.18rem); font-weight: 500; line-height: 1.45; color: var(--on-photo); text-shadow: 0 1px 10px oklch(0 0 0 / 0.5); text-wrap: pretty; overflow-wrap: anywhere; }
.w-cap.in { animation: capin 0.35s ease-out both; }
@keyframes capin { from { opacity: 0.001; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.w-cap small { display: block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-good); margin-bottom: 4px; }
.w-cap.chunk { font-family: var(--font-display); font-size: clamp(1.6rem, 7vw, 2.1rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; text-shadow: 0 2px 12px oklch(0 0 0 / 0.6); }
.w-vid { object-fit: cover; background: var(--w-bg); }
.w-cap.key { font-family: var(--font-display); font-weight: 650; font-size: clamp(1.25rem, 5vw, 1.5rem); line-height: 1.25; }
.w-acts { display: flex; align-items: center; gap: 4px; pointer-events: auto; margin-left: -8px; }
.w-open { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--w-glass); font-size: 0.82rem; font-weight: 700; color: var(--on-photo); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.w-open:hover { background: oklch(0.25 0.02 265 / 0.6); }
.w-got { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; background: var(--w-glass); font-size: 0.82rem; font-weight: 700; color: var(--on-photo); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.w-got:hover { background: color-mix(in oklch, var(--c-good) 45%, transparent); }
.w-side { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: oklch(1 0 0 / 0.14); color: var(--on-photo); flex: none; }
.w-side:hover { background: oklch(1 0 0 / 0.24); }
.w-side:disabled { opacity: 0.25; }
@media (max-width: 699px) { .w-side { position: absolute; top: 50%; z-index: 3; width: 34px; height: 34px; background: var(--w-glass); opacity: 0.7; transform: translateY(-50%); } .w-side.prev { left: max(6px, env(safe-area-inset-left, 0px)); } .w-side.next { right: max(6px, env(safe-area-inset-right, 0px)); } }
.stage.held .w-top, .stage.held .w-bottom { opacity: 0; }
.w-hint { position: absolute; z-index: 3; left: 50%; top: 42%; transform: translate(-50%, -50%); width: max-content; max-width: 80%; text-align: center; padding: 10px 16px; border-radius: 14px; background: var(--w-glass); font-size: 0.88rem; font-weight: 600; pointer-events: none; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fadein 0.3s ease-out both; }
.w-paused { position: absolute; z-index: 3; left: 50%; top: 42%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; display: grid; place-items: center; background: var(--w-glass); pointer-events: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Photo credit under a card */
.small-credit { font-size: 0.82rem; color: var(--ink-2); }
.small-credit a { color: inherit; text-underline-offset: 2px; }

/* ---------- Reels (Watch): full-screen cards you swipe up through ---------- */
.reels { position: fixed; inset: 0; z-index: 60; background: var(--w-bg); color: var(--on-photo); animation: fadein 0.2s ease-out both; }
.r-feed { position: absolute; inset: 0; overflow-y: scroll; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.r-feed::-webkit-scrollbar { display: none; }
.r-slide { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; justify-content: center; }
.r-frame { position: relative; height: 100%; width: 100%; overflow: hidden; background: var(--w-bg); }
@media (min-width: 700px) { .r-frame { width: auto; aspect-ratio: 9 / 16; max-width: 100%; } .r-slide { padding: 12px 0; } .r-frame { border-radius: 14px; } }
.r-media, .r-media > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.r-media img, .r-media .r-vid, .r-pat svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.r-media .r-vid { position: absolute; inset: 0; background: transparent; }
.r-slide.on .r-img { animation: r-kb 16s ease-out both; }
@keyframes r-kb { from { transform: scale(1.02); } to { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) { .r-slide.on .r-img { animation: none; } }
.r-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, oklch(0 0 0 / 0.38), transparent 18%, transparent 45%, oklch(0 0 0 / 0.78)); }
.r-info { position: absolute; left: 0; right: 76px; bottom: 0; padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 22px); display: flex; flex-direction: column; gap: 6px; text-shadow: 0 1px 6px oklch(0 0 0 / 0.5); }
.r-who { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--on-photo-2); }
.r-who b { color: var(--on-photo); }
.r-title { font-family: var(--font-display); font-size: clamp(1.25rem, 5.4vw, 1.6rem); font-weight: 750; line-height: 1.15; }
.r-key { font-weight: 650; font-size: 0.98rem; line-height: 1.35; padding-left: 10px; border-left: 3px solid var(--c-good); }
.r-body { font-size: 0.92rem; line-height: 1.45; color: var(--on-photo-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.r-info.open .r-body { display: block; max-height: 38vh; overflow-y: auto; overscroll-behavior: contain; color: var(--on-photo); }
.r-more { align-self: flex-start; font-weight: 700; font-size: 0.88rem; color: var(--on-photo); padding: 2px 0; }
.r-acts { position: absolute; right: 8px; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.r-act { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 60px; color: var(--on-photo); font-size: 0.72rem; font-weight: 700; text-shadow: 0 1px 4px oklch(0 0 0 / 0.6); }
.r-act .ico { width: 30px; height: 30px; filter: drop-shadow(0 1px 5px oklch(0 0 0 / 0.45)); transition: transform 0.15s; }
.r-act:active .ico { transform: scale(0.85); }
.r-act.on .ico { fill: var(--accent); stroke: var(--accent); }
.r-act[data-r="got"] .ico { padding: 4px; border-radius: 50%; border: 2px solid currentColor; stroke-width: 3; }
.r-act.got .ico { background: var(--c-good); border-color: var(--c-good); color: oklch(0.22 0.04 265); }
.r-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 6px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 0 18px; pointer-events: none; }
.r-top b { font-family: var(--font-display); font-size: 1.15rem; margin-right: auto; text-shadow: 0 1px 6px oklch(0 0 0 / 0.5); }
.r-top button { pointer-events: auto; }
.r-cap { position: absolute; left: 16px; right: 80px; top: 38%; text-align: center; font-family: var(--font-display); font-size: clamp(1.6rem, 7vw, 2.1rem); font-weight: 800; line-height: 1.15; text-shadow: 0 2px 12px oklch(0 0 0 / 0.6); pointer-events: none; opacity: 0; }
.r-cap.in { animation: r-pop 0.18s ease-out both; }
@keyframes r-pop { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.r-paused { position: absolute; left: 50%; top: 45%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; display: grid; place-items: center; background: var(--w-glass); pointer-events: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.r-paused .ico { width: 34px; height: 34px; }
.r-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: oklch(1 0 0 / 0.2); pointer-events: none; }
.r-prog i { display: block; height: 100%; width: 0; background: var(--on-photo); }
.r-end-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.r-end-in h2 { font-family: var(--font-display); font-size: 1.6rem; }
.r-end-in p { color: var(--on-photo-2); }
.r-end-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--c-good); color: oklch(0.22 0.04 265); }
.r-end-ico .ico { width: 34px; height: 34px; stroke-width: 3; }
.r-nav { display: none; }
@media (min-width: 700px) { .r-nav { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); z-index: 3; display: flex; flex-direction: column; gap: 12px; } .r-nav .w-side .ico { transform: rotate(90deg); } }
.r-hint { position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 18px; border-radius: 16px; background: var(--w-glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-weight: 700; pointer-events: none; }
.r-hint .ico { transform: rotate(90deg); animation: r-nudge 1.1s ease-in-out infinite; }
@keyframes r-nudge { 50% { transform: rotate(90deg) translateX(-8px); } }
