:root {
  color-scheme: light;
  --ink: #152f2f;
  --muted: #526563;
  --brand: #155a4e;
  --dark: #123633;
  --pale: #e8f2eb;
  --paper: #f6f8f3;
  --white: #fff;
  --line: #d4e0d9;
  --amber: #795217;
  --warm: #fff0d7;
  --red: #923d3d;
  --serif: Cambria, Georgia, serif;
  --sans: 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1.3rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.58 var(--sans); }
main { min-height: 75vh; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { opacity: .58; cursor: not-allowed; }
label { display: block; font-weight: 660; }
a { color: var(--brand); text-underline-offset: .2em; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.17; }
input:not([type='checkbox'], [type='file']), select, textarea {
  width: 100%; border: 1px solid #b9cdc1; background: var(--white); color: var(--ink);
  border-radius: .4rem; padding: .65rem .76rem; margin-top: .35rem; min-height: 2.82rem;
  font-weight: 460;
}
textarea { display: block; resize: vertical; line-height: 1.45; }
input:disabled, textarea:disabled, select:disabled { color: #3e5553; opacity: 1; background: #eff4ef; }
input::placeholder, textarea::placeholder { color: #697b75; }
input[type='checkbox'] { accent-color: var(--brand); width: 1.1rem; height: 1.1rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #397dc6; outline-offset: 3px; }
#main:focus, #topic-title:focus { outline: 0; }
.wrap { width: min(100% - 5.5rem, 83rem); margin-inline: auto; }
.skip { position: absolute; z-index: 10; left: .5rem; top: .5rem; transform: translateY(-180%); background: white; padding: .5rem 1rem; border-radius: .4rem; }
.skip:focus { transform: translateY(0); }
.helper, .muted { color: var(--muted); }
.helper, .optional { font-size: .88rem; font-weight: 520; }
.optional { color: var(--muted); margin-left: .3rem; }
.eyebrow { color: var(--brand); font-size: .84rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

.topbar { background: #fcfdf9; border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar nav, .button-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .67rem; color: var(--ink); text-decoration: none; font-weight: 800; line-height: 1.2; }
.brand-icon { width: 2.45rem; height: 2.45rem; display: grid; place-items: center; border: 1px solid #c0ddcb; border-radius: .62rem; background: #e4f1e8; color: var(--brand); flex: 0 0 auto; }
.brand-icon svg { width: 1.26rem; height: 1.26rem; }
.nav-context { color: var(--muted); font-size: .91rem; margin-right: .4rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.6rem; padding: .51rem .92rem; border: 1px solid transparent; border-radius: .45rem; text-decoration: none; color: var(--brand); font-size: .95rem; font-weight: 750; line-height: 1.25; text-align: center; }
.button.primary { color: white; background: var(--brand); }
.button.primary:hover:enabled { background: #1b6c5b; }
.button.outline { background: white; border-color: #b9cdc1; }
.button.quiet { background: transparent; }
.button.outline:hover, .button.quiet:hover { background: #e8f2eb; }
.button.warning { color: #fff; background: var(--red); }
.button.small { min-height: 2.05rem; padding: .23rem .55rem; font-size: .88rem; }

.entry-hero { position: relative; isolation: isolate; background: #143b38; color: #f3fcf7; }
.entry-hero::before, .entry-hero::after { content: ''; pointer-events: none; position: absolute; inset: 0; z-index: -1; }
.entry-hero::before { background: url('assets/du-thuyen.webp') center 55% / cover no-repeat; }
.entry-hero::after { background: linear-gradient(90deg, #0e302eea 0%, #0e302ed0 51%, #102b2a87 100%); }
.entry-grid { display: grid; grid-template-columns: 1.2fr minmax(21rem, .8fr); align-items: center; gap: clamp(2rem, 7vw, 7rem); padding-block: clamp(3.3rem, 8vw, 7rem); }
.entry-intro .eyebrow { color: #b9e5ce; margin-bottom: .85rem; }
.entry-intro h1 { color: white; font: 400 clamp(3rem, 5.8vw, 5.1rem)/1.01 var(--serif); letter-spacing: -.04em; max-width: 16ch; text-wrap: balance; }
.entry-intro > p:not(.eyebrow) { max-width: 34rem; margin-top: 1.1rem; color: #e1f0e9; font-size: 1.14rem; }
.entry-facts { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin-top: 1.5rem; color: #e7f6ee; }
.entry-facts span { display: inline-flex; gap: .34rem; align-items: baseline; }
.entry-facts strong { color: #fff; font-size: 1.24rem; }
.entry-card { display: grid; gap: 1rem; color: var(--ink); background: #fcfefa; padding: clamp(1.35rem, 3.3vw, 2.45rem); border-radius: .86rem; box-shadow: 0 24px 65px #142b2b4d; }
.entry-card h2 { font: 400 2rem/1.08 var(--serif); }
.entry-card p { color: var(--muted); }
.entry-card .button.quiet { justify-self: start; padding-left: 0; text-decoration: underline; text-underline-offset: .2rem; }
.entry-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 4vw, 3rem); padding-block: clamp(2rem, 5vw, 4rem); }
.entry-steps article { border-top: 2px solid #98bda9; padding-top: .95rem; }
.entry-steps h3 { font-size: 1.13rem; margin-bottom: .38rem; }
.entry-steps p { color: var(--muted); }
.loading { padding-block: 3rem; color: var(--muted); }

.survey-banner { background: var(--dark); color: #ebf7ef; }
.banner-grid { display: grid; grid-template-columns: 1fr minmax(12rem, .35fr); gap: 1.5rem; align-items: end; padding-block: clamp(1.65rem, 4vw, 3rem); }
.survey-banner .breadcrumb { color: #b8e4cc; font-weight: 760; text-transform: uppercase; letter-spacing: .05em; font-size: .84rem; }
.survey-banner h1 { color: white; font: 400 clamp(2.2rem, 4.4vw, 3.75rem)/1.03 var(--serif); letter-spacing: -.035em; margin: .38rem 0; }
.survey-banner .banner-status { padding: .85rem 1rem; background: #ffffff12; border: 1px solid #ffffff35; border-radius: .55rem; }
.banner-status p { margin: .35rem 0 .16rem; font-size: .91rem; }
progress { width: 100%; height: .48rem; accent-color: #9ed9b8; display: block; }
.pill { display: inline-flex; padding: .1rem .46rem; border-radius: .32rem; font-size: .775rem; line-height: 1.6; font-weight: 770; white-space: nowrap; }
.pill.core { background: var(--warm); color: var(--amber); }
.pill.neutral { background: #e8efeb; color: #435e54; }
.pill.good { background: #d8eee0; color: #1b664c; }

.survey-layout, .admin-layout { display: grid; grid-template-columns: minmax(14rem, 17.6rem) minmax(0, 1fr); gap: clamp(1.4rem, 4vw, 3rem); align-items: start; padding-block: 2rem 3.5rem; }
.sidebar { position: sticky; top: 1rem; align-self: start; border: 1px solid var(--line); border-radius: .68rem; background: white; padding: .7rem; min-width: 0; }
.side-heading { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: .58rem .45rem .77rem; }
.side-heading h2 { font-size: 1.07rem; }
.side-heading span { color: var(--brand); font-weight: 760; }
.sections-nav { max-height: min(68vh, 47rem); overflow: auto; }
.side-group h3 { color: var(--muted); font-size: .81rem; text-transform: uppercase; letter-spacing: .045em; padding: .8rem .4rem .43rem; }
.side-link { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .4rem; min-height: 2.56rem; background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: .35rem; text-align: left; padding: .45rem .41rem; line-height: 1.25; font-size: .91rem; }
.side-link[aria-current='true'] { background: #e2f0e7; color: #1a5142; border-color: #cbe5d3; font-weight: 760; }
.side-link:hover { background: #edf5ee; }
.side-link small { display: block; color: var(--muted); font-size: .84rem; margin-top: .2rem; }
.side-count { color: var(--brand); font-variant-numeric: tabular-nums; font-size: .83rem; }
.mobile-section { display: none; }
.topic-heading { margin-bottom: 1.15rem; }
.topic-heading h2, .admin-title h2, .admin-empty h2 { font: 400 clamp(1.85rem, 3.5vw, 3.04rem)/1.04 var(--serif); letter-spacing: -.026em; margin: .25rem 0 .4rem; }
.topic-heading > p:last-child, .admin-title p, .admin-empty p { color: var(--muted); }
.evidence { border: 1px solid #cddfd3; background: #eaf3ec; border-radius: .53rem; padding: .85rem 1rem; margin-bottom: 1rem; }
.evidence h3, .export-box h3 { font-size: 1.05rem; margin-bottom: .29rem; }
.evidence p { color: #45665a; }
.file-control { display: inline-flex; align-items: center; gap: .45rem; margin-top: .65rem; flex-wrap: wrap; }
.file-input { max-width: 100%; font-weight: 500; }
.file-input::file-selector-button { color: var(--brand); background: white; border: 1px solid #bdd1c6; border-radius: .36rem; padding: .34rem .6rem; margin-right: .5rem; cursor: pointer; }
.file-control + .helper { display: block; margin-top: .24rem; }
.file-list > div { display: flex; flex-wrap: wrap; gap: .48rem; align-items: center; margin-top: .28rem; overflow-wrap: anywhere; }
.file-list a { font-weight: 670; }
.inline-alert { background: var(--warm); color: #694b1f !important; border: 1px solid #ead8af; padding: .65rem .8rem; border-radius: .44rem; margin-bottom: .9rem; font-size: .95rem; }
.entry-card .inline-alert { margin-bottom: 0; }

.question-list { display: grid; gap: .85rem; }
.question { min-width: 0; background: white; border: 1px solid var(--line); border-radius: .65rem; padding: clamp(.85rem, 2.5vw, 1.4rem); scroll-margin: .6rem; }
.question-top { display: flex; gap: .9rem; justify-content: space-between; align-items: flex-start; }
.question-top > div { min-width: 0; }
.question-meta { display: flex; gap: .5rem; align-items: center; color: var(--muted); margin-bottom: .32rem; font-size: .84rem; font-weight: 760; }
.question h3 { font-size: clamp(1.13rem, 2vw, 1.36rem); }
.question-hint { color: var(--muted); margin-top: .37rem; }
.answer-state { color: var(--amber); font-size: .83rem; font-weight: 700; flex-shrink: 0; }
.answer-state.is-filled { color: var(--brand); }
.sample-field, .conditional { color: var(--brand); font-size: .91rem; margin-top: .57rem; }
.conditional { color: var(--amber); }
.question-body { border-top: 1px solid #e5ece6; margin-top: .8rem; padding-top: .8rem; display: grid; gap: .74rem; }
.status-label { max-width: 17rem; }
.compact-label textarea { min-height: 3.15rem; }
.fields-two { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.table-rows { display: grid; gap: .6rem; }
.table-row { background: #f5f8f4; border: 1px solid #e2ebe3; border-radius: .48rem; padding: .62rem .69rem; }
.row-head { display: flex; gap: .7rem; align-items: center; justify-content: space-between; margin-bottom: .3rem; }
.row-head strong { font-size: .94rem; color: var(--brand); }
.table-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .54rem; }
.table-fields label { font-size: .92rem; }
.table-fields input { min-height: 2.53rem; padding: .41rem .52rem; }
.question-body > .button.small { justify-self: start; }
.section-pagination { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: 1rem; }
.action-bar { position: sticky; bottom: 0; z-index: 2; border-top: 1px solid #bfd0c3; background: #fcfefa; box-shadow: 0 -7px 26px #263d290e; }
.action-inner { display: flex; align-items: center; justify-content: space-between; gap: .67rem; padding-block: .67rem; }
#save-line { font-size: .93rem; font-weight: 700; color: var(--brand); }
.action-inner .helper { margin-top: .13rem; }

.admin-layout { grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr); }
.admin-projects { max-height: 14rem; overflow: auto; }
.admin-form { display: grid; gap: .65rem; border: 1px solid var(--line); border-radius: .55rem; background: white; padding: 1rem; }
.sidebar .admin-form { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: .82rem .36rem .32rem; margin-top: .34rem; }
.admin-form h3 { font-size: 1.08rem; }
.admin-form label { font-size: .92rem; }
.admin-form > .button { justify-self: start; }
.admin-title { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: .85rem; margin-bottom: .8rem; }
.admin-content { min-width: 0; }
.admin-empty { background: white; border: 1px solid var(--line); border-radius: .6rem; padding: 1.4rem; }
.overview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin: .9rem 0; }
.overview-stats div { padding: .73rem .82rem; background: var(--pale); border-radius: .52rem; }
.overview-stats strong, .overview-stats span { display: block; }
.overview-stats strong { color: var(--brand); font: 400 2.1rem/1 var(--serif); margin-bottom: .18rem; }
.overview-stats span { font-size: .92rem; color: var(--muted); }
.coverage, .assign-details, .review-section { background: white; border: 1px solid var(--line); padding: .56rem .68rem; border-radius: .42rem; color: var(--ink); }
.coverage summary, .assign-details summary, .review-section summary { font-weight: 740; color: var(--brand); }
.coverage ul { margin: .45rem 0 .3rem; padding-left: 1.25rem; color: var(--muted); }
.admin-media { display: grid; grid-template-columns: 1.1fr .9fr; align-items: start; gap: .64rem; margin: .85rem 0 1.25rem; }
.export-box { display: flex; flex-direction: column; align-items: flex-start; gap: .52rem; border: 1px solid var(--line); background: #ecf4ee; padding: 1rem; border-radius: .52rem; }
.export-box p { color: var(--muted); font-size: .94rem; }
.section-options { display: grid; gap: .22rem; margin-top: .52rem; }
.section-options strong { color: var(--muted); font-size: .86rem; }
.check { display: flex; align-items: center; gap: .38rem; font-weight: 600; }
.responsive-table { overflow: auto; border: 1px solid var(--line); border-radius: .48rem; margin-top: .46rem; }
table { border-collapse: collapse; min-width: 35rem; width: 100%; background: white; text-align: left; }
thead { background: #e9f2eb; }
th, td { padding: .56rem .7rem; font-size: .9rem; border-bottom: 1px solid #e5ece5; }
th small { display: block; font-weight: 500; color: var(--muted); }
.text-button { color: var(--brand); background: none; border: 0; appearance: none; padding: 0; font-weight: 770; text-decoration: underline; text-underline-offset: .2em; text-align: left; }
.response-review { margin-top: 1.3rem; }
.review-section { margin-top: .53rem; }
.review-items article { padding: .7rem .1rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.review-items p { white-space: pre-wrap; }
.review-items h4 { margin-bottom: .27rem; }
.review-grid { display: grid; gap: .3rem; padding: .52rem; background: var(--pale); margin-block: .22rem; border-radius: .35rem; }
.review-grid span b { color: var(--muted); display: inline-block; min-width: 8rem; margin-right: .45rem; }

.footer { background: #163b36; color: #e4f2e9; font-size: .9rem; }
.footer > div { padding-block: 1rem; }
.notice { z-index: 4; position: fixed; top: 1rem; right: 1rem; max-width: min(34rem, calc(100% - 2rem)); padding: .7rem .95rem; background: #164d40; color: white; border-radius: .5rem; box-shadow: 0 15px 35px #162b2452; }
.notice.error { background: #873333; }
dialog { width: min(100% - 1.4rem, 37rem); max-height: min(83dvh, 48rem); overflow: auto; padding: 1.1rem; color: var(--ink); border: 1px solid var(--line); border-radius: .73rem; background: #fcfefa; box-shadow: 0 18px 55px #152a2b4f; }
dialog::backdrop { background: #102f2b92; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .65rem; }
.dialog-head h2 { font-size: 1.42rem; }
dialog p + p, dialog p + label { margin-top: .5rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .4rem; margin-top: .85rem; }
.issue-list { margin-top: .76rem; display: grid; gap: .43rem; }
.issue { text-align: left; display: flex; flex-direction: column; background: white; color: var(--ink); border: 1px solid var(--line); border-radius: .39rem; padding: .46rem .64rem; line-height: 1.4; }
.issue:hover { background: var(--pale); }
.issue span { font-size: .86rem; color: var(--muted); }

@media (max-width: 1000px) {
  .wrap { width: calc(100% - 2.4rem); }
  .entry-grid { gap: 2.15rem; }
  .survey-layout, .admin-layout { gap: 1.2rem; grid-template-columns: 14rem minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .wrap { width: calc(100% - 1.45rem); }
  .topbar-inner { gap: .45rem; }
  .nav-context { display: none; }
  .entry-grid, .survey-layout, .admin-layout, .banner-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .entry-grid { padding-block: 2.45rem; }
  .entry-intro h1 { max-width: 17ch; }
  .entry-intro > p:not(.eyebrow) { margin-top: .6rem; }
  .entry-steps { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sections-nav { display: none; }
  .mobile-section { display: block; padding: .63rem .38rem .35rem; }
  .action-inner { align-items: flex-start; flex-direction: column; }
  .action-inner .button-row { gap: .32rem; }
  .action-inner .button { padding-inline: .61rem; min-height: 2.35rem; font-size: .86rem; }
  .admin-media { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .brand { font-size: .9rem; }
  .brand-icon { width: 2.03rem; height: 2.03rem; }
  .topbar nav .button { padding-inline: .27rem; font-size: .86rem; }
  .entry-intro h1 { font-size: 2.75rem; }
  .section-pagination { align-items: flex-start; }
  .question-top { flex-direction: column; gap: .37rem; }
  .fields-two { grid-template-columns: 1fr; }
  .overview-stats { gap: .3rem; }
  .overview-stats div { padding-inline: .43rem; }
  .overview-stats span { font-size: .83rem; }
}
