/* Yumi's review site (docs/YUMI.md "The review site"): warm, dark, phone first. */
:root {
  --bg: #120d14; --bg2: #1b1420; --card: #231a29; --line: #3a2d42; --ink: #f3ecf5; --dim: #b19cba; --dim2: #7d6a86;
  --rose: #ff7aa2; --rose2: #ff4f86; --gold: #ffcf6b; --mint: #7fe3c4; --sky: #8ab4ff; --red: #ff6b6b;
  --r: 16px; --pad: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
a { color: var(--sky); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.y-dim { color: var(--dim); }
.y-boot { padding: 3rem 1rem; text-align: center; }
.hidden { display: none !important; }

/* gates */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.gate-card { width: min(100%, 26rem); background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 1.6rem; display: grid; gap: .9rem; text-align: center; }
.gate-card h1 { margin: 0; font-size: 1.5rem; }
.gate-card p { margin: 0; color: var(--dim); }
.gate-mark { font-size: 2.6rem; }

/* buttons + fields */
.btn { border: 1px solid var(--line); background: var(--bg2); color: var(--ink); border-radius: 999px; padding: .6rem 1.1rem; font-weight: 600; min-height: 44px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--rose2); border-color: var(--rose2); color: #fff; }
.btn.good { background: #1f5a48; border-color: #2a7a62; color: #d9fff1; }
.btn.warn { background: #5a4a1f; border-color: #7a652a; color: #fff2d0; }
.btn.danger { background: transparent; border-color: #6a2a3a; color: var(--red); }
.btn.big { width: 100%; padding: .9rem; font-size: 1.05rem; }
.btn.sm { min-height: 36px; padding: .35rem .8rem; font-size: .9rem; }
.field { display: grid; gap: .3rem; }
.field > span { color: var(--dim); font-size: .85rem; }
.input, textarea.input, select.input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: .65rem .8rem; color: var(--ink); min-height: 44px; }
textarea.input { min-height: 7rem; resize: vertical; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.msg { margin: .3rem 0 0; min-height: 1.3rem; font-size: .92rem; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--mint); }
.pill { display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .75rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; background: var(--line); color: var(--ink); }
.pill.review { background: #4a3a1a; color: var(--gold); }
.pill.rework { background: #3b2a4a; color: #d9b8ff; }
.pill.scheduled { background: #1a3a4a; color: var(--sky); }
.pill.uploading { background: #1a3a4a; color: var(--sky); }
.pill.uploaded { background: #1f5a48; color: var(--mint); }
.pill.failed { background: #5a1f2a; color: var(--red); }
.pill.archived { background: var(--line); color: var(--dim); }
.pill.on { background: #1f5a48; color: var(--mint); }
.pill.off { background: #5a1f2a; color: #ffb3b3; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.switch-row small { display: block; color: var(--dim); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + i { background: var(--rose2); }
.switch input:checked + i::after { transform: translateX(20px); }

/* shell */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .7rem; padding: calc(env(safe-area-inset-top) + .6rem) var(--pad) .6rem; background: rgba(18, 13, 20, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: .01em; }
.brand small { color: var(--dim); font-weight: 500; margin-left: .4rem; }
.top .spacer { flex: 1; }
.top .who { color: var(--dim); font-size: .85rem; }
.tabs { position: sticky; top: calc(env(safe-area-inset-top) + 3.4rem); z-index: 4; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg); border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: .7rem .2rem; color: var(--dim); font-weight: 600; }
.tab.on { color: var(--ink); border-bottom-color: var(--rose); }
.tab b { display: inline-block; min-width: 1.4rem; margin-left: .3rem; padding: 0 .35rem; border-radius: 999px; background: var(--line); color: var(--ink); font-size: .75rem; line-height: 1.4rem; }
.main { padding: var(--pad); padding-bottom: calc(env(safe-area-inset-bottom) + 2rem); max-width: 60rem; margin: 0 auto; display: grid; gap: .9rem; }
.empty { text-align: center; color: var(--dim); padding: 3rem 1rem; }
.empty b { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: .3rem; }
.hint { margin: 0; color: var(--dim); font-size: .9rem; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.vcard { display: grid; grid-template-columns: 96px 1fr; cursor: pointer; }
.vcard.wide { grid-template-columns: 150px 1fr; }
.poster { background: #000; aspect-ratio: 9 / 16; width: 96px; object-fit: cover; display: block; }
.vcard.wide .poster { aspect-ratio: 16 / 9; width: 150px; }
.poster.blank { display: grid; place-items: center; color: var(--dim2); font-size: 1.6rem; }
.vbody { padding: .7rem .9rem; display: grid; gap: .3rem; align-content: start; min-width: 0; }
.vtitle { margin: 0; font-size: 1.02rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vmeta { color: var(--dim); font-size: .85rem; }
.vnote { color: var(--gold); font-size: .85rem; }
.verr { color: var(--red); font-size: .85rem; }
.day { display: flex; align-items: baseline; justify-content: space-between; padding: .2rem .2rem 0; color: var(--dim); font-size: .9rem; }
.day b { color: var(--ink); font-size: 1rem; }
.cap { color: var(--dim); }
.cap.full { color: var(--gold); }
.slotline { display: grid; grid-template-columns: 5.2rem 1fr auto; align-items: center; gap: .6rem; padding: .7rem .9rem; border-top: 1px solid var(--line); }
.slotline:first-child { border-top: 0; }
.slotline .t { font-weight: 700; color: var(--sky); }
.slotline .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }

/* detail sheet */
.sheet { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow: auto; -webkit-overflow-scrolling: touch; }
.sheet-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .6rem; padding: calc(env(safe-area-inset-top) + .5rem) var(--pad) .5rem; background: rgba(18, 13, 20, .95); border-bottom: 1px solid var(--line); }
.sheet-top h2 { margin: 0; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { padding: var(--pad); padding-bottom: calc(env(safe-area-inset-bottom) + 3rem); max-width: 46rem; margin: 0 auto; display: grid; gap: 1rem; }
.player { width: 100%; max-height: 70dvh; background: #000; border-radius: var(--r); display: block; }
.player.portrait { max-width: 22rem; margin: 0 auto; }
.frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.frames img { width: 100%; border-radius: 10px; background: #000; }
.ready { padding: .7rem .9rem; border-radius: 12px; background: #1f5a48; color: #d9fff1; }
.notready { padding: .7rem .9rem; border-radius: 12px; background: #4a3a1a; color: var(--gold); }
.notready ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); display: grid; gap: .8rem; }
.box h3 { margin: 0; font-size: 1rem; }
.count { color: var(--dim2); font-size: .8rem; }
.count.bad { color: var(--gold); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.stat { display: grid; gap: .1rem; padding: .7rem .9rem; background: var(--bg2); border-radius: 12px; }
.stat span { color: var(--dim); font-size: .8rem; }
.stat b { font-size: 1.1rem; }
@media (min-width: 700px) {
  .vcard { grid-template-columns: 120px 1fr; }
  .poster { width: 120px; }
}
