/* Styled after the WDC Desktop v2.0 design system (BNIdirect):
   orange primary, neutral greys, teal navigation accent, pill buttons and badges. */
:root {
  --bg: #fafafa; --panel: #ffffff; --ink: #171717; --ink-2: #404040; --muted: #737373; --line: #e5e5e5; --line-2: #d4d4d4;
  --primary: #ff6b00; --primary-hover: #e66000; --primary-soft: #fff3eb; --primary-line: #ffc9a3;
  --teal: #006677; --teal-soft: #e6f3f5;
  --good: #067647; --good-soft: #ecfdf3; --good-line: #abefc6;
  --warn: #b54708; --warn-soft: #fffaeb; --warn-line: #fedf89;
  --bad: #d92d20; --bad-soft: #fef3f2; --bad-line: #fecdca;
  --data: #5925dc; --data-soft: #f4f3ff; --data-line: #d9d6fe;
  --grey-soft: #f5f5f5;
  --radius: 16px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/20px "TT Interphases Pro", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--bg); display: flex; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

/* sidebar: white, teal active item (WDC Sidebar Navigation) */
.nav { width: 232px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 20px 12px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; }
.nav .brand { padding: 4px 12px 24px; }
.nav .brand img { display: block; height: 28px; width: auto; }
.nav .brand small { display: block; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-2); margin-top: 8px; }
.nav a { color: var(--ink-2); font-weight: 500; padding: 10px 12px; border-radius: var(--radius-sm);
  display: flex; justify-content: space-between; align-items: center; }
.nav a:hover { background: var(--grey-soft); text-decoration: none; }
.nav a.on { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }

main { flex: 1; padding: 28px 32px 64px; min-width: 0; }
h1 { font-size: 24px; line-height: 32px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 16px; line-height: 24px; font-weight: 600; margin: 24px 0 10px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.kpi .n { font-size: 28px; line-height: 36px; font-weight: 600; }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi.warn .n { color: var(--primary); }
.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }
.bar { height: 8px; background: var(--grey-soft); border-radius: 9999px; overflow: hidden; margin: 6px 0 12px; }
.bar i { display: block; height: 100%; background: var(--teal); border-radius: 9999px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* buttons: pill, orange primary, grey secondary (WDC Button) */
button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2);
  padding: 8px 16px; border-radius: 9999px; cursor: pointer; white-space: nowrap; line-height: 20px; box-shadow: var(--shadow); }
button:hover, .btn:hover { background: var(--bg); text-decoration: none; }
button.primary, button.good, a.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button.primary:hover, button.good:hover, a.btn.primary:hover { text-decoration: none; background: var(--primary-hover); border-color: var(--primary-hover); }
button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
button.ghost:hover { background: var(--grey-soft); }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 12px;
  background: #fff; color: var(--ink); box-shadow: var(--shadow); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
textarea { width: 100%; resize: vertical; min-height: 40px; }

/* table: soft green header (WDC Table) */
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--ink-2); font-weight: 600; background: var(--good-soft); position: sticky; top: 0; }

/* badges: pill with border (WDC Badge) */
.tag { display: inline-block; font-size: 12px; line-height: 18px; padding: 0 8px; border-radius: 9999px; font-weight: 500;
  white-space: nowrap; background: var(--grey-soft); color: var(--ink-2); border: 1px solid var(--line); }
.tag.warn { background: var(--primary-soft); color: var(--primary-hover); border-color: var(--primary-line); }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.tag.good { background: var(--good-soft); color: var(--good); border-color: var(--good-line); }
.tag.data { background: var(--data-soft); color: var(--data); border-color: var(--data-line); }
.tag.grey { background: var(--grey-soft); color: var(--muted); }

/* tabs (pill segmented) */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; background: var(--grey-soft); padding: 4px;
  border-radius: 9999px; width: fit-content; max-width: 100%; }
.tabs button { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }

.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumb { flex: none; max-width: 220px; text-align: center; font-size: 11px; color: var(--muted); font-weight: 400; }
.thumb img { height: 140px; width: auto; max-width: 220px; min-width: 64px; object-fit: cover; object-position: top left;
  background: var(--grey-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); display: block; }
.thumb .ph { width: 92px; height: 140px; background: var(--grey-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.thumb span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.review-item { margin-bottom: 12px; }
.review-item .copy { font-size: 18px; line-height: 28px; font-weight: 600; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0; }
.dk-prog { margin-top: 12px; }
.dk-bar { height: 6px; border-radius: 3px; background: var(--grey-soft); overflow: hidden; }
.dk-bar i { display: block; height: 100%; background: var(--primary); transition: width .4s; }
.dg-wrap { max-height: 360px; overflow: auto; margin-top: 8px; }
.dg-t { width: 100%; border-collapse: collapse; }
.dg-t th, .dg-t td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dg-t th { position: sticky; top: 0; background: var(--panel); }
.compare > div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.key { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--muted); word-break: break-all; font-weight: 400; }
.tr { font-size: 13px; }
.tr b { display: inline-block; width: 26px; color: var(--muted); font-weight: 600; font-size: 11px; }
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.tree { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px;
  position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.tree div { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree div:hover { background: var(--grey-soft); }
.tree div.on { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.tree .f { font-weight: 700; cursor: default; background: none !important; }
.tree .p { padding-left: 16px; }
.tree .c { padding-left: 30px; font-size: 13px; color: var(--muted); }
.screen { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 20px; margin-bottom: 14px; }
.screen img, .screen .ph { width: 100%; max-height: 420px; object-fit: contain; object-position: top; background: var(--grey-soft);
  border: 1px solid var(--line); border-radius: var(--radius-sm); display: block; }
.ph { display: flex !important; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.drawer { position: fixed; top: 0; right: 0; width: min(720px, 100vw); height: 100vh; background: var(--panel);
  box-shadow: -12px 0 40px rgba(16, 24, 40, .12); overflow: auto; padding: 24px; z-index: 20; border-left: 1px solid var(--line); }
.modal { position: fixed; inset: 0; background: rgba(23, 23, 23, .5); z-index: 30; display: flex; align-items: flex-start;
  justify-content: center; padding: 40px 16px; overflow: auto; }
.modal-body { background: var(--panel); border-radius: var(--radius); width: min(920px, 100%); padding: 24px; }
.hidden { display: none !important; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 12px; z-index: 40; max-width: 80vw; font-weight: 500; }
.toast.err { background: var(--bad); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--primary);
  border-radius: 50%; animation: s 0.8s linear infinite; vertical-align: -2px; }
@keyframes s { to { transform: rotate(360deg); } }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.list-scroll { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 760px) {
  body { flex-direction: column; }
  .nav { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; }
  main { padding: 20px 16px; }
  .layout, .screen, .compare { grid-template-columns: 1fr; }
}
.lightbox { margin-top: 12px; background: var(--grey-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  text-align: center; max-height: calc(100vh - 220px); overflow: auto; }
.lightbox img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.merge-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  margin-top: 10px; cursor: pointer; }
.merge-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.merge-opt input { margin-top: 4px; accent-color: var(--primary); box-shadow: none; }
/* translate mode: spreadsheet */
.sheet-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: calc(100vh - 260px); }
.sheet { table-layout: fixed; }
.sheet th { position: sticky; top: 0; z-index: 1; }
.sheet td { padding: 0; border-right: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.sheet td:first-child, .sheet td:nth-child(2), .sheet td:last-child { padding: 6px 8px; }
.sheet td.src, .sheet td.ed, .sheet td.ro-cell { padding: 8px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; }
.sheet td.src { background: var(--bg); color: var(--ink-2); cursor: default; }
.sheet td.ed { cursor: text; outline: none; }
.sheet td.ed:empty::before { content: "—"; color: var(--line-2); }
.sheet td.ed:hover { background: #fffdf9; }
.sheet td.ed.editing { white-space: normal; overflow: visible; box-shadow: inset 0 0 0 2px var(--primary); background: #fff; }
.sheet td.ed.stale { background: var(--primary-soft); }
.sheet td.ed.saving { opacity: .6; }
.sheet td.ed.saved { background: var(--good-soft); transition: background .3s; }
.sheet select.ty { width: 100%; padding: 4px 6px; font-size: 12px; box-shadow: none; border-color: transparent; background: transparent;
  appearance: none; -webkit-appearance: none; cursor: pointer; }   /* reads as text; a box only on hover */
.sheet select.ty:hover, .sheet select.ty:focus { border-color: var(--line-2); background: #fff; }
.sheet .trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .where { padding: 4px 10px; font-weight: 500; }
/* screens: gallery + focus */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.scard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--ink);
  font-weight: 400; display: block; box-shadow: var(--shadow); }
.scard:hover { border-color: var(--primary-line); text-decoration: none; box-shadow: 0 4px 12px rgba(16,24,40,.08); }
.scard img, .scard .ph { width: 100%; height: 140px; object-fit: contain; object-position: top center; display: block; background: var(--grey-soft);
  border-bottom: 1px solid var(--line); }
.scard-body { padding: 10px 12px; }
.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus { display: grid; grid-template-columns: minmax(280px, 44%) 1fr; gap: 24px; align-items: start; }
.focus-shot { position: sticky; top: 16px; }
.focus-shot img { width: 100%; border: 1px solid var(--line); border-radius: 12px; display: block; background: var(--grey-soft); }
.reading { padding-left: 22px; margin: 0; }
.reading li { padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.reading li:hover { background: var(--bg); }
.reading .copy { font-size: 15px; font-weight: 500; }
@media (max-width: 900px) { .focus { grid-template-columns: 1fr; } .focus-shot { position: static; } .focus-shot img { max-height: 60vh; object-fit: contain; } }

#spage, #ssec { max-width: min(420px, 100%); }
/* lint marks in translate mode */
.sheet td.lint-block, .sheet td.lint-warn, .sheet td.lint-info { position: relative; }
.sheet td.lint-block::after, .sheet td.lint-warn::after, .sheet td.lint-info::after { content: ""; position: absolute; top: 0; right: 0;
  border-style: solid; border-width: 0 9px 9px 0; border-color: transparent var(--primary) transparent transparent; }
.sheet td.lint-block::after { border-right-color: var(--bad); }
.sheet td.lint-info::after { border-right-color: var(--line-2); }
.scard { position: relative; }
.scard-x { position: absolute; top: 6px; right: 6px; padding: 2px 10px; font-size: 12px; background: rgba(255,255,255,.92);
  border: 1px solid var(--line); opacity: 0; transition: opacity .15s; }
.scard:hover .scard-x { opacity: 1; }
.crop { display: block; position: relative; width: 300px; max-width: 100%; height: 160px; margin: 0 auto; background-color: var(--grey-soft);
  background-repeat: no-repeat; overflow: hidden; border-bottom: 1px solid var(--line); }
.crop.ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; width: 100%; }
.crop .hl { position: absolute; border: 2px solid var(--primary); border-radius: 4px; box-shadow: 0 0 0 2000px rgba(23,23,23,.18); pointer-events: none; }
.rule { margin-bottom: 12px; }
.rule.done { opacity: .65; }
.crumbs { font-size: 13px; color: var(--muted); }
h1 .h1-crumb { color: var(--muted); font-weight: 500; font-size: .72em; }   /* the parent (channel) in a stream's title line */
h1 a.h1-crumb:hover { color: var(--ink-2); }
.review-item .dev-edit { flex-basis: 100%; margin-top: 8px; }   /* "Write another…" on a developers' card */
.review-item .dev-edit textarea { width: 100%; font-size: 15px; }
.crumbs a { color: var(--ink-2); }
.stream { border-top: 1px solid var(--line); padding: 10px 0 4px; margin-top: 10px; }
.tabs a.btn.on { background: #fff; color: var(--ink); border-color: var(--line); }
.tabs a.btn { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.in-epic > h1, .in-epic > .row > h1, .in-epic > .sub { display: none; }
.where-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.where-grid .crop { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 4px; max-width: 100%; }
.lb-frame { position: relative; display: inline-block; max-width: 100%; }
.lb-frame img { display: block; max-width: 100%; height: auto; }
.lb-hl { position: absolute; border: 2px solid var(--primary); border-radius: 4px; box-shadow: 0 0 0 4px rgba(255,107,0,.18); pointer-events: none; }
.sheet td.src.ed { cursor: text; }
.sheet td.src.outdated { box-shadow: inset 3px 0 0 var(--primary); }
.crop-thumb { flex: none; width: 170px; font-size: 11px; color: var(--muted); text-align: center; }
.crop-thumb .crop { border: 1px solid var(--line); border-radius: 8px; margin: 0; }
.crop-thumb span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
/* one-click Track / Skip */
.seg { display: inline-flex; background: var(--grey-soft); border-radius: 9999px; padding: 3px; gap: 2px; }
.seg button { border: 1px solid transparent; background: transparent; box-shadow: none; color: var(--muted); padding: 4px 14px; font-weight: 600; }
.seg button.on[data-v="include"] { background: var(--primary); color: #fff; border-color: var(--primary); }
.seg button.on[data-v="exclude"] { background: #fff; color: var(--ink-2); border-color: var(--line-2); }
.seg button.hint { border: 1px dashed var(--primary); color: var(--primary); background: var(--primary-soft); }
.seg-hint { font-size: 11.5px; color: var(--muted); margin: 3px 0 0 10px; white-space: nowrap; }
.bulkbar { position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(16,24,40,.08); }
.review-item input.sel, td input.sel { width: 16px; height: 16px; accent-color: var(--primary); margin-right: 4px; }
/* export */
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.exp-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.exp-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.exp-opt input, .exp-chip input { accent-color: var(--primary); box-shadow: none; margin-top: 3px; }
.exp-chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 9999px; padding: 6px 12px; cursor: pointer; }
.exp-chip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 700px) { .exp-grid { grid-template-columns: 1fr; } }
/* signed-in user */
.nav .me { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.nav .me form { margin: 4px 0 0; }
.nav .me button { padding: 2px 0; text-align: left; }
.reading li { cursor: default; }
.toast-undo { margin-left: 12px; background: transparent; color: #ffb27a; border: 1px solid #ffb27a; padding: 2px 12px; box-shadow: none; }
.toast-undo:hover { background: rgba(255,255,255,.08); }

/* Developer details: keys are hidden for writers unless "Show developer details" is on.
   The drawer keeps its own folded section, so its keys stay visible inside it. */
body:not(.show-dev) .dev-only,
body:not(.show-dev) #main .key { display: none; }
.dev-details { margin: 12px 0; }
.dev-details > summary { cursor: pointer; padding: 6px 0; }
.dev-switch { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dev-switch input { box-shadow: none; }
.more-thumbs { align-self: center; font-size: 12px; padding: 4px 10px; }

/* AI translation drafts */
.tag.ai { background: var(--teal-soft); color: var(--teal); }
td.ed.aidraft { background: var(--teal-soft); box-shadow: inset 3px 0 0 var(--teal); }
.ai-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.ai-pair textarea { width: 100%; }
.warn-text { color: #9A5B00; margin-top: 4px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); transition: width .3s; }
@media (max-width: 700px) { .ai-pair { grid-template-columns: 1fr; } }

/* Translate table: a language none of this copy's epics ship in */
td.ed.notneeded { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--grey-soft) 6px 7px); }
td.ed.notneeded:empty::before { content: "not needed"; color: var(--muted); font-size: 12px; }
td.ed.notneeded:focus::before { content: none; }
.lang-chips .exp-chip { padding: 2px 8px; font-size: 12px; gap: 4px; }
.lang-chips .exp-chip input { box-shadow: none; margin: 0; }
tr.just-added td { background: var(--primary-soft); }

/* Translation coverage: stacked bar (approved · to re-check · AI drafts · missing) */
.bar.stack { display: flex; }
.bar.stack > i { border-radius: 0; flex: none; }
/* segment colours must beat `.bar > i` (orange) */
.seg-done, .bar > i.seg-done { background: var(--primary); }
.seg-stale, .bar > i.seg-stale { background: var(--primary-line); }
.seg-ai, .bar > i.seg-ai { background: #c4c4c4; }
.cov-legend { display: flex; gap: 14px; margin: -6px 0 12px; }
.cov-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }

/* ---------- app shell (BNIdirect layout), kept compact so the content gets the room ---------- */
.shell { flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg); z-index: 5; }
.shell-top { display: flex; align-items: center; gap: 8px; height: 52px; width: 292px; padding: 0 8px 0 16px; }
.shell-top .brand { height: 22px; width: 22px; flex: none; display: block; }
.shell-top .brand-sub { flex: 1; font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; white-space: nowrap; }
.icon-btn { padding: 6px; border-radius: var(--radius-sm); line-height: 0; color: var(--muted); }
.shell-body { flex: 1; display: flex; min-height: 0; }
.rail { width: 72px; flex: none; display: flex; flex-direction: column; gap: 4px; padding: 4px 6px 12px; }
.rail-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px;
  border-radius: 12px; color: var(--ink-2); font-size: 11px; line-height: 13px; font-weight: 500; text-align: center; }
.rail-item:hover { background: var(--grey-soft); text-decoration: none; }
.rail-item.on { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.rail-space { flex: 1; }
.rail-dot { position: absolute; top: 7px; right: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel);
  border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.rail-me.on { background: none; } .rail-me.on .avatar { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.panel { width: 220px; flex: none; overflow-y: auto; padding: 2px 8px 16px 4px; }
.ph { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 12px 10px 4px; }
.psub { font-size: 12px; font-weight: 500; color: var(--muted); padding: 6px 10px 2px; }
.pi { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 13px; font-weight: 500; }
.pi .ic { flex: none; color: var(--muted); }
.pi:hover { background: var(--grey-soft); text-decoration: none; }
.pi.on { background: var(--teal-soft); color: var(--teal); font-weight: 600; } .pi.on .ic { color: var(--teal); }
.pl { flex: 1; min-width: 0; line-height: 17px; overflow-wrap: anywhere; }   /* wraps instead of cutting long names */
.pc { flex: none; font-size: 11px; line-height: 18px; padding: 0 7px; border: 1px solid var(--line); border-radius: 9999px; background: var(--panel); color: var(--ink-2); }
.pempty { padding: 4px 10px; }
.psearch { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel); color: var(--muted); }
.psearch input { flex: 1; min-width: 0; border: 0; box-shadow: none; padding: 0; background: transparent; outline: none; font: inherit; }
.panel-warn { display: block; margin: 12px 4px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--primary-soft);
  border: 1px solid var(--primary-line); color: #9A3D00; font-size: 12px; font-weight: 600; }
.me-card { display: flex; flex-direction: column; padding: 4px 10px 10px; }
/* folded: rail only (the person chose it); hovering the rail peeks the menu out over the page */
body.panel-closed .panel { display: none; }
body.panel-closed .shell-top { width: 72px; padding: 0; justify-content: center; }
body.panel-closed .shell-top .brand, body.panel-closed .shell-top .brand-sub { display: none; }
body.panel-closed.peek .panel { display: block; position: fixed; left: 72px; top: 52px; bottom: 8px; z-index: 40; background: var(--bg);
  border-radius: 0 16px 16px 0; box-shadow: 8px 0 24px rgba(0,0,0,.12); padding-top: 8px; animation: peekin .12s ease-out; }
@keyframes peekin { from { transform: translateX(-8px); opacity: .6; } to { transform: none; opacity: 1; } }
/* B. the epic name in the breadcrumb switches epics */
.crumb-switch { all: unset; cursor: pointer; color: var(--ink-2); font-weight: 600; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; }
.crumb-switch:hover, .crumb-switch.open { background: var(--grey-soft); }
.epic-switch { position: fixed; z-index: 60; width: 300px; max-height: 60vh; overflow-y: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 8px; }
.epic-switch .psearch { margin: 0 0 6px; }
.epic-switch .es-group { font-size: 11px; font-weight: 600; color: var(--muted); padding: 8px 8px 2px; text-transform: none; }
.epic-switch a { display: block; padding: 6px 8px; border-radius: 8px; color: var(--ink-2); }
.epic-switch a:hover, .epic-switch a.on { background: var(--grey-soft); text-decoration: none; }
.epic-switch a.on { font-weight: 600; }
/* content: one rounded card, like the BNIdirect app */
main { margin: 8px 8px 8px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 24px 28px 48px; min-height: calc(100vh - 16px); }
@media (max-width: 760px) {
  .shell-top { width: 72px; padding: 0; justify-content: center; } .shell-top .brand, .shell-top .brand-sub { display: none; }
  .panel { position: fixed; left: 72px; top: 52px; bottom: 0; background: var(--bg); box-shadow: 4px 0 16px rgba(0,0,0,.08); }
  main { padding: 16px; }
}

/* Translate table: sortable headers, last-edited note */
.sheet th.sortable { cursor: pointer; user-select: none; }
.sheet th.sortable:hover { color: var(--ink); }
.sheet th.sorted { color: var(--teal); }
.sheet td .edited { font-size: 10px; line-height: 12px; color: var(--muted); white-space: nowrap; }
.sameas-row { padding: 6px 0; border-bottom: 1px solid var(--line); gap: 8px; }

.pfoot { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.epic-progress { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--grey-soft); }
.epic-progress.done { background: var(--good-soft); border-color: var(--good-line); }
.epic-progress .row { gap: 10px; }

/* screen page: copy as a sheet next to the screenshot */
.focus.focus-sheet { grid-template-columns: minmax(240px, 32%) 1fr; }
.sheet td.ed.here { box-shadow: inset 0 0 0 1.5px var(--primary-line); font-weight: 500; }
.sheet td.ed.here.outdated { box-shadow: inset 0 0 0 1.5px var(--primary-line), inset 3px 0 0 var(--primary); }
.sheet td.ed.here.editing { box-shadow: inset 0 0 0 2px var(--primary); }
.sheet tr.choice td { background: var(--primary-soft); padding: 8px 10px; border-right: 0; }
.sheet .nowrap { flex-wrap: nowrap; }
.sheet .mk { font-size: 10px; line-height: 14px; padding: 0 4px; border-radius: 6px; background: var(--grey-soft); color: var(--muted); white-space: nowrap; }
.sheet .mk.warn { background: var(--primary-soft); color: var(--primary-hover); }
.sheet .mk.dot { width: 7px; height: 7px; padding: 0; border-radius: 50%; background: var(--primary); }
.sheet td.acts { position: relative; padding: 2px !important; text-align: left; overflow: visible; }
.sheet td.acts .kebab { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }   /* over the cell's end: no width of its own */
.sheet .kebab { padding: 2px 8px; font-size: 16px; line-height: 20px; opacity: 0; }   /* row tools show on the row you're on */
.sheet tbody tr:hover .kebab, .sheet tbody tr:focus-within .kebab, .sheet .kebab:focus { opacity: 1; }
.sheet .kmenu { position: absolute; right: 4px; top: 30px; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.08); padding: 4px; display: flex; flex-direction: column; min-width: 130px; }
.sheet .kmenu.hidden { display: none; }
.sheet .kmenu button { text-align: left; padding: 6px 10px; font-size: 13px; }
.focus-sheet .sheet-wrap { max-height: none; overflow: visible; }
@media (max-width: 900px) { .focus.focus-sheet { grid-template-columns: 1fr; } }
.data-layers .data-row { padding: 4px 0; border-top: 1px solid var(--line); gap: 10px; color: var(--ink-2); }

/* calmer sheets: one quiet signal per state */
.sheet th { background: var(--bg); color: var(--muted); font-weight: 500; }
.sheet td.ed { position: relative; }
.sheet td.ed.aidraft, td.ed.aidraft { background: transparent; box-shadow: none; color: var(--muted); }
.sheet td.ed.aidraft::before { content: ""; position: absolute; left: 3px; top: 50%; width: 4px; height: 4px; margin-top: -2px;
  border-radius: 50%; background: var(--teal); }
.sheet td.ed.aidraft.editing { color: var(--ink); }
.sheet td.ed.here, .sheet td.ed.here.outdated { box-shadow: none; font-weight: 600; color: var(--ink); }
.sheet td.ed.here.aidraft { color: var(--ink); }
.sheet td.ed.here.editing { box-shadow: inset 0 0 0 2px var(--primary); }
.sheet td.lint-info::after { display: none; }
.sheet .mk { background: none; padding: 0 2px; color: var(--muted); }
.sheet .mk.warn { background: none; color: var(--primary-hover); }
.sheet .mk.dot { background: var(--primary); padding: 0; }
/* ✓ in an AI-draft cell: approve this language of this row (drawn by CSS: the cell's text stays the copy) */
.sheet td.ed .okcell { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; padding: 0;
  border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--teal); font-weight: 700; font-size: 12px;
  line-height: 20px; cursor: pointer; opacity: 0; transition: opacity .1s; }
.sheet td.ed .okcell::before { content: "✓"; }
.sheet td.ed:hover .okcell, .sheet td.ed.editing .okcell { opacity: 1; }
.sheet td.ed .okcell:hover { background: var(--teal-soft); border-color: var(--teal); }
.sheet td.ed.aidraft { padding-right: 30px; }
/* screen page: layer positions on the screenshot */
.shot-wrap { position: relative; display: block; }
.shot-wrap .row-hl { position: absolute; border: 2px solid var(--primary); border-radius: 4px; box-shadow: 0 0 0 4px rgba(255,107,0,.18); pointer-events: none; margin: -3px; box-sizing: content-box; padding: 1px; }
.shot-wrap .row-hl.hidden { display: none; }
.shot-wrap .hot { position: absolute; cursor: pointer; border-radius: 3px; }
.shot-wrap .hot:hover { outline: 1px dashed var(--primary); background: rgba(255,107,0,.08); }
.hl-note { margin-top: 6px; }
.hl-note.hidden { display: none; }
.sheet tr.flash td { animation: rowflash 1.4s ease-out; }
@keyframes rowflash { 0%, 30% { background: var(--primary-soft); } 100% { background: transparent; } }
.sheet .mk.flag { background: none; color: #b42318; font-size: 11px; padding: 0 1px; }
.sheet td.nowrap-cell { white-space: nowrap; }
/* ⓘ help on hover */
.info-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%;
  color: var(--muted); font-size: 13px; cursor: help; outline: none; }
.info-tip:hover, .info-tip:focus { color: var(--ink); background: var(--grey-soft); }
.info-tip .tip { display: none; position: absolute; z-index: 30; top: 24px; right: -8px; width: 340px; padding: 10px 12px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 12px; line-height: 18px; font-weight: 400; white-space: pre-line; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.info-tip:hover .tip, .info-tip:focus .tip { display: block; }
/* screen page header: compact */
.screen-head { margin-bottom: 10px; }
.screen-head h1 { margin: 2px 0 0; font-size: 22px; line-height: 30px; }
.screen-head .crumbs { font-size: 12px; }
.screen-head .trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; margin-top: 2px; }
.sheet tr.group-start td { border-top: 2px solid var(--line-2); }
/* side panel: stream links and ⋯ menus */
.ph-row, .psub-row { display: flex; align-items: center; justify-content: space-between; }
.ph-row .ph { flex: 1; }
.psub-row .psub { flex: 1; display: block; color: inherit; text-decoration: none; border-radius: 8px; }
.psub-row .psub:hover, .psub-row .psub.on { background: var(--grey-soft); color: var(--ink); }
.psub-row .psub.on { font-weight: 600; }
.gm { position: relative; }
.gm .kebab { padding: 0 8px; font-size: 15px; line-height: 22px; color: var(--muted); opacity: 0; }
.ph-row:hover .gm .kebab, .psub-row:hover .gm .kebab, .gm .kebab:focus, .row .gm .kebab { opacity: 1; }
.gm .kmenu { position: absolute; right: 0; top: 26px; z-index: 40; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.08); padding: 4px; display: flex; flex-direction: column; min-width: 170px; }
.gm .kmenu.hidden { display: none; }
.gm .kmenu .btn, .gm .kmenu button { text-align: left; justify-content: flex-start; padding: 6px 10px; font-size: 13px; border: 0; }
.kmenu .kslot { display: contents; }
.gm .kmenu a.on { font-weight: 600; background: var(--grey-soft); }
/* strings toolbar: one line; all filters in a panel */
.filters { flex-wrap: nowrap; }
.filters #q { flex: 0 1 300px; min-width: 160px; }
.filters .pager { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.filters .pager button { padding: 2px 10px; }
.filters .pager .pg-jump { width: 3.4em; padding: 1px 4px; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.filters .pager .pg-jump::-webkit-inner-spin-button, .filters .pager .pg-jump::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.filters #pgslot { flex: none; white-space: nowrap; }
.fwrap { position: relative; }
#fbtn.on { border-color: var(--primary); color: var(--primary-hover); }
.fpop { position: absolute; z-index: 40; top: 40px; left: 0; width: 360px; padding: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.10); display: flex; flex-direction: column; gap: 8px; }
.filters .fpop { left: auto; right: 0; max-height: calc(100vh - 160px); overflow-y: auto; }   /* Filters sits at the bar's right end */
.fpop.hidden { display: none; }
.fp-field { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.fp-field select { width: 100%; max-width: none; }
.fp-more { margin: 2px 0; }
.fp-more summary, .fp-legend summary { font-size: 12px; color: var(--muted); padding: 4px 0; }
.fp-more[open] { display: grid; gap: 8px; }
.fp-view { display: grid; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.fp-h { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.fp-legend { margin-top: 4px; color: var(--muted); }
.fp-legend summary { cursor: pointer; }
.fp-legend .legend { margin-top: 8px; color: var(--ink-2); }
/* toolbar: search, Filters and Sort share one shape and height */
.filters #q, .filters #fbtn { border-radius: var(--radius-sm); height: 38px; box-shadow: none; }
.filters #fbtn { padding: 0 14px; font-weight: 500; border-color: var(--line-2); }
/* strings toolbar: the epic's translation progress */
.epic-cov { display: inline-flex; gap: 10px; align-items: center; margin-right: 6px; flex-shrink: 0; }
.epic-cov .mc { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.epic-cov .mc b { color: var(--ink-2); font-weight: 600; }
.epic-cov .bar { width: 56px; margin: 0; height: 6px; }
/* hover preview for the Where number */
.where-pop { position: fixed; z-index: 60; width: 268px; padding: 4px 4px 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.12); pointer-events: none; }
.where-pop.hidden { display: none; }
.where-pop .trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 4px 4px 0; }
/* toolbar bars: the legend on hover */
.epic-cov .mc { position: relative; cursor: default; outline: none; }
.epic-cov .mc-tip { display: none; position: absolute; z-index: 50; top: 22px; right: -10px; white-space: nowrap; padding: 8px 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.10); font-size: 12px; font-weight: 400; color: var(--ink-2); }
.epic-cov .mc:hover .mc-tip, .epic-cov .mc:focus .mc-tip { display: block; }
.epic-cov .mc-tip .cov-legend { display: flex; gap: 12px; margin: 4px 0 0; }
.epic-cov .mc-tip .mc-all { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); }
.seg-miss { background: var(--line); }
/* stream ⋯: a small dashboard */
.gm .kmenu.rich { width: 300px; padding: 10px; }
.psub-row .psub { cursor: default; }
.psub-row .psub:hover { background: none; }
.gm-stats { padding: 2px 4px 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.gs-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.gs-n { background: var(--bg); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; }
.gs-n b { font-size: 15px; line-height: 20px; } .gs-n span { font-size: 11px; color: var(--muted); }
.gs-n.warn b { color: var(--primary-hover); }
.gs-lang { margin-top: 6px; font-size: 12px; } .gs-lang .bar { margin: 4px 0; height: 6px; }
.gs-lang .cov-legend { margin: 0; gap: 10px; font-size: 11px; }
.fig-note { color: var(--primary-hover); font-weight: 500; }   /* "Newer in Figma: sync", in the epic's one-line summary */
/* row selection */
.sheet input.rsel, .sheet input.rsel-all { box-shadow: none; margin: 0 4px 0 0; vertical-align: -2px; cursor: pointer; }
.sheet .rnum { white-space: nowrap; }   /* checkbox, row number and marker stay on one line */
/* fixed slots: checkbox · number · issue dot · developer key mark, aligned on every row whether a mark is there or not */
.sheet .rnum .rn { display: grid; grid-template-columns: 34px 14px 22px; align-items: center; column-gap: 2px; }
.sheet .rnum .rn-n { text-align: right; font-variant-numeric: tabular-nums; }
/* the checkbox sits in the number's place: it shows on the row you're on, and on every row once something is selected */
.sheet .rnum .rn-s { position: relative; display: flex; justify-content: flex-end; }
.sheet .rnum .rn-s input { position: absolute; left: 2px; top: 50%; transform: translateY(-50%); margin: 0; opacity: 0; }
.sheet tr:hover .rn-s input, .sheet .rn-s input:focus, .sheet .rn-s input:checked, .sheet:has(.rsel:checked) .rn-s input { opacity: 1; }
.sheet tr:hover .rn-s input + .rn-n, .sheet .rn-s input:focus + .rn-n, .sheet .rn-s input:checked + .rn-n,
.sheet:has(.rsel:checked) .rn-s input + .rn-n { visibility: hidden; }
.sheet .rnum .rn-i, .sheet .rnum .rn-d { display: flex; align-items: center; }
.sheet .rnum .idot, .sheet .rnum .dkmk { margin-left: 0; }
.bulk-sel { position: fixed; z-index: 70; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 16px; background: var(--ink); color: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.bulk-sel.hidden { display: none; }
.bulk-sel .bs-n { margin-right: 6px; font-weight: 600; }
.bulk-sel button { box-shadow: none; padding: 6px 12px; }
.bulk-sel button.ghost { color: #d4d4d4; }

/* Projects menu: a channel's and a stream's name open its page (all its copy) */
a.ph-link, .psub-row a.psub { text-decoration: none; border-radius: 8px; cursor: pointer; justify-content: flex-start !important; }
a.ph-link { color: var(--muted); }
a.ph-link:hover, .psub-row a.psub:hover { color: var(--ink); background: var(--grey-soft); }
a.ph-link.on, .psub-row a.psub.on { color: var(--primary-hover); background: var(--primary-soft); }
/* "N to review" next to Filters: one click to the rows with something to decide */
button.to-review { color: var(--primary-hover); font-weight: 600; }
button.to-review.on { background: var(--primary-soft); }
/* Guideline: the guideline site fills the content card */
main:has(> .guide-frame) { padding: 0; overflow: hidden; }
.guide-frame { display: block; width: 100%; height: calc(100vh - 18px); border: 0; border-radius: 20px; }
/* Projects menu hierarchy: channel (strongest, divided) › stream (small label) › epics (indented on a guide line) */
.pchan { padding-bottom: 4px; }
.pchan + .pchan, .pchan + .pgroup { border-top: 1px solid var(--line); margin-top: 6px; }
.pchan > .ph-row a.ph-link { color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .06em; padding: 14px 10px 4px; }
.pstream { position: relative; }
.pstream > .psub-row a.psub { color: var(--muted); font-size: 12px; font-weight: 600; padding: 6px 10px 3px; }
.pstream > .psub-row a.psub:hover { color: var(--ink); }
.pstream > .pi, .pstream > .pempty { margin-left: 16px; }
.pstream::before { content: ""; position: absolute; left: 17px; top: 30px; bottom: 6px; border-left: 1px solid var(--line-2, var(--line)); }
/* Strings toolbar, tidied: one height for every control; wraps as a whole (progress goes right, or onto its own line) */
.filters { flex-wrap: wrap; row-gap: 8px; align-items: center; }
.filters #q { flex: 1 1 200px; min-width: 200px; }
/* search options inside the search box: Match case · Whole word · Exact */
.filters .qwrap { position: relative; flex: 1 1 200px; min-width: 200px; display: flex; }
.filters .qwrap #q { flex: 1; min-width: 0; padding-right: 98px; }
.qopts { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; }
.qopt { height: 26px; min-width: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: none; box-shadow: none;
  font: 600 12px/1 ui-monospace, Menlo, monospace; color: var(--muted); cursor: pointer; }
.qopt:hover { background: var(--grey-soft); color: var(--ink-2); }
.qopt.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.filters #freset, .filters .to-review { height: 38px; padding: 0 12px; white-space: nowrap; }
.filters .to-review { border-radius: var(--radius-sm); }
.filters #tcount { white-space: nowrap; }
.filters .epic-cov { margin-left: auto; }
.filters .spacer { display: none; }

/* ---- The sheet's two layers, kept quiet ----
   String (where/how it's used): one chip in the Issue column. Translation (this cell's text): the text's own look —
   grey + dot = AI draft, orange bar = needs update, wavy underline = style issue, hatched = not needed. */
.sheet td.lint-block::after, .sheet td.lint-warn::after, .sheet td.lint-info::after { display: none; }
.sheet td.lint-block, .sheet td.lint-warn { text-decoration: underline wavy; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-skip-ink: none; }
.sheet td.lint-block { text-decoration-color: var(--bad); }
.sheet td.lint-warn { text-decoration-color: #b8b8b8; }
.sheet td.ed.stale, .sheet td.src.stale { background: transparent; box-shadow: inset 3px 0 0 var(--primary); }
.sheet td.src.outdated { box-shadow: none; }
/* markers: the same shapes in the cells, the hover note, the issue menu and the legend */
.tm { flex: none; display: inline-block; width: 14px; height: 14px; position: relative; margin-top: 2px; }
.tm-draft::after { content: ""; position: absolute; left: 5px; top: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--teal); }
.tm-stale::after { content: ""; position: absolute; left: 5px; top: 1px; bottom: 1px; width: 3px; border-radius: 2px; background: var(--primary); }
.tm-wavy { background: radial-gradient(circle at 50% 0, transparent 2.5px, #b8b8b8 2.6px 3.4px, transparent 3.5px) 0 7px / 6px 4px repeat-x; }
.tm-wavy.bad { background-image: radial-gradient(circle at 50% 0, transparent 2.5px, var(--bad) 2.6px 3.4px, transparent 3.5px); }
.tm-hatch { border-radius: 3px; background: repeating-linear-gradient(135deg, transparent 0 3px, var(--line-2) 3px 4px); }
.tm-chip::after { content: ""; position: absolute; left: 2px; top: 3px; width: 10px; height: 8px; border-radius: 3px; background: var(--primary-line); }
.tm-chip.low::after { background: var(--line-2); }
.tm-info::after { content: "i"; position: absolute; inset: 1px; border-radius: 50%; border: 1px solid var(--line-2); font: 600 9px/11px inherit; text-align: center; color: var(--muted); font-style: normal; }
.sheet-tip { position: fixed; z-index: 80; max-width: 320px; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); pointer-events: none; display: grid; gap: 8px; }
.sheet-tip.hidden { display: none; }
.sheet-tip .st-row { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.sheet-tip .st-row b { display: block; font-weight: 600; color: var(--ink); }
.sheet-tip .st-row span { display: block; color: var(--muted); }
.issue-menu { position: fixed; z-index: 85; width: 300px; padding: 4px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); display: grid; }
.issue-menu button { display: flex; gap: 8px; align-items: flex-start; text-align: left; border: 0; box-shadow: none; background: none; padding: 8px; border-radius: 8px; font-weight: 400; }
.issue-menu button:hover { background: var(--grey-soft); }
.issue-menu b { display: block; font-size: 13px; color: var(--ink); }
.issue-menu small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.info-tip .tip.legend { white-space: normal; width: 360px; font-size: 12px; line-height: 1.45; }
.info-tip .tip.legend .lg, .fp-legend .lg { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; color: var(--ink-2); }
.info-tip .tip.legend p, .fp-legend .legend p { margin: 10px 0 0; color: var(--muted); }
.issue-menu button { white-space: normal; width: 100%; }
.issue-menu button span { min-width: 0; flex: 1; }
/* an open issue: a small dot by the row number (red: decide; grey: clean-up). Hover says what, click decides. */
.sheet .idot { display: inline-block; vertical-align: middle; width: 14px; height: 14px; margin-left: 2px; padding: 0; border: 0; box-shadow: none;
  background: none; cursor: pointer; position: relative; }
.sheet .idot::after { content: ""; position: absolute; left: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.sheet .idot.low::after { background: var(--line-2); }
.sheet .idot:hover { background: var(--grey-soft); border-radius: 50%; }
.tm-chip::after { left: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); }
.tm-chip.low::after { background: var(--line-2); }
/* selection bar: one tidy row */
.bulk-sel { flex-wrap: nowrap; white-space: nowrap; gap: 6px; padding: 8px 8px 8px 16px; max-width: calc(100vw - 32px); }
.bulk-sel .bs-n { margin-right: 4px; }
.bulk-sel .bs-ctx { display: contents; }
.bulk-sel .bs-sep { width: 1px; height: 20px; background: #666; margin: 0 4px; }
.bulk-sel .bs-sep.hidden, .bulk-sel button.hidden { display: none; }
.bulk-sel .bs-flag { position: relative; }
.bulk-sel .bs-flagmenu { position: absolute; bottom: calc(100% + 8px); left: 0; display: grid; gap: 4px; padding: 6px; background: #1c1c1c; border-radius: 12px; }
.bulk-sel .bs-flagmenu.hidden { display: none; }
.bulk-sel .bs-flagmenu button { text-align: left; }
.bulk-sel .bs-x { padding: 6px 10px; }
/* developer keys: import dialog */
.dk-drop { display: block; margin-top: 12px; padding: 18px; border: 1.5px dashed var(--line-2); border-radius: 12px; text-align: center; cursor: pointer; }
.dk-drop.over, .dk-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.dk-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
/* developer key mark by the row number: filled = confirmed (exported under their key), outline = to decide */
.sheet .dkmk { display: inline-block; margin-left: 3px; padding: 0 3px; border-radius: 4px; font: 600 9px/13px ui-monospace, Menlo, monospace;
  color: #fff; background: var(--teal); vertical-align: middle; cursor: default; }
.sheet .dkmk.waiting { color: var(--teal); background: transparent; box-shadow: inset 0 0 0 1px var(--teal); }
.sheet .dkmk.rejected { color: var(--muted); background: var(--grey-soft); text-decoration: line-through; }
/* borrowed: the key is placed in another area; this layer has it only because the copy is the same */
.sheet .dkmk.borrowed { color: var(--warn); background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn-line); }
/* a draft from the developers' file (not AI): same grey "not reviewed" text, a small square instead of the AI dot */
.sheet td.ed.aidraft.devdraft::before { border-radius: 1px; background: #6b7280; }
.tm-devdraft::after { content: ""; position: absolute; left: 5px; top: 5px; width: 4px; height: 4px; border-radius: 1px; background: #6b7280; }

/* ---------- Glossary ---------- */
.gl-bar { gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.gl-bar #glq { width: 260px; }
.gl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.gl-chips button { border-radius: 9999px; padding: 4px 12px; font-weight: 500; box-shadow: none; background: var(--panel); }
.gl-chips button b { color: var(--muted); font-weight: 500; margin-left: 2px; }
.gl-chips button.on { background: var(--ink, #171717); color: #fff; border-color: var(--ink, #171717); }
.gl-chips button.on b { color: rgba(255,255,255,.7); }
.gl-cat h2 { display: flex; align-items: baseline; gap: 10px; margin-top: 28px; }
.gl-cat h2 .small { font-weight: 400; }
.gl-group { margin-bottom: 14px; }
.gl-gname { font-size: 12px; font-weight: 600; text-transform: none; color: var(--ink-2); margin: 0 0 6px 2px; }
.gl-gname .muted { font-weight: 400; margin-left: 4px; }
.gl-card { padding: 0; overflow: hidden; }
.gl-table th { background: var(--panel); font-weight: 500; color: var(--muted); }
.gl-table th:nth-child(-n+3), .gl-table td:nth-child(-n+3) { width: 17%; }
.gl-table th:nth-child(5), .gl-table td:nth-child(5) { width: 56px; text-align: right; }
.gl-table th:nth-child(6), .gl-table td:nth-child(6) { width: 64px; }
.gl-row { cursor: pointer; }
.gl-row:hover td { background: var(--grey-soft, #f5f5f5); }
.gl-row:last-child td { border-bottom: 0; }
.gl-row td:nth-child(-n+3) { font-weight: 500; }
.gl-mean { color: var(--ink-2); font-size: 13px; }
.gl-avoid { color: #b54708; font-size: 12px; margin-top: 2px; }
.gl-ord { white-space: nowrap; text-align: right; }
.gl-ord button { padding: 0 6px; box-shadow: none; visibility: hidden; }
.gl-row:hover .gl-ord button { visibility: visible; }
.gl-ord button:disabled { opacity: .25; }
.gl-empty { padding: 28px; text-align: center; }
.gl-empty .row { justify-content: center; }
.gl-form { display: grid; gap: 14px; margin-top: 18px; }
.gl-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gl-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gl-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.gl-f input, .gl-f textarea, .gl-f select { font: inherit; font-size: 14px; color: var(--ink, #171717); width: 100%; }
.gl-f em { font-style: normal; font-weight: 400; font-size: 11.5px; }
.gl-sug { max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
button.danger { color: #b42318; }
@media (max-width: 700px) { .gl-3, .gl-2 { grid-template-columns: 1fr; } .gl-bar #glq { width: 100%; } }
.gl-also { color: #b54708; font-size: 11.5px; }

/* Sync: an epic's new sections in one list */
.warn-btn { background: var(--warn-soft, #fff3eb); border-color: #f0d2a8; color: #b54708; }
.es-page { margin-bottom: 14px; }
.es-pname { font-weight: 600; margin: 0 0 6px 2px; }
.es-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.es-table td { vertical-align: middle; }
.es-table tr:last-child td { border-bottom: 0; }
.es-foot { position: sticky; bottom: -24px; background: var(--panel); padding: 12px 0 0; margin-top: 8px; border-top: 1px solid var(--line); }

/* role preview (admins trying the library as a writer or viewer) */
.preview-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 900; display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--ink); color: var(--panel); font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.preview-bar b { text-transform: capitalize; }

/* read-only roles (viewer, developer): no review or editing controls */
body.ro .rw { display: none !important; }
td.ro-cell { cursor: default; }
.sheet td.ro-cell:empty::before { content: "—"; color: var(--line-2); }
.sheet td.ro-type { padding: 8px 10px; }
#drawer textarea:disabled, #drawer input:disabled, #drawer select:disabled { background: var(--bg); color: var(--ink); opacity: 1; cursor: default; }
.sheet td.ro-cell.aidraft { color: var(--muted); }
.sheet tr.ro-row { cursor: pointer; }   /* viewers: click a row for its details */
.sheet td.ro-cell.here { font-weight: 600; color: var(--ink); }   /* the language this screen shows */
body.ro .fig-note { display: none; }   /* "edited in Figma since the last sync" is for the people who sync */
/* viewers: the copy only, no developer keys or review marks (developers keep keys) */
body[data-role="viewer"] .dkmk, body[data-role="viewer"] .idot, body[data-role="viewer"] .dev-details, body[data-role="viewer"] .dev-only { display: none !important; }

/* keys: a developer's key is firm; the library's placeholder is faint */
.key.firm { color: var(--ink); font-weight: 500; }
.key.ph { color: var(--muted); opacity: .55; }
.exp-note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); border: 1px solid var(--primary-line); font-size: 13px; }
.exp-note.ok { background: var(--bg); border-color: var(--line); color: var(--muted); }
/* Match developer keys */
.dm-sum { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin: 4px 0 8px; }
.dm-head { margin: 18px 0 8px; }
.dm-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1.3fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.dm-code .key { font-size: 12px; margin-bottom: 2px; }
.dm-val { font-size: 13px; margin-top: 4px; display: flex; gap: 6px; align-items: baseline; }
.dm-val .tag { font-size: 10px; padding: 0 5px; }
.dm-arrow { color: var(--muted); padding-top: 18px; }
.dm-copy { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.dm-copy:hover { background: var(--bg); }
.dm-copy input { margin-top: 6px; box-shadow: none; }
.dm-why { padding: 2px 8px 0 30px; }
.dm-acts { display: flex; flex-direction: column; gap: 6px; }
.dm-find input { width: 100%; }
.dm-hit { padding: 6px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.dm-older { margin-top: 18px; }
.dm-older table { margin-top: 8px; }
@media (max-width: 760px) { .dm-row { grid-template-columns: 1fr; } .dm-arrow { display: none; } .dm-acts { flex-direction: row; } }
/* Review › Hidden as data: compact rows (like the Strings page), tick several and decide once */
.hid-table { width: 100%; border-collapse: collapse; }
.hid-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.hid-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.hid-table tr:last-child td { border-bottom: 0; }
.hid-table button.small { padding: 4px 10px; font-size: 13px; }
@media (max-width: 700px) { .hid-table th:nth-child(3), .hid-table td:nth-child(3) { display: none; } }
/* the morning notice: last night's sync, over the top of the page until closed */
.nightly { position: fixed; z-index: 70; top: 14px; left: 50%; transform: translateX(-50%); width: min(680px, calc(100vw - 32px));
  padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--primary);
  border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.12); display: grid; gap: 6px; font-size: 13px; }
.nightly-h { display: flex; align-items: center; gap: 10px; }
.nightly-x { margin-left: auto; padding: 0 8px; font-size: 18px; line-height: 22px; }
.nightly-err { color: var(--bad); font-weight: 600; }

/* request in flight (core.js busy): a moving bar along the top of the window */
#busy { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity .15s;
  background: linear-gradient(90deg, transparent 0, var(--primary) 40%, transparent 80%) 0 0 / 50% 100% no-repeat; }
#busy.on { opacity: 1; animation: busy 1.1s linear infinite; }
@keyframes busy { from { background-position: -50% 0; } to { background-position: 150% 0; } }
body:has(#busy.on) { cursor: progress; }
@media (prefers-reduced-motion: reduce) { #busy.on { animation: none; background: var(--primary); } }

/* term families (Glossary › Term families) */
.gl-tabs { margin: 4px 0 14px; }
.tf-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.tf-side { position: sticky; top: 8px; }
.tf-side #tfq { width: 100%; }
.tf-list { max-height: calc(100vh - 260px); overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 4px 0; }
.tf-area { font-size: 11px; font-weight: 600; color: var(--muted); padding: 10px 12px 4px; }
.tf-item { display: flex; align-items: center; gap: 8px; padding: 5px 12px; color: inherit; text-decoration: none; font-size: 13px; }
.tf-item span { flex: 1; } .tf-item em { font-style: normal; color: var(--muted); font-size: 12px; }
.tf-item:hover { background: var(--grey-soft, #f5f5f5); } .tf-item.on { background: #fff1e6; font-weight: 600; }
.tf-dot { width: 8px; height: 8px; border-radius: 50%; background: #d4d4d4; flex: none; }
.tf-dot.gap { background: #f79009; } .tf-dot.ok { background: #12b76a; }
.tf-main h3 { margin: 22px 0 8px; font-size: 14px; }
.tf-stats { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0 12px; font-size: 13px; color: var(--ink-2); }
.tf-rec { padding: 14px; }
.tf-forms td { vertical-align: top; }
.tf-forms th:nth-child(1) { width: 20%; } .tf-forms th:nth-child(2), .tf-forms td.num { width: 56px; text-align: right; }
.tf-chip { display: inline-block; padding: 1px 8px; margin: 0 4px 4px 0; border-radius: 9999px; background: var(--grey-soft, #f2f2f2); font-size: 12px; }
.tf-chip b { font-weight: 500; color: var(--muted); } .tf-chip.top { background: #e6f2f3; } .tf-chip.en { background: #fff1e6; }
.tf-dec { font-size: 12px; color: #067647; }
.tf-rel { display: grid; gap: 6px; }
.tf-relitem { display: block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.tf-relitem:hover { border-color: var(--primary, #FF6B00); }
.tf-note { margin: 4px 0; }
@media (max-width: 800px) { .tf-wrap { grid-template-columns: 1fr; } .tf-side { position: static; } .tf-list { max-height: 240px; } }
/* Modules › Chinese review: a corner mark on the ZH cell for Claude's tier (the cell's own states keep their colours) */
.sheet td.ed.zt3, .sheet td.ed.zt2 { background-image: linear-gradient(225deg, var(--zt) 7px, transparent 7px); }
.sheet td.ed.zt3 { --zt: var(--bad); }
.sheet td.ed.zt2 { --zt: var(--warn); }
.sheet td.zt-why { white-space: normal; line-height: 1.35; }
/* Chinese review › "i": the progress overview (one channel) */
.zh-info { width: 22px; height: 22px; padding: 0; border-radius: 50%; font: italic 700 13px Georgia, serif; vertical-align: middle; margin-left: 6px; }
.zo-head { display: flex; gap: 32px; margin: 12px 0 16px; }
.zo-big { font-size: 28px; color: var(--teal); }
.zo-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.zo-table th, .zo-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.zo-table tr.zo-focus { background: var(--primary-soft); }
.zo-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--grey-soft); margin-bottom: 2px; }
.zo-ok { background: var(--good); } .zo-draft { background: var(--primary); } .zo-warn { background: var(--warn-line); } .zo-miss { background: var(--line-2); }
.zo-legend span { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }

/* Chinese review: its own page (teal frame, so it never reads as the Copy library) */
.zr { border-top: 4px solid var(--teal); padding-top: 12px; }
.zr-head { gap: 10px; align-items: center; }
.zr-tiers { display: flex; gap: 6px; }
.zr .pill { border-radius: 999px; padding: 4px 14px; }
.zr .pill.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.zr-table { border-collapse: collapse; width: 100%; }
.zr-table th, .zr-table td { border: 1px solid var(--line, #e3e3e3); padding: 8px 10px; vertical-align: top; }
.zr-table td.acts { white-space: nowrap; }
.zr-table td.acts > * { display: flex; width: 100%; justify-content: center; margin: 0 0 6px; }
.zr-btn { border: 1px solid var(--line, #ccc); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.zr-btn.zr-ok1 { border-color: var(--good); color: var(--good); }
.zr-btn.zr-ok1:hover { background: var(--good); color: #fff; }
.zr-btn.zr-flag:hover { background: #fff4ec; border-color: var(--orange, #FF6B00); }
.zr-flagged { display: inline-block; background: #fff4ec; color: #c24f00; border: 1px solid #ffb27a; border-radius: 999px; padding: 1px 8px; font-size: 12px; margin-bottom: 4px; }
.zr-badge { color: var(--good); font-size: 12px; padding: 5px 0; }
.zr-hide { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.zr-table td.zr-zh { font-size: 15px; }
.zr-table td.zr-zh.aidraft { color: var(--muted); }
.zr-done { color: var(--good); }
.zr-gone { opacity: 0; transition: opacity .25s; }

/* Copy library bar: Epic, Translation and Issue always in view; the rest under More */
.filters select.fbar { max-width: 180px; }
h1 .fch-title { font-size: 14px; font-weight: 400; vertical-align: middle; margin-left: 8px; }

/* Team › who can see what */
.acc { display: flex; gap: 8px; align-items: center; padding: 4px 0; cursor: pointer; }
.acctree { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin: 8px 0; }
.acctree.off { opacity: .45; }
.acc.st { padding-left: 22px; } .acc.ep { padding-left: 44px; font-size: 13px; }
.acc.ch { font-weight: 600; margin-top: 6px; }

/* a pressed button working in the background (core.js guard) */
button.busy { pointer-events: none; opacity: .85; }
button.busy::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 6px; vertical-align: -1px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: btnspin .7s linear infinite; }
@keyframes btnspin { to { transform: rotate(360deg); } }

/* background saves (core.js bgSave) */
#savenote { position: fixed; left: 16px; bottom: 16px; z-index: 60; background: var(--ink, #171717); color: #fff; border-radius: 999px;
  padding: 6px 14px; font-size: 13px; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none; }
#savenote.on { opacity: .92; transform: none; }
#savenote.done { background: var(--good, #1f8a4c); }
.rv-gone { display: none !important; }
