:root {
  color-scheme: light;
  --paper: #fff8ed; --surface: #fffcf5; --ink: #321327;
  --muted: #715761; --line: #e7d9cb; --yellow: #ffdb72; --input: #fffdf8;
  --canvas: #f3e9dd; --strong-line: #bfa9ad; --focus: #884271;
  --accent-ink: #321327; --inverse-bg: #321327; --inverse-text: #fffdf8;
  --avatar: #ead6e1; --avatar-ink: #462139; --placeholder: #ead9cc;
  --album-placeholder: #e4cdb8; --reaction: #a33255; --error: #982744;
  --radio: #632948; --active-icon: #e6c6d7;
  font: 16px/1.45 system-ui, sans-serif;
  color: var(--ink); background: var(--canvas);
}
:root[data-color-mode="dark"] {
  color-scheme: dark;
  --paper: #201721; --surface: #2d2230; --ink: #fff3ed;
  --muted: #d4bacb; --line: #574657; --input: #2b202e;
  --canvas: #160f17; --strong-line: #9d8097; --focus: #ffd77e;
  --inverse-bg: #ecd0e0; --inverse-text: #321327;
  --avatar: #5d3e57; --avatar-ink: #ffebf5; --placeholder: #423143;
  --album-placeholder: #584151; --reaction: #ff90b2; --error: #ff9ab1;
  --radio: #ffdb72; --active-icon: #604251;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0 auto; min-height: 100dvh; max-width: 680px; background: var(--paper); box-shadow: 0 0 42px #33162812; }
header { position: sticky; top: 0; z-index: 2; background: var(--paper); display: flex; justify-content: space-between; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--line); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 1px solid transparent; color: inherit; background: transparent; min-height: 44px; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.brand { display: flex; gap: 10px; align-items: center; text-align: left; padding: 0; font: bold 27px/1 Georgia, serif; letter-spacing: -.7px; }
.brand img { width: 43px; height: 43px; }
.brand small { display: block; font: italic 13px/1.3 Georgia, serif; letter-spacing: 0; margin-top: 3px; }
.avatar { border-radius: 100%; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; background: var(--avatar); color: var(--avatar-ink); font-weight: 750; }
main { padding: 19px 22px 12px; }
h1, h2, h3 { font-family: Georgia, serif; line-height: 1.08; margin: 0 0 13px; }
h1 { font-size: clamp(2.1rem, 8vw, 2.9rem); letter-spacing: -.05em; }
h2 { font-size: 1.55rem; letter-spacing: -.025em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 12px; }
.muted, small { color: var(--muted); }
small { display: block; }
.tabs { display: flex; gap: 22px; margin: 0 0 16px; }
.tabs button { color: var(--muted); position: relative; padding: 0 0 8px; font: bold clamp(1.42rem, 7vw, 2.12rem)/1.1 Georgia, serif; letter-spacing: -.045em; }
.tabs button[aria-selected=true] { color: var(--ink); }
.tabs button[aria-selected=true]::after { content: ''; background: var(--yellow); height: 5px; border-radius: 9px; position: absolute; inset: auto 0 0; }
.feed-card { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 17px; }
video { display: block; width: 100%; background: #281521; border-radius: 17px; object-fit: contain; max-height: 54dvh; }
.feed-card video { aspect-ratio: 1 / 1.02; object-fit: contain; }
.hero { position: relative; padding: 0; display: block; width: 100%; aspect-ratio: 1 / 1.02; background: var(--placeholder); overflow: hidden; border-radius: 17px; }
.hero img, .tile img, .album img, .mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play { display: grid; place-items: center; position: absolute; inset: 50% auto auto 50%; transform: translate(-50%,-50%); border-radius: 100%; width: 56px; height: 56px; background: #27101ed9; color: white; }
.chip { background: #24151ce8; color: white; padding: 4px 8px; border-radius: 20px; font-size: .76rem; position: absolute; bottom: 8px; left: 7px; white-space: nowrap; }
.hero .chip { top: 10px; bottom: auto; left: auto; right: 10px; }
.lock { position: absolute; top: 6px; right: 6px; background: #24151ce8; color: white; border-radius: 7px; padding: 4px; display: grid; }
.lock svg { width: 14px; height: 14px; }
.creator, .row, .clip-actions, .collection-row { display: flex; align-items: center; gap: 9px; }
.creator { margin: 9px 0 3px; justify-content: space-between; }
.identity { display: flex; align-items: center; gap: 9px; padding: 0; min-width: 0; text-align: left; }
.identity .avatar { width: 37px; height: 37px; flex-basis: 37px; font-size: .8rem; }
.identity strong { display: block; font: bold 1.14rem Georgia, serif; overflow-wrap: anywhere; }
.identity small { font-size: .74rem; }
.clip-actions { justify-content: space-between; align-items: start; }
.caption { font: 1.08rem/1.35 Georgia, serif; overflow-wrap: anywhere; padding: 8px 0 0; }
.icons { display: flex; align-items: center; margin-left: auto; flex-shrink: 0; }
svg { width: 23px; height: 23px; vertical-align: middle; pointer-events: none; }
.icon { min-width: 44px; padding: 4px; display: inline-flex; justify-content: center; align-items: center; gap: 4px; }
.icon[aria-pressed=true] svg { fill: var(--reaction); stroke: var(--reaction); }
.pill, .outline, .dark { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 16px; border-radius: 999px; font-weight: 680; }
.pill, a.pill { background: var(--yellow); color: var(--accent-ink); }
.outline { border-color: var(--line); background: var(--surface); }
.dark { color: var(--inverse-text); background: var(--inverse-bg); }
.wide { width: 100%; }
.section { margin: 19px 0; }
.divided { padding-top: 15px; border-top: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { aspect-ratio: .69; border-radius: 13px; position: relative; padding: 0; width: 100%; overflow: hidden; background: var(--placeholder); }
.albums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.album { position: relative; aspect-ratio: .82; overflow: hidden; padding: 0; border-radius: 17px; background: var(--album-placeholder); text-align: left; }
.album span { position: absolute; inset: auto 0 0; padding: 30px 13px 13px; color: white; background: linear-gradient(transparent,#1d1017eb); font: bold clamp(1.34rem, 6vw, 2rem)/1 Georgia, serif; }
.album small { margin-top: 5px; font: 12px system-ui, sans-serif; color: #fff6e8; }
.collection-row { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-bottom: 9px; padding: 6px; text-align: left; min-height: 55px; overflow-wrap: anywhere; }
.collection-row .chevron { margin-left: auto; padding-right: 8px; }
.mini { display: grid; place-items: center; width: 58px; height: 52px; flex: 0 0 58px; overflow: hidden; background: var(--placeholder); border-radius: 9px; }
.album-tools, .wrap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.album-tools > * { flex-grow: 1; }
.heading-row { justify-content: space-between; align-items: start; }
.heading-row h2 { margin-top: 8px; }
.empty { display: grid; justify-items: start; gap: 6px; border: 1px dashed var(--strong-line); border-radius: 14px; padding: 18px; background: var(--surface); }
.empty p { margin: 0; }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 17px; padding: 17px; margin: 15px 0; }
.auth { max-width: 385px; margin: 18px auto; }
.auth h1 { margin-bottom: 4px; }
.auth > img { width: 66px; margin-bottom: 9px; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 650; }
input:not([type=checkbox]), textarea, select { min-height: 44px; width: 100%; border: 1px solid var(--strong-line); border-radius: 10px; color: var(--ink); background: var(--input); padding: 8px 10px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0; min-width: 0; }
fieldset label { display: flex; align-items: center; min-height: 44px; gap: 8px; }
.publish-option { display: flex; align-items: center; min-height: 44px; gap: 8px; }
.publish-option input { accent-color: var(--radio); width: 18px; height: 18px; }
input[type=radio] { accent-color: var(--radio); width: 18px; height: 18px; }
.error { color: var(--error); font-weight: 650; margin: 0; }
.record-stage { position: relative; background: #301727; border-radius: 17px; overflow: hidden; }
.record-stage video { aspect-ratio: 1 / .95; }
.record-stage .chip { inset: 8px 8px auto auto; }
.preview-empty { padding: 25px 14px; aspect-ratio: 1 / .65; display: grid; align-content: center; justify-items: center; background: #382034; color: #fff5e0; border-radius: 17px; text-align: center; margin: 12px 0; }
.preview-empty svg { width: 38px; height: 38px; margin-bottom: 10px; }
.reel-list { list-style: none; padding: 0; margin: 0; }
.reel-item { border-bottom: 1px solid var(--line); padding: 5px 0; display: flex; align-items: center; gap: 7px; }
.reel-item .mini { width: 44px; flex-basis: 44px; height: 44px; }
.reel-item .title { flex: 1; min-width: 0; font-size: .89rem; overflow-wrap: anywhere; }
.reel-item .icon { flex: 0 0 44px; }
dialog { border: 1px solid var(--line); color: var(--ink); background: var(--paper); border-radius: 18px; padding: 17px; width: min(calc(100% - 28px), 460px); max-height: 88dvh; }
dialog::backdrop { background: #21101bb8; }
dialog h2 { margin: 7px 0 13px; }
.close { margin-left: auto; }
nav { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--line); background: var(--paper); padding: 5px 12px max(5px, env(safe-area-inset-bottom)); }
nav button { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 56px; font-size: .72rem; color: var(--muted); }
nav button[aria-current=page] { color: var(--ink); font-weight: 800; }
nav button[aria-current=page] svg { fill: var(--active-icon); }
nav .record-mark { background: var(--yellow); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 100%; color: var(--accent-ink); }
body:has(nav:not([hidden])) { display: flex; flex-direction: column; }
body:has(nav:not([hidden])) main { flex: 1; }
body:has(nav:not([hidden])) footer { order: -1; display: none; }
footer { text-align: center; font-size: .76rem; color: var(--muted); padding: 10px; }
#toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); padding: 9px 15px; margin: 0; width: max-content; max-width: 88vw; color: var(--inverse-text); background: var(--inverse-bg); border-radius: 12px; z-index: 5; }
#toast:empty { display: none; }
@media (max-width: 365px) {
  header, main { padding-left: 13px; padding-right: 13px; }
  .reel-item { gap: 3px; }
}
@media (min-width: 700px) {
  header, main { padding-left: 35px; padding-right: 35px; }
  .feed-card video, .hero { aspect-ratio: 1.4; }
  .tile { aspect-ratio: .8; }
  .album { aspect-ratio: 1.1; }
}
a.brand, a.outline { color: inherit; }
a.brand, a.pill, a.outline { text-decoration: none; min-height: 44px; }
.appearance { max-width: 230px; margin-top: 16px; }
.brand small { font: 600 13px/1.3 system-ui, sans-serif; }
.share-cover { display: block; width: 100%; max-height: 235px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }
.share-preview-link { color: var(--ink); text-decoration: none; }
.share-preview-link:hover h2, .share-preview-link:focus-visible h2 { text-decoration: underline; }

.avatar { position: relative; overflow: hidden; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--avatar); }
