/* 필브로 스튜디오: 모바일 우선. 촬영 현장은 한 손 조작(큰 탭 영역), 채널은 3초 파악용. */
:root {
  --bg: #f1f4f3; --surface: #ffffff; --surface-2: #f6f8f7; --ink: #0f1a17; --ink-2: #33423d; --muted: #596863; --line: #d9e1de; --line-strong: #bccac5;
  --accent: #0b5e50; --accent-ink: #ffffff; --accent-soft: #e3f1ed; --warn: #9a4a05; --danger: #b42318; --ok: #11703f;
  --shadow: 0 1px 2px rgba(15, 26, 23, .05);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1311; --surface: #141d1a; --surface-2: #19241f; --ink: #eef5f2; --ink-2: #cbd9d4; --muted: #9fb2ab; --line: #26342f; --line-strong: #3a4c45;
    --accent: #55d6ba; --accent-ink: #04251e; --accent-soft: #14312a; --warn: #f2a654; --danger: #ff8d7d; --ok: #62d89f;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1311; --surface: #141d1a; --surface-2: #19241f; --ink: #eef5f2; --ink-2: #cbd9d4; --muted: #9fb2ab; --line: #26342f; --line-strong: #3a4c45;
  --accent: #55d6ba; --accent-ink: #04251e; --accent-soft: #14312a; --warn: #f2a654; --danger: #ff8d7d; --ok: #62d89f;
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--font); letter-spacing: -.005em;
  word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: max(40px, env(safe-area-inset-bottom, 0px)); }
main { max-width: 760px; margin: 0 auto; display: grid; gap: 16px; padding-block: 12px; }
h1 { font-size: 1.55rem; line-height: 1.3; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 2px; text-wrap: balance; }
h2 { font-size: 1.05rem; line-height: 1.4; font-weight: 700; letter-spacing: -.01em; margin: 0 0 10px; text-wrap: balance; }
h3 { font-size: .92rem; font-weight: 700; margin: 16px 0 6px; color: var(--ink-2); }
p { text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; }
.muted { color: var(--muted); font-weight: 400; }
.big { font-size: 1.25rem; line-height: 1.35; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.eyebrow { margin: 0; font-size: .8rem; font-weight: 600; letter-spacing: .01em; color: var(--muted); }
.top { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 4px 14px; padding-block: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-decoration: none; padding: 8px 4px 8px 0; }
.top nav { display: flex; gap: 2px; flex: 1; }
.top nav a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .95rem; padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 8px; }
.top nav a:hover { background: var(--accent-soft); color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; min-width: 0; box-shadow: var(--shadow); }
a.card { display: block; color: inherit; text-decoration: none; }
a.card.action { border-color: var(--accent); background: var(--accent-soft); }
a.card.action .big { color: var(--accent); }
a.card.mini:hover { border-color: var(--line-strong); }
.card.mini { padding: 10px 12px; font-size: .95rem; line-height: 1.5; }
.card.sticky { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.chip { display: inline-block; font-size: .78rem; font-weight: 600; line-height: 1.5; padding: 1px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip:empty { display: none; }
.chip.on, .chip.ok { color: var(--ok); border-color: var(--ok); }
.chip.pending { color: var(--warn); border-color: var(--warn); }
.chip.err { color: var(--danger); border-color: var(--danger); }
.checklist, .videos, .timesum, .logs, .planb { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.timesum { grid-auto-flow: column; grid-auto-columns: max-content; gap: 16px; margin-bottom: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.videos { margin-bottom: 14px; }
.videos li > a { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; }
.videos li > a:hover { text-decoration: underline; }
.logs li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 36px; }
.shot { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 10px 10px; border-radius: 8px; cursor: pointer; line-height: 1.5; }
.shot:hover { background: var(--surface-2); }
.shot:has(input:checked) > span { color: var(--muted); }
.shot.must span { font-weight: 600; }
.shot.must:has(input:checked) > span { font-weight: 500; }
.shot input[type=checkbox] { width: 28px; height: 28px; flex: none; accent-color: var(--accent); margin: 0; }
.say { margin: 4px 0 10px; padding: 10px 14px; background: var(--accent-soft); color: var(--ink); border-radius: 8px; font-size: .95rem; }
.numgroup { grid-column: 1 / -1; margin: 10px 0 0; }
.flow { display: grid; gap: 10px; }
.numbers { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
label { font-size: .9rem; font-weight: 600; color: var(--ink-2); display: grid; gap: 4px; }
input:not([type=checkbox]), select { width: 100%; font: inherit; font-weight: 400; color: var(--ink); padding: 10px 12px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
input:focus-visible, button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button { font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); min-height: 44px; padding: 8px 14px; }
button:hover { background: var(--surface-2); }
button.primary, a.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; text-decoration: none; display: inline-block; padding: 10px 18px; border-radius: 8px; min-height: 44px; }
button.primary:hover, a.btn.primary:hover { background: var(--accent); filter: brightness(1.08); }
button.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 500; min-height: 44px; padding: 4px 8px; text-decoration: underline; text-underline-offset: 3px; }
button.linkbtn:hover { background: none; }
.top .linkbtn { color: var(--muted); font-size: .9rem; }
form.inline { margin: 0; }
.row { display: flex; gap: 8px; align-items: stretch; }
.row.wrap { flex-wrap: wrap; }
.row input { flex: 1 1 160px; }
.stages { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.stagebtn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.board { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.layout, .stack { display: grid; gap: 16px; min-width: 0; }
/* 폰: 사이드바·코너 래퍼를 풀어서 진행률 카드가 페이지 전체에서 고정되게 한다 */
.shoot, .shoot > aside, .corners { display: contents; }
.col { display: grid; gap: 8px; align-content: start; }
.col h2 { padding-bottom: 8px; border-bottom: 2px solid var(--line-strong); margin-bottom: 4px; }
.count { font-size: .8rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 12px; accent-color: var(--accent); }
details > summary { cursor: pointer; padding: 8px 0; font-weight: 600; min-height: 44px; }
.login { max-width: 380px; margin: 12vh auto 0; display: grid; gap: 14px; }
.login form { display: grid; gap: 14px; }
.error { color: var(--danger); margin: 0; } .warn { color: var(--warn); margin: 0; }
.card.corner > h2 { font-size: 1.15rem; }
.card.corner > h2 .muted { font-size: .85rem; font-weight: 500; margin-left: 4px; }
.sticky .big { margin: 0 0 8px; font-size: 1.2rem; }
.sticky progress { height: 14px; }

/* 채널 현황 */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { display: grid; align-content: start; gap: 2px; padding: 16px 18px 14px; }
.stat p { margin: 0; }
.stat .big { font-size: clamp(1.1rem, 5.3vw, 1.85rem); line-height: 1.2; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat .big .unit { font-size: .9rem; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.stat .sub { font-size: .85rem; color: var(--muted); }
.delta { font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
.delta.up::before { content: "▲ "; font-size: .72em; } .delta.down::before { content: "▼ "; font-size: .72em; } .delta.flat::before { content: "― "; }
.stat.stale .big { color: var(--warn); }
.stat.stale .eyebrow::after { content: " · 오래됨"; color: var(--warn); }
.asof { font-size: .88rem; margin: 0; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.insights { gap: 10px; }
.insights li { padding-left: 16px; position: relative; line-height: 1.65; }
.insights li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 6px; background: var(--accent); border-radius: 1px; }
.tablewrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.vtable { table-layout: fixed; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; white-space: nowrap; border-bottom: 1px solid var(--line-strong); padding-block: 8px; }
.t-title { width: auto; } .t-date { width: 6.6rem; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.t-views { width: 6rem; } .t-mult { width: 6rem; }
td.num, th.num, td.t-views, th.t-views, td.t-mult, th.t-mult, span.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.t-title { font-weight: 500; color: var(--ink); }
.mult { display: inline-block; min-width: 3.6rem; padding: 1px 8px; border-radius: 6px; font-weight: 600; }
.mult.hi { font-weight: 800; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.mult.hi::before { content: "▲ "; font-size: .7em; }
.mult.mid { color: var(--ink-2); }
.mult.lo { color: var(--muted); font-weight: 400; opacity: .85; }
.mult.lo::before { content: "▽ "; font-size: .7em; }
.note { font-size: .84rem; margin: 10px 0 0; }
.months li { display: grid; grid-template-columns: 4.6rem 1fr 2rem; gap: 10px; align-items: center; font-size: .85rem; font-variant-numeric: tabular-nums; }
.months .mname { color: var(--muted); }
.months progress { height: 10px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.months progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 3px; }
.months progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
.months progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
code { font-size: .85em; word-break: break-all; }

/* 폰: 표를 카드 목록처럼. 제목이 한 줄 전체를 쓰고 날짜·조회수·배수는 아래 한 줄 */
@media (max-width: 599px) {
  .vtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .vtable, .vtable tbody { display: block; }
  .vtable tr { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: baseline; padding: 12px 8px; border-bottom: 1px solid var(--line); }
  .vtable tbody tr:last-child { border-bottom: 0; }
  .vtable td { display: block; padding: 0; border: 0; width: auto; }
  .vtable td.t-title { grid-column: 1 / -1; }
  .vtable td.t-date { font-size: .84rem; }
  .vtable td.t-views { text-align: left; font-size: .95rem; font-weight: 600; }
  .vtable td.t-views::after { content: " 회"; font-weight: 400; color: var(--muted); font-size: .8rem; }
  .vtable td.t-mult { text-align: right; }
  .vtable td.t-mult:last-child { grid-column: 3; }
  .vtable td.t-date + td.t-views:last-child { grid-column: 2 / -1; text-align: right; }
}
@media (min-width: 600px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 넓은 화면(맥): 폭을 넓히고 여러 칸으로 */
@media (min-width: 900px) {
  main, .top { max-width: 1280px; }
  main { gap: 20px; padding-block: 20px; }
  .card { padding: 20px 24px; }
  .card.mini { padding: 10px 12px; }
  .layout, .stack { gap: 20px; }
  .layout.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .layout.two:has(.vtable) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .board { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .shoot { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
  .shoot > aside { display: grid; gap: 16px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
  .corners { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .card.sticky { position: static; }
  .numbers { grid-template-columns: 1fr; }
  .stat .big { font-size: 2.2rem; }
  h1 { font-size: 1.75rem; }
}
@media (min-width: 1500px) { .corners { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* 작업(PD·작가·쇼츠) */
.formgrid { display: grid; gap: 10px; }
textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); resize: vertical; }
textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.joblist li > a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: inherit; }
.chip.st-done { color: var(--ok); border-color: var(--ok); } .chip.st-running, .chip.st-queued { color: var(--warn); border-color: var(--warn); }
.chip.st-failed { color: var(--danger); border-color: var(--danger); }
.md { line-height: 1.7; } .md h1 { font-size: 1.3rem; } .md h2 { font-size: 1.1rem; margin-top: 1.2em; } .md h3 { font-size: 1rem; }
.md ul, .md ol { padding-left: 1.3em; display: grid; gap: 4px; } .md blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--accent); background: var(--bg); }
.md pre { overflow-x: auto; padding: 10px; background: var(--bg); border-radius: 8px; } .md .tablewrap { overflow-x: auto; }

/* 결정 선택 */
.decide { border-color: var(--accent); }
.choices { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
.choices legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; background: var(--surface); cursor: pointer; min-height: 44px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 5px; flex: none; }
.rec { font-style: normal; font-size: .78rem; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 0 7px; margin-left: 4px; white-space: nowrap; }
pre.summary { white-space: pre-wrap; margin: 0 0 10px; font: inherit; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.decide textarea { width: 100%; font: inherit; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; background: var(--surface); color: var(--ink); }
.joblist li { display: flex; align-items: center; gap: 8px; }
.joblist li > a { flex: 1; min-width: 0; }
.joblist li > button { flex: none; }
.choice { font-weight: 400; color: var(--ink); }
.choice input[type=radio] { width: 22px; height: 22px; min-height: 0; padding: 0; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.choice > span { flex: 1; min-width: 0; line-height: 1.5; }

/* 배운 점 */
.lessonlist { display: grid; gap: 10px; }
.lesson { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.lesson p { margin: 6px 0; white-space: pre-wrap; }
.lesson.st-dismissed { opacity: .55; }
.lesson.st-adopted { border-color: var(--accent); background: var(--accent-soft); }
.lessonbtns { display: flex; flex-wrap: wrap; gap: 6px; }

/* 가이드·촬영 습관 */
.toc ul { display: grid; gap: 2px; margin: 6px 0 0; }
.toc li.toc-h2 { padding-left: 1em; font-size: .92rem; }
.toc a { display: inline-block; min-height: 32px; line-height: 32px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md h1, .md h2 { scroll-margin-top: 12px; }
.habitlist { display: grid; gap: 8px; }
.habitlist li { border-left: 3px solid var(--accent); padding-left: 10px; }

/* 컷 선택 */
.cutlist { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; }
.cutrow { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); font-weight: 400; color: var(--ink); cursor: pointer; min-height: 44px; }
.cutrow:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cutrow input[type=checkbox] { width: 22px; height: 22px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
.cutrow > span:last-child { flex: 1; min-width: 0; }
.cutbtns { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.inlinecheck { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.inlinecheck input { width: 22px; height: 22px; min-height: 0; padding: 0; flex: none; accent-color: var(--accent); }
.cutreq summary { cursor: pointer; list-style: none; } .cutreq summary h2 { display: inline; margin: 0; }

/* 소재 찾기 */
.scoutlist { display: grid; gap: 8px; }
.scoutrow { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.scoutmain { grid-column: 1 / 2; display: grid; gap: 2px; min-width: 0; }
.scoutmain a { font-weight: 600; overflow-wrap: anywhere; }
.scoutscore { grid-column: 2 / 3; display: flex; gap: 6px; align-items: center; font-size: 1.15rem; }
.scoutrow button { grid-column: 1 / -1; justify-self: start; }
