/* ==========================================================================
   Localization Hub — frontend styles.

   One small stylesheet built on design tokens (colours, radii, shadows, type)
   so the whole app shares a single look and can be re-themed in one place.
   Redesigned 2026-10-01: calmer surfaces, clearer hierarchy, colour only
   where it carries meaning (stage, urgency, action). Every selector that the
   JavaScript relies on is unchanged — this file restyles, it never renames.
   ========================================================================== */

:root {
  /* Brand + accents. The header uses the deck palette (Evolution Path navy)
     so the tool and the presentations read as one family. */
  --navy: #0B5FA5; --navy-d: #094b83; --teal: #0E9488; --amber: #C2410C;
  --brand: var(--navy); --brand-dark: var(--navy-d);
  --head-1: #0C1B34; --head-2: #15284F; --cyan: #1EBADD;

  /* Surfaces + text. */
  --bg: #f5f6fa; --card: #ffffff; --line: #e6e8ef; --border: var(--line);
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #f1f3f8;

  /* Semantic stage colours (text + tint). */
  --c-slate: #475569; --t-slate: #eef1f6;
  --c-blue: #1d4ed8;  --t-blue: #e8efff;
  --c-amber: #b45309; --t-amber: #fff4e0;
  --c-green: #15803d; --t-green: #e6f7ec;
  --c-violet: #6d28d9; --t-violet: #f1ecfe;
  --c-red: #b91c1c;   --t-red: #fdeaea;

  /* Shape + depth. */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --sh-2: 0 4px 14px rgba(15, 23, 42, .08), 0 1px 3px rgba(15, 23, 42, .06);
  --sh-3: 0 24px 60px rgba(12, 27, 52, .28);
  --font: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; font-family: var(--font); }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45;
  font-feature-settings: "cv11", "ss01"; }
.muted { color: var(--muted); font-size: 12.5px; }
[hidden] { display: none !important; }
a { color: var(--navy); }

/* ---------- Login ---------- */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% -10%, #1f3a6b 0%, var(--head-1) 55%, #080f1f 100%);
  padding: 20px; }
.login-card { background: var(--card); border-radius: var(--r-lg); padding: 30px; width: 100%; max-width: 380px;
  box-shadow: var(--sh-3); position: relative; overflow: hidden; }
/* A thin brand-to-cyan line along the top of the card — the one flourish. */
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--navy), var(--cyan), #3ecf8e); }
.login-card h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.01em; color: var(--ink); }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 14px; }
.login-card input { width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: 14px; }
.login-card .btn { width: 100%; margin-top: 18px; }
.login-error { color: var(--amber); font-size: 13px; margin: 12px 0 0; }

/* ---------- Header / nav ---------- */
header { background: linear-gradient(100deg, var(--head-1), var(--head-2)); color: #fff;
  padding: 12px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; }
header h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
header p { margin: 2px 0 0; font-size: 12.5px; color: rgba(255,255,255,.62); }
.brand { display: flex; align-items: center; gap: 14px; }
/* White chip so any logo (light or dark) reads on the navy header. */
.logo-chip { background: #fff; border-radius: var(--r-sm); padding: 5px 9px; display: flex; align-items: center; }
.logo-chip img { height: 24px; display: block; }
.logo-login { display: block; height: 38px; margin-bottom: 10px; }
.userbar { display: flex; align-items: center; gap: 10px; }
.who { font-size: 13px; color: rgba(255,255,255,.85); }
.badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,.14); }
.badge.live { background: rgba(62, 207, 142, .18); color: #7fe7b4; border: 1px solid rgba(62,207,142,.35); }
.badge.demo { background: rgba(245, 166, 34, .18); color: #ffd28a; border: 1px solid rgba(245,166,34,.35); }
/* Header buttons: quiet translucent chips, one shared size. */
.userbar .btn, .userbar .btn.ghost { min-height: 32px; padding: 5px 12px; display: inline-flex; align-items: center;
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18); font-size: 12.5px; }
.userbar .btn:hover, .userbar .btn.ghost:hover { background: rgba(255,255,255,.16); box-shadow: none; }
.userbar .btn, .who { white-space: nowrap; }

nav { display: flex; gap: 4px; padding: 8px 22px; background: var(--card); border-bottom: 1px solid var(--line);
  flex-wrap: wrap; align-items: center; position: sticky; top: 0; z-index: 20; }
nav button { border: 0; background: none; padding: 8px 14px; font-size: 13.5px; font-weight: 500;
  color: var(--muted); cursor: pointer; border-radius: 9px; transition: background .12s, color .12s; }
nav button:hover { background: var(--faint); color: var(--ink); }
nav button.active { color: var(--navy); background: #e8f1f8; font-weight: 600; }
/* "New request" is an action, not a page — the nav's one primary button. */
#tabs button.nav-cta { margin-left: auto; background: var(--navy); color: #fff; border-radius: 10px;
  padding: 9px 16px; font-weight: 600; box-shadow: 0 2px 8px rgba(11, 95, 165, .28); }
#tabs button.nav-cta:hover { background: var(--navy-d); color: #fff; }
#tabs button.nav-cta.active { background: var(--navy-d); color: #fff; }

main { padding: 24px 28px 40px; max-width: 1320px; margin: 0 auto; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; }
/* Every page opens the same way: one 20px title, then a quiet one-line
   subtitle. Views write plain <h2> + <p class="muted">, this makes them match. */
#view > h2 { font-size: 20px; letter-spacing: -.02em; margin: 0 0 6px; }
#view > h2 + p.muted { font-size: 13.5px; margin: 0 0 16px; }
#view > p.muted + p.muted { margin-top: -10px; margin-bottom: 16px; }
.section-title h2 { font-size: 15px; }

/* ---------- Greeting ---------- */
/* "🌈 Good morning, Elisabetta" — the name carries a soft rainbow gradient,
   the emoji does a tiny wave once on load. */
.greeting { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; font-size: 22px;
  letter-spacing: -.02em; color: var(--ink-2); font-weight: 500; }
.greeting:empty { display: none; }
.greeting .rainbow { font-size: 26px; line-height: 1; display: inline-block; transform-origin: 70% 90%;
  animation: greet-wave 1.2s ease-in-out 1; }
.greeting strong { font-weight: 700;
  background: linear-gradient(90deg, #e0407a, #f5a622, #3ecf8e, #1ebadd, #6d5ce7);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes greet-wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 60% { transform: rotate(10deg); } }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px 13px;
  min-height: 84px; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px;
  box-shadow: var(--sh-1); position: relative; }
.stat .n { font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1.1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center; gap: 7px; }
.stat .l::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--navy); flex: none; }
.stat.teal .l::before { background: var(--teal); }
.stat.amber .l::before { background: var(--amber); }
.stat.amber .n { color: var(--amber); }
.stat.stat-link { cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.stat.stat-link:hover { box-shadow: var(--sh-2); transform: translateY(-1px); border-color: #d6dbe6; }

/* ---------- Cards / tables ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--sh-1); transition: box-shadow .15s ease; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; }
td { padding: 11px 14px; border-bottom: 1px solid var(--faint); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }

select, input, textarea { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
select:focus, input:focus, textarea:focus { outline: none; border-color: #9cc3e6; box-shadow: 0 0 0 3px rgba(11,95,165,.12); }
select.st { font-weight: 600; }

/* Pills carry a small dot in their own colour so state reads at a glance. */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.cov-Staffed { background: var(--t-green); color: var(--c-green); }
.cov-Needsbackup { background: var(--t-amber); color: var(--c-amber); }
.cov-GapAIinterim, .cov-Gapunstaffed { background: var(--t-red); color: var(--c-red); }

/* ---------- Forms ---------- */
form.entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px;
  max-width: 100%; box-shadow: var(--sh-1); }
/* Big side-by-side panes for the full-page proofreading editor. */
.editor-pane { width: 100%; min-height: 55vh; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font: inherit; font-size: 14px; line-height: 1.5; resize: vertical; }
textarea.editor-pane[readonly] { background: var(--bg); }
/* Read-only source pane rendered as a div so variables/tags can be highlighted. */
.editor-pane.readonly { background: var(--bg); overflow: auto; white-space: pre-wrap; box-sizing: border-box; }

/* Protected tokens ({{ }} / {% %} / <tags>) that must never be translated. */
mark.tok { background: #fff3cd; color: #7a5b00; border-radius: 3px; padding: 0 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.tok-legend { font-weight: 400; font-size: 11px; }

/* Variable-integrity warning shown when the draft breaks a variable/tag. */
.token-warn { margin-top: 10px; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px;
  background: var(--t-red); color: #8a1c12; border: 1px solid #f5c6c0; }

/* ---------- Glossary: never-translate brand box ---------- */
.brand-box { padding: 14px 16px; margin-bottom: 14px;
  background: linear-gradient(135deg, #f2f7fc, #eef6fb); border: 1px solid #cfe3f3; }
.brand-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.brand-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px;
  background: var(--card); border: 1px solid #cfe3f3; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--navy); }
.brand-chip .x { margin: 0; }

/* ---------- Dashboard: activity feed ---------- */
/* The history can be hundreds of rows — keep the box a fixed height and let it
   scroll instead of stretching the page. */
.activity-box { max-height: 380px; overflow-y: auto; }
.activity-box table th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.section-title input { padding: 7px 11px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font: inherit; font-size: 13px; }

/* ---------- Reports ---------- */
.report-latest td { background: #f4f9ff; }
.report-good { color: var(--teal); font-weight: 700; }
.report-warn { color: var(--amber); font-weight: 700; }
.report-share { padding: 14px 16px; margin-top: 22px; max-width: 620px; }
.report-share textarea { width: 100%; height: 172px; margin: 10px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }

/* ---------- Buttons ---------- */
.btn { background: var(--navy); color: #fff; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; line-height: 1.3;
  transition: transform .06s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease; }
.btn:hover { background: var(--navy-d); box-shadow: 0 2px 8px rgba(11,95,165,.22); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--card); color: var(--ink-2); border-color: var(--line); box-shadow: var(--sh-1); }
.btn.ghost:hover { background: #fff; border-color: #cbd3e1; color: var(--ink); box-shadow: var(--sh-2); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.btn-lg { font-size: 15px; padding: 11px 20px; font-weight: 700; }
.x { color: #c0392b; cursor: pointer; font-weight: 700; border: 0; background: none; font-size: 15px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar h2 { font-size: 20px; letter-spacing: -.02em; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 4px; }

/* Segmented control for view modes (Board: By stage / All / Completed).
   Wraps the existing toggle buttons so the JS wiring is untouched. */
.mode-seg { display: inline-flex; padding: 3px; background: var(--faint); border-radius: 10px; gap: 2px; }
.mode-seg .btn { border-radius: 8px; box-shadow: none; border-color: transparent; }
.mode-seg .btn.ghost { background: transparent; color: var(--muted); }
.mode-seg .btn.ghost:hover { background: rgba(255,255,255,.7); color: var(--ink); box-shadow: none; }
.mode-seg .btn:not(.ghost) { background: var(--card); color: var(--ink); box-shadow: var(--sh-1); }
.mode-seg .btn:not(.ghost):hover { background: var(--card); }
.toolbar select { padding-right: 28px; }

/* ---------- Progress bars (dashboard + Crowdin) ---------- */
.bar-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.bar-row .label { width: 140px; font-size: 12px; }
.bar-track { flex: 1; background: var(--faint); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill { background: var(--navy); height: 100%; border-radius: 6px; transition: width .3s ease; }
.bar-fill.teal { background: var(--teal); }
.bar-row .val { width: 42px; text-align: right; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Inline progress (markets published) used by the Board list and stage cards. */
.prog { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.prog-bar { flex: 1; height: 5px; background: var(--faint); border-radius: 3px; overflow: hidden; max-width: 90px; }
.prog-bar i { display: block; height: 100%; background: var(--teal); border-radius: 3px; }
.prog-bar i.none { background: transparent; }
.prog-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 50; }
.toast.error { background: var(--amber); }

/* ---------- Status pills (requests + assignment stages) ---------- */
.st-Intake, .st-Awaitingdraft { background: var(--t-slate); color: var(--c-slate); }
.st-Drafting, .st-Drafted { background: var(--t-blue); color: var(--c-blue); }
.st-Inproofreading { background: var(--t-amber); color: var(--c-amber); }
.st-Approved { background: var(--t-violet); color: var(--c-violet); }
.st-Published { background: var(--t-green); color: var(--c-green); }
.st-AIinterim { background: var(--t-violet); color: var(--c-violet); }
.st-Recurring { background: var(--t-slate); color: var(--muted); }

/* ---------- Clickable rows + deadline urgency colouring ---------- */
tr.clickable { cursor: pointer; }
tr.clickable:hover td, .board-list li:hover { background: #f6f9fe; }
tr.due td:first-child { border-left: 3px solid transparent; }
tr.due-overdue td:first-child { border-left-color: #e24b4a; }
tr.due-soon td:first-child { border-left-color: #ef9f27; }
tr.due-ok td:first-child { border-left-color: transparent; }
.due-tag { font-size: 11px; font-weight: 600; }
.due-tag.overdue { color: var(--c-red); }
.due-tag.soon { color: var(--c-amber); }
/* Compact due chip (stage cards + list): neutral unless urgent. */
.due-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--faint); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due-chip.overdue { background: var(--t-red); color: var(--c-red); }
.due-chip.soon { background: var(--t-amber); color: var(--c-amber); }
.task-title { font-weight: 600; color: var(--ink); }
.task-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cell-date { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Hover tooltip ---------- */
.tip { position: fixed; z-index: 60; max-width: 320px; background: var(--ink); color: #fff;
  padding: 9px 12px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.45; white-space: pre-line;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); pointer-events: none; }
.tip strong { color: #cfe3f3; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(12,27,52,.5); backdrop-filter: blur(2px); display: flex;
  align-items: flex-start; justify-content: center; padding: 24px 16px; z-index: 70; overflow-y: auto; }
.modal-card { background: #fff; border-radius: var(--r-lg); padding: 24px 30px; width: 96vw; max-width: 1280px;
  box-shadow: var(--sh-3); }
.modal-card .kv { grid-template-columns: 150px 1fr 150px 1fr; }
.modal-card .modal-note { font-size: 14px; }
.modal-card h2 { font-size: 19px; letter-spacing: -.02em; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; }
.modal-head .grow { flex: 1; }
.modal-close { border: 0; background: var(--faint); width: 32px; height: 32px; border-radius: 50%; font-size: 20px;
  line-height: 1; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.modal-close:hover { background: #e6e9f0; color: var(--ink); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; margin: 12px 0;
  padding: 12px 14px; background: #fafbfd; border: 1px solid var(--line); border-radius: var(--r-md); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.modal-note { background: #fafbfd; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px;
  font-size: 13px; white-space: pre-wrap; margin: 6px 0 14px; }

/* ---------- Market picker (new request) ---------- */
.picker { border: 1px solid var(--line); border-radius: var(--r-sm); max-height: 230px; overflow-y: auto; padding: 6px; }
.picker label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; font-size: 13px;
  font-weight: 400; border-radius: 6px; cursor: pointer; }
.picker label:hover { background: var(--bg); }
.picker input[type="checkbox"] { width: auto; }
.picker .lang { color: var(--muted); font-size: 12px; }
.picker-count { font-size: 12px; color: var(--navy); font-weight: 600; }
textarea.big { min-height: 120px; resize: vertical; }

/* ---------- Roster edit + my work ---------- */
.row-actions { display: flex; gap: 6px; }
.inline-edit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { margin: 0; }

/* ---------- Notifications bell ---------- */
.bell { position: relative; }
.bell button { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px; padding: 5px 10px; font-size: 13px; cursor: pointer; min-height: 32px; }
.bell button:hover { background: rgba(255,255,255,.16); }
.bell .count { background: #ef4444; color: #fff; border-radius: 10px; font-size: 11px;
  font-weight: 700; padding: 0 6px; margin-left: 4px; }
.notif-panel { position: absolute; right: 0; top: 40px; width: 340px; max-height: 400px; overflow-y: auto;
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-3); z-index: 65; padding: 8px; }
.notif-item { padding: 9px 10px; border-bottom: 1px solid var(--faint); font-size: 13px; border-radius: 6px; }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: #f3f8ff; }
.notif-item .when { color: var(--muted); font-size: 11px; }

/* ---------- Workflow draft display + actions ---------- */
.draft-box { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px;
  font-size: 13px; white-space: pre-wrap; margin: 6px 0; max-height: 220px; overflow-y: auto; }
.stage-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; align-items: center; }

/* ---------- Board: "By stage" cards ---------- */
/* Six stage cards in three columns: each has a tone (colour) so a glance
   tells you where the pressure is; lists stay short and scroll inside. */
.overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.bucket { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0;
  box-shadow: var(--sh-1); display: flex; flex-direction: column; min-height: 180px; overflow: hidden;
  --tone: var(--c-slate); --tint: var(--t-slate); }
.bucket.tone-blue { --tone: var(--c-blue); --tint: var(--t-blue); }
.bucket.tone-amber { --tone: var(--c-amber); --tint: var(--t-amber); }
.bucket.tone-green { --tone: var(--c-green); --tint: var(--t-green); }
.bucket.tone-violet { --tone: var(--c-violet); --tint: var(--t-violet); }
.bucket.tone-red, .bucket.warn { --tone: var(--c-red); --tint: var(--t-red); }
.bucket h3 { margin: 0; padding: 14px 16px 12px; font-size: 13px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--faint); }
.bucket h3 .ico { width: 28px; height: 28px; border-radius: 8px; background: var(--tint); color: var(--tone);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.bucket h3 .n { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--tone); background: var(--tint);
  padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.bucket.warn .n { color: var(--c-red); }
.bucket ul { margin: 0; padding: 6px 8px 8px; list-style: none; max-height: 272px; overflow-y: auto; flex: 1; }
.bucket li { font-size: 13px; padding: 8px 8px; border-radius: 8px; cursor: pointer; display: flex;
  flex-direction: column; gap: 5px; transition: background .12s; }
.bucket li:hover { background: #f6f9fe; }
.bucket li.empty { cursor: default; color: var(--muted); font-size: 12.5px; padding: 14px 8px; }
.bucket li.empty:hover { background: none; }
.bucket .bk-title { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bucket .bk-meta { display: flex; align-items: center; gap: 8px; }
.bucket .bk-meta .prog { flex: 1; min-width: 0; }
.bucket.tone-amber .prog-bar i, .bucket.tone-blue .prog-bar i { background: var(--tone); }

/* ---------- Empty states (My work on a quiet day) ---------- */
.empty-state { padding: 26px 28px; max-width: 980px; }
.es-hero { display: flex; gap: 18px; align-items: flex-start; }
.es-ico { width: 56px; height: 56px; border-radius: 16px; flex: none; display: flex; align-items: center;
  justify-content: center; font-size: 28px; background: linear-gradient(135deg, #e8f1f8, #eef6fb); }
.es-hero h3 { margin: 4px 0 4px; font-size: 18px; letter-spacing: -.01em; }
.es-hero p { margin: 0; font-size: 13.5px; }
.es-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.es-step { position: relative; padding: 14px 14px 14px 46px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fafbfd; display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.es-step strong { color: var(--ink); font-size: 13.5px; }
.es-n { position: absolute; left: 14px; top: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--navy);
  color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.es-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.es-actions code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #fff3cd;
  color: #7a5b00; padding: 0 4px; border-radius: 3px; }
@media (max-width: 720px) { .es-steps { grid-template-columns: 1fr; } .empty-state { padding: 18px; } }

/* ---------- Spreadsheet requests (mode toggle + grid) ---------- */
/* Segmented control on the "New request" form (single text vs spreadsheet). */
/* Hug the buttons — the parent .field is a flex column, which would otherwise
   stretch this control to the full card width. */
.seg { display: inline-flex; width: fit-content; align-self: flex-start;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.seg-btn { background: #fff; border: 0; padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--ink); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.active { background: var(--navy); color: #fff; }

/* The English-vs-language proofreading grid (row per source string). */
table.grid-table { width: 100%; border-collapse: collapse; }
table.grid-table th, table.grid-table td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; text-align: left; }
table.grid-table th { background: var(--bg); font-size: 12px; }
.grid-table .gr-num { width: 36px; text-align: center; color: var(--muted); font-size: 12px; white-space: nowrap; }
.grid-table .gr-src { width: 45%; font-size: 13px; white-space: pre-wrap; }
.grid-table td.gr-src { background: var(--bg); }
.grid-table .gr-tgt { width: 52%; }
.grid-table textarea.cell-edit { width: 100%; min-height: 44px; resize: vertical; font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
/* Inside a grid cell the read-only box is plain text, not a bordered panel. */
.grid-table .draft-box { margin: 0; border: 0; background: transparent; padding: 0; max-height: none; }

/* Make the status chips legible on the white page, not only in the dark header. */
.badge.demo, .badge.live { color: #fff; }
header .badge.live { color: #7fe7b4; }
header .badge.demo { color: #ffd28a; }

/* The expanded per-market panel in the request popup (the grid or draft box). */
.draft-row > td { padding: 12px; background: #fafbfd; }
.grid-actions { align-items: center; }
.grid-actions .pill { align-self: center; }

/* ---------- Sticky action bar (proofreader editor) ---------- */
.action-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 -4px 14px rgba(14,23,38,.08); }
.action-bar .action-notes { flex: 1; min-width: 200px; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font: inherit; font-size: 14px; }
.action-bar .action-hours { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.action-bar .action-hours input { width: 84px; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font: inherit; font-size: 15px; text-align: right; }

/* Quick "add to glossary" popover in the proofreading editor. */
.gl-quick-pop { margin-top: 10px; padding: 10px 14px; border-radius: var(--r-sm);
  background: #f2f7fc; border: 1px solid #cfe3f3; }

/* Translation-memory suggestions (reuse a previously-approved translation). */
.tm-suggest { margin-top: 10px; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px;
  background: #eaf5ec; color: #1f6b3b; border: 1px solid #bfe3ca; }
.tm-suggest .btn { margin-left: 6px; }
.tm-chip { margin-top: 4px; color: #1f6b3b; border-color: #bfe3ca; }

/* "Changes vs AI draft" diff panel. */
.diff-panel { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); white-space: pre-wrap; font-size: 14px; line-height: 1.6; max-height: 40vh; overflow: auto; }
.diff-panel ins { background: #d7f5dd; color: #12633a; text-decoration: none; }
.diff-panel del { background: #fdd8d5; color: #8a1c12; }
.field { margin-bottom: 13px; display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

/* ---------- Attachments (images + files) ---------- */
.attach-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.attach-item { width: 132px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px;
  background: var(--card); }
.attach-thumb { width: 118px; height: 84px; object-fit: cover; border-radius: 5px; background: var(--bg);
  display: block; cursor: zoom-in; }
.attach-thumb.thumb-failed { min-height: 84px; }
.attach-item.attach-file { display: flex; flex-direction: column; justify-content: center; min-height: 96px; }
.attach-meta { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11px; }
.attach-meta .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* Upload drop zone. */
.att-drop { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 8px;
  border: 1px dashed var(--line); border-radius: var(--r-sm); }
.att-drop.dropping { border-color: var(--brand); background: #eef4ff; }
.att-hint { font-size: 12px; }
.att-linkrow { display: flex; gap: 8px; margin: 6px 0; }
.att-url { flex: 1; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; font-size: 13px; }

/* Full-size image viewer overlay. */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.8);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 24px; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: var(--r-sm); background: #fff; }
.lightbox figcaption { color: #fff; text-align: center; margin-top: 10px; font-size: 13px; }

/* ---------- Visibility upgrades (from proofreader feedback) ---------- */
/* The requester's brief: it used to be grey micro-text nobody read. */
.brief-box { margin: 10px 0; padding: 12px 14px; border-radius: 10px;
  background: #fff8e6; border: 1px solid #f0dca6; font-size: 14px; line-height: 1.5; }
.brief-box strong { display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: .3px; color: #8a6d1f; margin-bottom: 4px; }

/* Grid progress at a glance — four states, each with its own colour so a row's
   state is obvious without reading anything. */
.grid-table .gr-status { width: 190px; white-space: nowrap; }
.row-pill { display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; }
.grid-table tr.rs-pending  > td { background: #fff; }
.grid-table tr.rs-ai       > td { background: #fffaf0; }
.grid-table tr.rs-edited   > td { background: #f2f7fd; }
.grid-table tr.rs-approved > td { background: #eefaf1; }
.grid-table tr.rs-flagged  > td { background: #fdf0ee; }
.row-pill.rs-flagged  { background: #fde2dd; color: #8a2b1d; cursor: help; }
.row-pill.rs-pending  { background: #f1f2f4; color: #6b7178; }
.row-pill.rs-ai       { background: #fff3cd; color: #7a5b00; }
.row-pill.rs-edited   { background: #dce8fa; color: #24427a; }
.row-pill.rs-approved { background: #d7f5dd; color: #12633a; }
.est-chip { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  background: #eef4ff; color: #24427a; font-size: 12px; font-weight: 600; }

/* Row-level approval controls in the grid (Crowdin-style sign-off). */
.grid-bulk { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 8px 0; padding: 8px 12px; border-radius: var(--r-sm); background: var(--bg);
  border: 1px solid var(--line); font-size: 13px; }
.grid-table .row-pick { margin-right: 4px; }
.grid-table .row-approve { margin-left: 6px; }

/* Glossary — collapsible category sections (calm by default, open on demand) */
details.gl-cat { margin-top: 12px; }
details.gl-cat > summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 10px 14px; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; list-style: none;
}
details.gl-cat > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.gl-cat[open] > summary::before { transform: rotate(90deg); }
details.gl-cat > summary::-webkit-details-marker { display: none; }
details.gl-cat[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.gl-cat > .card { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }

/* Row-count chips: informative, not alarming (red is for problems) */
.badge.rows { background: #E8F1F8; color: var(--navy); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  header { padding: 10px 16px; flex-wrap: wrap; }
  header p { display: none; }
  .userbar { flex-wrap: wrap; gap: 6px; }
  .userbar .btn { padding: 4px 9px; font-size: 12px; min-height: 28px; }
  nav { padding: 6px 10px; }
  main { padding: 16px 16px 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .modal-card { padding: 18px 16px; }
  .modal-card .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
