:root {
  --bg: #f6f6f8;
  --panel: #ffffff;
  --text: #17171c;
  --muted: #6b6b78;
  --line: #e4e4ea;
  --accent: #6d4aff;
  --accent-soft: #efeaff;
  --ok: #138a4b;
  --warn: #b26a00;
  --bad: #c62f3a;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f13;
    --panel: #18181f;
    --text: #ececf1;
    --muted: #9a9aa8;
    --line: #2a2a35;
    --accent: #8c70ff;
    --accent-soft: #241d42;
    --ok: #3ccf84;
    --warn: #f0a33a;
    --bad: #ff6b75;
  }
}
* { box-sizing: border-box; }
:root { accent-color: var(--accent); }  /* 체크박스·라디오 등 브라우저 기본 컨트롤도 강조색으로 */
[hidden] { display: none !important; }
body { word-break: keep-all;
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }

.topbar {
  display: flex; align-items: center; gap: 24px; padding: 14px 24px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.logo { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600;
}
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.who { color: var(--muted); font-size: 13px; display: flex; gap: 10px; align-items: center; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 16px 80px; }
h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 28px 0 12px; }
.sub { color: var(--muted); margin: 0 0 22px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 220px; }

input:not([type]), input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
input:not([type]):hover, input[type=text]:hover, input[type=email]:hover, input[type=password]:hover, input[type=number]:hover, select:hover, textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--panel);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
label.field { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
label.field > * { margin-top: 5px; }
div.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field-head .meta { font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }
.field-head .meta.bad { color: var(--bad); }
/* 입력칸 + 버튼 한 덩어리 (이메일 + 인증 코드 받기) */
.input-group { display: flex; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 3px;
  transition: border-color .15s, box-shadow .15s, background-color .15s; }
.input-group:focus-within { border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.input-group input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 7px 9px; min-width: 0; flex: 1; }
.input-group .btn { flex: none; padding: 7px 12px; font-size: 13px; border-radius: 7px; }
/* 인증 코드 6자리 */
input.otp { font-size: 22px; font-weight: 700; letter-spacing: .55em; text-align: center; padding: 12px 0 12px .55em;
  font-variant-numeric: tabular-nums; color: var(--text); }
input.otp::placeholder { color: color-mix(in srgb, var(--muted) 45%, transparent); }

.btn {
  border: 0; border-radius: 9px; padding: 10px 16px; font-weight: 700; cursor: pointer;
  background: var(--accent); color: #fff; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: default; }
a.btn { text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--line); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.ghost:not(:disabled):hover, .btn.danger:not(:disabled):hover { background: var(--bg); border-color: color-mix(in srgb, var(--text) 18%, var(--line)); }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn.wide { width: 100%; padding: 13px 18px; font-size: 15px; margin-top: 12px; }
.btn svg, .icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 업로드 영역: 끌어다 놓기 또는 눌러서 고르기 */
/* position: relative — 숨긴 파일 입력칸(.sr-only)이 이 영역 안에 놓이게 한다. 아니면 누를 때 브라우저가 입력칸이 있는 엉뚱한 곳으로 화면을 옮긴다 */
.dropzone { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px 22px; border: 1.5px dashed color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 14px; background: color-mix(in srgb, var(--accent-soft) 45%, var(--panel)); cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.over { border-color: var(--accent); border-style: solid; background: var(--accent-soft); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.dropzone.has-file { border-style: solid; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.dz-icon { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--panel); color: var(--accent);
  box-shadow: 0 1px 2px rgba(16, 16, 24, .06), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); }
.dz-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dz-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dz-text b { font-size: 15px; }
.dz-change { flex: none; pointer-events: none; }

/* 슬라이더: 채워진 부분은 강조색 (--p 는 app.js 의 rangeFill 이 맞춘다) */
input[type=range] { -webkit-appearance: none; appearance: none; height: 18px; background: transparent; cursor: pointer; --p: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 99px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--line) var(--p)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 99px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(16, 16, 24, .25); transition: transform .1s; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(16, 16, 24, .25); }
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type=range]:focus { outline: none; box-shadow: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }

/* 켜고 끄는 스위치 (label.switch > input[type=checkbox]) */
label.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 14px; color: var(--text); font-weight: 600; padding: 2px 0; }
label.switch input { -webkit-appearance: none; appearance: none; flex: none; width: 36px; height: 20px; border-radius: 99px; background: var(--line);
  position: relative; cursor: pointer; transition: background-color .15s; margin: 0; }
label.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(16, 16, 24, .3); transition: transform .15s; }
label.switch input:checked { background: var(--accent); }
label.switch input:checked::after { transform: translateX(16px); }
label.switch input:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.big-input { display: flex; gap: 10px; }
.big-input input { font-size: 16px; padding: 14px 16px; }
.big-input .btn { padding: 0 22px; font-size: 16px; }

/* 처리 옵션: 자막 · 화면 · 클립 구성 · 음성 인식 구역 */
.opts-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 24px 0 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.opts-title b { font-size: 15px; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; align-items: start; }
.opt-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 760px) { .opts { grid-template-columns: minmax(0, 1fr); } }
.opt-group { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; background: var(--panel); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.opt-head { display: flex; gap: 10px; align-items: center; }
.opt-head b { display: block; font-size: 14px; }
.opt-head .meta { display: block; font-size: 12px; margin-top: 1px; }
.opt-ico { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.opt-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.opt-body { display: flex; flex-direction: column; gap: 14px; }
.opt-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.opt-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.opt-item .chips { margin-top: 0; }
.opt-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.num-unit { position: relative; display: block; }
.num-unit input { padding-right: 34px; font-variant-numeric: tabular-nums; }
.num-unit > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); pointer-events: none; }
.opt-switch { align-items: flex-start; padding-top: 12px; border-top: 1px dashed var(--line); }
.opt-switch > span { display: flex; flex-direction: column; gap: 2px; }
.opt-switch .meta { font-weight: 400; font-size: 12px; }
.opt-switch input { margin-top: 2px; }
.opt-note { margin: 0; font-size: 12px; }
.modal .opts { grid-template-columns: 1fr; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg);
  cursor: pointer; font-size: 13px; font-weight: 600;
}
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.or { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.card .thumb { aspect-ratio: 16/9; background: var(--line) center/cover no-repeat; position: relative; cursor: pointer; }
.card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta { color: var(--muted); font-size: 13px; }
/* 휴대폰에서 바로 올린 파일 이름처럼 띄어쓰기 없는 긴 글자는 body 의 keep-all 때문에 줄이 안 바뀌어 화면을 옆으로 밀어낸다.
   제목·설명류는 넘칠 때만 아무 곳에서나 끊고, 그리드·플렉스 칸은 내용보다 좁아질 수 있게 한다 */
h1, h2, h3, .sub, .meta, .card .title, .cp-title, .ed-title, .notice { overflow-wrap: anywhere; }
.grid > *, .clips > *, .card, .card .body, .ed-title { min-width: 0; }
/* 파일 이름 같은 제목은 한 줄로 보여 주고 넘치면 … (전체 이름은 title 속성으로 마우스를 올리면 보인다) */
.one-line, .card .title.one-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: unset; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.badge.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }

.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.clip video { width: 100%; aspect-ratio: 9/16; background: #000; display: block; object-fit: contain; }
.clip.wide video { aspect-ratio: 16/9; }
.clip.square video { aspect-ratio: 1/1; }
.score { font-weight: 800; color: var(--accent); }
.clip .actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.clip input.title-edit { font-weight: 700; padding: 6px 8px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
th { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
td img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
.table-wrap { overflow-x: auto; }

.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal { background: var(--panel); border-radius: 16px; width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 22px; }
.modal h3 { margin: 0 0 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.check { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.check.consent { align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--muted); }
.check.consent input { margin-top: 3px; flex: none; }
.check.consent a { color: var(--accent); }
.check.remember { font-size: 14px; border: 0; padding: 0 2px; }
.check.remember input { flex: none; }
.check.remember .meta { margin-left: auto; font-size: 12px; text-align: right; }

.auth { max-width: 380px; margin: 9vh auto; }
.auth .logo { font-size: 28px; text-align: center; margin-bottom: 4px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.err { color: var(--bad); font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 30; max-width: calc(100% - 32px);
}
.notice { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .nav { order: 3; width: 100%; }
  .big-input { flex-direction: column; }
  .big-input .btn { padding: 12px; }
}
.sub-note { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 16px; margin-bottom: 16px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--panel); font-size: 14px; }
.sub-note.warn { border-left-color: var(--warn); }
.sub-note .btn { flex: none; }

/* 콘텐츠 캘린더 */
.cal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cal-head .btn { flex: none; margin-top: 6px; }
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.cal-nav b { font-size: 17px; margin-left: 6px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 224px; gap: 16px; align-items: start; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-week .cal-post { flex-direction: column; gap: 5px; }
.cal-week .cp-thumb { width: 100%; aspect-ratio: 16/10; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-height: 260px; display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s, background .15s; }
.cal-month .cal-day { min-height: 104px; border-radius: 9px; }
.cal-day.other { opacity: .45; }
.cal-day.past { background: color-mix(in srgb, var(--panel) 60%, var(--bg)); }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-day.drop { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.cd-head { display: flex; align-items: baseline; gap: 6px; padding: 8px 10px 6px; font-size: 12px; color: var(--muted); }
.cd-head b { font-size: 16px; color: var(--text); }
.cal-day.today .cd-head b { color: var(--accent); }
.cd-add { margin-left: auto; width: 24px; height: 24px; border-radius: 7px; border: 1px dashed var(--line); background: transparent; color: var(--muted);
  cursor: pointer; font-size: 15px; line-height: 1; opacity: 0; transition: opacity .15s, color .15s, border-color .15s; }
.cal-day:hover .cd-add, .cd-add:focus-visible { opacity: 1; }
.cd-add:hover { color: var(--accent); border-color: var(--accent); }
.cd-body { display: flex; flex-direction: column; gap: 6px; padding: 0 6px 8px; flex: 1; }
.cd-empty { margin: auto; font-size: 12px; color: var(--muted); opacity: .6; }
.cd-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-post { display: flex; gap: 8px; padding: 6px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); cursor: pointer;
  border-left: 3px solid var(--muted); transition: transform .12s, box-shadow .12s; }
.cal-post:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -10px rgba(0,0,0,.4); }
.cal-post[draggable=true] { cursor: grab; }
.cal-post.dragging, .tray-clip.dragging { opacity: .45; }
.cal-post.st-scheduled { border-left-color: var(--accent); }
.cal-post.st-publishing { border-left-color: var(--warn); }
.cal-post.st-published { border-left-color: var(--ok); }
.cal-post.st-failed { border-left-color: var(--bad); }
.cal-post.st-canceled { opacity: .5; text-decoration: line-through; }
.cal-post.compact { padding: 3px 6px; gap: 5px; font-size: 11.5px; align-items: center; border-radius: 6px; }
.cal-post.compact .cp-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-thumb { width: 34px; flex: none; aspect-ratio: 9/16; border-radius: 6px; background: var(--line) center/cover; }
.cp-body { min-width: 0; flex: 1; }
.cp-time { font-size: 11.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.cp-title { font-size: 12.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cp-plats { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.plat { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; font: 700 9.5px/1 ui-monospace, monospace; color: #fff; background: #777; }
.plat-x { background: #111; } .plat-tiktok { background: linear-gradient(135deg, #25f4ee, #fe2c55); }
.plat-instagram { background: linear-gradient(135deg, #feda75, #d62976 55%, #4f5bd5); } .plat-test { background: #8a8a99; }
.cal-tray { position: sticky; top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; max-height: calc(100vh - 40px); overflow: auto; }
.cal-tray h3 { margin: 0 0 2px; font-size: 15px; }
#tray { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.tray-clip { display: flex; gap: 10px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; cursor: grab; background: var(--bg); transition: border-color .15s, transform .12s; }
.tray-clip:hover { border-color: var(--accent); transform: translateX(-2px); }
.tray-count { color: var(--accent); font-weight: 600; }
.sched-clip { display: flex; gap: 12px; align-items: center; }
.sched-clip .cp-thumb { width: 44px; }
.best-times { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
@media (max-width: 900px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }  /* 1fr 이면 주간 달력(7칸 × 132px)만큼 넓어져 화면이 옆으로 밀린다 */
  .cal-week { grid-template-columns: repeat(7, minmax(132px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
  .cal-tray { position: static; max-height: none; }
  .cal-head { flex-direction: column; }
}

/* 총관리자 */
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 18px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); width: fit-content; }
.admin-nav a { padding: 7px 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.admin-nav a:hover { color: var(--text); }
.admin-nav a.on { background: var(--accent-soft); color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 24px; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-bottom: 18px; }
.todo-item { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-size: 14px; }
.todo-item:hover { border-color: var(--accent); }
.todo-item.zero { color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-bottom: 14px; }
.charts h3 { margin: 0 0 8px; font-size: 14px; }
svg.bars { width: 100%; height: auto; display: block; }
svg.bars text { font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
svg.bars .grid { stroke: var(--line); stroke-dasharray: 2 3; }
svg.bars .axis { stroke: var(--line); }
svg.bars .bar { fill: var(--accent); }
svg.bars .hit { fill: transparent; }
svg.bars .col:hover .hit { fill: var(--accent-soft); }
.admin-tools { margin-bottom: 12px; flex-wrap: wrap; }
.admin-tools input[type=search] { flex: 1; min-width: 220px; }
.admin-actions { margin: 6px 0 4px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--accent-soft); }
.pager { justify-content: flex-end; padding: 10px 6px 4px; }
.todo-item .badge { white-space: nowrap; flex: none; }

/* 클립 편집기 (editor.js) */
main:has(> .editor) { max-width: none; padding: 14px 16px 40px; }
.editor { display: flex; flex-direction: column; gap: 12px; }
.ed-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ed-title { flex: 1; min-width: 160px; display: flex; flex-direction: column; line-height: 1.3; }
.ed-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-main { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 12px; height: min(68vh, 760px); min-height: 420px; }
.ed-left, .ed-right { padding: 12px; overflow: auto; }
.ed-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; margin-bottom: 10px; }
summary.ed-h { cursor: pointer; list-style: none; }
summary.ed-h::after { content: "▾"; color: var(--muted); }
details:not([open]) > summary.ed-h::after { content: "▸"; }
.ed-sec { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.ed-sec:last-child { border-bottom: 0; margin-bottom: 0; }
details.ed-sec:not([open]) { gap: 0; }
.ed-pair { flex-wrap: nowrap; }
.ed-pair > * { flex: 1; min-width: 0; }
.ed-slider b { float: right; color: var(--text); font-weight: 600; }
.ed-slider input[type=range] { width: 100%; }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.ed-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }

.ed-caps { display: flex; flex-direction: column; gap: 6px; }
.ed-cap-row { display: grid; grid-template-columns: 54px 1fr 24px; gap: 6px; align-items: start; padding: 4px; border-radius: 9px; border: 1px solid transparent; }
.ed-cap-row.sel { border-color: var(--accent); background: var(--accent-soft); }
.ed-cap-row textarea { min-height: 0; padding: 6px 8px; font-size: 14px; resize: none; }
.ed-cap-time { border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 700; padding: 8px 0; cursor: pointer; font-variant-numeric: tabular-nums; }

.ed-center { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.ed-stage-wrap { flex: 1; min-height: 0; display: grid; place-items: center; }
.ed-stage { position: relative; background: #000; overflow: hidden; border-radius: 10px; }
.ed-stage video { position: absolute; max-width: none; }
.ed-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ed-cap-layer { position: absolute; inset: 0; pointer-events: none; }
.ed-stage-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center;
  color: #fff; background: rgba(0,0,0,.72); font-size: 14px; line-height: 1.6; }
.ed-cap { position: absolute; left: 6%; right: 6%; text-align: center; text-wrap: balance; word-break: keep-all; overflow-wrap: anywhere;
  font-family: "Noto Sans KR", "Noto Sans CJK KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-weight: 700; }
.ed-cap .hl { font-size: 110%; }
.ed-transport { display: flex; align-items: center; gap: 10px; }
.ed-transport input[type=range] { flex: 1; }
.ed-time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); white-space: nowrap; }

.ed-timeline { padding: 10px 12px; }
.ed-tl-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ed-tl-bar .grow { flex: 1; min-width: 0; }
.tl { display: grid; grid-template-columns: 56px minmax(0, 1fr); }
.tl-labels > div { height: 40px; display: flex; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.tl-labels > .tl-l-ruler { height: 24px; }
.tl-add { margin-left: 6px; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent-soft);
  color: var(--accent); font-weight: 800; line-height: 1; cursor: pointer; padding: 0; }
.tl-caps { cursor: copy; }
.ed-cap-del, .tl-del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 6px 0; border-radius: 6px; }
.ed-cap-del:hover, .tl-del:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.tl-del { flex: none; padding: 0 4px; font-size: 15px; color: var(--bad); align-self: center; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; }
/* 트랙 빈 곳은 손가락으로 밀면 타임라인·화면이 넘어가고, 눈금자·블록은 끌기 동작이라 브라우저 스크롤을 막는다 */
.tl-inner { position: relative; user-select: none; touch-action: pan-x pan-y; }
.tl-ruler, .tl-blk { touch-action: none; }
.tl-ruler { height: 24px; position: relative; border-bottom: 1px solid var(--line); cursor: pointer; }
.tl-ruler span { position: absolute; top: 4px; font-size: 11px; color: var(--muted); padding-left: 3px; border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tl-track { height: 40px; position: relative; border-bottom: 1px dashed var(--line); }
.tl-blk { position: absolute; top: 5px; bottom: 5px; border-radius: 6px; overflow: hidden; display: flex; align-items: center;
  font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.tl-blk span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 6px; pointer-events: none; }
.tl-blk.seg { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tl-blk.cap { background: color-mix(in srgb, var(--warn) 18%, var(--panel)); color: var(--warn); cursor: grab; }
.tl-blk.mus { background: color-mix(in srgb, var(--ok) 18%, var(--panel)); color: var(--ok); }
.tl-blk.sel { border-color: var(--text); box-shadow: 0 0 0 1px var(--text) inset; z-index: 1; }
.tl-blk .h { width: 7px; align-self: stretch; cursor: ew-resize; flex: none; background: color-mix(in srgb, currentColor 30%, transparent); }
/* 손가락(터치)으로 쓰는 기기: 손잡이를 넓히고 잡는 곳을 표시, 트랙도 조금 키운다 */
@media (pointer: coarse) {
  .tl-blk .h { width: 18px; position: relative; }
  .tl-blk .h::after { content: ""; position: absolute; top: 30%; bottom: 30%; left: 50%; width: 2px; margin-left: -1px;
    border-radius: 1px; background: currentColor; opacity: .7; }
  .tl-track, .tl-labels > div:not(.tl-l-ruler) { height: 48px; }
  .tl-add { width: 28px; height: 28px; }
}
.tl-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); pointer-events: none; z-index: 2; margin-left: -1px; }

@media (max-width: 1100px) {
  .ed-main { grid-template-columns: minmax(0, 1fr) 280px; height: auto; }
  .ed-left { grid-column: 1 / -1; order: 3; max-height: 320px; }
  .ed-center { height: 62vh; }
}
@media (max-width: 720px) {
  .ed-main { grid-template-columns: minmax(0, 1fr); }
  .ed-center { height: 58vh; }
  .ed-right { order: 4; }
  .ed-tl-bar .meta { display: none; }
}
.ed-words { display: flex; flex-direction: column; gap: 8px; }
.ed-words .field-label { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.ed-words .field-label .meta { font-weight: 400; font-size: 12px; }
.ed-word-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ed-word-chips .chip { padding: 4px 9px; }
.report summary { list-style: none; }
.report summary::-webkit-details-marker { display: none; }
.finding { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }
.device-list { display: flex; flex-direction: column; }
.device { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.device:first-child { border-top: 0; }
.device-info { flex: 1; min-width: 0; }
.device-info .meta { margin-top: 2px; }
.device .btn { flex: none; }

/* ---------------------------------------------------------------- 편집기 다듬기 (밝고 깔끔하게)
   위의 기본 편집기 규칙을 덮어쓴다: 테두리 대신 옅은 그림자, 아이콘 도구 막대, 트랙별 색 */
.editor .panel { border-color: color-mix(in srgb, var(--line) 75%, transparent); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 16, 24, .04), 0 2px 10px -6px rgba(16, 16, 24, .08); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--text); cursor: pointer; padding: 0; text-decoration: none; transition: background-color .15s, color .15s; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover:not(:disabled) { background: var(--bg); }
.icon-btn:disabled { color: color-mix(in srgb, var(--muted) 45%, transparent); cursor: default; }
.icon-btn.sm { width: 26px; height: 26px; color: var(--muted); }
.icon-btn.sm svg { width: 16px; height: 16px; }
.text-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--accent); font-weight: 700; font-size: 13px;
  cursor: pointer; padding: 4px 6px; border-radius: 7px; }
.text-btn:hover { background: var(--accent-soft); }
.text-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.soft:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); }
.ed-tools { display: inline-flex; gap: 2px; padding: 2px; border-radius: 11px; background: var(--bg); }
.ed-tools .icon-btn { width: 32px; height: 32px; }
.ed-tools .icon-btn:hover:not(:disabled) { background: var(--panel); box-shadow: 0 1px 2px rgba(16, 16, 24, .08); }

/* 상단: 뒤로 · 제목과 저장 상태 · 되돌리기 · 완성본 · 내보내기 */
.ed-top { gap: 10px; padding: 2px 2px 4px; }
.ed-back { border: 1px solid var(--line); background: var(--panel); }
.ed-title { gap: 2px; }
.ed-title b { font-size: 16px; letter-spacing: -.01em; }
.ed-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ed-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.ed-status[data-state="ok"]::before { background: var(--ok); }
.ed-status[data-state="busy"]::before { background: var(--warn); animation: pulse 1s ease-in-out infinite; }
.ed-status[data-state="err"] { color: var(--bad); }
.ed-status[data-state="err"]::before { background: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }
.ed-render { display: inline-flex; gap: 6px; align-items: center; }
#ed-export { padding: 9px 16px; box-shadow: 0 1px 2px rgba(16, 16, 24, .12), 0 4px 12px -4px color-mix(in srgb, var(--accent) 55%, transparent); }

/* 패널 머리글 */
.ed-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.ed-right .ed-h { color: var(--text); font-size: 14px; text-transform: none; letter-spacing: 0; }
.ed-left, .ed-right { padding: 14px; }
.ed-sec { gap: 12px; padding-bottom: 16px; margin-bottom: 16px; }
.ed-right label.field { font-weight: 600; }
.ed-slider b { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }
.ed-right input[type=number], .ed-right input[type=text], .ed-right select, .ed-right textarea { padding: 8px 10px; font-size: 14px; }
.ed-right .chips .chip { font-size: 12.5px; }

/* 자막 목록: 글자는 평소엔 바탕에 녹아 있다가 고를 때만 칸이 보인다 */
.ed-caps { gap: 2px; }
.ed-cap-row { grid-template-columns: 52px 1fr 26px; padding: 6px 4px; border: 0; border-radius: 10px; transition: background-color .12s; }
.ed-cap-row:hover { background: var(--bg); }
.ed-cap-row.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ed-cap-row textarea { background: transparent; border-color: transparent; padding: 5px 7px; line-height: 1.45; }
.ed-cap-row textarea:hover { border-color: var(--line); }
.ed-cap-row textarea:focus { background: var(--panel); }
.ed-cap-time { align-self: start; margin-top: 4px; padding: 3px 0; border-radius: 6px; font-size: 11.5px; background: var(--panel);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.ed-cap-row.sel .ed-cap-time { background: var(--accent); color: #fff; box-shadow: none; }
.ed-cap-del { opacity: 0; transition: opacity .12s; font-size: 16px; }
.ed-cap-row:hover .ed-cap-del, .ed-cap-row.sel .ed-cap-del, .ed-cap-del:focus-visible { opacity: 1; }
@media (pointer: coarse) { .ed-cap-del { opacity: 1; } }

/* 미리보기: 옅은 작업대 위에 영상 */
.ed-stage-wrap { border-radius: 14px; background: radial-gradient(circle at 50% 40%, var(--panel), var(--bg) 70%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent); }
.ed-stage { border-radius: 12px; box-shadow: 0 12px 32px -12px rgba(16, 16, 24, .45), 0 0 0 1px rgba(0, 0, 0, .06); }
.ed-transport { gap: 12px; padding: 4px 4px 2px; }
.play-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: #fff; box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 70%, transparent); transition: transform .08s, background-color .15s; }
.play-btn:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.play-btn:active { transform: scale(.95); }
.play-btn svg { width: 16px; height: 16px; margin-left: 2px; }
.play-btn.on svg { margin-left: 0; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ed-time { font-size: 12.5px; min-width: 104px; }

/* 타임라인 */
.ed-timeline { padding: 12px 14px 10px; }
.ed-tl-bar { margin-bottom: 10px; }
.ed-tl-bar > b { font-size: 14px; }
.tl { grid-template-columns: 64px minmax(0, 1fr); }
.tl-labels > div { font-size: 11.5px; letter-spacing: .02em; padding-left: 2px; }
.tl-ruler { border-bottom: 0; background: var(--bg); border-radius: 7px; }
.tl-ruler span { top: 5px; border-left-color: color-mix(in srgb, var(--muted) 30%, transparent); font-size: 10.5px; }
.tl-track { border-bottom: 0; }
.tl-track + .tl-track, .tl-ruler + .tl-track { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--line) 60%, transparent); }
.tl-blk { top: 6px; bottom: 6px; border-radius: 8px; font-weight: 600; box-shadow: 0 1px 2px rgba(16, 16, 24, .06); }
.tl-blk.seg { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, var(--panel)), color-mix(in srgb, var(--accent) 24%, var(--panel)));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tl-blk.cap { background: color-mix(in srgb, #f59e0b 16%, var(--panel)); color: color-mix(in srgb, #b45309 85%, var(--text));
  border-color: color-mix(in srgb, #f59e0b 40%, transparent); }
.tl-blk.mus { background: color-mix(in srgb, var(--ok) 14%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.tl-blk.sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.tl-blk .h { width: 8px; background: color-mix(in srgb, currentColor 22%, transparent); }
.tl-add { width: 20px; height: 20px; border-radius: 6px; border: 0; background: var(--accent-soft); font-size: 14px; }
.tl-playhead { width: 2px; background: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--panel) 70%, transparent); }
.tl-playhead::before { content: ""; position: absolute; top: -1px; left: 50%; width: 10px; height: 10px; margin-left: -5px;
  background: var(--accent); border-radius: 2px 2px 50% 50%; }

/* 배경음악: 작은 업로드 영역과 올린 음악 카드 */
.dropzone.sm { padding: 12px; gap: 10px; border-radius: 12px; }
.dropzone.sm .dz-icon, .music-card .dz-icon { width: 36px; height: 36px; border-radius: 10px; }
.dropzone.sm .dz-icon svg, .music-card .dz-icon svg { width: 18px; height: 18px; }
.dropzone.sm .dz-text b { font-size: 13.5px; }
.dropzone.sm .dz-text .meta { font-size: 11.5px; }
.ed-right .check.consent { font-size: 12px; padding: 8px 10px; }
#p-mup { width: 100%; margin-top: 10px; }
#p-mdrop { margin-top: 2px; }
#p-mdrop + .check { margin-top: 10px; }
.music-card + .ed-slider { margin-top: 10px; }
.music-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--ok) 8%, var(--panel)); border: 1px solid color-mix(in srgb, var(--ok) 25%, var(--line)); }
.music-card .dz-icon { color: var(--ok); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ok) 25%, transparent); }
.music-card .dz-text b { font-size: 13.5px; }

/* 편집기: 아직 MP4 에 반영되지 않은 편집 안내 */
.ed-notice { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 11px; font-size: 13px;
  background: color-mix(in srgb, var(--warn) 10%, var(--panel)); color: color-mix(in srgb, var(--warn) 70%, var(--text));
  border: 1px solid color-mix(in srgb, var(--warn) 28%, var(--line)); }
.ed-notice b { color: var(--text); }
.ed-notice-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.clip .actions { align-items: center; }
.meta.expiring { color: var(--warn); font-weight: 600; }

/* 편집기: 말로 편집 (명령창 + 마이크 + 추천 명령) */
.editor .ed-ai { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ed-ai-bar { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); padding: 4px 4px 4px 12px;
  transition: border-color .15s, box-shadow .15s, background-color .15s; }
.ed-ai-bar:focus-within { border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ed-ai-icon { display: inline-grid; place-items: center; color: var(--accent); flex: none; }
.ed-ai-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.ed-ai-bar input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 7px 4px; outline: none; font-size: 14px; }
.ed-ai-bar input::placeholder { color: var(--muted); }
.ed-ai-mic { color: var(--muted); }
.ed-ai-mic:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
.ed-ai.recording .ed-ai-mic { color: #fff; background: var(--bad); }
.ed-ai.recording .ed-ai-bar { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.ed-ai-rec { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--bad); font-weight: 600; flex: none; }
.ed-ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: pulse 1s ease-in-out infinite; }
.ed-ai-go { border-radius: 8px; }
.ed-ai.busy .ed-ai-go svg { animation: ed-ai-spin .9s linear infinite; }
@keyframes ed-ai-spin { to { transform: rotate(360deg); } }
.ed-ai-foot { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.ed-ai-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.ed-ai-chips::-webkit-scrollbar { display: none; }
@media (max-width: 720px) { .ed-ai-chips { mask-image: linear-gradient(to right, #000 85%, transparent); -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); } }
.ed-ai-chips .chip { flex: none; padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--panel); }
.ed-ai-chips .chip:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.ed-ai-result { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); flex: 1; min-width: 0; }
.ed-ai-result .ok-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 14%, var(--panel)); color: var(--ok);
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; }
.ed-ai-result .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ed-ai-result.err { color: var(--bad); }
.ed-ai-result .info-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; font-style: italic; font-family: Georgia, serif; }
.ed-ai-result .text-btn { flex: none; }
.ed-ai-left { flex: none; font-size: 12px; margin-left: auto; white-space: nowrap; }
.ed-ai-chips .chip:disabled { opacity: .5; cursor: default; }
.ed-ai-bar input:disabled { opacity: .7; }
@media (max-width: 720px) {
  .ed-ai-go span { display: none; }
  .ed-ai-go { padding: 7px 9px; }
  .ed-ai-left { display: none; }
  .ed-ai-result .txt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
}

/* 업로드 진행: 남은 시간·속도 (연결이 불안정하면 경고 색) */
.upload-eta { margin-top: 6px; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.upload-eta.warn { color: var(--warn); }

/* 원본에서 직접 클립 만들기 (#/p/<id>/cut) — 편집기와 같은 재생 버튼·시간·재생선 */
main:has(> .cut) { max-width: 1240px; }
.cut-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; margin-top: 14px; }
.cut-player { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.cut-stage { background: #000; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.cut-stage video { max-width: 100%; max-height: min(52vh, 560px); display: block; }
.cut-tl { user-select: none; -webkit-user-select: none; }
.cut-ruler { position: relative; height: 18px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cut-ruler span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.cut-ruler span:first-child { transform: none; }
.cut-ruler span.end { transform: translateX(-100%); }
.cut-track { position: relative; height: 56px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); cursor: pointer; touch-action: none; overflow: hidden; }
.cut-speech { position: absolute; top: 18px; bottom: 18px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 22%, transparent); pointer-events: none; }
.cut-dim { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--text) 6%, transparent); pointer-events: none; }
.cut-dim.l { left: 0; } .cut-dim.r { right: 0; }
.cut-sel { position: absolute; top: 0; bottom: 0; border: 2px solid var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); cursor: grab; box-sizing: border-box; }
.cut-sel:active { cursor: grabbing; }
.cut-h { position: absolute; top: 50%; width: 14px; height: 34px; margin-top: -17px; border-radius: 6px; background: var(--accent); cursor: ew-resize; box-shadow: 0 1px 3px rgba(16, 16, 24, .25); }
.cut-h::after { content: ""; position: absolute; left: 50%; top: 9px; bottom: 9px; width: 2px; margin-left: -1px; border-radius: 1px; background: rgba(255, 255, 255, .8); }
.cut-h[data-edge="a"] { left: -8px; } .cut-h[data-edge="b"] { right: -8px; }
.cut-ph { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); pointer-events: none; z-index: 2; }
.cut-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cut-legend .sw { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 1px; }
.cut-legend .sw.speech { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.cut-legend .sw.sel { border: 2px solid var(--accent); height: 6px; width: 10px; }
.cut-legend .meta { margin-left: auto; }
.cut-side { padding: 14px; }
.cut-fields { display: flex; flex-direction: column; gap: 10px; }
.cut-fields .field { font-size: 13px; font-weight: 700; color: var(--muted); }
.cut-fields input { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.cut-len { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.cut-len b { font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.cut-limit { margin: 2px 0 0; text-align: right; }
.cut-limit.bad { color: var(--bad); }
.cut-words { font-size: 14px; line-height: 1.6; max-height: 150px; overflow: auto; padding: 10px 12px; border-radius: 10px; background: var(--bg); color: var(--text); }
.cut-side .btn.wide svg { width: 16px; height: 16px; }
@media (max-width: 900px) {
  .cut-main { grid-template-columns: minmax(0, 1fr); }
  .cut-stage video { max-height: 46vh; }
  .cut-legend .meta { display: none; }
}

.cut-player .ed-transport .grow { min-width: 0; }
@media (pointer: coarse) {
  .cut-h { width: 22px; height: 42px; margin-top: -21px; }
  .cut-h[data-edge="a"] { left: -12px; } .cut-h[data-edge="b"] { right: -12px; }
  .cut-track { height: 64px; }
}
