/* Hanami: Sakura Mist */
@font-face { font-family: 'Shippori Mincho'; font-weight: 500; src: url('fonts/shippori-mincho-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Shippori Mincho'; font-weight: 700; src: url('fonts/shippori-mincho-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 400; src: url('fonts/zen-kaku-gothic-new-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 500; src: url('fonts/zen-kaku-gothic-new-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 700; src: url('fonts/zen-kaku-gothic-new-latin-700-normal.woff2') format('woff2'); }

:root {
  --mist: #F6F3F7;
  --card: #FFFCFD;
  --line: #E6DBE3;
  --ink: #2B2433;
  --muted: #6F5F7D;
  --sakura: #C2648F;
  --deep: #A24C74;
  --plum: #4A3A4F;
  --lilac: #EFE7F2;
  --lilac-2: #E4D8EA;
  --approved: #4E8A66;
  --redo: #B8475B;
  --edited: #7D69B3;
  --waiting: #C2648F;
  --shadow: 0 10px 30px rgba(74, 58, 79, 0.08), 0 1px 3px rgba(74, 58, 79, 0.06);
  --shadow-lg: 0 24px 60px rgba(74, 58, 79, 0.16), 0 2px 8px rgba(74, 58, 79, 0.08);
  --r: 16px;
  --serif: 'Shippori Mincho', 'Hiragino Mincho ProN', Georgia, serif;
  --sans: 'Zen Kaku Gothic New', 'Hiragino Sans', -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--mist); color: var(--ink); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: antialiased; overflow: hidden; user-select: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
input, textarea { user-select: text; }
::selection { background: #F3D3E1; }

/* ---------- layout */
.app { position: relative; display: grid; grid-template-rows: 58px 1fr 46px; height: 100vh; }
.topbar { -webkit-app-region: drag; display: flex; align-items: center; gap: 18px; padding: 0 24px 0 92px; position: relative; z-index: 3; }
.topbar button, .topbar .nav a { -webkit-app-region: no-drag; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; color: var(--plum); }
.wordmark svg { width: 18px; height: 18px; }
.nav { display: flex; gap: 6px; margin-left: 10px; }
.nav a { -webkit-app-region: no-drag; padding: 6px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.6); color: var(--ink); }
.nav a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.topbar .spacer { flex: 1; }
.status-chip { -webkit-app-region: no-drag; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; background: rgba(255,252,253,.7); padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: inline-block; }
.dot.ok { background: var(--approved); } .dot.warn { background: var(--sakura); }

main.screen { position: relative; z-index: 1; overflow: hidden; min-height: 0; }
.scroll { height: 100%; overflow-y: auto; padding: 8px 48px 48px; }
.scroll::-webkit-scrollbar { width: 10px; } .scroll::-webkit-scrollbar-thumb { background: var(--lilac-2); border-radius: 10px; border: 3px solid var(--mist); }

/* ---------- blossom canopy (original art, drawn in canopy.js) */
.canopy { position: absolute; top: 0; right: 0; pointer-events: none; z-index: 0; }
.canopy svg { display: block; width: 100%; height: 100%; }
.canopy.big { width: min(1100px, 78vw); height: 440px; }
.canopy.small { width: min(640px, 50vw); height: 210px; opacity: .72; }
.petals { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.petal { position: absolute; top: -20px; width: 11px; height: 9px; background: #F2C1D4; border-radius: 80% 10% 80% 10%; opacity: .0; animation: fall linear infinite; }
@keyframes fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: .75; }
  100% { transform: translate(-260px, 105vh) rotate(540deg); opacity: 0; }
}

/* ---------- type */
.title { font-family: var(--serif); font-weight: 500; font-size: 56px; line-height: 1.05; margin: 34px 0 6px; letter-spacing: .005em; }
.title em { font-style: normal; color: var(--sakura); }
.title.sm { font-size: 34px; margin: 6px 0 4px; }
.lede { color: var(--muted); font-size: 15px; max-width: 560px; line-height: 1.6; margin: 0 0 26px; }
.label { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--deep); }
.label.muted { color: var(--muted); }
.section { margin-top: 30px; }
.section > .label { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section > .label .count { background: var(--lilac); color: var(--plum); border-radius: 999px; padding: 1px 8px; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- components */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 16px; border-radius: 12px; cursor: pointer; font-weight: 500; transition: transform .08s ease, box-shadow .15s ease, background .15s; white-space: nowrap; }
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.ink { background: var(--ink); color: var(--card); border-color: var(--ink); }
.btn.ink:hover { background: #3a3044; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(255,255,255,.7); color: var(--ink); box-shadow: none; }
.btn.sakura { background: var(--sakura); border-color: var(--sakura); color: #fff; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .k { font-size: 11px; opacity: .7; border: 1px solid currentColor; border-radius: 5px; padding: 0 5px; line-height: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--lilac); color: var(--plum); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 500; }
.pill.approved { background: #E3F0E8; color: var(--approved); }
.pill.redo { background: #F7E1E5; color: var(--redo); }
.pill.edited { background: #ECE7F7; color: var(--edited); }
.pill.waiting { background: #F8E3EC; color: var(--deep); }
.bar { height: 3px; background: var(--lilac); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--sakura); border-radius: 3px; transition: width .3s ease; }
kbd, .kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px; font-family: var(--sans); font-size: 11.5px; font-weight: 700; color: var(--plum); }
.seg { display: inline-flex; background: var(--lilac); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(74,58,79,.12); }
.input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; outline: none; transition: border .15s, box-shadow .15s; }
.input:focus { border-color: var(--sakura); box-shadow: 0 0 0 3px rgba(194,100,143,.14); }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }

/* ---------- footer key row */
.keys { position: relative; z-index: 2; display: flex; align-items: center; gap: 18px; padding: 0 28px; border-top: 1px solid var(--line); background: rgba(255,252,253,.78); backdrop-filter: blur(10px); color: var(--muted); font-size: 12px; overflow: hidden; white-space: nowrap; }
.keys span { display: inline-flex; align-items: center; gap: 6px; }
.keys .spacer { flex: 1; }

/* ---------- toast & modal */
.toasts { position: fixed; bottom: 62px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--card); padding: 10px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13px; animation: pop .18s ease; max-width: 640px; text-align: center; }
.toast.err { background: var(--redo); }
.toast.ok { background: var(--plum); }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay { position: fixed; inset: 0; background: rgba(43,36,51,.28); backdrop-filter: blur(3px); z-index: 40; display: flex; align-items: center; justify-content: center; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(560px, 92vw); max-height: 86vh; overflow: auto; padding: 26px 28px 22px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal.wide { width: min(940px, 94vw); }
.modal h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0 0 6px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; position: sticky; bottom: -22px; background: var(--card); padding: 14px 0 4px; border-top: 1px solid transparent; }
.modal .two { display: grid; grid-template-columns: 300px 1fr; gap: 28px; }
.modal .two > div > .field:first-child { margin-top: 0; }
.field { margin-top: 16px; }
.field > .label { display: block; margin-bottom: 8px; }

/* ---------- inbox */
.batch-card { display: flex; align-items: stretch; gap: 22px; padding: 18px 20px; margin-bottom: 12px; cursor: pointer; position: relative; transition: transform .12s ease, box-shadow .15s ease; max-width: 1040px; }
.batch-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.batch-card.sel { border-color: var(--sakura); box-shadow: 0 0 0 3px rgba(194,100,143,.16), var(--shadow); }
.batch-card .info { flex: 0 0 280px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.batch-card .name { font-family: var(--serif); font-size: 25px; font-weight: 500; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-card .meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.batch-card .bar { margin-top: auto; }
.thumbs { display: flex; gap: 8px; align-items: center; overflow: hidden; flex: 1; }
.thumb { width: 58px; aspect-ratio: 9/16; border-radius: 9px; background: var(--lilac) center/cover no-repeat; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(74,58,79,.06); }
.thumb.lg { width: 74px; }
.batch-card .go { align-self: center; }
.dl-card { display: flex; align-items: center; gap: 22px; padding: 16px 20px; margin-bottom: 12px; max-width: 1040px; }
.dl-card .info { flex: 0 0 280px; }
.dl-card .name { font-family: var(--serif); font-size: 22px; }
.decided-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 12px; max-width: 1040px; cursor: pointer; }
.decided-row:hover { background: rgba(255,252,253,.8); }
.decided-row .n { font-family: var(--serif); font-size: 17px; min-width: 260px; }
.empty { padding: 34px 36px; max-width: 760px; display: flex; gap: 28px; align-items: center; }
.empty h3 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0 0 8px; }
.empty p { color: var(--muted); line-height: 1.65; margin: 0 0 16px; }
.dropzone { position: fixed; inset: 58px 0 46px 0; z-index: 30; display: none; align-items: center; justify-content: center; background: rgba(246,243,247,.82); border: 2px dashed var(--sakura); border-radius: 24px; margin: 12px; font-family: var(--serif); font-size: 30px; color: var(--deep); }
.dropzone.on { display: flex; }

/* file-into-brand dialog */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; max-height: 232px; overflow: auto; padding: 3px; }
.pick { position: relative; cursor: pointer; border-radius: 11px; }
.pick .thumb { width: 100%; }
.pick.off .thumb { opacity: .35; filter: grayscale(.6); }
.pick .tick { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--sakura); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.pick.off .tick { background: rgba(255,255,255,.85); color: transparent; border: 1px solid var(--line); }
.pick.ref.sel .thumb { box-shadow: 0 0 0 3px var(--sakura); }
.pick .thumb.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: #FFF7FB; box-shadow: inset 0 0 0 2px #E2C3D3; color: var(--deep); text-align: center; padding: 4px; }
.pick .thumb.add b { font-size: 24px; line-height: 1; font-weight: 500; }
.pick .thumb.add span { font-size: 10.5px; font-weight: 700; line-height: 1.2; }
.pick .cap { font-size: 10.5px; color: var(--muted); margin-top: 4px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 11px; cursor: pointer; font-size: 12.5px; color: var(--plum); }
.chip:hover, .chip.on { border-color: var(--sakura); color: var(--deep); background: #FCEFF5; }

/* ---------- review */
.review { display: grid; grid-template-columns: 96px 1fr 372px; gap: 22px; height: 100%; padding: 6px 28px 18px; }
.rail { overflow-y: auto; padding: 4px 6px 20px 2px; display: flex; flex-direction: column; gap: 10px; }
.rail::-webkit-scrollbar { width: 0; }
.rail .r { position: relative; cursor: pointer; border-radius: 11px; transition: transform .1s; }
.rail .r .thumb { width: 100%; border-radius: 11px; }
.rail .r.cur .thumb { box-shadow: 0 0 0 3px var(--sakura); }
.rail .r .sdot { position: absolute; bottom: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; background: var(--line); }
.rail .r .ed { position: absolute; top: 5px; left: 5px; font-size: 9.5px; font-weight: 700; background: rgba(255,252,253,.92); color: var(--edited); border-radius: 6px; padding: 1px 5px; letter-spacing: .04em; }
.s-approved { background: var(--approved) !important; } .s-redo { background: var(--redo) !important; } .s-edited { background: var(--edited) !important; } .s-waiting { background: var(--sakura) !important; }
.stage { display: flex; flex-direction: column; align-items: center; min-width: 0; min-height: 0; }
.stage-head { width: 100%; display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.stage-head .crumb { font-family: var(--serif); font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-head .crumb .b { color: var(--muted); font-size: 15px; font-family: var(--sans); margin-right: 6px; }
.stage-head .prog { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 120px; max-width: 280px; margin-left: auto; }
.players { flex: 1; min-height: 0; display: flex; gap: 18px; align-items: stretch; justify-content: center; width: 100%; }
.player { position: relative; height: 100%; aspect-ratio: 9/16; max-width: 100%; border-radius: 18px; overflow: hidden; background: #1d1822; box-shadow: var(--shadow-lg); }
.player video { width: 100%; height: 100%; object-fit: contain; display: block; background: #1d1822; }
.player .tag { position: absolute; top: 12px; left: 12px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; background: rgba(255,252,253,.9); color: var(--deep); border-radius: 8px; padding: 3px 8px; }
.player .state { position: absolute; top: 12px; right: 12px; }
.player .flash { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 46px; color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,.4); opacity: 0; pointer-events: none; }
.player .flash.on { animation: flash .7s ease; }
@keyframes flash { 0% { opacity: 0; transform: scale(.94); } 20% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
.player .speed { position: absolute; bottom: 12px; right: 12px; background: rgba(43,36,51,.7); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 7px; }
.player .muted-ico { position: absolute; bottom: 12px; left: 12px; background: rgba(43,36,51,.7); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 7px; }
.tl { width: min(100%, 560px); margin-top: 14px; }
.tl .track { position: relative; height: 22px; cursor: pointer; }
.tl .track .base { position: absolute; left: 0; right: 0; top: 9px; height: 4px; background: var(--lilac-2); border-radius: 4px; }
.tl .track .fill { position: absolute; left: 0; top: 9px; height: 4px; background: var(--sakura); border-radius: 4px; }
.tl .track .pin { position: absolute; top: 2px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--plum); }
.tl .track .pin.redo { background: var(--redo); }
.tl .times { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.side { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; padding-bottom: 12px; }
.side::-webkit-scrollbar { width: 0; }
.side .card { padding: 18px 18px; }
.side h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; margin: 6px 0 4px; word-break: break-word; }
.side .file { font-size: 11px; color: var(--muted); word-break: break-all; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin-top: 12px; font-size: 13px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acts .btn { justify-content: space-between; }
.acts .btn.a:hover { border-color: var(--approved); color: var(--approved); }
.acts .btn.r:hover { border-color: var(--redo); color: var(--redo); }
.notes { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.note { display: flex; gap: 10px; align-items: flex-start; }
.note .t { flex: 0 0 auto; cursor: pointer; }
.note .fr { width: 40px; aspect-ratio: 9/16; border-radius: 6px; background: var(--lilac) center/cover; flex: 0 0 auto; cursor: pointer; }
.note .tx { flex: 1; line-height: 1.45; font-size: 13px; }
.note .x { opacity: 0; cursor: pointer; color: var(--muted); }
.note:hover .x { opacity: 1; }
.note.redo .tx { color: var(--redo); }
.note .fixed { margin-top: 4px; color: var(--approved, #3f8a5f); font-size: 12px; cursor: pointer; }
.note .fixed:hover { text-decoration: underline; }
.pill.fixing { background: var(--lilac); color: var(--deep); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }
.facts dd.claude-note { color: var(--deep); line-height: 1.5; }
.mute-row { flex-wrap: wrap; row-gap: 6px; }
.mute-pill { background: #F7E1E5; color: var(--redo); }
.mute-pill .x { cursor: pointer; opacity: .8; }
.grid { height: 100%; overflow-y: auto; padding: 4px 2px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; align-content: start; width: 100%; }
.gcell { cursor: pointer; }
.gcell .player { height: auto; width: 100%; border-radius: 14px; box-shadow: var(--shadow); outline: 3px solid transparent; outline-offset: 2px; }
.gcell.cur .player { outline-color: var(--sakura); }
.gcell .cap { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.gcell .cap .sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }

/* ---------- editor */
.editor { display: grid; grid-template-columns: 1fr 380px; grid-template-rows: auto 1fr auto; gap: 16px 22px; height: 100%; padding: 6px 28px 16px; }
.ed-head { grid-column: 1 / 3; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ed-head .crumb { font-family: var(--serif); font-size: 22px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.lens { display: flex; gap: 14px; align-items: baseline; color: var(--muted); font-size: 13px; }
.lens b { color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 500; }
.lens .arrow { color: var(--sakura); }
.ed-stage { display: flex; gap: 22px; align-items: stretch; min-height: 0; }
.ed-stage .player { height: 100%; cursor: crosshair; }
.ed-stage .player video { transform-origin: 50% 50%; will-change: transform; }
.ed-stage .player .focus { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--sakura), 0 2px 10px rgba(0,0,0,.3); pointer-events: none; display: none; }
.ed-stage .player .focus.on { display: block; }
.ed-stage .player .playbtn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; pointer-events: none; }
.ed-stage .player.paused .playbtn { opacity: 1; }
.playbtn i { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,252,253,.88); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); font-style: normal; font-size: 22px; color: var(--ink); padding-left: 4px; }
.ed-info { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.ed-info .card { padding: 16px 18px; }
.insp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.insp-row .lbl { width: 56px; color: var(--muted); font-size: 12.5px; }
.chat { grid-row: 2 / 4; grid-column: 2; display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.chat-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-head .who { font-family: var(--serif); font-size: 20px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 16px 6px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 14px; line-height: 1.5; font-size: 13.5px; user-select: text; }
.msg.user { align-self: flex-end; background: var(--ink); color: var(--card); border-bottom-right-radius: 5px; }
.msg.claude { align-self: flex-start; background: var(--lilac); color: var(--ink); border-bottom-left-radius: 5px; }
.msg.claude .cost { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.msg.sys { align-self: center; background: transparent; color: var(--muted); font-size: 12px; text-align: center; }
.msg.thinking { color: var(--muted); }
.msg.thinking::after { content: '…'; animation: dots 1.2s steps(4) infinite; display: inline-block; width: 1em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } to { width: 1em; } }
.chat-foot { padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.chat-foot .row { display: flex; gap: 8px; margin-top: 8px; }
.chat-foot textarea { min-height: 44px; height: 44px; max-height: 120px; resize: none; }
.timeline { grid-column: 1; padding: 14px 16px 12px; }
.tl2 { position: relative; height: 112px; margin-top: 6px; }
.tl2 .film { position: absolute; left: 0; right: 0; top: 22px; height: 64px; border-radius: 10px; background-repeat: no-repeat; background-size: 100% 100%; opacity: .5; }
.tl2 .graph { position: absolute; left: 0; right: 0; top: 22px; height: 64px; }
.tl2 .ruler { position: absolute; left: 0; right: 0; top: 0; height: 18px; font-size: 10.5px; color: var(--muted); }
.tl2 .ruler span { position: absolute; transform: translateX(-50%); }
.tl2 .dead { position: absolute; top: 22px; height: 64px; background: repeating-linear-gradient(135deg, rgba(184,71,91,.16) 0 6px, rgba(184,71,91,.06) 6px 12px); border-radius: 4px; pointer-events: none; }
.tl2 .cut { position: absolute; top: 18px; height: 72px; width: 2px; margin-left: -1px; background: rgba(74,58,79,.45); pointer-events: none; }
.tl2 .segs { position: absolute; left: 0; right: 0; top: 22px; height: 64px; }
.tl2 .sg { position: absolute; top: 0; height: 64px; border: 2px solid var(--sakura); background: rgba(194,100,143,.10); border-radius: 9px; cursor: grab; }
.tl2 .sg.sel { background: rgba(194,100,143,.22); box-shadow: 0 0 0 3px rgba(194,100,143,.25); }
.tl2 .sg .h { position: absolute; top: -2px; bottom: -2px; width: 10px; background: var(--sakura); cursor: ew-resize; }
.tl2 .sg .h.l { left: -2px; border-radius: 8px 0 0 8px; } .tl2 .sg .h.r { right: -2px; border-radius: 0 8px 8px 0; }
.tl2 .sg .z { position: absolute; bottom: 3px; left: 12px; font-size: 10px; font-weight: 700; color: #fff; background: var(--plum); border-radius: 5px; padding: 0 5px; }
.tl2 .sg .sp { position: absolute; top: 3px; left: 12px; font-size: 10px; font-weight: 700; color: var(--deep); }
.tl2 .ph { position: absolute; top: 14px; height: 80px; width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; }
.tl2 .ph::before { content: ''; position: absolute; top: -5px; left: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); }
.tl2 .scrub { position: absolute; left: 0; right: 0; top: 0; height: 18px; cursor: pointer; }
.legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); align-items: center; margin-top: 4px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- settings */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; max-width: 1100px; }
.set-grid .card { padding: 22px 24px; }
.set-grid h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 4px 0 6px; }
.set-grid p { color: var(--muted); line-height: 1.6; margin: 6px 0; font-size: 13.5px; }
.keyrow { display: flex; gap: 8px; margin-top: 12px; }
.pathrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.pathrow code { flex: 1; background: var(--lilac); border-radius: 10px; padding: 9px 12px; font-size: 12.5px; color: var(--plum); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: text; }
.switch { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--lilac-2); cursor: pointer; transition: background .15s; flex: 0 0 auto; border: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.switch.on { background: var(--sakura); } .switch.on::after { left: 21px; }
.keylist { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; align-items: center; font-size: 13.5px; }
.keylist .grp { grid-column: 1 / 3; margin-top: 10px; }

/* on-screen text preview (same PNG the render burns in) */
.player .txt { position: absolute; display: none; pointer-events: none; z-index: 2; }

/* background job chip (auto-sort, Edit all) */
.status-chip.job { max-width: 420px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: default; }
.status-chip.job .dot.warn { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.suggest { font-size: 12px; color: var(--deep); margin-top: 6px; }

/* ---- Settings → Phone */
.phone-step { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; }
.phone-step .num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--lilac-2); color: var(--plum); margin-top: 1px; }
.phone-step.todo .num { background: var(--sakura); color: #fff; }
.phone-step.done .num { background: var(--approved); color: #fff; }
.phone-step.wait { opacity: .55; }
.phone-step .st { font-weight: 700; }
.phone-qr { display: block; width: 190px; height: 190px; margin: 12px 0 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); image-rendering: pixelated; }

/* ---------- sound box: drop / AirDrop any song or video */
.sound-drop { border: 2px dashed #E2C3D3; border-radius: 14px; background: linear-gradient(180deg, #FFF7FB, #FBF5FA); padding: 10px 12px; margin: 10px 0 12px; transition: border-color .15s, opacity .15s; }
.sound-drop.busy { opacity: .75; border-color: var(--sakura); }
.sound-drop .sd-head { display: flex; align-items: center; gap: 10px; }
.sound-drop .sd-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--sakura); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.sound-drop.busy .sd-ico { animation: breathe 1.2s ease-in-out infinite; }
.sound-drop .sd-text { flex: 1; min-width: 0; }
.sound-drop .sd-title { font-weight: 700; color: var(--deep); }
.sound-drop .sd-head .btn { flex: none; padding: 5px 10px; font-size: 12px; }
.sound-drop .sd-tray { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 4px; }
.sound-drop .sd-gap { flex: none; width: 1px; background: var(--line); margin: 4px 2px 22px; }
.sound-drop .sd-empty { margin-top: 8px; }
.sd-tile { position: relative; flex: none; width: 66px; cursor: pointer; }
.sd-tile .sd-thumb { width: 66px; height: 88px; border-radius: 10px; background: #2B2433 center / cover no-repeat; outline: 2px solid transparent; outline-offset: 1px; transition: outline-color .12s, transform .12s; }
.sd-tile .sd-thumb.audio { background: linear-gradient(160deg, #E9B8CF, #C2648F); color: #fff; font-size: 28px; display: flex; align-items: center; justify-content: center; }
.sd-tile:hover .sd-thumb { transform: translateY(-1px); outline-color: #E2C3D3; }
.sd-tile.on .sd-thumb { outline-color: var(--sakura); }
.sd-tile .sd-cap { font-size: 10.5px; font-weight: 700; color: var(--ink); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-tile .sd-sub { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-tile .sd-new { position: absolute; top: 4px; left: 4px; background: var(--sakura); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 6px; padding: 1px 5px; }
.sd-tile .sd-tick { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--sakura); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
