[hidden] { display: none !important; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url(../fonts/BeVietnamPro-Regular.woff) format("woff"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url(../fonts/BeVietnamPro-SemiBold.woff) format("woff"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 800; font-display: swap; src: url(../fonts/BeVietnamPro-ExtraBold.woff) format("woff"); }

:root {
  --bg: #f6f4ef; --card: #ffffff; --ink: #1d232a; --muted: #5d6670; --line: #e2ded5;
  --acc: #0f6e66; --acc-ink: #ffffff; --acc-soft: #e2f1ee; --warn: #9a5b00; --warn-bg: #fff4dc;
  --del: #b42318; --dem: #8a4fd1; --noilai: #c2410c; --gap: #6b7280; --voiced: #a16207; --now: #fde68a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14181c; --card: #1d2228; --ink: #e8eaed; --muted: #a0a8b2; --line: #2f363e;
    --acc: #3fb8ab; --acc-ink: #06201d; --acc-soft: #183632; --warn: #f5b74e; --warn-bg: #3a2c10;
    --del: #f87171; --dem: #c4a1ff; --noilai: #fb923c; --gap: #9ca3af; --voiced: #facc15; --now: #5b4a12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14181c; --card: #1d2228; --ink: #e8eaed; --muted: #a0a8b2; --line: #2f363e;
  --acc: #3fb8ab; --acc-ink: #06201d; --acc-soft: #183632; --warn: #f5b74e; --warn-bg: #3a2c10;
  --del: #f87171; --dem: #c4a1ff; --noilai: #fb923c; --gap: #9ca3af; --voiced: #facc15; --now: #5b4a12;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.brand { display: flex; gap: 12px; align-items: center; }
.logo { width: 38px; height: 38px; border-radius: 10px; background: var(--acc); color: var(--acc-ink); display: grid; place-items: center; font-size: 16px; }
h1 { font-size: 19px; margin: 0; font-weight: 800; letter-spacing: -0.01em; }
.top p { margin: 0; color: var(--muted); font-size: 13px; }
.env { font-size: 12px; color: var(--muted); text-align: right; }
main { max-width: 1180px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.step.locked { opacity: .5; pointer-events: none; }
h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; font-weight: 800; }
.n { width: 26px; height: 26px; border-radius: 50%; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; font-size: 13px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; text-align: center; }
.drop span { color: var(--muted); font-size: 13px; }
.drop.over, .drop:focus-visible { border-color: var(--acc); background: var(--acc-soft); outline: none; }
.info { margin-top: 10px; padding: 10px 12px; background: var(--acc-soft); border-radius: 10px; font-size: 14px; }
.warn { margin: 10px 0 0; padding: 10px 12px 10px 30px; background: var(--warn-bg); color: var(--warn); border-radius: 10px; font-size: 13.5px; }
.row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin: 6px 0; }
label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; }
select { width: auto; max-width: 100%; text-overflow: ellipsis; }
.edit > * { min-width: 0; }
label.chk { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; }
select, input[type=text], input:not([type]), input[type=number] { font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; max-width: 100%; }
input[type=number] { width: 70px; padding: 4px 6px; }
button, .btn, .btnlike { font: inherit; font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 9px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btnlike { flex-direction: row; color: var(--ink); }
button:hover, .btnlike:hover { border-color: var(--acc); }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.linkish { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 4px 0; font-weight: 400; font-size: 13px; }
.note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.prog { margin-top: 10px; display: grid; gap: 4px; }
.bar { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .2s; }
.prog small { color: var(--muted); }
.edit { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 18px; }
@media (max-width: 760px) { .edit { grid-template-columns: 1fr; } }
.pv canvas { width: 100%; aspect-ratio: 9/16; background: #000; border-radius: 12px; display: block; }
.pvbar { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.pvbar input { flex: 1; min-width: 0; }
.pvbar span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg label { flex-direction: row; align-items: center; gap: 5px; padding: 7px 10px; color: var(--ink); font-size: 13px; cursor: pointer; }
.seg label:has(input:checked) { background: var(--acc-soft); color: var(--acc); font-weight: 600; }
.seg input { margin: 0; }
.opts { margin: 8px 0; font-size: 13px; }
.opts summary { cursor: pointer; color: var(--muted); }
.sum { font-weight: 600; margin: 8px 0 4px; }
.legend { font-size: 12px; color: var(--muted); margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.words { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--bg); }
.sen { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; padding: 6px 2px; border-bottom: 1px dashed var(--line); }
.sen:last-child { border-bottom: none; }
.sen .ctl { display: flex; flex-direction: column; gap: 4px; }
.sen .ctl button { padding: 2px 7px; font-size: 12px; font-weight: 600; }
.sen p { margin: 0; line-height: 1.95; font-size: 16px; }
.w { cursor: pointer; border-radius: 4px; padding: 1px 2px; }
.w:hover { background: var(--acc-soft); }
.w.del { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--del); opacity: .75; }
.w.why-dem { color: var(--dem); }
.w.why-noilai { color: var(--noilai); }
.w.fixed { border-bottom: 2px dotted var(--acc); }
.w.now { background: var(--now); }
.g { cursor: pointer; font-size: 12px; color: var(--gap); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin: 0 2px; white-space: nowrap; }
.g.del { text-decoration: line-through; }
.g.voiced { color: var(--voiced); border-color: var(--voiced); }
.w input { font: inherit; width: 8em; padding: 0 4px; }
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.preset { border: 2px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; display: flex; gap: 10px; align-items: center; background: var(--bg); text-align: left; }
.preset[aria-pressed="true"] { border-color: var(--acc); background: var(--acc-soft); }
.preset canvas { width: 54px; height: 96px; border-radius: 6px; background: #222; flex: none; }
.preset b { display: block; font-size: 14px; }
.preset small { color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 16px; margin-bottom: 8px; }
.dl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 16px 30px; }
.foot a { color: inherit; }
@media (max-width: 520px) { main { padding: 10px; } .step { padding: 14px 12px; } .top { padding: 12px 16px; } }
.prog small, .info, .note, .warn, .env { overflow-wrap: anywhere; }
