/* CineKitchen · light, quiet workspace. One accent (selection blue); zone colours carry meaning. */
:root {
  color-scheme: light;
  --ground: #F4F4F1; --panel: #FFFFFF; --line: #E6E6E2; --line2: #EDEDEA; --soft: #F7F7F5;
  --ink: #1D1D1F; --ink2: #3A3A3C; --muted: #6E6E73; --faint: #A1A1A6;
  --blue: #2E6BF0; --blue-ink: #1F54C7; --blue-soft: #EEF3FE;
  --green: #1E6B3A; --green-soft: #E3F2E8; --amber: #7A4F00; --amber-soft: #FFF1D6; --red: #C2410C; --red-soft: #FBE9E1;
  --dancer: #DDF4F1; --dancer-ink: #0F5E57; --post: #F3EEFB; --post-ink: #5B3B8C;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  --r: 14px; --r-s: 9px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); background-image: radial-gradient(#DADAD5 1px, transparent 1px); background-size: 22px 22px; color: var(--ink);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2 { text-wrap: balance; margin: 0; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 650; }
.k-ic { flex-shrink: 0; }
.k-boot { padding: 48px 20px; text-align: center; color: var(--muted); }
.k-muted { color: var(--muted); }
.k-ok { color: var(--green); display: inline-flex; gap: 4px; align-items: center; }
.k-warn { color: var(--red); font-size: 12px; }
.k-red { color: var(--red); }
.k-accent { color: var(--blue-ink) !important; }
.k-pad { padding: 12px 4px; }
.k-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- header and flow ---------- */
.k-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  background: rgba(244,244,241,.86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.k-brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 0; font-size: 14px; color: var(--muted); }
.k-brand a, .k-brand button { border: 0; background: none; padding: 4px 2px; color: var(--muted); text-decoration: none; }
.k-brand .k-home { color: var(--ink); font-weight: 700; }
.k-brand .k-projname { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.k-flow { display: flex; align-items: center; gap: 0; }
.k-flow-step { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border: 0; border-radius: 18px; background: transparent; color: var(--muted); font-weight: 550; transition: background .15s, color .15s; }
.k-flow-step:hover { background: rgba(0,0,0,.04); color: var(--ink); }
.k-flow-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #E4E4E0; color: var(--ink2); }
.k-flow-step.done .k-flow-n { background: var(--green-soft); color: var(--green); }
.k-flow-step.current { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.k-flow-step.current .k-flow-n { background: var(--ink); color: #fff; }
.k-flow-line { width: 18px; height: 2px; background: #DCDCD7; border-radius: 1px; }
.k-flow-line.done { background: #A9D3B6; }
.k-top-right { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.k-sync { text-align: right; font-size: 12px; color: var(--faint); white-space: nowrap; }
.k-sync[data-state="saving"] { color: var(--muted); }
.k-sync[data-state="error"], .k-sync[data-state="offline"] { color: var(--red); }
.k-subtabs { display: flex; justify-content: center; gap: 4px; padding: 10px 16px 0; }
.k-subtabs button { height: 32px; padding: 0 14px; border: 0; border-radius: 16px; background: transparent; color: var(--muted); font-weight: 550; }
.k-subtabs button:hover { color: var(--ink); background: rgba(0,0,0,.04); }
.k-subtabs button[aria-current="page"] { background: var(--ink); color: #fff; }

.k-main { max-width: 1440px; margin: 0 auto; padding: 22px 20px 64px; }
.k-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.k-head-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.k-lead { margin: 4px 0 0; color: var(--muted); }
.k-sechead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.k-sechead h2 { margin-right: auto; }
.k-sechead > .k-muted:first-child { margin-right: auto; }

/* ---------- controls ---------- */
.k-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-weight: 560; white-space: nowrap; transition: border-color .15s, background .15s; }
.k-btn:hover:not(:disabled) { border-color: #CFCFCA; }
.k-btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.k-btn-primary:hover:not(:disabled) { background: #000; border-color: #000; }
.k-btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.k-btn-ghost:hover:not(:disabled) { color: var(--ink); background: rgba(0,0,0,.04); }
.k-btn-danger { background: #B42318; border-color: #B42318; color: #fff; }
.k-btn-s { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.k-btn-l { height: 48px; padding: 0 20px; font-size: 16px; border-radius: 12px; }
.k-icbtn { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.k-icbtn:hover:not(:disabled) { background: rgba(0,0,0,.05); color: var(--ink); }
.k-icbtn-dark { background: var(--ink); color: #fff; width: 36px; height: 36px; border-radius: 50%; }
.k-icbtn-dark:hover:not(:disabled) { background: #000; color: #fff; }
.k-link { border: 0; background: none; padding: 0; color: var(--blue-ink); font-weight: 550; display: inline-flex; align-items: center; gap: 4px; }
.k-link:hover { text-decoration: underline; }
.k-in { width: 100%; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--panel); transition: border-color .15s, box-shadow .15s; }
textarea.k-in { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.k-in:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,107,240,.15); }
.k-in.k-invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(194,65,12,.12); }
.k-in-s { width: auto; height: 30px; padding: 0 8px; font-size: 13px; }
.k-in-xs { width: 64px; height: 30px; padding: 0 6px; font-size: 13px; text-align: right; }
.k-in-m { width: auto; max-width: 340px; }
.k-in-flat { border-color: transparent; background: transparent; padding: 0 6px; height: 30px; }
.k-in-flat:hover { border-color: var(--line); }
.k-in-code { width: 54px; text-align: center; font-weight: 700; }
.k-in-title { font-weight: 650; font-size: 15px; }
select.k-in { padding-right: 24px; }
.k-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 14px; }
.k-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.k-hint { font-size: 12px; color: var(--muted); }
.k-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.k-check, .k-radio { display: inline-grid; place-items: center; width: 28px; height: 28px; }
.k-check input, .k-radio input, .k-check-l input { width: 17px; height: 17px; accent-color: var(--green); margin: 0; }
.k-check-l { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); white-space: nowrap; }
.k-grid2, .k-grid3, .k-grid4 { display: grid; gap: 0 12px; }
.k-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.k-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.k-grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.k-align-start { align-items: start; gap: 16px; }
.k-plain { list-style: none; margin: 0; padding: 0; }

.k-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: #E9E9E5; max-width: 100%; overflow-x: auto; }
.k-seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 550; white-space: nowrap; }
.k-seg button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.k-tabsrow { margin-bottom: 16px; }

.k-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 0; }
.k-chip-s { height: 20px; font-size: 11px; padding: 0 7px; }
.k-chip-muted { background: #EFEFEC; color: var(--muted); }
.k-chip-cast { background: #EFEFEC; color: var(--ink2); }
.k-chip-dancer { background: var(--dancer); color: var(--dancer-ink); }
.k-chip-post { background: var(--post); color: var(--post-ink); }
.k-chip-warn { background: var(--amber-soft); color: var(--amber); }
.k-chip-gap { background: var(--red-soft); color: var(--red); height: 24px; }
button.k-chip:hover { filter: brightness(.96); }
.k-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.k-term { height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); font-size: 13px; font-weight: 550; color: var(--ink2); transition: all .12s; }
.k-term:hover { border-color: #CFCFCA; }
.k-term[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.k-term.dancer[aria-pressed="true"] { background: var(--dancer-ink); border-color: var(--dancer-ink); }
.k-term.post[aria-pressed="true"] { background: var(--post-ink); border-color: var(--post-ink); }

.k-panel { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; min-width: 0; }
.k-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.k-panel-head > div { display: flex; flex-direction: column; }
.k-empty { text-align: center; padding: 48px 20px; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.k-empty strong { font-size: 16px; }
.k-empty p { margin: 0 0 8px; color: var(--muted); max-width: 52ch; }
.k-confirm { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--red); }
.k-blk-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

.k-thumb { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; aspect-ratio: 16/9; padding: 6px;
  border: 1.5px dashed #CFCFCA; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 12px; overflow: hidden; }
.k-thumb:hover { border-color: var(--blue); color: var(--blue-ink); }
.k-thumb.has { border: 0; padding: 0; }
.k-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k-toast { pointer-events: none; position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.2); animation: k-pop .2s ease-out; }
@keyframes k-pop { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- home ---------- */
.k-home-wrap { max-width: 720px; margin: 24px auto; }
.k-newproj { display: flex; gap: 8px; margin: 20px 0; }
.k-newproj .k-in { height: 44px; font-size: 15px; }
.k-newproj .k-btn { height: 44px; }
.k-projlist { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.k-projlist li { display: flex; align-items: center; gap: 8px; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px 10px 6px 6px; }
.k-proj { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.k-proj:hover { background: var(--soft); }
.k-proj strong { font-size: 15px; }
.k-proj span { font-size: 13px; color: var(--muted); }
.k-proj-off { cursor: default; }
.k-proj-off:hover { background: transparent; }
.k-example { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.k-archived summary { cursor: pointer; color: var(--muted); padding: 8px 0; }

/* ---------- scene plan ---------- */
.k-timeline { padding: 14px 16px 10px; }
.k-tl-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.k-tl-gaps { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.k-tl-len { margin-left: auto; }
.k-tl-len .k-in { width: 72px; }
.k-tl-track { position: relative; background: var(--soft); border-radius: 8px; }
.k-tl-block { position: absolute; height: 22px; padding: 0 4px; border: 0; border-radius: 6px; font-size: 11px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: box-shadow .12s, transform .12s; }
.k-tl-block:hover, .k-tl-block.on { box-shadow: 0 0 0 2px var(--blue); z-index: 2; }
.k-tl-ticks { position: relative; height: 18px; margin-top: 4px; }
.k-tl-ticks span { position: absolute; transform: translateX(-50%); font-size: 10px; color: var(--faint); }
.k-tl-ticks span:first-child { transform: none; }
.k-timeline-empty { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.k-timeline-empty p { margin: 2px 0 0; color: var(--muted); }
.k-timeline-empty .k-in { width: 90px; }
.k-filters { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.k-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.k-fchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); font-size: 13px; font-weight: 550; color: var(--ink2); }
.k-fchip i { width: 8px; height: 8px; border-radius: 50%; }
.k-fchip b { font-weight: 600; color: var(--faint); }
.k-fchip[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.k-table { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.k-row { display: grid; grid-template-columns: 128px 92px 64px minmax(200px, 1.7fr) 92px 104px 112px 56px 140px minmax(150px, 1.3fr); gap: 12px; align-items: start;
  width: 100%; padding: 12px 14px; border: 0; border-top: 1px solid var(--line2); background: transparent; text-align: left; font-size: 13px; transition: background .12s; }
.k-row:first-child { border-top: 0; }
.k-row:hover { background: #FAFAF8; }
.k-row.on { background: var(--blue-soft); }
.k-row-head { position: sticky; top: 0; background: var(--soft); font-size: 11px; font-weight: 650; color: var(--muted); padding-block: 8px; cursor: default; }
.k-row-head:hover { background: var(--soft); }
.k-row > span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.k-row small { color: var(--muted); font-size: 12px; }
.k-c-frame .k-sketch, .k-c-frame .k-frame-img { width: 128px; border-radius: 6px; }
.k-c-time { color: var(--red); font-weight: 600; }
.k-c-code strong { font-size: 15px; }
.k-c-desc .k-chip { align-self: flex-start; }
.k-c-cast, .k-c-notes { flex-direction: row !important; flex-wrap: wrap; }
.k-c-notes .k-clamp { width: 100%; color: var(--muted); }
.k-sketch, .k-frame-img { display: block; width: 100%; aspect-ratio: 16/9; height: auto; object-fit: cover; border-radius: 8px; background: #CFCFCA; }

/* ---------- drawer ---------- */
.k-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.12); animation: k-fade .2s; }
@keyframes k-fade { from { opacity: 0; } }
.k-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(460px, 100%); overflow-y: auto; background: var(--panel); box-shadow: -10px 0 40px rgba(0,0,0,.12);
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px)); animation: k-slide .22s cubic-bezier(.2,.8,.2,1); }
@keyframes k-slide { from { transform: translateX(24px); opacity: 0; } }
.k-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.k-drawer-head h2 { font-size: 22px; }
.k-drawer-links { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line2); font-size: 13px; }
.k-drawer-foot { display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--line2); }
.k-timerow { display: flex; align-items: center; gap: 6px; }
.k-timerow .k-in { width: 76px; }
.k-frames { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.k-frameslot { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

/* ---------- storyboard ---------- */
.k-chars { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.k-chars > .k-label { margin-right: 4px; }
.k-char { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px 0 5px; border: 1px solid var(--line); border-radius: 23px; background: var(--panel); text-align: left; }
.k-char span { display: flex; flex-direction: column; line-height: 1.2; }
.k-char small { font-size: 11px; }
.k-char.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.k-char-add { padding-left: 12px; color: var(--muted); border-style: dashed; }
.k-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.k-avatar-i { display: grid; place-items: center; background: #E4E4E0; color: var(--ink2); font-weight: 700; }
.k-avatar-i.dancer { background: var(--dancer); color: var(--dancer-ink); }
.k-angles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.k-angle { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); text-align: center; }
.k-angle .k-thumb { aspect-ratio: 3/4; }
.k-board { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.k-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.k-card { display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 10px; border: 0; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); text-align: left; transition: box-shadow .12s, transform .12s; }
.k-card:hover { transform: translateY(-1px); }
.k-card.on { box-shadow: 0 0 0 2px var(--blue), var(--shadow); }
.k-card-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); padding: 0 2px; }
.k-card-meta strong { color: var(--ink); font-size: 13px; }
.k-card-desc { font-size: 12px; color: var(--ink2); padding: 0 2px; }
.k-artist { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; }
.k-artist-frame { margin-bottom: 14px; }
.k-sugg { margin: -6px 0 14px; }
.k-understood { background: var(--soft); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.k-understood dl, .k-readout, .k-spec { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 13px; }
.k-understood dt, .k-readout dt, .k-spec dt { color: var(--muted); }
.k-understood dd, .k-readout dd, .k-spec dd { margin: 0; font-weight: 550; }
.k-warnlist { margin: 10px 0 0; padding-left: 18px; font-size: 12px; color: var(--red); }
.k-gen { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.k-gen .k-btn { align-self: flex-start; }
.k-charpanel .k-grid3 { margin-bottom: 4px; }

/* ---------- blocking ---------- */
.k-blocking { display: grid; grid-template-columns: 76px minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.k-palette { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px 6px; position: sticky; top: 76px; }
.k-pal { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border: 2px solid transparent; border-radius: 12px; background: transparent; font-size: 11px; font-weight: 600; }
.k-pal span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; transition: transform .15s; }
.k-pal:hover span { transform: scale(1.06); }
.k-pal[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); }
.k-stage-col { min-width: 0; }
.k-stage-col > .k-hint { margin: 0 0 8px; }
.k-stage-wrap { background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px; }
.k-stage { display: block; width: 100%; height: auto; border-radius: 8px; touch-action: none; user-select: none; }
.k-stage.placing { cursor: copy; }
.k-piece { cursor: grab; }
.k-piece:active { cursor: grabbing; }
.k-selbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 10px; padding: 6px 8px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); }
.k-selbar strong { margin-right: 8px; padding-left: 4px; }
.k-vf-col { position: sticky; top: 76px; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; }
.k-vf-col .k-inline { margin: 0 12px 12px 0; }
.k-vf { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: linear-gradient(#2A2622 0 62%, #3A332C 62%); }
.k-vf i { position: absolute; display: block; }
.k-vf-body { transform: translateX(-50%); border-radius: 40% 40% 8% 8%; }
.k-vf-head { transform: translateX(-50%); aspect-ratio: 1; border-radius: 50%; }
.k-vf-glow { transform: translate(-50%, -50%); aspect-ratio: 1; border-radius: 50%; background: #FFD27A; animation: k-flick 1.6s infinite alternate; }
.k-vf-fire { transform: translate(-50%, -50%); border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%; background: radial-gradient(ellipse at 50% 80%, #FFF1B8, #FF9A3C 45%, rgba(255,90,20,0) 72%); animation: k-flick 1.2s infinite alternate; }
.k-vf-stand { transform: translateX(-50%); background: linear-gradient(#FFE9B0 0 12%, #444 12%); border-radius: 2px; }
.k-vf-wall { background: #5A5048; }
@keyframes k-flick { to { opacity: .82; transform: translate(-50%, -52%) scale(1.04); } }
.k-vf span { position: absolute; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.85); text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.k-vf-rec { top: 8px; left: 10px; color: rgba(255,255,255,.5) !important; }
.k-vf-rec.on { color: #FF5A4E !important; }
.k-vf-tc { top: 8px; right: 10px; }
.k-vf-size { bottom: 8px; left: 10px; }
.k-vf-lens { bottom: 8px; right: 10px; }
.k-play { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.k-play input[type="range"] { flex: 1; accent-color: var(--blue); }
.k-sync-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 14px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 12px; }
.k-sync-box.ok { background: var(--green-soft); color: var(--green); justify-content: flex-start; }
.k-readout { padding-top: 10px; border-top: 1px solid var(--line2); }
.k-mv-arc .k-ic { animation: none; }

/* ---------- schedule ---------- */
.k-night .k-grid4 { margin-bottom: 4px; }
.k-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.k-stat { background: var(--soft); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.k-stat span { font-size: 12px; color: var(--muted); }
.k-stat strong { font-size: 18px; }
.k-sched { list-style: none; margin: 0 0 12px; padding: 0; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.k-sched-row { display: grid; grid-template-columns: 56px 30px minmax(180px, 1fr) minmax(120px, auto) auto auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line2); }
.k-sched-row:first-child { border-top: 0; }
.k-sched-row.done { background: #FAFAF8; }
.k-sched-row.done .k-sched-main strong, .k-sched-row.done .k-sched-main span { color: var(--faint); }
.k-type-break, .k-type-move, .k-type-setup { background: var(--soft); }
.k-sched-time { display: flex; flex-direction: column; font-weight: 650; font-size: 13px; }
.k-sched-time small { font-weight: 500; color: var(--faint); font-size: 11px; }
.k-sched-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; border: 0; background: none; text-align: left; padding: 0; font-size: 13px; }
button.k-sched-main:hover strong { color: var(--blue-ink); }
.k-sched-main .k-in-flat { margin-left: -6px; }
.k-sched-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.k-sched-min { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.k-sched-ops { display: flex; }
.k-sched-hint { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--amber-soft); color: var(--amber); font-size: 12px; border-top: 1px solid var(--line2); }
.k-sched-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.k-free { display: flex; flex-direction: column; gap: 8px; }

/* ---------- on set ---------- */
.k-set { max-width: 640px; margin: 0 auto; }
.k-next { background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.k-next-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.k-next-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; margin-bottom: 12px; }
.k-next-body h2 { font-size: 28px; }
.k-next-body p { margin: 4px 0 8px; }
.k-spec { font-size: 15px; padding: 12px; background: var(--soft); border-radius: 12px; }
.k-next-note { background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 10px 12px; }
.k-next-act { display: flex; gap: 8px; margin-top: 14px; }
.k-next-act .k-in { height: 48px; }
.k-next-done { text-align: center; }
.k-setlist { list-style: none; margin: 0; padding: 0; background: var(--panel); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.k-setlist li { display: grid; grid-template-columns: 52px 30px 1fr; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line2); font-size: 14px; }
.k-setlist li:first-child { border-top: 0; }
.k-setlist li.done { color: var(--faint); }
.k-setlist li.cur { background: var(--blue-soft); }

/* ---------- edit ---------- */
.k-coverage { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.k-covlist { display: flex; gap: 6px; flex-wrap: wrap; }
.k-cov { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); font-size: 12px; font-weight: 600; }
.k-cov i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #CFCFCA; }
.k-take-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.k-kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.k-col { background: #EBEBE7; border-radius: var(--r); padding: 10px; min-height: 160px; }
.k-col h2 { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 2px 4px 10px; }
.k-col h2 i { width: 8px; height: 8px; border-radius: 50%; }
.k-col h2 b { color: var(--faint); font-weight: 600; }
.k-col-empty { font-size: 12px; padding: 8px 4px; margin: 0; }
.k-take { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 10px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.k-take-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.k-take-meta { font-size: 12px; color: var(--muted); }
.k-take-ops { display: flex; justify-content: space-between; align-items: center; }
.k-take .k-in-flat { height: auto; font-size: 12px; padding: 4px 6px; margin: 0 -6px; width: calc(100% + 12px); }
.k-take-orphan { color: var(--muted); }

/* ---------- prep ---------- */
.k-split { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.k-sidenav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; }
.k-sidenav button { display: flex; justify-content: space-between; align-items: center; height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-weight: 550; color: var(--ink2); }
.k-sidenav button:hover { background: rgba(0,0,0,.04); }
.k-sidenav button[aria-current="page"] { background: var(--panel); box-shadow: var(--shadow); color: var(--ink); }
.k-sidenav b { font-weight: 600; color: var(--faint); font-size: 12px; }
.k-cards2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.k-cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.k-cards2 > .k-panel, .k-cards3 > .k-panel { margin-bottom: 0; }
.k-castcard-head { display: flex; gap: 12px; align-items: flex-end; }
.k-castcard-head .k-avatar { width: 52px; height: 52px; margin-bottom: 14px; font-size: 18px; }
.k-castcard-head .k-grid2 { flex: 1; }
.k-castcard-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.k-castcard-foot .k-btn, .k-castcard-foot .k-confirm { margin-left: auto; }
.k-mood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.k-mood-img { position: relative; margin: 0; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--soft); }
.k-mood-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k-icbtn-float { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; background: rgba(255,255,255,.9); }
.k-total { color: var(--muted); }
.k-total strong { color: var(--ink); }
.k-prop-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.k-prop-head > .k-in:not(.k-in-s) { flex: 1; min-width: 160px; font-weight: 600; }
.k-prop.confirmed { box-shadow: 0 0 0 2px #A9D3B6, var(--shadow); }
.k-opts { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.k-opt { display: grid; grid-template-columns: 28px minmax(120px, 1fr) 90px auto 100px 30px; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 10px; }
.k-opt.on { background: var(--blue-soft); }
.k-opt-total { font-size: 13px; color: var(--muted); text-align: right; }
.k-rate0 { color: var(--green); } .k-rate1 { color: var(--amber); } .k-rate2 { color: #9B2C2C; }
.k-prop-foot { display: flex; justify-content: space-between; align-items: center; }
.k-member, .k-note, .k-fixed, .k-zone { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.k-note.done .k-in { color: var(--faint); text-decoration: line-through; }
.k-zone .k-in:first-of-type { max-width: 260px; }
.k-handle { display: inline-flex; align-items: center; color: var(--muted); max-width: 180px; }
.k-zone .k-muted { white-space: nowrap; min-width: 52px; }
.k-swatch { width: 30px; height: 30px; border: 0; border-radius: 8px; font-size: 13px; flex-shrink: 0; }

/* location plan */
.k-locgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.k-locgrid.with-side { grid-template-columns: minmax(0, 1fr) 320px; }
.k-plan { position: relative; border-radius: 10px; overflow: hidden; background: var(--soft); touch-action: none; user-select: none; }
.k-plan img { display: block; width: 100%; height: auto; pointer-events: none; }
.k-plan.noimg { aspect-ratio: 2/1; background-color: #FAFAF8; background-image: linear-gradient(#ECECE8 1px, transparent 1px), linear-gradient(90deg, #ECECE8 1px, transparent 1px); background-size: 32px 32px; }
.k-plan.placing { cursor: crosshair; box-shadow: inset 0 0 0 2px var(--blue); }
.k-marker { position: absolute; z-index: 2; transform: translate(-50%, -50%); width: 30px; height: 26px; border: 2px solid #fff; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: grab; }
.k-marker.on { box-shadow: 0 0 0 3px var(--blue), 0 2px 8px rgba(0,0,0,.25); }
.k-cone { position: absolute; z-index: 1; width: 70%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  -webkit-mask: radial-gradient(circle, #000 0 30%, transparent 70%); mask: radial-gradient(circle, #000 0 30%, transparent 70%); }
.k-markerpanel { margin: 0; }
.k-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.k-markerpanel input[type="range"] { accent-color: var(--blue); }
.k-markerpanel .k-thumb { aspect-ratio: 3/2; }

/* equipment */
.k-case-head { display: flex; gap: 8px; align-items: flex-start; }
.k-case-title { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.k-case-title .k-in:first-child { font-weight: 650; }
.k-state { height: 30px; padding: 0 10px; border: 0; border-radius: 15px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.k-state0 { background: #EFEFEC; color: var(--ink2); } .k-state1 { background: var(--blue-soft); color: var(--blue-ink); } .k-state2 { background: var(--green-soft); color: var(--green); }
.k-items li { display: flex; gap: 4px; align-items: center; padding: 2px 0; }
.k-items li .k-in-flat:first-of-type { flex: 1; }
.k-in-qty { width: 52px; text-align: right; }
.k-in-move { width: 64px; padding-right: 18px; color: var(--muted); font-size: 12px; }
.k-lensitem > span { flex: 1; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.k-additem { display: flex; gap: 6px; margin-top: 8px; }
.k-additem .k-in { height: 30px; }
.k-lensrow { display: grid; grid-template-columns: minmax(180px, 1.4fr) auto auto 130px 120px auto minmax(140px, 1fr) 30px; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line2); }
.k-lensrow:first-child { border-top: 0; }
.k-lens-main { display: flex; flex-direction: column; gap: 4px; }
.k-lens-main .k-in:first-child { font-weight: 600; }
.k-lens-use { display: flex; flex-direction: column; font-size: 12px; }
.k-setup.ready { box-shadow: 0 0 0 2px #A9D3B6, var(--shadow); }
.k-setup-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .k-blocking { grid-template-columns: 76px minmax(0, 1fr); }
  .k-vf-col { grid-column: 1 / -1; position: static; }
  .k-board { grid-template-columns: minmax(0, 1fr); }
  .k-artist { position: static; max-height: none; }
  .k-cards3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .k-lensrow { grid-template-columns: minmax(160px, 1fr) auto auto; }
  .k-row { grid-template-columns: 112px 84px 56px minmax(180px, 1.6fr) 84px 96px 100px 48px minmax(120px, 1fr); }
  .k-row > .k-c-notes { display: none; }
  .k-row-head > span:last-child { display: none; }
  .k-c-frame .k-sketch, .k-c-frame .k-frame-img { width: 112px; }
}
@media (max-width: 860px) {
  .k-top { flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
  .k-brand { flex: 1 1 auto; }
  .k-top-right { flex: 0 0 auto; }
  .k-flow { order: 3; width: 100%; justify-content: space-between; overflow-x: auto; }
  .k-flow-step { padding: 0 8px 0 4px; gap: 6px; font-size: 13px; }
  .k-flow-line { flex: 1; min-width: 6px; }
  .k-subtabs { justify-content: flex-start; overflow-x: auto; padding-inline: 16px; }
  .k-main { padding: 16px 16px 64px; }
  .k-row-head { display: none; }
  .k-row { grid-template-columns: 112px minmax(0, 1fr); grid-auto-flow: row; gap: 4px 12px; }
  .k-row > span { grid-column: 2; }
  .k-row > .k-c-frame { grid-column: 1; grid-row: 1 / span 4; }
  .k-row > .k-c-angle, .k-row > .k-c-fps, .k-row > .k-c-lens { display: none; }
  .k-c-code { flex-direction: row !important; gap: 8px !important; align-items: baseline; }
  .k-c-time { flex-direction: row !important; flex-wrap: wrap; gap: 6px !important; font-size: 12px; }
  .k-c-size { flex-direction: row !important; gap: 6px !important; }
  .k-blocking { grid-template-columns: minmax(0, 1fr); }
  .k-palette { flex-direction: row; position: static; overflow-x: auto; }
  .k-pal { min-width: 60px; }
  .k-split { grid-template-columns: minmax(0, 1fr); }
  .k-sidenav { flex-direction: row; overflow-x: auto; position: static; }
  .k-sidenav button { white-space: nowrap; }
  .k-cards2, .k-cards3, .k-grid4 { grid-template-columns: minmax(0, 1fr); }
  .k-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .k-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .k-sched-row { grid-template-columns: 52px 30px auto auto minmax(0, 1fr); row-gap: 6px; }
  .k-sched-row > .k-sched-time { grid-row: span 3; align-self: start; }
  .k-sched-row > .k-check { grid-row: span 3; align-self: start; }
  .k-sched-main, .k-sched-tags { grid-column: 3 / -1; }
  .k-sched-ops { justify-content: flex-end; }
  .k-sched-tags:empty { display: none; }
  .k-tl-ticks span:nth-child(even) { display: none; }
  .k-board-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .k-card-desc { display: none; }
  .k-locgrid.with-side { grid-template-columns: minmax(0, 1fr); }
  .k-opt { grid-template-columns: 28px minmax(0, 1fr) 80px; }
  .k-opt > select, .k-opt-total { grid-column: 2; }
  .k-angles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .k-next-body { grid-template-columns: minmax(0, 1fr); }
  .k-kanban { grid-template-columns: repeat(5, 260px); }
  .k-zone { flex-wrap: wrap; }
  .k-fixed { flex-wrap: wrap; }
  .k-fixed .k-in { flex: 1 1 140px; }
}
@media (max-width: 520px) {
  .k-brand .k-parent, .k-brand .k-parent + span { display: none; }
  .k-flow-step span:not(.k-flow-n) { display: none; }
  .k-flow-step.current span:not(.k-flow-n) { display: inline; }
  .k-grid2, .k-grid3 { grid-template-columns: minmax(0, 1fr); }
  .k-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .k-row { grid-template-columns: 88px minmax(0, 1fr); }
  .k-c-frame .k-sketch, .k-c-frame .k-frame-img { width: 88px; }
  .k-newproj { flex-direction: column; }
  .k-next-act { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  body { background: #fff; }
  .k-top, .k-subtabs, .k-chars, .k-charpanel, .k-artist, .k-head .k-btn, .k-scrim, .k-drawer, .k-toast { display: none !important; }
  .k-board { display: block; }
  .k-board-grid { grid-template-columns: repeat(3, 1fr); }
  .k-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .k-card.on { box-shadow: none; }
}

/* ---------- account ---------- */
.k-user { position: relative; }
.k-user-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; }
.k-menu { position: absolute; right: 0; top: 40px; z-index: 40; min-width: 240px; padding: 6px; background: var(--panel); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.16); display: flex; flex-direction: column; }
.k-menu-who { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line2); margin-bottom: 4px; font-size: 13px; }
.k-menu-who span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.k-menu button { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-size: 14px; }
.k-menu button:hover { background: var(--soft); }
.k-menu form { margin: 0; }
.k-person { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line2); }
.k-person:first-child { border-top: 0; }
.k-person.off { opacity: .55; }
.k-person-main { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.k-invite, .k-linkrow { display: flex; gap: 8px; flex-wrap: wrap; }
.k-invite .k-in, .k-linkrow .k-in { flex: 1 1 240px; width: auto; }
.k-linkbox { margin: 14px 0 4px; padding: 12px; border-radius: 12px; background: var(--blue-soft); display: flex; flex-direction: column; gap: 8px; }
.k-subhead { font-size: 14px; margin: 18px 0 4px; }
.k-pwform { max-width: 380px; }
.k-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.k-auth-card { width: min(420px, 100%); background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); padding: 28px; }
.k-auth-brand { margin: 0 0 18px; font-weight: 800; letter-spacing: -.01em; }
.k-auth-card h1 { font-size: 22px; }
.k-auth-card .k-lead { margin-bottom: 18px; }
.k-auth-form { display: flex; flex-direction: column; }
.k-auth-form .k-btn { justify-content: center; margin-top: 6px; }
.k-auth-error { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.k-narrow { max-width: 820px; margin: 0 auto; }
.k-google { justify-content: center; width: 100%; gap: 10px; text-decoration: none; color: var(--ink); }
.k-or { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 12px; }
.k-or::before, .k-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
