/* Layout: 작업 도구 — 상단 바 + 탭, 자료는 카드 격자(미리보기·비고 입력), 스토리는 목록|편집기 2단 */
:root {
  --wall: #f4f3ef; --paper: #ffffff; --ink: #23283a; --muted: #656b7b; --rule: #e1ded6;
  --sea: #2c6e73; --sea-soft: #e3eeec; --sun: #d99a3c; --danger: #b3412f; --ok: #2f7d4f;
  --display: "Gowun Batang", "Nanum Myeongjo", serif;
  --body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --wall: #15181f; --paper: #1d212a; --ink: #e8e6e1; --muted: #a2a6b2; --rule: #2e333e;
    --sea: #7cc3c2; --sea-soft: #1f3335; --sun: #e9b25c; --danger: #ef8a78; --ok: #79c99a; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--wall); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.6; word-break: keep-all; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.3; }
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 20px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--sea); background: var(--sea); color: var(--paper); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--sea); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
input[type=text], input[type=password], input:not([type]), textarea, select {
  width: 100%; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 9px 11px; }
textarea { resize: vertical; }
label.f { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }

.top { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand b { font-family: var(--display); font-size: 20px; }
.brand span { font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin-right: auto; }
.tabs button { background: none; border: 0; padding: 8px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; }
.tabs button[aria-selected=true] { background: var(--sea-soft); color: var(--sea); font-weight: 700; }
.top form { margin: 0; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; }

main { padding-block: 28px 80px; }
.drop { border: 2px dashed var(--rule); border-radius: 14px; background: var(--paper); padding: 28px; display: grid; gap: 10px; justify-items: center; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--sea); background: var(--sea-soft); }
.drop h2 { font-size: 21px; }
.drop p { margin: 0; color: var(--muted); font-size: 14px; }
.who { display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }
.who input { width: 160px; padding: 6px 10px; }
.queue { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.queue li { display: grid; grid-template-columns: minmax(0, 1fr) 140px 64px; gap: 12px; align-items: center; font-size: 13px; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px; }
.queue .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--sea); width: 0; transition: width .2s; }
.queue .st { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.queue .st.err { color: var(--danger); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 28px 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.chips button[aria-pressed=true] { background: var(--ink); color: var(--wall); border-color: var(--ink); }
.chips small { opacity: .65; margin-left: 2px; }
.acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.item { background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.item.sel { border-color: var(--sea); box-shadow: 0 0 0 2px var(--sea-soft); }
.pv { position: relative; aspect-ratio: 4 / 3; background: var(--wall); display: grid; place-items: center; overflow: hidden; }
.pv img, .pv video { width: 100%; height: 100%; object-fit: contain; }
.pv .ic { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--muted); border: 1.5px solid var(--rule); border-radius: 8px; padding: 14px 18px; }
.pv .chk { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; accent-color: var(--sea); }
.pv .from { position: absolute; bottom: 8px; left: 8px; right: 8px; font-size: 11.5px; background: color-mix(in srgb, var(--paper) 88%, transparent); border-radius: 6px; padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.body { padding: 12px 14px 14px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.nm2 { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.note label { font-size: 12px; font-weight: 700; color: var(--sea); display: flex; justify-content: space-between; }
.note .saved { font-weight: 400; color: var(--muted); }
.note .saved.ok { color: var(--ok); }
.note .saved.err { color: var(--danger); }
.note textarea { min-height: 76px; font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; border: 1px dashed var(--rule); border-radius: 12px; }

/* 스토리텔링 */
.st-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.st-list { display: grid; gap: 8px; }
.st-list .new { justify-content: center; }
.st-card { text-align: left; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; cursor: pointer; display: grid; gap: 2px; }
.st-card[aria-current=true] { border-color: var(--sea); box-shadow: 0 0 0 2px var(--sea-soft); }
.st-card b { font-family: var(--display); font-size: 16px; }
.st-card span { font-size: 12px; color: var(--muted); }
.editor { background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 22px; display: grid; gap: 16px; min-width: 0; }
.editor .two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.editor textarea#sBody { min-height: 320px; line-height: 1.8; font-size: 15px; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: -6px; }
.sugg span { font-size: 12px; color: var(--muted); margin: 0 2px 0 6px; }
.sugg span:first-child { margin-left: 0; }
.sugg button { border: 1px solid var(--rule); background: var(--wall); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; }
.sugg button:hover { border-color: var(--sea); color: var(--sea); }
.sugg button.zip { border-style: dashed; }
.voice { display: grid; gap: 6px; }
.vbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.vbtn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--sea); background: var(--paper); color: var(--sea); font-weight: 700; cursor: pointer; }
.vbtn::before { content: ""; width: 10px; height: 14px; border-radius: 5px; border: 2px solid currentColor; }
.vbtn.rec::before { width: 12px; height: 12px; border-radius: 50%; border: 0; background: var(--danger); }
.vbtn.on { background: var(--sea); color: var(--paper); }
.vbtn.rec.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.vbtn.rec.on::before { background: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.interim { margin: 0; min-height: 1.4em; color: var(--muted); font-style: italic; font-size: 14px; }
.aud { display: grid; gap: 12px; justify-items: center; width: 100%; padding: 0 14px; }
.aud audio { width: 100%; }
.ts { display: grid; gap: 6px; justify-items: start; background: var(--wall); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.ts b { font-size: 12px; color: var(--sea); }
.ts p { margin: 0; white-space: pre-wrap; }
.guide { background: var(--sea-soft); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; }
.guide b { color: var(--sea); }
.guide ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; padding: 2px; }
.pick { position: relative; aspect-ratio: 1; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--wall); cursor: pointer; padding: 0; }
.pick img, .pick video { width: 100%; height: 100%; object-fit: cover; }
.pick[aria-pressed=true] { border-color: var(--sea); }
.pick[aria-pressed=true]::after { content: "✓"; position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--sea); color: var(--paper); font-size: 12px; display: grid; place-items: center; }
.pick span { font-size: 10px; padding: 4px; display: block; overflow-wrap: anywhere; }
.ed-acts { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--wall); padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 50; }

@media (prefers-reduced-motion: reduce) { .vbtn.rec.on::before { animation: none; } }
@media (max-width: 820px) {
  .top .wrap { gap: 8px 10px; flex-wrap: wrap; height: auto; padding-block: 10px; }
  .tabs { order: 3; width: 100%; margin-right: 0; }
  .brand { margin-right: auto; }
  .brand span { display: none; }
  .st-grid { grid-template-columns: minmax(0, 1fr); }
  .editor .two { grid-template-columns: minmax(0, 1fr); }
  .queue li { grid-template-columns: minmax(0, 1fr) 80px 48px; }
}
.tabs button small { font-weight: 400; opacity: .75; }
.tablink { color: var(--muted); text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.tablink:hover { background: var(--sea-soft); color: var(--sea); }
[hidden] { display: none !important; }
