/* DOD-4 (jobs/ux/plan.md): one palette for the whole app. Its values live once, in the --n-* block further down (the approved
   mock-up's tokens, light and dark); the older names every screen's rules use are aliases of it, so a rule keeps its name and the
   tests their selectors. The old red accent is gone: --accent is the teal, with --accent-text its ink. */
@font-face { font-family: "Noto Sans Thai"; src: url("/fonts/NotoSansThai-Variable.ttf") format("truetype"); font-weight: 400 800; font-style: normal; font-display: swap; }
:root {
  color-scheme: light dark; /* native controls (select lists, time and range inputs, scrollbars) follow the theme */
  --bg: var(--n-bg); --panel: var(--n-panel); --text: var(--n-text); --muted: var(--n-muted); --line: var(--n-line); --bar: var(--n-raised);
  --accent: var(--n-accent); --accent-text: var(--n-accent-ink); --ok: var(--n-ok); --warn: var(--n-warn); --bad: var(--n-danger);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--n-font); -webkit-font-smoothing: antialiased; }
body.center { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); }
h1 { font: 800 24px/1.3 var(--n-font); margin: 0 0 4px; }
h2 { font: 700 18px/1.35 var(--n-font); margin: 0 0 12px; }
a { color: inherit; }
/* the older screens' buttons in the library's look (.v-btn): primary by default, ghost on the raised fill */
button, .button { font: inherit; font-weight: 700; line-height: 1.3; border: 0; border-radius: 12px; padding: 10px 16px; background: var(--n-primary); color: var(--n-primary-ink); cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
button.ghost, .button.ghost { background: var(--n-raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--n-line-soft); }
button.small, .button.small { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
button:disabled { opacity: .45; cursor: default; }
:is(button, .button, a, input, select, textarea, summary):focus-visible { outline: 2px solid var(--n-accent-fg); outline-offset: 2px; }
[hidden] { display: none !important; } /* author display rules (e.g. .button) would otherwise beat the hidden attribute */
input, select { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--n-line); border-radius: 10px; background: var(--n-raised); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--n-faint); opacity: 1; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--n-accent-fg); }
label { display: block; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
label input, label select { margin-top: 6px; color: var(--text); }
.card { background: var(--panel); border: 1px solid var(--n-line-soft); border-radius: 14px; padding: 20px; }
.narrow { width: 100%; max-width: 400px; }
/* the login, invite and consent page (login.html) */
.login { padding: 24px 20px; border-radius: 18px; box-shadow: var(--n-shadow); }
.login h1 { letter-spacing: -.01em; }
.login form button { width: 100%; margin: 4px 0 12px; }
.login .error { margin: 12px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--bad); overflow-wrap: anywhere; }
#np-err { margin: 8px 0 0; } #np-err:empty { display: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 160px; }
/* the header on a desktop: the brand, the nav (ฟุตเทจ first, สร้างวิดีโอ as the accent button), the member and ออกจากระบบ at the right */
header { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--n-line-soft); flex-wrap: wrap; }
header > b { font: 800 16px/1.2 var(--n-font); letter-spacing: -.01em; }
header nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
header nav a { padding: 7px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; }
header nav a:hover { color: var(--text); }
header nav a.on { background: var(--bar); color: var(--text); }
header .me { margin-left: auto; font-size: 13px; color: var(--muted); }
header .me #me { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
header .me #logout { display: inline-flex; align-items: center; min-height: 24px; } /* a 24 px target (DOD-5 PH-4) */
main.page { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
/* a page's title row (the library's .v-top) and its section headings (the library's .v-sec) */
#view > h2:not(.section) { font: 700 22px/1.3 var(--n-font); margin: 4px 0 14px; overflow-wrap: anywhere; }
#view > h2 .muted.small, h2.section .muted.small { font-weight: 400; }
h2.section { font: 700 16px/1.4 var(--n-font); margin: 26px 0 10px; }
#view > p.small:first-child a { color: var(--muted); font-weight: 500; text-decoration: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--n-line-soft); border-radius: 14px; overflow: hidden; cursor: pointer; text-decoration: none; display: block; }
.tile:hover { border-color: var(--n-line); }
/* a clip's poster is dark in both themes, as the library's media tiles are */
.tile .thumb { aspect-ratio: 9 / 16; background: #2a2e36 center / cover no-repeat; display: grid; place-items: center; color: #e8eaee; font-size: 13px; }
.tile .body { padding: 10px 12px; overflow-wrap: anywhere; } /* a member-typed name or project name with no spaces wraps, the "project · style" line too (BACKLOG UI2-1; DOD-4 check PH-1) */
.tile b { display: block; }
.plist .tile .body { padding: 14px 16px; }
table { width: 100%; border-collapse: collapse; }
#view table { border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--n-line-soft); border-radius: 14px; overflow: hidden; }
td, th { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--n-line-soft); vertical-align: middle; }
#view tr:last-child > td { border-bottom: 0; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
td img { width: 96px; border-radius: 8px; display: block; }
.bar { height: 6px; background: var(--bar); border-radius: 3px; overflow: hidden; min-width: 120px; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.5; padding: 1px 8px; border-radius: 6px; background: var(--bar); color: var(--text); white-space: nowrap; }
button.small { white-space: nowrap; }
.tag.ok { color: var(--ok); } .tag.warn { color: var(--warn); } .tag.bad { color: var(--bad); }
.drop { border: 2px dashed var(--n-line); border-radius: 14px; padding: 28px; text-align: center; color: var(--muted); background: var(--panel); cursor: pointer; margin: 0 0 20px; }
.drop:hover, .drop.over { border-color: var(--n-accent-fg); color: var(--text); }
.transcript { max-height: 360px; overflow: auto; font-size: 14px; white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.section { margin: 28px 0 0; }
.code { font-family: Consolas, ui-monospace, monospace; background: var(--bar); padding: 8px 10px; border-radius: 10px; word-break: break-all; }
.steps li { margin: 0 0 10px; }
#uploads { position: fixed; right: 16px; bottom: 16px; width: 320px; max-width: calc(100vw - 32px); }
#uploads .card { padding: 12px 14px; margin-top: 8px; font-size: 13px; box-shadow: var(--n-shadow); }
#uploads .card b { overflow-wrap: anywhere; }
dialog { border: 0; border-radius: 18px; padding: 16px; background: var(--panel); color: var(--text); max-width: 96vw; box-shadow: var(--n-shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog video { display: block; height: min(70vh, 720px); aspect-ratio: 9 / 16; background: #000; border-radius: 12px; margin: 0 auto 12px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }
@media (max-width: 600px) { td img { width: 64px; } .hide-sm { display: none; } }
/* on a phone: the older dialogs are bottom sheets like the create sheet (centred on a desktop), the clips grid two across, and
   every table (the project's files, the team) a list of cards */
@media (max-width: 700px) {
  dialog:is(#brief, #wizard, #auto, #series, #player) { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; animation: v-up .22s ease; }
  dialog:is(#brief, #auto, #series, #player) { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .grid:not(.plist) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #view table, #view tbody, #view tr, #view td { display: block; }
  #view table { background: none; border: 0; border-radius: 0; overflow: visible; }
  #view tr:has(> th) { display: none; }
  #view tr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 12px; align-items: start; background: var(--panel); border: 1px solid var(--n-line-soft); border-radius: 14px; padding: 12px; margin: 0 0 8px; }
  #view td { padding: 0; border: 0; min-width: 0; }
  #view td.row { display: flex; }
  /* a file's row: its poster on the left, the rest beside it */
  #view tr:has(> td:first-child > img) { grid-template-columns: auto minmax(0, 1fr); }
  #view tr:has(> td:first-child > img) > td { grid-column: 2; }
  #view tr:has(> td:first-child > img) > td:first-child { grid-column: 1; grid-row: 1 / span 4; }
  #view td:empty { display: none; }
}
/* project brief dialog */
#brief { width: min(560px, 96vw); }
textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--n-line); border-radius: 10px; background: var(--n-raised); color: var(--text); margin-top: 6px; resize: vertical; }
.chips { gap: 6px; margin-bottom: 12px; }
/* the older screens' choices in the library's chip look: raised, the ticked one on the teal tint with its teal edge */
label.chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 12px; border: 1px solid transparent; border-radius: 999px; background: var(--bar); color: var(--text); font-size: 13px; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; } /* a session's name is member-typed */
label.chip input { width: auto; margin: 0; }
label.chip:has(input:checked) { border-color: var(--n-accent-fg); background: var(--n-accent-soft); }
.lens { margin: -6px 0 12px; }
/* start card and the "สร้างคลิปใหม่" wizard */
.lead { font: 700 18px/1.4 var(--n-font); }
.push { margin-left: auto; }
button.big { padding: 13px 22px; font-size: 16px; border-radius: 14px; }
.start summary { cursor: pointer; color: var(--muted); }
/* tap targets at least 24 px tall (DOD-4 check PH-2): the small summary rows and the inline links a thumb lands on */
summary.small, .start summary, .pv-credits summary { padding: 2px 0; }
#view > p.small:first-child a, .drop a, .pv-credits a, .section.card a:not(.button) { display: inline-block; padding: 2px 0; } /* the chat card's "เชื่อม AI" sits in a span (re-check ui2-2-1) */
.checklist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: center; }
.checklist .tick { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; background: var(--bar); color: var(--muted); }
.checklist li.done .tick { background: var(--ok); color: var(--n-bg); }
.checklist li.done > span:last-child { color: var(--muted); }
#wizard { width: min(760px, 96vw); max-height: 92dvh; padding: 0; }
#wz-form { padding: 16px 16px 0; }
.wz-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 12px 0 16px; counter-reset: s; }
.wz-steps li { flex: 1; font-size: 12px; color: var(--muted); border-top: 3px solid var(--n-line); padding-top: 6px; counter-increment: s; }
.wz-steps li::before { content: counter(s) ". "; }
.wz-steps li.on { color: var(--text); border-color: var(--n-accent); }
/* z-index: above the clip picker's sticky bar (.fbar, 2), which slid under it and took the บันทึกบรีฟ tap (wizard14 at 1280) */
.wz-foot { position: sticky; bottom: 0; z-index: 3; background: var(--panel); padding: 10px 0 calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--n-line-soft); }
/* the wizard's messages ride in the sticky bar: on a phone they sat under the styles, off screen (re-check 4 R4-5) */
#wz-err { margin: 0 0 8px; }
#wz-err:empty { display: none; }
/* the clip picker (wizard step 3 and the brief dialog): small 3:4 poster tiles, 3-4 across on a phone; a ticked one is outlined */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 8px 0 12px; }
/* the count and the switch stay at the top while the member scrolls the tiles (a first tap on the 40th tile left them
   2,242 px above the screen: check PK2-3) */
.fbar { position: sticky; top: 0; z-index: 2; background: var(--panel); padding: 6px 0 2px; }
.fbar .fcount { margin: 0 0 6px; }
.fexp.off { opacity: .5; }
/* the brief dialog's 16 px padding showed the tiles through a band above the stuck bar (re-check 2 PK3-2) */
#brief .fbar { top: -16px; padding-top: 22px; }
.ftile { position: relative; margin: 0; padding: 4px; border: 2px solid var(--n-line-soft); border-radius: 10px; background: var(--panel); cursor: pointer; min-width: 0; color: var(--text); font-size: 12px; }
.ftile:has(input:checked) { border-color: var(--n-accent-fg); background: var(--n-accent-soft); }
.ftile input { position: absolute; top: 8px; left: 8px; width: auto; }
.ftile img, .ftile .fph { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; background: var(--bar); font-size: 20px; }
/* the whole name: two takes that differ at the end looked the same when cut after two lines (check PK-7) */
.ftile .fname { display: block; overflow-wrap: anywhere; line-height: 1.3; margin-top: 3px; }
.ftile .small { overflow-wrap: anywhere; } /* "จาก <project>" on a linked tile: a long name with no spaces must not widen the tile */
#wizard h3 { font: 700 18px/1.35 var(--n-font); margin: 0 0 6px; }
#wizard h4 { font-size: 14px; margin: 14px 0 8px; color: var(--muted); font-weight: 500; }
.recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.recipe-wrap { position: relative; }
/* a template card in the create sheet's look (.v-recipe): raised, the ticked one on the teal tint */
.recipe { text-align: left; width: 100%; height: 100%; background: var(--bar); color: var(--text); border: 1px solid transparent; border-radius: 14px; padding: 12px; display: block; font-weight: 400; line-height: 1.5; }
.recipe:hover, .recipe:focus-visible { border-color: var(--n-accent-fg); }
.recipe .ico { font-size: 26px; line-height: 1.2; }
.recipe b { display: block; margin: 4px 0 2px; font-size: 14px; overflow-wrap: anywhere; } /* a team template's name is member-typed */
.recipe span { display: block; font-size: 13px; color: var(--muted); }
.recipe .meta { margin-top: 6px; font-size: 12px; }
.recipe-wrap .del { position: absolute; top: 8px; right: 8px; z-index: 1; background: var(--panel); } /* readable over a playing preview (C14-17) */
.pv-credits { margin: 8px 0 12px; }
.pv-credits ul { margin: 6px 0; padding-left: 18px; }
/* slice 14: moving previews on template cards and style tiles; a ticked template is outlined with a check */
.recipe { position: relative; }
.recipe video.pv, .look video.pv { display: block; width: 100%; height: auto; margin: 0; aspect-ratio: 3 / 4; /* not the player's dialog video height */ object-fit: cover; border-radius: 10px; background: var(--line); margin-bottom: 6px; }
.recipe.on { border-color: var(--n-accent-fg); background: var(--n-accent-soft); box-shadow: 0 0 0 1px var(--n-accent-fg); }
.recipe.on::after { content: "✓"; position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--n-accent); color: var(--n-accent-ink); font-weight: 700; text-align: center; line-height: 24px; }
.looks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 12px; }
label.look { position: relative; display: block; margin: 0; padding: 6px; border: 1px solid var(--n-line-soft); border-radius: 12px; background: var(--panel); font-size: 12px; line-height: 1.4; color: var(--text); cursor: pointer; }
label.look input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.look:has(input:checked) { border-color: var(--n-accent-fg); background: var(--n-accent-soft); box-shadow: 0 0 0 1px var(--n-accent-fg); }
label.look:has(input:focus-visible) { outline: 2px solid var(--n-accent-fg); outline-offset: 2px; }
label.chip.block { display: flex; margin: 8px 0; }
/* the งาน tab's unfinished clips: one compact row each (a phone page of 13 big tiles was 10,000 px long) */
.worklist { padding: 0; }
.worklist a.row { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; color: var(--text); text-decoration: none; border-top: 1px solid var(--n-line-soft); }
.worklist a.row:first-child { border-top: 0; }
.worklist a.row .grow { min-width: 0; overflow-wrap: anywhere; } /* the title and the project line: a 48-letter name pushed the page sideways (DOD-4 check PH-1) */
.worklist .error { display: block; overflow-wrap: anywhere; }
/* a file's credit can hold a long web address: it wraps anywhere so the file table fits a phone (re-check R14-3) */
.credit-line { overflow-wrap: anywhere; word-break: break-word; }
.note { background: color-mix(in srgb, var(--warn) 14%, transparent); padding: 8px 10px; border-radius: 10px; }
.ok-text { color: var(--ok); }
.nw { white-space: nowrap; }
/* long session labels and file names wrap instead of pushing the files table past a phone's width */
.tag.wrap { white-space: normal; overflow-wrap: anywhere; } /* a long project name with no spaces (DOD-2 check: a Latin one pushed the phone page sideways) */
td b { overflow-wrap: anywhere; }
/* the beats board */
.beat { padding: 12px 14px; margin: 0 0 10px; }
#view.busy [data-act]:not([data-act="play"]), #view.busy #approve { opacity: .5; pointer-events: none; }
.beat.dropped { opacity: .6; border-style: dashed; }
.beat-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 700; }
.beat.dropped .beat-n { background: var(--bar); color: var(--muted); }
.beat-text { margin: 8px 0; font-size: 16px; line-height: 1.6; }
.board-head { margin-bottom: 12px; }
.fails { margin: 10px 0 0; padding-left: 18px; color: var(--bad); }
.fails li { margin: 0 0 6px; }
.fails .muted, .warns .muted { display: block; font-size: 12px; }
.warns { margin: 10px 0 0; padding-left: 18px; color: var(--warn); }
.warns li { margin: 0 0 6px; }
#auto { width: min(640px, 96vw); }
/* ซีรีส์อัตโนมัติ (DECISIONS 2026-10-07): the setup dialog's fields and the episodes list on the project page */
#series { width: min(640px, 96vw); }
.field { margin: 0 0 14px; }
.field .error:empty { display: none; }
/* the topic shows only visually shortened (never cut in the saved data): two lines, then an ellipsis */
.topic-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-row { margin: 0 0 10px; overflow-wrap: anywhere; }
#series-card b { overflow-wrap: anywhere; }
dialog form > .row:first-child { margin-bottom: 8px; } /* a dialog's title row (สร้างอัตโนมัติ, ซีรีส์) and its first field */
.ep-row .ep-actions { margin-top: 8px; }
/* fix round 4: the writer's fact lines (DECISIONS 2026-10-07) and the copy-post-text fallback box (SC-6) */
.claims { margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 12%, transparent); }
.claims ul { margin: 4px 0 0; padding-left: 18px; }
.claims li { margin: 0 0 4px; }
.post-box { margin-top: 8px; }
.post-box textarea { font-size: 13px; }
/* long voice and music lists stay a fixed height so the setup dialog does not grow past a few screens */
.voice-list, .music-list { max-height: 220px; overflow: auto; border: 1px solid var(--n-line-soft); border-radius: 12px; padding: 6px; margin-bottom: 4px; }
.voice-list label.chip, .music-list label.chip { display: flex; width: 100%; margin: 2px 0; }
.code.prompt { font-family: inherit; word-break: normal; overflow-wrap: anywhere; font-size: 15px; padding: 10px 12px; } /* a monospace font split Thai words */
#wizard .drop { margin: 8px 0 4px; padding: 20px; }
/* step 2: one clear choice, new or existing project */
.where { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.choice { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; margin: 0; padding: 12px 14px; border: 1px solid var(--n-line-soft); border-radius: 14px; background: var(--panel); color: var(--text); cursor: pointer; }
.choice input { width: auto; margin: 0; grid-row: span 2; } /* the dot sits left of the title and its note */
.choice:has(input:checked) { border-color: var(--n-accent-fg); background: var(--n-accent-soft); }
.plist-pick { display: grid; gap: 8px; max-height: 46vh; overflow: auto; margin: 8px 0; }
.row-choice b { overflow-wrap: anywhere; }
.dest { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--bar); }
.dest b { overflow-wrap: anywhere; }
@media (max-width: 420px) { .where { grid-template-columns: 1fr; } }
/* the player's versions and ปรับเอง panel (slice 13): the video shrinks while the panel is open so both fit a phone */
#player { max-height: 96dvh; overflow: auto; width: min(520px, 96vw); }
#player:has(#tweak:not([hidden])) video { height: min(38dvh, 420px); }
#versions { margin: 0 0 10px; gap: 6px; }
#player-title { display: block; font-size: 16px; overflow-wrap: anywhere; }
#tweak { border-top: 1px solid var(--n-line-soft); padding: 12px 0 0; margin: 0 0 12px; }
#tweak input[type=range] { padding: 4px 0; min-height: 24px; border: 0; background: none; } /* a 24 px tap box around the 16 px native slider (DOD-4 check PH-2) */
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--n-muted); }
img.preview { display: block; width: min(100%, 300px); margin: 8px auto 0; border-radius: 10px; }
@media (max-width: 600px) { button.big { width: 100%; } }
/* the clip picker's whole-library part (DOD-3) */
.flib { margin: 4px 0 12px; }
.flib [data-flib] { white-space: normal; text-align: left; } /* its long label wraps inside a phone's sheet (look-test: 389 px at 375) */
.flib h4 .small { font-weight: normal; }

/* ---- DOD-3 (jobs/ux/plan.md): the footage library, the create sheet, the selection bar and the phone's bottom tab bar, in the
   approved mock-up's look (jobs/ux/mock-v1.html). Its tokens, prefixed --n-, are the whole app's palette since DOD-4 (the older
   names at the top of this file alias them). New markup takes v- classes inside the .nx reset, so no older rule (button, label,
   .tile, .chip, .recipe, .grow, dialog video ...) reaches it (LEARNINGS E64). Contrast: --n-muted, --n-faint, --n-ok, --n-warn and
   --n-danger 4.5:1 or more on panel, raised and bg in both themes (light --n-ok #1a7040: 5.3 on raised); --n-accent-fg is the
   accent as text (the teal fill fails as text on white). ---- */
:root {
  --n-bg: #f4f5f7; --n-panel: #ffffff; --n-raised: #eceef2; --n-line: #d3d8df; --n-line-soft: #e2e5ea;
  --n-text: #111318; --n-muted: #4b5260; --n-faint: #5b6270; --n-sw-off: #8a919c;
  --n-accent: #35e3c6; --n-accent-ink: #06201b; --n-accent-soft: rgba(53, 227, 198, .2); --n-accent-fg: #0a6b5c;
  --n-primary: #111318; --n-primary-ink: #ffffff; --n-ok: #1a7040; --n-warn: #8a5a00; --n-danger: #b42318;
  --n-tabbar: rgba(255, 255, 255, .96); --n-shadow: 0 12px 30px rgba(17, 19, 24, .18);
  --n-font: "Noto Sans Thai", "Leelawadee UI", "Sukhumvit Set", system-ui, sans-serif;
  --n-num: "Manrope", "Noto Sans Thai", "Leelawadee UI", system-ui, sans-serif;
  --n-tab-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --n-bg: #0c0d10; --n-panel: #15171c; --n-raised: #1e2127; --n-line: #2a2e36; --n-line-soft: #22262d;
    --n-text: #f3f4f6; --n-muted: #9aa1ad; --n-faint: #8b93a1; --n-sw-off: #3a3f49;
    --n-accent-soft: rgba(53, 227, 198, .14); --n-accent-fg: #35e3c6;
    --n-primary: #ffffff; --n-primary-ink: #0c0d10; --n-ok: #3ed598; --n-warn: #f5b944; --n-danger: #ff6b6f;
    --n-tabbar: rgba(21, 23, 28, .96); --n-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  }
}
nb { white-space: nowrap; } tx { display: inline; } /* joinText's islands: custom names, so no "... span" rule or flex gap reaches them */
body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); } /* viewport-fit=cover: a landscape notch */
body.nx-page { background: var(--n-bg); color: var(--n-text); }
.nx { font-family: var(--n-font); color: var(--n-text); }
.nx button { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
.nx button:disabled { opacity: .45; cursor: default; }
.nx :focus-visible { outline: 2px solid var(--n-accent-fg); outline-offset: 2px; }
.nx input, .nx textarea { font: inherit; color: var(--n-text); background: var(--n-raised); border: 1px solid var(--n-line); border-radius: 10px; padding: 10px 12px; width: 100%; margin: 0; }
.nx input::placeholder, .nx textarea::placeholder { color: var(--n-faint); opacity: 1; }
.nx textarea { min-height: 112px; resize: vertical; }
.nx label { display: block; margin: 0; color: inherit; font-size: inherit; }
.nx h2, .nx h3, .nx h4, .nx p { margin: 0; }
.nx a { color: inherit; }
.nx svg.i, header nav svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nx .v-num { font-family: var(--n-num); font-variant-numeric: tabular-nums; }
.nx .v-name { overflow-wrap: anywhere; } /* a member-typed name with no spaces wraps rather than widen the page (BACKLOG UI2-1) */
.nx .v-grow { flex: 1; }

/* the header nav: ฟุตเทจ first and สร้างวิดีโอ at the end on a desktop; the bottom tab bar on a phone */
header nav svg.i, header nav .phone { display: none; }
header .v-plus { order: 9; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-size: 14px; border-radius: 10px; background: var(--n-accent); color: var(--n-accent-ink); }
header .v-plus svg.i { display: block; width: 18px; height: 18px; }
@media (max-width: 700px) {
  header { padding: 0; border: 0; background: none; display: block; }
  header > b, header .me { display: none; } /* the name and ออกจากระบบ are under เพิ่มเติม */
  header nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--n-tab-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    display: grid; grid-template-columns: 1fr 1fr 72px 1fr 1fr; align-items: center; gap: 0; max-width: none; flex-wrap: nowrap;
    background: var(--n-tabbar); border-top: 1px solid var(--n-line-soft); backdrop-filter: blur(10px); font-family: var(--n-font); }
  header nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%; padding: 0; border-radius: 0;
    font-size: 11px; line-height: 1.2; color: var(--n-muted); background: none; white-space: nowrap; text-decoration: none; }
  header nav a.on { background: none; color: var(--n-text); }
  header nav a.on svg.i { color: var(--n-accent-fg); }
  /* inset rings: the screen's own rounded corners must not cut them (mock-up round 3, rule 4) */
  header nav a:focus-visible { outline: 2px solid var(--n-accent-fg); outline-offset: -6px; border-radius: 14px; }
  header nav svg.i { display: block; }
  header nav .desk { display: none; }
  header nav .phone { display: flex; }
  header .v-plus { order: 0; width: 54px; height: 54px; margin: 0 auto; padding: 0; border: 0; border-radius: 18px; background: var(--n-primary); color: var(--n-primary-ink);
    display: grid; place-items: center; transform: translateY(-6px); box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
  header .v-plus span { display: none; } /* its name is the aria-label */
  header .v-plus svg.i { width: 26px; height: 26px; stroke-width: 2.6; }
  header .v-plus:focus-visible { outline: 2px solid var(--n-accent-fg); outline-offset: 3px; }
  body { padding-bottom: calc(var(--n-tab-h) + env(safe-area-inset-bottom, 0px)); }
  /* a control scrolled into view (Tab, a script) stops above the tab bar, not under it (DOD-4) */
  html { scroll-padding-bottom: calc(var(--n-tab-h) + 8px + env(safe-area-inset-bottom, 0px)); }
  #uploads { bottom: calc(var(--n-tab-h) + 12px + env(safe-area-inset-bottom, 0px)); }
  /* a page wider than the phone grows the layout viewport and pushes the fixed tab bar off the screen (the team table: an email
     with no break point made it 409 px at 375; a project name with no spaces in the project page's heading, BACKLOG UI2-1) */
  .page td, .page h2, .page h3, .page .tile b { overflow-wrap: anywhere; }
}

/* the library */
.nx .v-top { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0 0 10px; }
.nx .v-top h2 { font: 700 22px/1.3 var(--n-font); flex: 1; min-width: 0; outline: none; }
.nx .v-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--n-raised); color: var(--n-text); flex: none; }
.nx .v-icon.on { background: var(--n-accent-soft); color: var(--n-accent-fg); }
.nx .v-search { display: flex; align-items: center; gap: 8px; background: var(--n-raised); border: 1px solid var(--n-line-soft); border-radius: 12px; padding: 2px 12px; color: var(--n-muted); margin: 0 0 10px; }
.nx .v-search input { background: none; border: 0; padding: 9px 0; border-radius: 0; }
.nx .v-search input:focus-visible { outline: none; }
.nx .v-search:focus-within { outline: 2px solid var(--n-accent-fg); outline-offset: 2px; }
.nx .v-err { color: var(--n-danger); font-size: 13px; margin: 0 0 8px; overflow-wrap: anywhere; }
.nx .v-err:empty { display: none; }
.nx .v-err .v-retry { padding: 4px 12px; font-size: 13px; margin-left: 4px; min-height: 28px; vertical-align: middle; } /* ลองใหม่ beside a failure (DOD-5 PH-1) */
#poll-err { position: sticky; top: 8px; z-index: 6; margin: 0 0 12px; } /* a poll that failed: seen while scrolled (DOD-5 PR-3) */
#poll-err .v-err { margin: 0; padding: 10px 14px; }
.nx .v-chips { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.nx .v-chips::-webkit-scrollbar { display: none; }
.nx .v-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--n-raised); color: var(--n-muted); font-size: 13px; line-height: 1.35; border: 1px solid transparent; white-space: nowrap; }
.nx .v-chip .v-name { white-space: normal; max-width: min(60vw, 260px); }
.nx .v-chip.on { background: var(--n-accent-soft); color: var(--n-accent-fg); border-color: var(--n-accent-fg); }
.nx .v-chip:focus-visible { outline-offset: -2px; }
.nx .v-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.nx .v-hint { display: flex; align-items: flex-start; gap: 10px; background: var(--n-panel); border: 1px solid var(--n-line-soft); border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.5; color: var(--n-muted); margin: 0 0 12px; }
.nx .v-hint > svg { color: var(--n-accent-fg); }
.nx .v-hint > div { flex: 1; min-width: 0; }
.nx .v-hint b { color: var(--n-text); font-weight: 500; }
.nx .v-hint > button { color: var(--n-accent-fg); flex: none; font-weight: 700; padding: 2px 4px; }
.nx .v-hint.task { border-color: var(--n-accent-fg); }
.nx .v-sec { display: flex; align-items: baseline; gap: 4px 8px; margin: 6px 0 10px; flex-wrap: wrap; }
.nx .v-sec h3 { font: 700 15px/1.4 var(--n-font); display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.nx .v-sec h3 .v-dot { align-self: center; }
.nx .v-cnt { color: var(--n-faint); font-size: 12px; }
.nx .v-sec .v-act { margin-left: auto; color: var(--n-accent-fg); font-size: 13px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; } /* a 24 px target (DOD-5 PH-4) */
.nx .v-sec .v-act.quiet { color: var(--n-faint); font-weight: 400; }
.nx .v-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 18px; }
@media (min-width: 701px) { .nx .v-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; } }
.nx .v-tile { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #2a2e36; color: #fff; text-align: left; } /* a media tile is dark in both themes */
.nx .v-tile:focus-visible { outline: 3px solid var(--n-accent-fg); outline-offset: -3px; }
.nx .v-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.nx .v-sign { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .55); padding-bottom: 18%; }
.nx .v-sign svg.i { width: 30px; height: 30px; stroke-width: 1.6; }
/* the words sit on a near-black band: white text keeps 7:1 even over a white poster */
.nx .v-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, .64) 56%, rgba(0, 0, 0, .9)); }
.nx .v-tile.on .v-scrim { background: linear-gradient(180deg, rgba(53, 227, 198, .18) 0%, rgba(0, 0, 0, .64) 56%, rgba(0, 0, 0, .9)); }
.nx .v-tile.on::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 3px var(--n-accent); pointer-events: none; }
.nx .v-words { position: absolute; left: 7px; right: 7px; bottom: 6px; font-size: 11px; line-height: 1.35; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.nx .v-words.fname { -webkit-line-clamp: 3; }
.nx .v-kind { position: absolute; left: 6px; top: 6px; width: 20px; height: 20px; border-radius: 6px; background: rgba(0, 0, 0, .6); display: grid; place-items: center; color: #fff; }
.nx .v-kind svg.i { width: 13px; height: 13px; }
.nx .v-dur { position: absolute; left: 30px; top: 6px; font-size: 11px; font-weight: 600; line-height: 1; background: rgba(0, 0, 0, .72); color: #fff; padding: 4px 6px; border-radius: 6px; }
.nx .v-pdot { position: absolute; left: 6px; top: 32px; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .55); }
.nx .v-shared { position: absolute; left: 6px; top: 32px; font-size: 10px; line-height: 1.4; background: var(--n-accent); color: var(--n-accent-ink); padding: 1px 6px; border-radius: 5px; font-weight: 700; }
.nx .v-tick { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9); background: rgba(0, 0, 0, .35);
  display: grid; place-items: center; font-size: 12px; font-weight: 800; line-height: 1; color: var(--n-accent-ink); opacity: 0; transform: scale(.8); transition: opacity .12s, transform .12s; }
.nx .v-picking .v-tick, .nx .v-tile.on .v-tick { opacity: 1; transform: none; }
.nx .v-tile.on .v-tick { background: var(--n-accent); border-color: var(--n-accent); }
.nx .v-tile.up .v-scrim { background: rgba(0, 0, 0, .55); }
.nx .v-tile.bad .v-sign { color: #fff; }
.nx .v-ring { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 14%; }
.nx .v-ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.nx .v-ring circle { fill: none; stroke-width: 4; }
.nx .v-ring .bg { stroke: rgba(255, 255, 255, .28); }
.nx .v-ring .fg { stroke: var(--n-accent); stroke-dasharray: 113; transition: stroke-dashoffset .3s linear; }
.nx .v-state { position: absolute; left: 6px; right: 6px; bottom: 6px; font-size: 11px; line-height: 1.3; color: #fff; text-align: center; overflow-wrap: anywhere; }
.nx .v-empty { color: var(--n-muted); font-size: 14px; padding: 28px 8px; text-align: center; display: grid; gap: 14px; justify-items: center; }

/* the selection bar: above the tab bar on a phone, centred at the bottom on a desktop; its second line wraps (never cut) */
.v-selbar { position: fixed; z-index: 15; left: calc(12px + env(safe-area-inset-left, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); bottom: 16px;
  background: var(--n-raised); border: 1px solid var(--n-line); border-radius: 18px; padding: 10px 12px; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--n-shadow); transform: translateY(calc(100% + 120px)); transition: transform .22s ease; pointer-events: none; }
.v-selbar.show { transform: none; pointer-events: auto; }
@media (max-width: 700px) { .v-selbar { bottom: calc(var(--n-tab-h) + 10px + env(safe-area-inset-bottom, 0px)); } }
@media (min-width: 701px) { .v-selbar { left: 50%; right: auto; width: min(640px, calc(100vw - 48px)); transform: translate(-50%, calc(100% + 40px)); } .v-selbar.show { transform: translateX(-50%); } }
.nx .v-thumbs { display: flex; flex: none; }
.nx .v-thumbs i { width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--n-raised); margin-left: -10px; display: block; background: var(--n-line) center / cover no-repeat; }
.nx .v-thumbs i:first-child { margin-left: 0; }
@media (max-width: 400px) { .nx .v-thumbs { display: none; } } /* the count and the project line come first on a narrow phone */
.v-selbar.add .v-thumbs { display: none; }
.nx .v-txt { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; }
.nx .v-txt b { display: block; font-weight: 700; }
.nx .v-where { display: block; color: var(--n-muted); font-size: 12px; overflow-wrap: anywhere; }
.nx .v-clear { color: var(--n-muted); font-size: 13px; padding: 8px 6px; flex: none; }
.nx .v-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: 15px; line-height: 1.3; white-space: nowrap; text-decoration: none; }
.nx .v-btn.primary { background: var(--n-primary); color: var(--n-primary-ink); }
.nx .v-btn.accent { background: var(--n-accent); color: var(--n-accent-ink); }
.nx .v-btn.ghost { background: var(--n-raised); color: var(--n-text); }
.nx .v-btn.line { border: 1px solid var(--n-line); color: var(--n-text); }
.nx .v-btn.block { width: 100%; }
.nx .v-btn svg.i { width: 18px; height: 18px; }

/* the create sheet: a bottom sheet on a phone, a centred dialog on a desktop */
dialog.v-sheet { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--n-text); max-width: 100%; max-height: 100%; overflow: visible; }
dialog.v-sheet::backdrop { background: rgba(0, 0, 0, .55); }
.nx .v-pane { background: var(--n-panel); display: flex; flex-direction: column; max-height: 92dvh; overflow: hidden; }
@media (max-width: 700px) {
  dialog.v-sheet { width: 100%; margin: auto 0 0; }
  .nx .v-pane { border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: v-up .22s ease; }
}
@media (min-width: 701px) { dialog.v-sheet { width: min(600px, calc(100vw - 48px)); margin: auto; } .nx .v-pane { border-radius: 18px; max-height: min(88dvh, 880px); } .nx .v-grip { display: none; } }
@keyframes v-up { from { transform: translateY(40px); opacity: 0; } }
.nx .v-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--n-line); margin: 10px auto 2px; flex: none; }
.nx .v-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px 10px; flex: none; }
.nx .v-head h3 { font: 700 18px/1.35 var(--n-font); flex: 1; min-width: 0; outline: none; }
.nx .v-head .v-icon { width: 38px; height: 38px; border-radius: 10px; }
.nx .v-steps { display: flex; gap: 6px; padding: 0 16px 12px; flex: none; }
.nx .v-steps i { flex: 1; height: 3px; border-radius: 2px; background: var(--n-line); }
.nx .v-steps i.on { background: var(--n-accent); }
.nx .v-body { overflow-y: auto; padding: 2px 16px 16px; flex: 1; min-height: 0; overscroll-behavior: contain; }
.nx .v-foot { padding: 10px 16px 14px; border-top: 1px solid var(--n-line-soft); flex: none; }
.nx .v-foot .v-row { display: flex; gap: 10px; }
.nx .v-lead { color: var(--n-muted); font-size: 13px; line-height: 1.5; margin: 0 0 12px; }
.nx .v-lead b { color: var(--n-text); font-weight: 500; }
.nx .v-recipes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 701px) { .nx .v-recipes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.nx .v-recipe { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 112px; text-align: left; background: var(--n-raised); border: 1px solid transparent; border-radius: 14px; padding: 12px 12px 10px; }
.nx .v-recipe:focus-visible { outline-offset: -4px; }
.nx .v-recipe .v-ico { font-size: 22px; line-height: 1.2; }
.nx .v-recipe b { font-size: 14px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; padding-right: 18px; }
.nx .v-recipe .v-desc { color: var(--n-muted); font-size: 12px; line-height: 1.45; }
.nx .v-recipe .v-meta { color: var(--n-muted); font-size: 11px; line-height: 1.4; margin-top: auto; }
.nx .v-recipe.on { border-color: var(--n-accent-fg); background: var(--n-accent-soft); }
.nx .v-recipe .v-tk { position: absolute; right: 10px; top: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--n-accent); color: var(--n-accent-ink); display: none; place-items: center; }
.nx .v-recipe.on .v-tk { display: grid; }
.nx .v-recipe .v-tk svg.i { width: 12px; height: 12px; stroke-width: 3; }
.nx .v-looks { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; }
.nx .v-looks::-webkit-scrollbar { display: none; }
.nx .v-look { flex: none; width: 96px; text-align: left; }
.nx .v-look .v-pv { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: 10px; background: var(--n-raised); border: 2px solid transparent; overflow: hidden; }
.nx .v-look video.pv { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; margin: 0; border-radius: 0; background: none; }
.nx .v-look.on .v-pv { border-color: var(--n-accent); }
.nx .v-look b { display: block; font-size: 12px; font-weight: 500; line-height: 1.4; margin-top: 6px; }
.nx .v-look.on b { color: var(--n-accent-fg); font-weight: 700; }
.nx .v-field { margin: 0 0 14px; }
.nx .v-field > span { display: block; color: var(--n-muted); font-size: 13px; line-height: 1.45; margin: 0 0 6px; }
.nx .v-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.nx .v-seg button { padding: 7px 12px; border-radius: 10px; background: var(--n-raised); color: var(--n-muted); font-size: 13px; font-weight: 600; }
.nx .v-seg button.on { background: var(--n-text); color: var(--n-bg); }
.nx .v-seg + input { margin-top: 8px; }
.nx .v-toggle { display: flex; align-items: center; gap: 12px; background: var(--n-raised); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; }
.nx .v-toggle .v-t { flex: 1; min-width: 0; }
.nx .v-toggle .v-t b { display: block; font-weight: 500; font-size: 14px; }
.nx .v-toggle .v-t span { color: var(--n-muted); font-size: 12px; }
.nx .v-sw { width: 46px; height: 28px; border-radius: 14px; background: var(--n-sw-off); position: relative; flex: none; transition: background .15s; }
.nx .v-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); transition: transform .15s; }
.nx .v-sw.on { background: var(--n-accent); }
.nx .v-sw.on::after { transform: translateX(18px); }
.nx .v-dest { background: var(--n-raised); border-radius: 12px; padding: 12px; margin: 0 0 6px; }
.nx .v-dest .v-row { display: flex; align-items: center; gap: 10px; }
.nx .v-dest .v-row > svg { color: var(--n-muted); }
.nx .v-dest .v-row b { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.nx .v-dest .v-row button { color: var(--n-accent-fg); font-size: 13px; font-weight: 700; flex: none; padding: 4px; }
.nx .v-note { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--n-muted); overflow-wrap: anywhere; }
.nx .v-note.warn { color: var(--n-warn); }
.nx .v-note a { color: var(--n-accent-fg); }
.nx .v-choices { display: grid; gap: 6px; margin-top: 10px; }
.nx .v-choices button { display: flex; gap: 8px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 10px; background: var(--n-panel); border: 1px solid var(--n-line-soft); font-size: 13px; line-height: 1.4; }
.nx .v-choices button.on { border-color: var(--n-accent-fg); box-shadow: 0 0 0 1px var(--n-accent-fg); }
.nx .v-choices button .v-name { flex: 1; min-width: 0; }
.nx .v-choices button svg.i { color: var(--n-accent-fg); width: 18px; height: 18px; }
.nx .v-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 14px; }
.nx .v-strip i { flex: none; width: 56px; height: 56px; border-radius: 10px; display: grid; place-items: center; color: rgba(255, 255, 255, .6); background: #2a2e36 center / cover no-repeat; }
.nx .v-summary { background: var(--n-raised); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; margin: 0 0 14px; font-size: 14px; }
.nx .v-summary div { display: flex; gap: 12px; }
.nx .v-summary span { color: var(--n-muted); width: 96px; flex: none; font-size: 13px; }
.nx .v-summary b { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.nx .v-prompt { background: var(--n-bg); border: 1px dashed var(--n-line); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.6; color: var(--n-text); margin: 0 0 12px; user-select: text; overflow-wrap: anywhere; }
.nx .v-done { text-align: center; padding: 10px 0 12px; }
.nx .v-ok { width: 56px; height: 56px; border-radius: 50%; background: var(--n-accent-soft); color: var(--n-accent-fg); display: grid; place-items: center; margin: 0 auto 10px; }
.nx .v-ok svg.i { width: 28px; height: 28px; stroke-width: 2.6; }
.nx .v-done h4 { font-size: 18px; margin: 0 0 4px; }
.nx .v-done p { color: var(--n-muted); font-size: 13px; line-height: 1.5; }
.nx .v-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nx .v-big { display: flex; flex-direction: column; gap: 6px; min-height: 132px; text-align: left; background: var(--n-raised); border: 1px solid transparent; border-radius: 16px; padding: 16px 14px; }
.nx .v-big:focus-visible { outline-offset: -4px; }
.nx .v-big svg.i { width: 28px; height: 28px; color: var(--n-accent-fg); }
.nx .v-big b { font-size: 15px; }
.nx .v-big span { color: var(--n-muted); font-size: 12px; line-height: 1.45; }
.nx .v-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.nx .v-btns .v-btn { white-space: normal; text-align: center; }
.nx .v-okline { color: var(--n-accent-fg); font-size: 13px; margin: 8px 0 0; }
.nx .v-okline:empty { display: none; }
/* the toast: at the top, clear of the selection bar and the sheets' buttons; inside the sheet while it is open */
.v-toast { position: fixed; z-index: 40; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -10px); width: max-content; max-width: min(90vw, 520px);
  background: var(--n-text); color: var(--n-bg); padding: 10px 14px; border-radius: 12px; font: 500 13px/1.5 var(--n-font); opacity: 0; transition: opacity .2s, transform .2s;
  pointer-events: none; text-align: center; box-shadow: var(--n-shadow); overflow-wrap: anywhere; }
.v-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 700px) { #toast { top: calc(64px + env(safe-area-inset-top, 0px)); } } /* under the page title and its buttons */
/* เพิ่มเติม */
.nx .v-who { color: var(--n-muted); font-size: 13px; margin: 0 0 12px; }
.nx .v-who b { color: var(--n-text); font-weight: 500; }
.nx .v-list { display: grid; gap: 6px; }
.nx .v-list a, .nx .v-list button { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--n-panel); border: 1px solid var(--n-line-soft); border-radius: 12px; padding: 12px 14px; text-align: left; font-size: 15px; color: var(--n-text); text-decoration: none; }
.nx .v-list svg.i:first-child { color: var(--n-accent-fg); }
.nx .v-list span { flex: 1; min-width: 0; }
.nx .v-list small { display: block; color: var(--n-faint); font-size: 12px; }
.nx .v-list .chev { color: var(--n-faint); }
/* Public rendering and owner project assignments reuse the editor's cards and form controls. */
.nx .project-grants { min-width: 210px; max-width: 360px; display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.nx .project-grants legend { color: var(--n-muted); }
.project-grants label, label.switch { display: flex; align-items: flex-start; gap: 7px; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.project-grants input, label.switch input { flex: none; width: auto; margin-top: 3px; }
.nx.v-render { max-width: 760px; margin: 0 auto; }
.nx.v-render fieldset { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; }
.nx.v-render fieldset > label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: start; line-height: 1.5; }
.nx.v-render fieldset > label small { grid-column: 2; color: var(--n-muted); font-size: 12px; }
.nx.v-render input[type=radio] { width: auto; padding: 0; margin-top: 4px; }
.nx.v-render .button { color: var(--n-primary-ink); margin-top: 10px; }
.nx.v-render form.section { display: grid; gap: 10px; margin: 14px 0; }
.nx .v-device-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.nx .v-device-list li { display: flex; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--n-line-soft); }
.nx .v-device-list li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.nx .v-device-list small { display: block; color: var(--n-muted); font-size: 12px; }
/* the five-Tab rule (DOD-4): while files are ticked, the tile with focus is followed by this button; Tab, then Enter, reaches the bar */
.nx .v-skip { position: fixed; z-index: 16; left: 50%; bottom: 120px; transform: translateX(-50%); background: var(--n-text); color: var(--n-bg); padding: 8px 14px; border-radius: 12px; font-size: 13px; font-weight: 700; white-space: nowrap; opacity: 0; pointer-events: none; }
.nx .v-skip:focus { opacity: 1; pointer-events: auto; }
@media (max-width: 700px) { .nx .v-skip { bottom: calc(var(--n-tab-h) + 120px + env(safe-area-inset-bottom, 0px)); } }
/* ---- DOD-6 (jobs/ux/plan.md): a footage record's page (#file-<id>) in the library's look: cards on --n-panel with 14 px radii, the
   time bar in the tokens' colours (pauses --n-line, loud --n-warn, shake --n-danger hatched, cuts --n-muted); its ⓘ on a library tile ---- */
.nx .v-cell { position: relative; min-width: 0; }
.nx .v-info { position: absolute; right: 4px; bottom: 4px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .62); color: #fff; }
.nx .v-info:hover { background: rgba(0, 0, 0, .85); }
.nx .v-info svg.i { width: 18px; height: 18px; }
.nx .v-cell .v-words { right: 34px; } /* the words end before the ⓘ */
.nx.v-record { max-width: 860px; margin: 0 auto; }
.nx.v-record .v-top { flex-wrap: wrap; align-items: flex-start; }
.nx.v-record .v-top h2 { margin-top: 5px; } /* level with the 40 px back button */
.nx .v-acts { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nx .v-acts .v-btn { padding: 8px 12px; font-size: 13px; gap: 6px; }
.nx .v-acts .v-btn svg.i { width: 16px; height: 16px; }
@media (max-width: 420px) { .nx .v-acts .v-btn svg.i { display: none; } } /* the three buttons on one row on a phone */
.nx .v-built { flex-basis: 100%; color: var(--n-muted); font-size: 12px; }
.nx .v-card { background: var(--n-panel); border: 1px solid var(--n-line-soft); border-radius: 14px; padding: 16px; margin: 0 0 12px; min-width: 0; overflow-wrap: anywhere; }
.nx .v-card h3, .nx .v-recfoot h3 { font: 700 16px/1.4 var(--n-font); margin: 0 0 10px; }
.nx .v-card h4 { font: 700 14px/1.4 var(--n-font); margin: 14px 0 6px; }
.nx .v-ch { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 10px; }
.nx .v-ch h3 { margin: 0; }
.nx .v-dl { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14px; line-height: 1.55; }
.nx .v-dl dt { color: var(--n-muted); font-size: 13px; overflow-wrap: anywhere; }
.nx .v-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.nx .v-md + .v-dl { margin-top: 10px; }
.nx .v-sum { font-size: 15px; line-height: 1.65; margin: 0 0 10px; overflow-wrap: anywhere; }
.nx .v-plink { display: inline-block; padding: 2px 0; color: var(--n-accent-fg); font-weight: 500; }
.nx .v-facts { display: grid; gap: 14px; }
.nx .v-poster { display: block; width: 100%; max-height: 160px; object-fit: contain; background: #2a2e36; border-radius: 10px; }
@media (min-width: 701px) { .nx .v-facts.has-p { grid-template-columns: 200px minmax(0, 1fr); align-items: start; } .nx .v-poster { max-height: 260px; } }
.nx .v-md { font-size: 14px; line-height: 1.6; min-width: 0; }
.nx .v-md:empty { display: none; }
.nx .v-md p, .nx .v-md ul, .nx .v-md ol { margin: 0 0 8px; }
.nx .v-md ul, .nx .v-md ol { padding-left: 20px; }
.nx .v-md :is(h3, h4, h5, h6) { font: 700 14px/1.4 var(--n-font); margin: 12px 0 6px; }
.nx .v-md code { font-family: Consolas, ui-monospace, monospace; font-size: 13px; background: var(--n-raised); padding: 0 4px; border-radius: 4px; }
.nx .v-twrap { overflow-x: auto; margin: 0 0 8px; }
.nx .v-record .v-note a { display: inline-block; padding: 4px 0; color: var(--n-accent-fg); }
.nx .v-mlist { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 8px; }
.nx .v-mlist li { display: flex; align-items: baseline; gap: 10px; font-size: 14px; line-height: 1.55; }
.nx .v-mt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.nx .v-time { flex: none; display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.5; padding: 1px 8px; border-radius: 999px; background: var(--n-raised); color: var(--n-text); white-space: nowrap; }
.nx [data-kind="hook"] .v-time { background: var(--n-accent-soft); color: var(--n-accent-fg); }
.nx [data-kind="avoid"] .v-time { color: var(--n-danger); }
.nx [data-kind="doubt"] .v-time { color: var(--n-warn); }
.nx .v-tbar { position: relative; height: 44px; margin: 4px 0 2px; border-radius: 8px; background: var(--n-panel); box-shadow: inset 0 0 0 1px var(--n-line); overflow: hidden; }
.nx .v-tbar i { position: absolute; top: 0; bottom: 0; display: block; }
.nx .v-tp { background: var(--n-muted); opacity: .35; min-width: 2px; } /* a pause band: --n-line alone was 1.3:1 against the bar (the lead's call after the implementer's note) */
.nx .v-ts { min-width: 3px; background: repeating-linear-gradient(135deg, var(--n-danger) 0 2px, transparent 2px 7px); box-shadow: inset 0 0 0 1px var(--n-danger); }
/* a landscape shot that shakes once cropped to 9:16 (check UI-1): hatched the other way, in --n-warn */
.nx .v-tx { min-width: 3px; background: repeating-linear-gradient(45deg, var(--n-warn) 0 2px, transparent 2px 7px); box-shadow: inset 0 0 0 1px var(--n-warn); }
.nx .v-tj { min-width: 3px; background: radial-gradient(circle, var(--n-danger) 1.2px, var(--n-panel) 1.6px 2.4px, transparent 2.8px) center / 6px 6px; opacity: .7; } /* a steady shot with a few jumps: lighter, dotted; each dot ringed in the bar's colour, the grid centred, so a 3 px sliver's dot is seen over a cut tick (fix round 3c F3) */
.nx .v-tu { background: repeating-linear-gradient(90deg, var(--n-muted) 0 3px, transparent 3px 6px); } /* no shake entry */
.nx .v-tbar .v-tu { top: auto; height: 6px; min-width: 2px; }
.nx .v-tc { width: 2px; margin-left: -1px; background: var(--n-muted); }
.nx .v-tbar .v-tl { top: 2px; bottom: auto; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--n-warn); box-shadow: 0 0 0 1px var(--n-panel); }
.nx .v-axis { display: flex; justify-content: space-between; color: var(--n-muted); font-size: 12px; margin: 0 0 8px; }
.nx .v-legend { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--n-muted); font-size: 12px; }
.nx .v-legend li { display: inline-flex; align-items: center; gap: 6px; }
.nx .v-legend i { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 3px; }
.nx .v-legend .v-tc { width: 3px; margin: 0; }
.nx .v-legend .v-tl { width: 12px; height: 12px; border-radius: 50%; background: var(--n-warn); }
.nx .v-legend .v-tu { height: 6px; }
/* fix round 3b (UI2-2): each band keeps its shot's true extent (3 px floor), so the verdict is told by height as well as colour, for a
   member who cannot tell red from orange: สั่น the zone's full height, สั่นถ้าครอปเป็น 9:16 its upper half, กระตุก its lower half; the legend alike.
   Fix round 3c (F1): the loud dots have the bar's top 14 px to themselves (a 10 px dot 2 px down in a 1 px ring); the verdict zone is the 30 px
   under that lane, so no dot covers a band (GU Talk's crop slivers at 1:16.5 and 6:10.1 showed 30% and 43% of their paint at 375) */
.nx .v-tbar :is(.v-ts, .v-tx, .v-tj) { top: 14px; }
.nx .v-tbar .v-tx { bottom: 15px; }
.nx .v-tbar .v-tj { top: 29px; }
.nx .v-legend .v-tx { height: 7px; margin-bottom: 7px; }
.nx .v-legend .v-tj { height: 7px; margin-top: 7px; }
/* fix round 3d (PR3C-1): a band's sides stand on its shot's cut ticks, so on GU Talk's dense cuts a 3 px สั่น or crop sliver showed its colour
   over the ticks and the pauses with almost no brightness step (crop 1:16.5 at 1.17-1.56:1). In the bar each is ringed inside its box in the
   bar's colour, its colour line inside the ring (as the กระตุก dots are ringed): the ring stands out on the ticks, the colour on the bar; the
   last half px on the right stays in colour, so a sliver drawn past its end tick by the 3 px floor still shows there (EDGE's crop sliver
   beside a สั่น sliver: with the ring alone its own column was the ring on the bare bar, its height unread). The ring inside the colour
   line (the page reviewer's VA) left GU's 5:43.2 and 6:10.1 with no device px at 3:1 against the bar in light */
.nx .v-tbar .v-ts { box-shadow: inset -0.5px 0 var(--n-danger), inset 0 0 0 1px var(--n-panel), inset 0 0 0 2px var(--n-danger); }
.nx .v-tbar .v-tx { box-shadow: inset -0.5px 0 var(--n-warn), inset 0 0 0 1px var(--n-panel), inset 0 0 0 2px var(--n-warn); }
.nx .v-measuring { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--n-raised); color: var(--n-text); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.nx .v-lines { list-style: none; padding: 0; margin: 0; }
.nx .v-line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--n-line-soft); }
.nx .v-line:first-child { border-top: 0; padding-top: 0; }
.nx .v-line > .v-time { margin-top: 3px; }
.nx .v-say { min-width: 0; }
.nx .v-said { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; } /* every line whole: it wraps, never clamps */
.nx .v-gist { color: var(--n-muted); font-size: 13px; line-height: 1.5; margin-top: 2px; }
.nx .v-ltags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.nx .v-recfoot { color: var(--n-muted); font-size: 13px; line-height: 1.55; padding: 4px 4px 12px; overflow-wrap: anywhere; }
.nx #rec-legacy { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--n-line-soft); } /* the older notes after a re-log, apart from the current header (SR4-1) */
.nx .v-recfoot h3 { font-size: 13px; margin: 0 0 4px; }
.nx .v-recfoot .v-md { font-size: 13px; }
.nx .v-det { margin-top: 10px; border-top: 1px solid var(--n-line-soft); padding-top: 6px; }
.nx .v-det summary { cursor: pointer; color: var(--n-accent-fg); font-size: 13px; font-weight: 600; padding: 4px 0; }
.nx .v-det[open] summary { margin-bottom: 6px; }
.nx .v-skel i { display: block; height: 96px; border-radius: 14px; background: var(--n-raised); margin: 0 0 12px; animation: v-pulse 1.1s ease-in-out infinite alternate; }
.nx .v-skel i:first-child { height: 140px; }
@keyframes v-pulse { to { opacity: .45; } }
.nx .v-load { color: var(--n-muted); font-size: 13px; }
/* the AI's shots: a table on a desktop; on a phone the app's table-as-cards rule, each cell under its column's name */
.nx .v-mdt th { overflow-wrap: normal; }
@media (min-width: 701px) { .nx .v-mdt td:first-child { white-space: nowrap; } } /* a time range stays on one line */
@media (max-width: 700px) {
  #view .v-mdt td[data-l]:not([data-l=""]) { display: grid; grid-template-columns: 34% minmax(0, 1fr); gap: 10px; }
  .nx .v-mdt td[data-l]:not([data-l=""])::before { content: attr(data-l); color: var(--n-muted); font-size: 12px; font-weight: 500; line-height: 1.9; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { .nx *, .v-selbar, .v-toast, .nx .v-pane, dialog, .tile { transition: none !important; animation: none !important; } }
