@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap');

:root {
  --ground: #FAFAF9; --surface: #FFFFFF; --ink: #0A0A0A; --muted: #6B6B6B; --soft: #A3A3A3;
  --line: #E7E7E5; --line-soft: #EFEFED; --fill: #F2F2F0; --flag: #1F45C2; --flag-dot: #4F7BFF;
  --mono: 'Geist Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 Geist, Inter, system-ui, sans-serif; }
a { color: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, video:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* sign in */
body.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { width: min(340px, 90vw); display: flex; flex-direction: column; gap: 8px; }
.login-box h1 { margin: 0 0 16px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.login-box label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.login-box input, .login-box select { height: 44px; border: 1px solid #D6D6D3; border-radius: 8px; padding: 0 12px; font: inherit; background: var(--surface); }
.login-box .btn-primary { margin-top: 16px; }
.login-error { margin: 0; color: var(--flag); }

.btn-primary { height: 44px; border: none; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 500; padding: 0 18px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn { height: 44px; border: 1px solid #D6D6D3; border-radius: 8px; background: var(--surface); font-weight: 500; padding: 0 18px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* shell */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.top { height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.top-left { display: flex; align-items: center; gap: 32px; }
.brand { font-weight: 600; letter-spacing: -0.01em; }
.tabs { display: flex; gap: 24px; height: 56px; }
.tabs a { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.tabs a span { font-weight: 400; color: var(--muted); }
.top-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
.top-right form { margin: 0; }
.link-btn { border: none; background: none; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.notice { padding: 10px 24px; background: var(--fill); border-bottom: 1px solid var(--line); font-size: 13px; }
.notice.bad { color: var(--flag); }

/* review */
.review { flex: 1; display: flex; flex-wrap: wrap; min-height: 0; }
.queue { flex: 1 1 280px; max-width: 320px; border-right: 1px solid var(--line); background: var(--surface); padding: 16px 0; }
.queue h2 { margin: 0; padding: 8px 20px; font-size: 12px; font-weight: 500; color: var(--muted); }
.queue ul { list-style: none; margin: 0 0 12px; padding: 0 8px; }
.row { width: 100%; display: flex; gap: 12px; align-items: center; padding: 8px 12px; border: none; border-radius: 8px; text-align: left; background: transparent; }
.row[aria-current="true"] { background: var(--fill); }
.row:hover { background: var(--fill); }
.thumb { flex: none; overflow: hidden; border-radius: 6px; background: var(--fill); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: var(--muted); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb.v { width: 32px; height: 56px; }
.thumb.w { width: 72px; height: 40px; }
.thumb.t { width: 40px; height: 40px; }
.row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.row-title { font-size: 13px; font-weight: 500; line-height: 1.35; }
.row-meta { font-size: 12px; color: var(--muted); }
.row-meta.bad { color: var(--flag); }
.empty { padding: 8px 20px; color: var(--muted); font-size: 13px; }

.stage-wrap { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; }
.stage { background: var(--ink); padding: 28px; display: flex; justify-content: center; align-items: center; min-height: 460px; }
.stage video, .stage img { display: block; border-radius: 6px; background: #1A1A1A; max-width: 100%; }
.stage .tall { height: 560px; aspect-ratio: 9 / 16; object-fit: cover; }
.stage .wide { width: 100%; max-width: 760px; aspect-ratio: 16 / 9; object-fit: cover; }
.page-stage { background: var(--fill); padding: 48px 28px; display: flex; justify-content: center; border-bottom: 1px solid var(--line); }
.page { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px 32px; }
.page p { margin: 0; font-size: 16px; line-height: 1.6; white-space: pre-line; text-wrap: pretty; }
.detail { padding: 28px 32px 40px; max-width: 860px; display: flex; flex-direction: column; gap: 24px; }
.detail h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; text-wrap: pretty; }
.detail .sub { margin: 6px 0 0; color: var(--muted); }
.section-h { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.caption { margin: 0; white-space: pre-line; color: #262626; }
.caption-tabs { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }

.side { flex: 1 1 300px; max-width: 360px; border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; }
.side-body { padding: 24px; display: flex; flex-direction: column; gap: 28px; flex: 1; }
.lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.lines > div > span:last-child { white-space: nowrap; }
.card-meta .mono { white-space: nowrap; }
.side-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.side-foot p { margin: 0; font-size: 12px; color: var(--muted); }
.bad { color: var(--flag); }

/* calendar */
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; }
.cal-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.cal-head-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.icon-btn { width: 32px; height: 32px; border: none; border-radius: 6px; background: transparent; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--fill); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 10px; border: none; border-radius: 6px; font-size: 13px; background: transparent; color: #525252; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 500; }
.cal { flex: 1; display: flex; flex-wrap: wrap; border-top: 1px solid var(--line); min-height: 0; }
.cal-grid-wrap { flex: 999 1 720px; min-width: 0; overflow-x: auto; background: var(--surface); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); min-width: 1050px; }
.day { border-right: 1px solid var(--line-soft); min-height: 720px; }
.day h2 { margin: 0; padding: 12px 12px 10px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 500; }
.day h2 .dow { color: var(--muted); font-weight: 400; }
.day h2 .today { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; background: var(--ink); color: #fff; font-size: 12px; }
.day h2 .gap { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--flag); }
.day ul { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.card { width: 100%; display: flex; gap: 8px; align-items: flex-start; padding: 6px; border: none; border-radius: 6px; text-align: left; background: transparent; }
.card:hover, .card[aria-pressed="true"] { background: var(--fill); }
.card .thumb.v { width: 24px; height: 42px; }
.card .thumb.t { width: 24px; height: 24px; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.card-title { font-size: 12px; line-height: 1.35; }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; margin-left: auto; }
.dot.fail { border: 2px solid var(--flag-dot); }
.dot.done { background: var(--soft); }
.cal-side { flex: 1 1 300px; max-width: 340px; border-left: 1px solid var(--line); background: var(--surface); padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.cal-side .frame { overflow: hidden; border-radius: 10px; background: var(--fill); }
.cal-side .frame.v { width: 160px; aspect-ratio: 9 / 16; align-self: center; }
.cal-side .frame img, .cal-side .frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-side .frame.t { border: 1px solid var(--line); background: var(--surface); padding: 16px; font-size: 13px; white-space: pre-line; max-height: 260px; overflow: auto; }
.actions { display: flex; gap: 8px; }
.actions > * { flex: 1; height: 40px; font-size: 13px; }

@media (max-width: 700px) {
  .top { padding: 0 16px; } .top-left { gap: 16px; } .top-right .sync { display: none; }
  .queue, .side, .cal-side { max-width: none; }
  .stage { padding: 16px; min-height: 0; } .stage .tall { height: 70vh; }
  .detail { padding: 20px 16px 32px; }
}
