/* Be Vietnam Pro (SIL OFL 1.1), tự lưu trong dự án, không tải từ mạng ngoài */
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/be-vietnam-pro-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/be-vietnam-pro-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/be-vietnam-pro-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/be-vietnam-pro-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/be-vietnam-pro-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/be-vietnam-pro-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/be-vietnam-pro-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/be-vietnam-pro-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/be-vietnam-pro-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/be-vietnam-pro-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/be-vietnam-pro-vietnamese-400-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/be-vietnam-pro-vietnamese-500-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/be-vietnam-pro-vietnamese-600-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/be-vietnam-pro-vietnamese-700-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/be-vietnam-pro-vietnamese-800-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
:root {
  --bg: #f1faf8; --surface: #ffffff; --surface-2: #f6fbfa; --ink: #0f2f3a; --ink-2: #2d4d59; --muted: #587583; --line: #d9ebec; --line-2: #c3dcdf;
  --brand: #087a88; --brand-ink: #ffffff; --brand-soft: #e1f5f4; --brand-line: #b3e0de; --brand-2: #0ea5b3;
  --accent: #ff7a59; --accent-soft: #fff0ea; --sun: #ffc857; --lav: #7c6cf0; --lav-soft: #efedff; --peach-soft: #fff1e9; --mint-soft: #e1f7f1;
  --red: #b42318; --red-soft: #fef3f2; --amber: #8a5300; --amber-soft: #fff6dc; --blue: #2457d6; --blue-soft: #eaf1ff; --green: #067647; --green-soft: #e6f8ee;
  --c-blue: #2563eb; --c-purple: #7c3aed; --c-teal: #0d9488; --c-orange: #d97706; --c-gray: #64748b;
  --radius: 16px; --shadow-sm: 0 1px 2px rgba(15, 70, 80, .06); --shadow: 0 2px 4px rgba(15, 70, 80, .04), 0 14px 32px -12px rgba(15, 90, 100, .18);
  --font: "Be Vietnam Pro", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #08171c; --surface: #0f262d; --surface-2: #123038; --ink: #eaf6f7; --ink-2: #c3dadd; --muted: #8fb0b8; --line: #1d3d46; --line-2: #2a4f5a;
    --brand: #4fd1d9; --brand-ink: #06242a; --brand-soft: #0f343b; --brand-line: #1f5a63; --brand-2: #7fe3e9;
    --accent: #ff9a7e; --accent-soft: #3a211b; --sun: #ffd37a; --lav: #a99cff; --lav-soft: #231f45; --peach-soft: #33231c; --mint-soft: #0f3a34;
    --red: #fda29b; --red-soft: #2d1715; --amber: #fec84b; --amber-soft: #2b2110; --blue: #8fb0ff; --blue-soft: #14233f; --green: #6ce9a6; --green-soft: #10261c; --shadow: none; --shadow-sm: none;
    --c-blue: #7aa2ff; --c-purple: #b79cff; --c-teal: #5eead4; --c-orange: #fbbf5c; --c-gray: #94a3b8; }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; scroll-padding-bottom: 24px; }
[id], .sec, details { scroll-margin-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.6 var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
a, .link { color: var(--brand); }
.link { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .4rem; letter-spacing: -.02em; font-weight: 650; }
h2 { font-size: 1.05rem; margin: 0 0 .5rem; font-weight: 650; } h3 { font-size: .98rem; margin: 0 0 .4rem; font-weight: 650; }
.lede { color: var(--muted); margin: 0 0 1.25rem; max-width: 62ch; font-size: 1rem; }
.hint, .note { color: var(--muted); font-size: .84rem; margin: .5rem 0 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }

/* Thanh đầu trang */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--brand); text-decoration: none; }
.brand strong { color: var(--ink); font-size: 1rem; font-weight: 650; letter-spacing: -.01em; }
.ver { font-size: .7rem; border: 1px solid var(--line-2); color: var(--muted); border-radius: 99px; padding: 0 7px; font-weight: 600; line-height: 1.5; }
.links { display: flex; gap: 2px; }
.links .link { text-decoration: none; color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 500; font-size: .92rem; }
.links .link:hover { background: var(--bg); color: var(--ink); }
main { padding-top: 36px; padding-bottom: 56px; min-height: 66vh; }

/* Trang chủ */
.hero { max-width: 780px; margin: 7vh auto 0; text-align: center; position: relative; }
.hero::before { content: ""; position: absolute; inset: -120px -200px auto; height: 360px; background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--brand) 11%, transparent), transparent 70%); pointer-events: none; z-index: -1; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3rem); letter-spacing: -.035em; font-weight: 700; margin-bottom: .6rem; }
.ver-lg { font-size: .4em; vertical-align: .9em; border: 1px solid var(--line-2); color: var(--muted); border-radius: 99px; padding: 1px 10px; font-weight: 600; letter-spacing: 0; margin-left: 4px; background: var(--surface); }
.tagline { font-size: clamp(1.1rem, 2.4vw, 1.3rem); color: var(--ink-2); margin: 0 0 .5rem; font-weight: 450; }
.legal { color: var(--muted); font-size: .88rem; margin: 0; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; text-align: left; }
@media (max-width: 680px) { .choices { grid-template-columns: 1fr; } }
.choice { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; cursor: pointer; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; text-align: left; }
.choice:hover { border-color: var(--brand-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.choice .ic { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.choice .tx { flex: 1; display: grid; gap: 2px; } .choice b { font-weight: 650; font-size: 1.02rem; } .choice .tx span { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.choice .go { color: var(--muted); transition: transform .15s, color .15s; } .choice:hover .go { color: var(--brand); transform: translateX(3px); }
.privacy { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .84rem; margin: 28px 0 0; }

/* Các bước */
.steps { list-style: none; display: flex; align-items: center; gap: 0; padding: 0; margin: 0 0 34px; flex-wrap: wrap; row-gap: 8px; }
.steps li { display: flex; align-items: center; }
.steps li + li::before { content: ""; width: 32px; height: 1px; background: var(--line-2); margin: 0 10px; }
.steps .st, .steps button { display: flex; align-items: center; gap: 8px; font: inherit; font-size: .88rem; color: var(--muted); background: none; border: 0; padding: 2px; border-radius: 8px; }
.steps button { cursor: pointer; } .steps button:hover { color: var(--ink); }
.steps i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-size: .76rem; font-weight: 650; }
.steps .on .st { color: var(--ink); font-weight: 600; } .steps .on i { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.steps .done i { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); } .steps .done button { color: var(--ink-2); }
.head { margin-bottom: 18px; }

/* Bộ chọn loại văn bản */
.pickbar { display: grid; gap: 14px; margin-bottom: 8px; }
.searchbox { display: flex; align-items: center; gap: 10px; max-width: 520px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 14px; color: var(--muted); box-shadow: var(--shadow-sm); }
.searchbox:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.searchbox input { flex: 1; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 10px 0; outline: none; min-width: 0; }
.searchbox input:focus { outline: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { font: inherit; font-size: .86rem; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 4px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.chips button:hover { border-color: var(--gc, var(--brand)); }
.chips button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chips button small { opacity: .6; font-size: .78rem; }
.chips .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gc, var(--brand)); }
.chips button.on .dot { box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg) 40%, transparent); }
.chips.small { margin: 0 0 14px; } .chips.small button { font-size: .82rem; padding: 2px 10px; }
.stdsw { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; justify-self: start; max-width: 100%; }
.stdsw button { font: inherit; border: 0; background: transparent; color: var(--ink-2); border-radius: 9px; padding: 7px 16px; cursor: pointer; display: grid; gap: 0; text-align: left; }
.stdsw button b { font-weight: 650; font-size: .92rem; } .stdsw button small { font-size: .74rem; opacity: .7; }
.stdsw button.on { background: var(--ink); color: var(--bg); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font: inherit; font-size: .95rem; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 99px; padding: 9px 18px; cursor: pointer; display: inline-flex; align-items: center; gap: 9px; box-shadow: var(--shadow-sm); }
.pill:hover { border-color: var(--gc, var(--brand)); transform: translateY(-1px); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gc, var(--brand)); }
.link.showall { margin-top: 16px; display: inline-block; font-size: .92rem; }
.tag { font-style: normal; font-size: .68rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 0 7px; margin-left: 4px; vertical-align: middle; }
.chips { margin: 4px 0 14px; }
.g-red { --gc: var(--c-red, #c2413a); } .g-blue { --gc: var(--c-blue); } .g-purple { --gc: var(--c-purple); } .g-teal { --gc: var(--c-teal); } .g-orange { --gc: var(--c-orange); } .g-gray { --gc: var(--c-gray); }
.count { color: var(--muted); font-size: .84rem; margin: 14px 0 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.card { text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; align-items: flex-start; gap: 12px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: var(--gc, var(--brand)); box-shadow: var(--shadow); transform: translateY(-1px); }
.badge-t { flex: none; min-width: 40px; height: 40px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: .76rem; font-weight: 700; letter-spacing: .01em; color: var(--gc, var(--brand)); background: color-mix(in srgb, var(--gc, var(--brand)) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gc, var(--brand)) 22%, transparent); }
.card .tx { display: grid; gap: 2px; min-width: 0; } .card b { font-weight: 650; font-size: .96rem; }
.card .d { color: var(--muted); font-size: .82rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.profile-line { margin: 0 0 16px; }

/* Tải lên */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 250px; padding: 28px; border: 1.5px dashed var(--line-2); border-radius: 16px; background: var(--surface); cursor: pointer; color: var(--muted); max-width: 720px; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over, .drop:focus-visible { border-color: var(--brand); background: var(--brand-soft); outline: none; }
.drop svg { color: var(--brand); margin-bottom: 4px; } .drop strong { color: var(--ink); word-break: break-all; font-weight: 600; }
.alt { margin: 14px 0; }
.lbl { display: block; font-weight: 600; margin-bottom: 6px; }
textarea, input[type=text], select { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); transition: border-color .12s, box-shadow .12s; }
textarea { resize: vertical; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
#paste { max-width: 720px; }
.btn { font: inherit; font-weight: 600; font-size: .92rem; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 8px 16px; cursor: pointer; display: inline-block; box-shadow: var(--shadow-sm); }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); } .btn.primary:hover:not(:disabled) { filter: brightness(1.1); border-color: var(--brand); }
.btn.ghost { background: transparent; box-shadow: none; } .btn.small { padding: 5px 11px; font-size: .84rem; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.actions.bar { position: sticky; bottom: 0; justify-content: space-between; background: linear-gradient(transparent, var(--bg) 40%); padding: 26px 0 14px; max-width: 860px; }
.alert { padding: 10px 14px; border-radius: 10px; margin: 12px 0; font-size: .94rem; } .alert.err { background: var(--red-soft); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); } .alert.warn { background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent); }
.busy { margin-top: 16px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--brand); border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.5s; } .card, .choice, .go { transition: none; }  }

/* Ý kiến chuyên gia */
#rv, .ref { max-width: 860px; }
.sum { display: flex; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.ring { --p: 50; flex: none; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.ring::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); } .ring b { position: relative; z-index: 1; font-size: 1.3rem; font-weight: 700; }
.sum .v { margin: 0 0 8px; font-weight: 600; }
.counts { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { border-radius: 99px; padding: 1px 10px; font-size: .8rem; font-weight: 600; }
.pill.loi { background: var(--red-soft); color: var(--red); } .pill.canh-bao { background: var(--amber-soft); color: var(--amber); } .pill.goi-y { background: var(--blue-soft); color: var(--blue); }
.info { background: var(--brand-soft); color: var(--ink-2); border: 1px solid var(--brand-line); border-radius: 10px; padding: 9px 14px; margin: 0 0 10px; font-size: .92rem; }
.sec { margin: 22px 0 8px; font-size: .98rem; } .sec small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.bulk { margin: 0 0 8px; color: var(--muted); font-size: .88rem; }
.f { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.f > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 11px 14px; }
.f > summary::-webkit-details-marker { display: none; }
.f > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); margin: 0 4px 3px 2px; order: 3; transition: transform .15s; }
.f[open] > summary::after { transform: rotate(225deg); margin-bottom: -2px; }
.ft { flex: 1; font-weight: 600; font-size: .94rem; }
.tag { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 6px; padding: 2px 7px; flex: none; }
.tag.loi { background: var(--red-soft); color: var(--red); } .tag.canh-bao { background: var(--amber-soft); color: var(--amber); } .tag.goi-y { background: var(--blue-soft); color: var(--blue); }
.fixrow { display: flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; white-space: nowrap; order: 2; color: var(--ink-2); }
.fixrow input { width: 16px; height: 16px; accent-color: var(--brand); }
.fb { padding: 0 14px 14px; } .fb p { margin: 0 0 6px; color: var(--ink-2); } .basis { color: var(--muted) !important; font-size: .82rem; }
.ex { margin: 8px 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .9rem; }
.ex li { background: var(--bg); border-radius: 6px; padding: 5px 10px; word-break: break-word; }
.ex .pre, .ex .post { color: var(--muted); } .ex mark { background: var(--red-soft); color: var(--red); border-radius: 3px; padding: 0 2px; text-decoration: line-through; }
.ex ins { background: var(--green-soft); color: var(--green); border-radius: 3px; padding: 0 2px; text-decoration: none; font-weight: 600; } .ex .arrow { color: var(--muted); padding: 0 4px; }
details.sub { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; margin: 10px 0; }
details.sub > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: .92rem; }
details.sub[open] > summary { margin-bottom: 8px; }
details.sub ul { margin: 0; padding-left: 18px; } details.sub li { margin-bottom: 6px; } details.sub li span { color: var(--muted); font-size: .88rem; }
.cols2 { columns: 2; } @media (max-width: 640px) { .cols2 { columns: 1; } }

/* Trình soạn */
.edbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; } .sp { flex: 1; }
.donebar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--green-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: .94rem; }
.ed { display: grid; grid-template-columns: minmax(330px, 430px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 960px) { .ed { grid-template-columns: 1fr; } }
.acc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 16px; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); margin: 0 3px 3px auto; transition: transform .15s; }
.acc[open] > summary::after { transform: rotate(225deg); margin-bottom: -2px; }
.acc[open] > summary { border-bottom: 1px solid var(--line); }
.badge { font-size: .74rem; font-weight: 600; background: var(--amber-soft); color: var(--amber); border-radius: 99px; padding: 1px 9px; } .badge.ok { background: var(--green-soft); color: var(--green); }
.in { padding: 14px 16px 16px; display: grid; gap: 12px; }
.fl { display: grid; gap: 4px; font-size: .86rem; } .fl > span { font-weight: 600; color: var(--ink-2); } .fl small { color: var(--muted); font-size: .78rem; }
.fl.miss input, .fl.miss textarea { border-color: color-mix(in srgb, var(--amber) 55%, transparent); background: var(--amber-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more { border-top: 1px dashed var(--line-2); padding-top: 10px; } .more > summary { cursor: pointer; color: var(--muted); font-size: .86rem; margin-bottom: 8px; }
.more > div, .more > label { margin-top: 8px; }
.sigbox { border-top: 1px dashed var(--line-2); padding-top: 12px; display: grid; gap: 12px; }
.stage { position: static; }
@media (min-width: 961px) {
  /* Khung xem trước dính khi cuộn nhưng không cao hơn màn hình: phần dài hơn cuộn ngay trong khung, nên luôn xem trọn vẹn từ đầu đến cuối văn bản. */
  .stage { position: sticky; top: 76px; max-height: calc(100vh - 92px); max-height: calc(100dvh - 92px); overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; scrollbar-width: thin; overscroll-behavior-y: auto; }
  .stage:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 10px; }
}
.paperwrap { background: #e9ecf1; border: 1px solid var(--line); border-radius: 14px; padding: 16px; overflow: hidden; }
@media (prefers-color-scheme: dark) { .paperwrap { background: #0a0e14; } }
.paper { width: 793.7px; min-height: 1122px; background: #fff; color: #000; padding: 75.6px 56.7px 75.6px 113.4px; font-family: "Times New Roman", "Liberation Serif", Times, serif; transform-origin: top left; box-shadow: 0 1px 3px rgba(15, 23, 42, .15), 0 12px 32px -12px rgba(15, 23, 42, .25); }
.paper p { margin: 0; } .paper table.cols { border-collapse: collapse; } .paper table.cols td { vertical-align: top; padding: 0 2px; }
.paper table.data { border-collapse: collapse; width: 100%; table-layout: fixed; margin: 4pt 0; font-size: 13pt; } .paper table.data td, .paper table.data th { border: 1px solid #000; padding: 2pt 5pt; }
.paper .pg-footer { margin-top: 40px; border-top: 1px solid #000; font-size: 11pt; padding-top: 2pt; }
#quick { margin-top: 16px; }

/* Hộp thoại, thông báo */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 26px; width: min(600px, 94vw); max-height: 88vh; background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px -12px rgba(15, 23, 42, .4); }
dialog::backdrop { background: rgba(15, 23, 42, .5); }
.dlg-close { position: absolute; top: 12px; right: 12px; margin: 0; } .dlg-close button { border: 0; background: transparent; font-size: 1rem; cursor: pointer; color: var(--muted); padding: 6px 10px; border-radius: 8px; } .dlg-close button:hover { background: var(--bg); }
.meta { display: grid; grid-template-columns: 110px 1fr; gap: 10px 16px; margin: 16px 0; font-size: .92rem; } .meta dt { color: var(--muted); font-weight: 600; } .meta dd { margin: 0; }
.row-actions { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 14px 0; }
.saved { color: var(--green); font-weight: 600; min-height: 1.4em; margin: 8px 0 0; font-size: .9rem; } .saved.bad { color: var(--red); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 60; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); max-width: 90vw; font-size: .92rem; }
.ref .scroll { overflow-x: auto; } .ref table { border-collapse: collapse; width: 100%; font-size: .9rem; } .ref th, .ref td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; vertical-align: top; } .ref th { background: var(--bg); color: var(--ink-2); }
.foot { color: var(--muted); font-size: .82rem; padding-bottom: 36px; border-top: 1px solid var(--line); padding-top: 22px; } .foot p { margin: 3px 0; } .contact { margin: 3px 0; }

/* Chia sẻ: nút nhỏ tách riêng ở góc dưới, không nổi bật */
.share { position: fixed; right: 20px; bottom: 20px; z-index: 40; }
.share-fab { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); opacity: .85; transition: opacity .15s, color .15s, border-color .15s; }
.share-fab:hover, .share-fab[aria-expanded="true"] { opacity: 1; color: var(--brand); border-color: var(--brand-line); }
.popover { position: absolute; right: 0; bottom: calc(100% + 10px); width: 288px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 0 16px 40px -8px rgba(15, 23, 42, .3); }
.popover[hidden] { display: none; }
.pop-title { margin: 0 0 10px; font-weight: 650; font-size: .92rem; }
.share-grid { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.share-grid a, .share-grid button { display: grid; justify-items: center; gap: 4px; font: inherit; font-size: .7rem; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 6px 0; border-radius: 8px; width: 100%; }
.share-grid a:hover, .share-grid button:hover { color: var(--ink); background: var(--bg); }
.share-grid i { font-style: normal; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .9rem; }
.share-url { margin: 8px 0 0; font-size: .78rem; color: var(--muted); word-break: break-all; }
@media (max-width: 480px) { .share { right: 12px; bottom: 12px; } .popover { width: min(288px, calc(100vw - 24px)); } }

/* Tô gợi ý (chỉ trong bản xem trước; không đi vào file .docx) */
.stagebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.legend { color: var(--muted); font-size: .8rem; display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; background: #fff0a8; box-shadow: 0 0 0 1px rgba(200, 160, 0, .45); display: inline-block; }
.tgl { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--ink-2); cursor: pointer; font-weight: 600; }
.tgl small { color: var(--muted); font-weight: 500; }
.tgl input { accent-color: var(--brand); }
mark.hl { background: #fff0a8; color: inherit; border-radius: 2px; cursor: pointer; padding: 0; box-shadow: 0 0 0 1px rgba(200, 160, 0, .28); }
mark.hl:hover, mark.hl:focus-visible { background: #ffe066; outline: none; box-shadow: 0 0 0 2px rgba(200, 150, 0, .55); }
mark.hl-spell, mark.hl-word { border-bottom: 1.5px dotted #b88700; }
.paper.hl-off mark.hl { background: transparent; box-shadow: none; border-bottom: 0; cursor: text; }
.hl-pop { position: fixed; z-index: 70; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 16px 40px -8px rgba(15, 23, 42, .35); font: 14px/1.5 var(--font); display: grid; gap: 8px; }
.hl-pop p { margin: 0; color: var(--ink-2); }
.hp-h { display: flex; justify-content: space-between; align-items: center; } .hp-h b { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--amber); background: var(--amber-soft); border-radius: 6px; padding: 1px 8px; }
.hp-h .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.hl-pop .sug { display: flex; gap: 6px; flex-wrap: wrap; }

/* Xác nhận loại văn bản, nhiều người ký, chế độ gọn */
.gate { max-width: 640px; margin: 4vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.gate.warn { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.gate-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); font-weight: 800; font-size: 1.3rem; margin-bottom: 12px; }
.gate h1 { font-size: 1.35rem; } .gate p { color: var(--ink-2); margin: .5rem 0; }
.ev { margin: 0 0 8px; padding-left: 20px; color: var(--ink-2); } .ev li { margin: 2px 0; }
.allset { background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; font-size: .94rem; color: var(--ink); }
.sig-h { display: flex; justify-content: space-between; align-items: center; } .sig-h h3 { margin: 0; }
.sig-add { display: grid; gap: 4px; } .sig-add small { color: var(--muted); font-size: .8rem; }

.paper table.data th { text-align: center; font-weight: 700; } .paper table.data td { vertical-align: middle; } .paper table.data td.c { text-align: center; }
mark.hl-blank { background: #dff0ff; box-shadow: 0 0 0 1px rgba(40, 110, 190, .35); } mark.hl-blank:hover, mark.hl-blank:focus-visible { background: #bfe0ff; box-shadow: 0 0 0 2px rgba(40, 110, 190, .6); }

/* Thống kê lượt truy cập (góc dưới phải, bên trái nút chia sẻ) */
.visits { position: fixed; right: 68px; bottom: 27px; z-index: 40; }
.visit-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-2, #d6dbe6); background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer; opacity: .85; box-shadow: var(--shadow-sm); }
.visit-chip:hover, .visit-chip[aria-expanded="true"] { opacity: 1; color: var(--brand); }
.visit-pop { position: absolute; right: 0; bottom: calc(100% + 8px); width: 224px; max-width: calc(100vw - 24px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; box-shadow: 0 10px 28px -8px rgba(15, 23, 42, .35); font-size: 12px; line-height: 1.4; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.vis-top { margin: 0 0 6px; color: var(--muted); } .vis-top b { color: var(--ink); font-size: 13px; }
.vis-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; height: 38px; align-items: end; margin-bottom: 6px; }
.vis-bars > div { display: grid; grid-template-rows: 1fr auto; height: 100%; align-items: end; justify-items: center; }
.vis-bars i { display: block; width: 70%; background: var(--brand); border-radius: 2px 2px 0 0; opacity: .85; }
.vis-bars span { font-size: 9px; color: var(--muted); margin-top: 1px; line-height: 1; }
.vis-cn { margin: 0 0 4px; color: var(--ink-2, var(--ink)); } .vis-cn b { font-weight: 650; } .vis-cn span { white-space: nowrap; }
.vis-note { margin: 0; font-size: 10.5px; color: var(--muted); }
@media print { .visits { display: none !important; } }

/* ===== Tương thích điện thoại, máy tính bảng, laptop và màn hình lớn ===== */
html { -webkit-tap-highlight-color: transparent; }
main { overflow-x: clip; }
.hero::before { inset: -120px 0 auto; }
.ed > *, .stage, .paperwrap { min-width: 0; }
.brand strong, .links .link { white-space: nowrap; }
.links .short { display: none; }
.wrap { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
img, svg, video { max-width: 100%; }

/* Máy tính bảng và cửa sổ hẹp */
@media (max-width: 960px) {
  .wrap { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
  .ed { gap: 18px; }
  .actions.bar { max-width: none; }
}

/* Điện thoại */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .bar { height: 54px; gap: 6px; }
  .brand { gap: 8px; } .brand svg { width: 24px; height: 24px; } .brand strong { font-size: .94rem; }
  .links { gap: 0; } .links .link { padding: 8px 9px; font-size: .86rem; }
  .links .long { display: none; } .links .short { display: inline; }
  main { padding-top: 20px; padding-bottom: 96px; }
  .hero { margin-top: 2vh; } .choices { margin-top: 26px; } .choice { padding: 16px; gap: 14px; }
  h1 { font-size: 1.4rem; } .lede { font-size: .95rem; margin-bottom: 1rem; }
  .pickbar { gap: 10px; } .chips { gap: 6px; } .cards { grid-template-columns: 1fr; }
  .drop { min-height: 190px; padding: 20px; }
  .sum { padding: 14px; gap: 14px; } .ring { width: 60px; height: 60px; } .ring b { font-size: 1.1rem; }
  .f > summary { flex-wrap: wrap; padding: 10px 12px; } .ft { flex: 1 1 calc(100% - 96px); min-width: 0; }
  .fixrow { order: 5; flex: 1 1 100%; }
  .fb { padding: 0 12px 12px; }
  .edbar { gap: 6px; } .edbar .sp { display: none; } .edbar .btn { flex: 1 1 auto; text-align: center; }
  .actions.bar { padding-bottom: calc(14px + env(safe-area-inset-bottom)); } .actions.bar .btn { flex: 1 1 auto; text-align: center; }
  .acc > summary { padding: 12px 14px; } .in { padding: 12px 14px 14px; }
  .row2 { grid-template-columns: 1fr; } .row3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .paperwrap { padding: 8px; border-radius: 10px; }
  dialog { padding: 20px 16px; width: 94vw; max-height: 90vh; }
  .meta { grid-template-columns: 1fr; gap: 2px 0; } .meta dt { margin-top: 8px; }
  .visits { right: 58px; bottom: 18px; }
  .foot { padding-bottom: 80px; }
  input, select, textarea { font-size: 16px; } /* tránh iPhone tự phóng to khi nhập */
}

/* Màn hình cảm ứng: vùng bấm đủ lớn */
@media (pointer: coarse) {
  .btn { min-height: 42px; } .btn.small { min-height: 36px; }
  .chips button { padding: 7px 13px; } .links .link { min-height: 40px; }
  .steps button { min-height: 36px; } .f > summary, .acc > summary { min-height: 46px; }
  .share-fab { width: 42px; height: 42px; } .visit-chip { min-height: 34px; }
}

/* Điện thoại nằm ngang, màn hình thấp */
@media (max-height: 500px) and (orientation: landscape) {
  .topbar { position: static; } .stage { top: 8px; } main { padding-top: 16px; }
}

/* Màn hình lớn */
@media (min-width: 1500px) {
  body { font-size: 16px; }
  .wrap { max-width: 1280px; }
  .ed { grid-template-columns: minmax(380px, 470px) 1fr; gap: 32px; }
}
@media (min-width: 1900px) { .wrap { max-width: 1400px; } }

/* Các bước: chỉ hiện tên bước đang làm, các bước khác là số (điện thoại và máy tính bảng dọc) */
@media (max-width: 860px) {
  .steps { flex-wrap: nowrap; margin-bottom: 22px; }
  .steps li + li::before { width: 18px; margin: 0 6px; }
  .steps li:not(.on) .lb { display: none; }
  .steps li.on { flex: 1 1 auto; min-width: 0; } .steps .on .lb { white-space: normal; line-height: 1.25; }
}
/* Máy tính bảng dọc: biểu mẫu chia hai cột cho gọn */
@media (min-width: 641px) and (max-width: 960px) {
  .ed .in { grid-template-columns: 1fr 1fr; align-items: start; }
  .ed .in > :not(.fl), .ed .in > .fl:has(textarea) { grid-column: 1 / -1; }
}

/* ---- Luận văn, luận án, bài báo khoa học ---- */
.choice.wide { grid-column: 1 / -1; }
.acad-card .d { -webkit-line-clamp: 3; }
.bdgs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.bdg { font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface); }
.bdg.sc { background: #fdf0d8; border-color: #ecc77b; color: #7a4d00; }
.bdg.gs { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.bdg.v-ok { background: var(--green-soft, #e3f4ea); border-color: #9bd2b0; color: var(--green, #1f7a45); }
.bdg.v-mid { background: #fff6dc; border-color: #ecd68a; color: #7a5b00; }
.bdg.v-low { background: var(--bg); color: var(--muted); }
@media (prefers-color-scheme: dark) { .bdg.sc { background: #3a2c10; border-color: #6d5420; color: #f1cd7e; } .bdg.v-mid { background: #34300f; border-color: #6a5f20; color: #e8d479; } }
.acwrap { display: flex; justify-content: center; padding: 12px; overflow-x: auto; }
.acp { overflow: hidden; text-align: left; }
.acp p { word-wrap: break-word; }
.acp .ac-img { color: #888; border: 1px dashed #bbb; padding: 14px; font-size: 10pt; }
.acp .ac-more { color: #888; text-align: center; font-style: italic; }
.acp table.ac-tbl { border-collapse: collapse; width: 100%; margin: 6pt 0; }
.acp table.ac-tbl td { padding: 2pt 4pt; vertical-align: top; }
.acp table.ac-tbl.h { border-top: 1px solid #000; border-bottom: 1px solid #000; }
.wh { color: var(--muted); }
table.rules { border-collapse: collapse; width: 100%; margin-top: 10px; font-size: .92rem; } table.rules th { text-align: left; width: 34%; color: var(--muted); font-weight: 600; } table.rules th, table.rules td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.tune { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; } .tune label { display: grid; gap: 3px; font-size: .86rem; color: var(--muted); } .tune input, .tune select { font: inherit; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); } .tune .actions { grid-column: 1 / -1; }

/* ---- Chọn chuẩn: tab, bộ lọc, danh sách gọn, chi tiết mở khi cần ---- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2, var(--bg)); border: 1px solid var(--line); border-radius: 12px; margin: 4px 0 14px; max-width: 100%; }
.seg button { font: inherit; font-weight: 600; font-size: .92rem; border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 9px; cursor: pointer; min-height: 40px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); } .seg button small { opacity: .6; margin-left: 4px; }
.recent { display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; text-align: left; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--ink); padding: 10px 14px; border-radius: 12px; cursor: pointer; margin-bottom: 12px; }
.recent span { color: var(--brand); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; } .recent b { flex: 1; font-weight: 600; } .recent:hover { filter: brightness(.97); }
.pfilter { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pfilter input[type=search] { flex: 1 1 260px; font: inherit; font-size: 16px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); min-height: 44px; }
.pfilter input[type=search]:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--ink-2); cursor: pointer; min-height: 40px; }
.plist { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.prow-li + .prow-li { border-top: 1px solid var(--line); } .prow-li.open { background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); }
.prow { display: flex; align-items: center; gap: 12px; width: 100%; font: inherit; color: inherit; text-align: left; background: transparent; border: 0; padding: 12px 16px; cursor: pointer; min-height: 56px; }
.prow:hover { background: var(--brand-soft); } .prow:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.pn { flex: 1; min-width: 0; display: grid; gap: 1px; } .pn b { font-weight: 600; font-size: .96rem; } .pn small { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; } .chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; flex: none; margin: 0 4px 3px 2px; }
.prow-li.open .chev { transform: rotate(-135deg); margin-top: 6px; }
.pdetail { padding: 0 16px 16px; display: grid; gap: 10px; } .pdetail .ps { margin: 0; color: var(--ink-2); font-size: .92rem; max-width: 70ch; }
.spec { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 18px; margin: 0; } .spec div { display: grid; gap: 1px; } .spec dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); } .spec dd { margin: 0; font-size: .9rem; }
.pv { margin: 0; font-size: .85rem; color: var(--muted); } .pdetail .actions { margin-top: 4px; }
.plist .empty { padding: 22px 16px; color: var(--muted); text-align: center; }
.more { margin-top: 10px; }
@media (max-width: 640px) { .pb { display: none; } .pn small { white-space: normal; } .seg { display: flex; } .seg button { flex: 1; padding: 8px 6px; } .pdetail .actions .btn { flex: 1 1 100%; } }

/* ---- Cấu trúc luận văn nhận diện ---- */
.struct { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 0 0 16px; padding: 0 14px; }
.struct > summary { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; cursor: pointer; padding: 12px 0; list-style: none; } .struct > summary::-webkit-details-marker { display: none; }
.struct > summary::before { content: '▸'; color: var(--muted); } .struct[open] > summary::before { content: '▾'; } .struct .sm { color: var(--muted); font-size: .86rem; }
.sg-h { margin: 10px 0 4px; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.sgs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sgs li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 99px; border: 1px solid var(--line-2); font-size: .84rem; background: var(--bg); }
.sgs li i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .72rem; font-weight: 700; background: var(--line-2); color: var(--ink-2); }
.sgs li small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.1; }
.sgs .seg-found { border-color: #9bd2b0; } .sgs .seg-found i { background: var(--green, #1f7a45); color: #fff; }
.sgs .seg-missing { border-color: #e4b14a; background: #fff6dc; } .sgs .seg-missing i { background: #d99a1b; color: #fff; }
.sgs .seg-optional { color: var(--muted); }
@media (prefers-color-scheme: dark) { .sgs .seg-missing { background: #34300f; border-color: #6a5f20; } }
.mainpick { display: grid; gap: 4px; margin: 12px 0 4px; font-size: .86rem; color: var(--muted); } .mainpick select { font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); max-width: 100%; }
.struct .hint { margin: 4px 0 12px; }


/* ================= Giao diện tươi sáng v2 ================= */
body { background: var(--bg); background-image: radial-gradient(60vw 50vh at 8% -6%, color-mix(in srgb, #7fe3d0 26%, transparent), transparent 70%), radial-gradient(50vw 46vh at 100% 4%, color-mix(in srgb, #ffc7a8 24%, transparent), transparent 70%), radial-gradient(50vw 50vh at 50% 108%, color-mix(in srgb, #b9c8ff 22%, transparent), transparent 70%);  font-size: 15.5px; }
h1, h2, h3 { letter-spacing: -.015em; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { color: var(--brand); } .brand svg rect { fill: url(#brandgrad); }
.brand strong { font-weight: 700; } .ver { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.links .link:hover { background: var(--brand-soft); color: var(--brand); }
main { padding-top: 28px; }

/* Trang chủ */
.hero2 { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 28px; align-items: center; max-width: 1080px; margin: 2vh auto 0; }
.hero-copy { text-align: left; }
.kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 5px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .82rem; font-weight: 600; box-shadow: var(--shadow-sm); }
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px color-mix(in srgb, #22c55e 22%, transparent); }
.hero2 h1 { font-size: clamp(2.2rem, 5.2vw, 3.4rem); line-height: 1.08; font-weight: 800; letter-spacing: -.035em; margin: 0 0 .5rem; }
.grad { padding: 0 .08em; margin: 0 -.04em; background: linear-gradient(100deg, var(--brand) 0%, var(--lav) 70%, var(--accent) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero2 .tagline { text-align: left; font-size: clamp(1.05rem, 2.3vw, 1.25rem); font-weight: 500; }
.hero2 .legal { text-align: left; }
.hero2 .choices { grid-template-columns: 1fr; gap: 12px; margin-top: 26px; }
.hero2 .privacy { margin-top: 20px; }
.choice { border-radius: 18px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.choice::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--ck, var(--brand)); opacity: .9; }
.choice:hover { border-color: var(--ck, var(--brand)); box-shadow: var(--shadow); transform: translateY(-2px); }
.choice .ic { width: 50px; height: 50px; border-radius: 16px; background: var(--cs, var(--brand-soft)); color: var(--ck, var(--brand)); }
.choice:hover .go { color: var(--ck, var(--brand)); }
.c-mint { --ck: #0b9a8c; --cs: var(--mint-soft); } .c-peach { --ck: #f0643f; --cs: var(--peach-soft); } .c-lav { --ck: var(--lav); --cs: var(--lav-soft); }
.hero2 .choice.wide { grid-column: auto; }

/* Sân khấu nhân vật */
.hero-stage { position: relative; display: grid; justify-items: center; align-content: end; min-height: 580px; border-radius: 32px; background: radial-gradient(70% 55% at 50% 38%, color-mix(in srgb, #ffffff 80%, transparent), transparent 70%), linear-gradient(160deg, color-mix(in srgb, #9de8dc 55%, var(--surface)), color-mix(in srgb, #ffd9c5 55%, var(--surface)) 60%, color-mix(in srgb, #cfd6ff 55%, var(--surface))); border: 1px solid color-mix(in srgb, var(--line) 80%, #fff); box-shadow: var(--shadow); overflow: hidden; isolation: isolate; }
.hero-stage::before, .hero-stage::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; filter: blur(2px); }
.hero-stage::before { width: 190px; height: 190px; left: -50px; bottom: 60px; background: color-mix(in srgb, #ffffff 40%, transparent); }
.hero-stage::after { width: 120px; height: 120px; right: -30px; top: 90px; background: color-mix(in srgb, var(--sun) 40%, transparent); }
.stage-char { width: min(100%, 420px); height: 450px; margin-top: 104px; }
.stage-name { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font-size: .78rem; font-weight: 600; color: var(--ink-2); background: color-mix(in srgb, var(--surface) 82%, transparent); padding: 3px 12px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.bubble { position: absolute; z-index: 3; top: 18px; left: 18px; right: 18px; max-width: 340px; margin: 0 auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 12px 16px; font-size: .95rem; line-height: 1.45; font-weight: 500; box-shadow: var(--shadow); min-height: 3.4em; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 16px; height: 16px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }

.stage-char:focus-visible, .assist-char:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; border-radius: 24px; }

/* Dải trợ lý ở các bước */
.assist { display: flex; align-items: center; gap: 12px; margin: -6px 0 22px; padding: 8px 12px 8px 8px; border-radius: 22px; background: linear-gradient(110deg, color-mix(in srgb, var(--mint-soft) 90%, var(--surface)), color-mix(in srgb, var(--lav-soft) 70%, var(--surface))); border: 1px solid var(--line); box-shadow: var(--shadow-sm); position: relative; }
.assist-char { flex: none; width: 112px; height: 112px; border-radius: 20px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, #fff 70%, transparent), transparent 70%); }
.assist-msg { flex: 1; min-width: 0; } .assist-name { font-size: .74rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; }
.assist-msg p { margin: 2px 0 0; font-size: .98rem; font-weight: 500; color: var(--ink); line-height: 1.45; position: relative; }
.assist-hide { position: absolute; top: 6px; right: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .85rem; width: 28px; height: 28px; border-radius: 50%; } .assist-hide:hover { background: var(--surface); color: var(--ink); }
.assist.hidden { background: none; border: 0; box-shadow: none; padding: 0; margin: -10px 0 14px; } .assist-show { font: inherit; font-size: .82rem; font-weight: 600; border: 1px dashed var(--brand-line); background: var(--brand-soft); color: var(--brand); padding: 5px 14px; border-radius: 99px; cursor: pointer; }

/* Các bước, nút, thẻ */
.steps li + li::before { background: var(--brand-line); }
.steps .on i { background: linear-gradient(135deg, var(--brand-2), var(--brand)); border-color: transparent; box-shadow: 0 4px 10px -2px color-mix(in srgb, var(--brand) 55%, transparent); }
.steps .done i { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.btn { border-radius: 12px; padding: 9px 16px; } .btn.primary { background: linear-gradient(135deg, var(--brand-2), var(--brand)); border-color: transparent; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--brand) 70%, transparent); } .btn.primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.btn.primary:disabled { box-shadow: none; }
.card, .plist, .struct, .sum, .drop, details.f, .sub { border-radius: var(--radius); }
.card:hover, .prow:hover { background: var(--brand-soft); }
.drop { border-radius: 22px; background: color-mix(in srgb, var(--surface) 70%, var(--mint-soft)); border-color: var(--brand-line); border-style: dashed; }
.chips button.on, .seg button.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.seg { background: color-mix(in srgb, var(--brand-soft) 70%, var(--surface)); border-color: var(--brand-line); }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.recent { background: linear-gradient(110deg, var(--mint-soft), var(--lav-soft)); border-color: var(--brand-line); border-radius: 14px; }
.sum { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
.foot { color: var(--muted); }

@media (max-width: 880px) {
  .hero2 { grid-template-columns: 1fr; gap: 18px; margin-top: 0; }
  .hero-stage { order: -1; min-height: 380px; border-radius: 26px; }
  .stage-char { height: 270px; margin-top: 96px; width: min(100%, 280px); }
  .bubble { max-width: 300px; font-size: .88rem; padding: 9px 13px; min-height: 0; top: 12px; }
  .hero2 h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
}
@media (max-width: 560px) { .assist-char { width: 78px; height: 78px; } .assist-msg p { font-size: .9rem; } .assist { padding: 6px 28px 6px 6px; gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .choice, .btn { transition: none; } }
@media (prefers-color-scheme: dark) {
  .hero-stage { background: radial-gradient(60% 50% at 50% 42%, rgba(120, 220, 215, .22), transparent 70%), linear-gradient(160deg, #123a40, #2a2540 62%, #3a2a2c); }
  .hero-stage::before { background: rgba(255, 255, 255, .06); } .hero-stage::after { background: color-mix(in srgb, var(--sun) 22%, transparent); }
  .assist { background: linear-gradient(110deg, #123a40, #221f42); }
  body { background-image: radial-gradient(60vw 50vh at 8% -6%, rgba(40, 160, 150, .22), transparent 70%), radial-gradient(50vw 46vh at 100% 4%, rgba(255, 130, 90, .1), transparent 70%); }
}

/* Chuyển ngôn ngữ */
.lang { display: inline-flex; padding: 2px; gap: 2px; margin-left: auto; margin-right: 6px; border: 1px solid var(--brand-line); border-radius: 99px; background: var(--brand-soft); }
.lang button { font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .03em; border: 0; background: transparent; color: var(--brand); padding: 3px 11px; border-radius: 99px; cursor: pointer; min-height: 28px; }
.lang button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.lang button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.bar { gap: 8px; }

.only-en { display: none; } html[lang="en"] .only-en { display: block; }

/* ---- Hệ sinh thái ISA, câu hỏi thường gặp ---- */
.ecopop { position: fixed; z-index: 40; top: 64px; right: max(16px, calc((100vw - 1120px) / 2 + 24px)); width: min(380px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 8px; }
.ecopop[hidden] { display: none; }
.ep-h { margin: 2px 6px 4px; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.ep-i { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; text-decoration: none; color: inherit; border: 1px solid var(--line); }
.ep-i:hover { border-color: var(--brand); background: var(--brand-soft); } .ep-i.self { background: var(--brand-soft); border-color: var(--brand-line); }
.ep-i i { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .85rem; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: var(--brand-ink); }
.ep-i b { display: block; font-size: .95rem; } .ep-i small { color: var(--muted); font-size: .8rem; }
.ep-foot { margin: 2px 6px 0; font-size: .8rem; color: var(--muted); }
.eco-sec, .faq-sec { margin-top: 36px; } .eco-sec h2, .faq-sec h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; } .eco-lead { color: var(--muted); margin: 0 0 14px; }
.eco-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: s; }
.eco-steps li a { display: grid; gap: 4px; height: 100%; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s; }
.eco-steps li a:hover { transform: translateY(-2px); border-color: var(--brand); }
.eco-steps li.self a { background: var(--brand-soft); border-color: var(--brand-line); }
.eco-steps small { color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; } .eco-steps b { font-size: 1.05rem; } .eco-steps span { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.faq-sec details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; margin: 8px 0; } .faq-sec summary { cursor: pointer; font-weight: 700; } .faq-sec details p { margin: .5rem 0 .2rem; color: var(--ink-2); }
.faq-links { color: var(--muted); font-size: .9rem; margin-top: 14px; }
.eco-hint { margin: 6px 0 0; font-size: .92rem; color: var(--muted); } .eco-hint a { font-weight: 600; } .eco-hint.next { margin: 14px 0 6px; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--ink-2); }
@media (max-width: 860px) { .eco-steps { grid-template-columns: 1fr; } .ecopop { top: 58px; } }
@media (max-width: 560px) { .bar .ver { display: none; } .brand strong { font-size: .92rem; } .links .link { padding: 7px 7px; font-size: .84rem; } .lang { margin-right: 0; } .lang button { padding: 3px 8px; } .bar { gap: 4px; } .ecopop { right: 12px; } }

/* Đăng ký, tài khoản và quản trị */
.authdlg { width: min(440px, 94vw); }
.authdlg .x { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.authdlg .x:hover { background: var(--brand-soft); color: var(--ink); }
.authdlg h2 { margin: 0 0 6px; font-size: 1.3rem; }
.authdlg .lede { margin: 0 0 12px; color: var(--ink-2); font-size: .95rem; }
.authdlg label { display: grid; gap: 4px; margin: 10px 0; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.authdlg input[type=email], .authdlg input[type=text], .authdlg input[type=tel] { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); width: 100%; box-sizing: border-box; }
.authdlg input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.authdlg .consent { grid-template-columns: auto 1fr; align-items: start; gap: 10px; font-weight: 400; font-size: .84rem; color: var(--muted); }
.authdlg .consent input { margin-top: 3px; }
.authdlg .btn { width: 100%; margin-top: 6px; }
.authdlg .actions { display: flex; gap: 8px; } .authdlg .actions .btn { width: auto; flex: 1; }
.authdlg .code { width: 100%; box-sizing: border-box; text-align: center; font-size: 2rem; letter-spacing: .5em; padding: 12px 8px 12px 20px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); font-variant-numeric: tabular-nums; }
.authdlg .err { margin: 8px 0 0; color: #b42318; font-size: .86rem; }
.authdlg .row2 { margin: 12px 0 0; text-align: center; font-size: .88rem; color: var(--muted); }
.authdlg .pledge { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--ink); font-size: .86rem; font-weight: 600; }
.authdlg .pledge span { color: #e0526b; margin-right: 4px; }
.authdlg .who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; word-break: break-all; }
.authdlg .badge { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line); }
.authdlg .mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.authdlg .mini div { text-align: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.authdlg .mini b { display: block; font-size: 1.3rem; } .authdlg .mini span { font-size: .74rem; color: var(--muted); }
.authdlg .hint { margin: 6px 0 0; font-size: .82rem; color: var(--muted); }
.authdlg .danger { margin-top: 14px; font-size: .86rem; color: var(--muted); } .authdlg .danger summary { cursor: pointer; }
#navAuth.signed { font-weight: 700; }
.ref.admin { max-width: none; }
.admin .adhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.admin .adhead h1 { margin: 2px 0 0; font-size: 1.5rem; line-height: 1.2; } .admin .adhead .btn { flex: none; }
.admin .tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 0 0 12px; }
.admin .tiles div { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.admin .tiles b { display: block; font-size: 1.5rem; line-height: 1.2; font-variant-numeric: tabular-nums; } .admin .tiles span { font-size: .78rem; color: var(--muted); }
.admin .cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.admin .panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 12px 14px; min-width: 0; margin-bottom: 12px; }
.admin .panel h2 { margin: 0 0 8px; font-size: .95rem; }
.admin .ptop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; } .admin .ptop h2 { margin: 0; }
.admin table { border-collapse: collapse; width: 100%; font-size: .84rem; }
.admin th, .admin td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin th { font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.admin tr:last-child td { border-bottom: 0; } .admin tbody tr:hover td, .admin tr:hover td { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.admin td b, .admin td .muted { display: block; line-height: 1.35; } .admin td .score { display: inline; color: var(--brand); }
.admin th.n, .admin td.n { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; } .admin td.nw { white-space: nowrap; }
.admin .muted { color: var(--muted); font-size: .78rem; }
.admin .medal { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: .72rem; font-weight: 700; color: #fff; background: #94a3b8; } .admin .m1 { background: #e0a526; } .admin .m2 { background: #8795a8; } .admin .m3 { background: #c07a4b; }
.admin .bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.admin .bars li { display: grid; grid-template-columns: minmax(48px, 38%) 1fr 26px; align-items: center; gap: 8px; font-size: .78rem; }
.admin .bars .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin .bars i { display: block; height: 8px; border-radius: 6px; background: var(--brand-2); min-width: 2px; } .admin .bars b { text-align: right; font-variant-numeric: tabular-nums; }
.admin .cols { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 118px; }
.admin .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; font-size: .75rem; min-width: 0; }
.admin .col b { font-variant-numeric: tabular-nums; font-size: .78rem; } .admin .col i { display: block; width: min(100%, 36px); border-radius: 6px 6px 2px 2px; background: var(--brand-2); } .admin .col span { color: var(--muted); text-align: center; line-height: 1.2; } .admin .col small { display: block; font-size: .68rem; opacity: .8; }
.admin .col:not(:has(i[style*="height:2%"])) i { background: linear-gradient(180deg, var(--brand-2), var(--brand)); }
.admin .pfilter { display: flex; gap: 8px; margin: 0; } .admin .pfilter input { width: 260px; max-width: 100%; font: inherit; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); }
.admin .pfilter select { width: auto; font: inherit; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.admin .scroll { overflow: auto; max-height: 70vh; }
.admin .hint { margin: 8px 0 0; font-size: .78rem; color: var(--muted); }
@media (max-width: 860px) { .admin .tiles { grid-template-columns: repeat(2, 1fr); } .admin .cols3 { grid-template-columns: 1fr; } .admin .pfilter input { width: 100%; } .admin .pfilter { width: 100%; } }
.admin .warn { border-color: #f1b24a; background: color-mix(in srgb, #f1b24a 14%, var(--surface)); }

[hidden] { display: none !important; }


/* Điện thoại: thanh đầu trang không bao giờ tràn ngang (khi đăng nhập có thêm Quản trị, Tài khoản) */
html, body { overflow-x: clip; max-width: 100%; }
.topbar .bar { min-width: 0; } .brand { min-width: 0; flex: 0 1 auto; } .brand strong { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .topbar .bar { height: auto; min-height: 56px; flex-wrap: wrap; row-gap: 0; padding-top: 6px; padding-bottom: 4px; }
  .links { order: 3; flex: 1 0 100%; justify-content: space-between; gap: 0; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; padding: 0; }
  .links::-webkit-scrollbar { display: none; }
  .links .link { flex: 0 0 auto; padding: 7px 8px; }
  .links #navAuth .long { display: inline; } .links #navAuth .short { display: none; }
  .brand strong { font-size: .95rem; }
}
@media (max-width: 380px) { .links .link { padding: 7px 5px; font-size: .8rem; } .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); } .lang button { padding: 3px 7px; } }
dialog { max-width: calc(100vw - 24px); }
.actions.bar { height: auto; }

.guestnote { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; font-size: .86rem; color: var(--ink-2, var(--ink)); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius: 10px; }
.guestnote::before { content: "✓"; color: var(--brand); font-weight: 700; }
.guestnote[hidden] { display: none; }

/* So sánh Trước / Sau */
.cmp { margin: 0 0 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.cmp-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 22px; }
.cmp-col { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 8px; } .cmp-col .cmp-t { grid-column: 1 / -1; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cmp-n { font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; } .cmp-col small { color: var(--muted); font-size: .8rem; }
.cmp-n.good { color: #15803d; } .cmp-n.mid { color: #b45309; } .cmp-n.bad { color: #b91c1c; }
.cmp-arrow { color: var(--muted); font-size: 1.3rem; }
.cmp-note { flex: 1 1 200px; margin: 0; color: var(--muted); font-size: .78rem; }
.cmp-list { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 4px 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); font-size: .84rem; line-height: 1.4; }
.cmp-list li::before { content: "✓ "; color: var(--brand); font-weight: 700; } .cmp-list li span { display: block; color: var(--muted); font-size: .78rem; margin-left: 1.2em; }
.cmp .sub { margin-top: 6px; }
@media (max-width: 560px) { .cmp-row { gap: 6px 14px; } .cmp-n { font-size: 1.6rem; } .cmp-note { flex-basis: 100%; } }
