/* IBM Plex Sans Arabic, served from /fonts. Arabic and Latin subsets load only when used. */
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Light paper, navy ink, turquoise action. Amber, red and green only describe deadline state. */
:root {
  --paper: #f3f6f8;
  --surface: #ffffff;
  --ink: #13294b;
  --ink-soft: #52627a;
  --line: #dde4ec;
  --line-strong: #bfcad7;
  --hover: #eef2f6;
  --primary: #0b7f81;
  --primary-strong: #08686a;
  --primary-soft: #e1f3f2;
  --amber: #8a5300; --amber-bg: #fff3d9; --amber-dot: #dc9b1d;
  --red: #a3271f; --red-bg: #fde9e7; --red-dot: #d2402f;
  --ok: #1d6b45; --ok-bg: #dff3e8; --ok-dot: #2e9a63;
  --gray-dot: #a6b1be;
  /* Names older page rules use. */
  --border: var(--line); --muted: var(--ink-soft);
  --yellow: var(--amber); --yellow-bg: var(--amber-bg);
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar-width: 244px;
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
a { color: var(--primary-strong); font-weight: 600; text-underline-offset: .2em; }
a:hover { color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.55rem; line-height: 1.3; font-weight: 700; margin-block: 2px 6px; }
h2 { font-size: 1.04rem; font-weight: 700; margin-bottom: 10px; }
h3 { font-size: .95rem; font-weight: 600; margin-block: 8px 4px; }
small { font-weight: 400; color: var(--ink-soft); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.block { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Shell: sidebar at the inline start (right in Arabic), content beside it. */
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 60; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; color: #fff; }
.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 12px 10px; background: var(--surface); border-inline-end: 1px solid var(--line); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 12px; }
.wordmark { color: var(--ink); font-weight: 700; font-size: 1rem; text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.wordmark:hover { color: var(--primary-strong); }
.menu-close { display: none; }
.sidebar-nav { flex: 1; display: grid; align-content: start; gap: 14px; }
.nav-group-title { font-size: .76rem; font-weight: 600; color: var(--ink-soft); padding-inline: 10px; margin-bottom: 3px; }
.nav-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.nav-group a { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink); font-weight: 500; font-size: .94rem; text-decoration: none; }
.nav-group a:hover { background: var(--hover); color: var(--ink); }
.nav-group a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.nav-group a[aria-current="page"]::before { content: ""; position: absolute; inset-inline-start: -10px; inset-block: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav-group .count { margin-inline-start: auto; }
.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.sidebar-user:hover { color: var(--ink); background: var(--hover); border-radius: 8px; }
.sidebar-user strong { display: block; font-size: .9rem; font-weight: 600; }
.sidebar-user small { display: block; font-size: .78rem; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 600; flex-shrink: 0; }
.scrim, .sidebar-logout { display: none; }
.main-column { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px clamp(14px, 3vw, 28px); background: var(--surface); border-bottom: 1px solid var(--line); }
.menu-button, .topbar-mark { display: none; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.icon-button { position: relative; display: inline-flex; padding: 6px; border-radius: 8px; color: var(--ink); }
.icon-button:hover { background: var(--hover); color: var(--ink); }
.icon-button .icon { width: 20px; height: 20px; }
.bell .count { position: absolute; top: -1px; inset-inline-end: -3px; }
.count { min-width: 19px; padding: 0 6px; border-radius: 999px; background: var(--red-dot); color: #fff; font-size: .72rem; font-weight: 600; line-height: 19px; text-align: center; }
main { width: 100%; max-width: 1240px; padding: 18px clamp(14px, 3vw, 28px) 48px; }
body.plain main { max-width: 1100px; margin-inline: auto; }
.plain-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1100px; margin: auto; padding: 12px clamp(16px, 4vw, 32px); }

/* Workspace: current work first, reviews beside it, campaigns below. */
.page-head { margin-bottom: 14px; }
/* Titles keep their own direction but sit at the interface's start edge, beside the context line. */
.page-head h1 { width: fit-content; max-width: 100%; margin: 0 0 2px; overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: 3px; margin-bottom: 6px; color: var(--ink-soft); font-size: .86rem; text-decoration: none; }
.back:hover { color: var(--primary-strong); }
.back .icon { width: 16px; height: 16px; }
[dir="ltr"] .back .icon { transform: scaleX(-1); }
.page-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.page-title-text { flex: 1 1 320px; min-width: 0; }
.context { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; color: var(--ink-soft); font-size: .88rem; }
.context > span { display: inline-flex; align-items: center; }
.context > span + span::before { content: ""; width: 4px; height: 4px; margin-inline: 9px; border-radius: 50%; background: var(--line-strong); }
.lead { max-width: 72ch; margin-top: 2px; color: var(--ink-soft); font-size: .93rem; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Record pages: the work in the main column, facts and settings in a narrower aside. */
.page-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 330px); gap: 14px; align-items: start; }
.page-main, .page-aside { display: grid; gap: 14px; min-width: 0; }
.page-main > *, .page-aside > * { margin-block: 0; }
.page-aside .form-grid { grid-template-columns: minmax(0, 1fr); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, 1fr); gap: 14px; align-items: start; margin-bottom: 14px; }
.side-column { display: grid; gap: 14px; }
.workspace .panel, .side-column .panel { margin-bottom: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.tally { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: .85rem; font-weight: 600; }
.late-tally { padding: 1px 8px; border-radius: 999px; background: var(--red-bg); color: var(--red); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.work-list { list-style: none; margin: 0 -16px; padding: 0; }
/* The deadline rail: each row's inline-start edge shows on time, due soon, late or undated. */
.work-row { display: flex; align-items: center; gap: 12px; padding-block: 10px; padding-inline: 12px 16px; border-top: 1px solid var(--line); border-inline-start: 4px solid var(--gray-dot); }
.work-row[data-due="green"] { border-inline-start-color: var(--ok-dot); }
.work-row[data-due="yellow"] { border-inline-start-color: var(--amber-dot); }
.work-row[data-due="red"] { border-inline-start-color: var(--red-dot); background: #fffafa; }
.work-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.work-title { justify-self: start; color: var(--ink); font-weight: 600; font-size: .98rem; text-decoration: none; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.work-title:hover { color: var(--primary-strong); text-decoration: underline; }
.work-project { display: flex; flex-wrap: wrap; gap: 2px 10px; color: var(--ink-soft); font-size: .85rem; }
.work-project span { unicode-bidi: plaintext; }
.work-stage::before { content: "/"; margin-inline-end: 10px; color: var(--line-strong); }
.work-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; }
.due-text { color: var(--ink-soft); font-size: .82rem; font-weight: 600; }
.due-text[data-color="green"] { color: var(--ok); }
.due-text[data-color="yellow"] { color: var(--amber); }
.due-text[data-color="red"] { color: var(--red); }
.list-title { margin: 10px 0 4px; color: var(--ink-soft); font-size: .8rem; font-weight: 600; }
/* A record row without a deadline rail: files, requests, posts, shoots. */
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.work-list.compact .list-row { padding-block: 8px; }
.excerpt { color: var(--ink-soft); font-size: .86rem; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.work-list.compact .work-row { padding-block: 8px; }
.work-list.compact .work-title { font-size: .93rem; }
.campaign-list { list-style: none; margin: 0; padding: 0; }
.campaign-list li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(170px, 1fr) minmax(120px, auto); gap: 6px 18px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.campaign-name a { color: var(--ink); text-decoration: none; unicode-bidi: plaintext; }
.campaign-name a:hover { color: var(--primary-strong); text-decoration: underline; }
.campaign-name span { display: block; color: var(--ink-soft); font-size: .82rem; }
.campaign-progress { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: .84rem; white-space: nowrap; }
.campaign-progress progress { flex: 1; width: auto; min-width: 80px; }
.campaign-state { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; font-size: .82rem; }
details.create { margin-top: 4px; }
details.create > summary { display: inline-block; color: var(--primary-strong); font-weight: 600; }
.department-links h2 { font-size: .95rem; margin-bottom: 8px; }
.department-links ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.department-links a { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-weight: 500; text-decoration: none; }
.department-links a:hover { border-color: var(--primary); color: var(--primary-strong); }

/* Controls. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--primary); border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.button:hover { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.button.quiet { background: var(--surface); border-color: var(--line-strong); color: var(--primary-strong); }
.button.quiet:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); }
.work-list.compact .button { padding: 5px 12px; font-size: .85rem; }
button.wide { width: 100%; }
button { font: inherit; font-weight: 600; width: fit-content; padding: 7px 14px; border: 1px solid var(--primary); border-radius: var(--radius-sm); background: var(--primary); color: #fff; cursor: pointer; }
button:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
button.ghost { background: var(--surface); color: var(--primary-strong); border-color: var(--line-strong); }
button.ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
button.small { padding: 3px 10px; font-size: .85rem; }
button.danger { background: var(--red); border-color: var(--red); }
button.danger:hover { background: #861f19; }
button.link { padding: 0; border: 0; background: none; color: var(--primary-strong); text-align: start; text-decoration: underline; text-underline-offset: .2em; }
button[disabled] { opacity: .5; cursor: not-allowed; }
.fields { display: grid; gap: 10px; }
label { display: grid; gap: 4px; font-weight: 600; min-width: 0; }
label small { font-weight: 400; }
input, textarea, select { width: 100%; min-width: 0; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: inherit; font: inherit; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
textarea { min-height: 72px; resize: vertical; }
fieldset { margin: 0; min-width: 0; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
legend { padding-inline: 6px; font-weight: 600; }
progress { width: 120px; height: 8px; vertical-align: middle; border: 0; border-radius: 999px; background: var(--hover); accent-color: var(--primary); }
progress::-webkit-progress-bar { background: var(--hover); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }

/* Shared page pieces. */
.muted, .meta, .items p, .empty { color: var(--ink-soft); }
.empty { padding-block: 6px; }
.grid, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid > details { align-self: start; }
.panel { min-width: 0; margin-bottom: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
/* The one thing this person is expected to do on the page. */
.panel.emphasis { border-color: #b8dcdb; box-shadow: inset 0 3px 0 var(--primary); }
.panel.narrow { max-width: 580px; }
.filter-panel { padding-block: 10px 12px; }
/* Folded panels: a creation form or a long history, one click away. */
details.panel { margin-top: 0; padding: 0; border-top: 1px solid var(--line); }
details.panel > summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-size: 1rem; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: ""; width: 7px; height: 7px; margin-inline-start: auto; border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg) translateY(-2px); }
details.panel[open] > summary { border-bottom: 1px solid var(--line); }
details.panel[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details.panel > :not(summary) { margin-inline: 16px; }
details.panel[open] { padding-bottom: 14px; }
details.panel > summary + * { margin-top: 12px; }
details.panel > summary + .entry { border-top: 0; }
.create-panel > summary { color: var(--primary-strong); }
.create-panel > summary .icon { width: 22px; height: 22px; padding: 3px; border-radius: 6px; background: var(--primary-soft); }
.log > summary { color: var(--ink); }
.decision { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--paper); }
.review-notes { margin-bottom: 12px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--amber-bg); }
.review-notes .entry { border-top: 0; }
.description { max-width: 75ch; margin-bottom: 14px; color: var(--ink-soft); }
.auth { max-width: 440px; margin: 5vh auto 0; padding: 22px; }
.auth h1 { margin-bottom: 2px; }
.auth .lead { margin-bottom: 14px; }
.demo-accounts ul { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.demo-accounts li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; font-size: .88rem; }
.search-row { display: flex; gap: 8px; margin-bottom: 6px; }
.search-row label { flex: 1; }
.link-list { display: grid; margin: 0; padding: 0; list-style: none; }
.link-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: 7px; border-top: 1px solid var(--line); }
.link-list a { unicode-bidi: plaintext; }
.people-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.people-list li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.people-list .avatar { width: 28px; height: 28px; background: var(--primary-soft); color: var(--primary-strong); font-size: .8rem; }
.preview-panel .preview { margin-inline: auto; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 10px; border-top: 1px solid var(--line); }
.items li > div { min-width: 0; overflow-wrap: anywhere; }
.items li > form { min-width: 0; }
.items p, .meta, .stat { font-size: .86rem; }
.row-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.notifications li.unread { font-weight: 600; }
.notifications li.unread::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red-dot); flex-shrink: 0; }
.notifications form { flex: 1; min-width: 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--hover); color: var(--ink); font-size: .78rem; font-weight: 600; text-align: center; white-space: nowrap; }
.badge[data-status="ready"], .badge[data-status="plan_active"], .badge[data-status="in_progress"], .badge[data-status="in_review"], .badge[data-status="pending_approval"] { background: var(--primary-soft); color: var(--primary-strong); }
.badge[data-status="blocked"], .badge[data-status="correction_requested"], .badge[data-status="changes_requested"], .badge[data-status="request_submitted"], .badge[data-status="on_hold"],
.badge[data-status="proposal_proposed"], .badge[data-status="project_at_risk"], .badge[data-status="high_load"],
.badge[data-status="conn_not_connected"], .badge[data-status="conn_disconnected"] { background: var(--amber-bg); color: var(--amber); }
.badge[data-status="rejected"], .badge[data-status="inactive"], .badge[data-status="request_declined"], .badge[data-status="failed"], .badge[data-status="cancelled"],
.badge[data-status="project_late"], .badge[data-status="proposal_declined"], .badge[data-status="conn_expired"], .badge[data-status="conn_error"] { background: var(--red-bg); color: var(--red); }
.badge[data-status="approved"], .badge[data-status="plan_completed"], .badge[data-status="gate_open"], .badge[data-status="request_converted"], .badge[data-status="published"], .badge[data-status="done"],
.badge[data-status="proposal_applied"], .badge[data-status="project_completed"], .badge[data-status="suggested"], .badge[data-status="project_on_track"],
.badge[data-status="conn_connected"] { background: var(--ok-bg); color: var(--ok); }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; white-space: nowrap; }
.due::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--gray-dot); flex-shrink: 0; }
.due[data-color="green"]::before { background: var(--ok-dot); }
.due[data-color="yellow"]::before { background: var(--amber-dot); }
.due[data-color="red"]::before { background: var(--red-dot); }
.due[data-color="red"] { color: var(--red); font-weight: 600; }
dl { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 6px 12px; margin: 0; }
dt { color: var(--ink-soft); }
dd { justify-self: start; margin: 0; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
details { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
details > form, details > p, details > div { margin-top: 8px; }
summary { cursor: pointer; font-weight: 600; }
code { display: inline-block; padding-inline: 4px; border-radius: 4px; background: var(--hover); }
.alert { margin-block: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--red-bg); color: var(--red); }
.notice { margin-block: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--ok-bg); color: var(--ok); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.standalone { margin-bottom: 14px; }
.entry { padding-block: 10px; border-top: 1px solid var(--line); }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
/* User-entered content keeps its own direction inside either interface language. */
.text, h1, h3, dd, .items a, td, .stepper li, summary, .notifications button, .meta { unicode-bidi: plaintext; }
.text[dir] { unicode-bidi: isolate; }
.quote { margin-block: 6px; padding-inline-start: 10px; border-inline-start: 3px solid var(--primary); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 8px; border-top: 1px solid var(--line); text-align: start; vertical-align: top; }
th { border-top: 0; color: var(--ink-soft); font-size: .82rem; font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.prereq { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-block: 6px; }
.prereq select { width: auto; }
.stepper { display: flex; gap: 6px; margin: 0 0 14px; padding: 0; overflow-x: auto; list-style: none; }
.stepper li { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .88rem; white-space: nowrap; }
.stepper .dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--hover); font-size: .8rem; font-weight: 600; }
.stepper li[data-status="completed"] .dot { background: var(--primary); color: #fff; }
.stepper li[data-status="rejected"] .dot { background: var(--red); color: #fff; }
.stepper li[aria-current="step"] { border-color: var(--primary); font-weight: 600; }
.checklist { margin: 0; padding: 0; list-style: none; }
.checklist .item { display: flex; align-items: flex-start; gap: 10px; padding-block: 6px; }
.tick { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 2px solid var(--primary); border-radius: 6px; background: var(--surface); color: var(--primary); flex-shrink: 0; }
.tick:hover { background: var(--primary-soft); }
.item[data-done="yes"] .tick { background: var(--primary); color: #fff; }
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.subnav a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 500; text-decoration: none; }
.subnav a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-card { display: grid; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.stat-card strong { font-size: 1.5rem; line-height: 1.2; }
.stat-card span, .stat-card small { color: var(--ink-soft); font-weight: 500; }
.stages { margin: 0; padding: 0; list-style: none; }
.stages > li { padding-block: 10px; border-top: 1px solid var(--line); }
.stages > li.inactive { opacity: .65; }
.stage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.inline { display: inline-flex; gap: 4px; }
.manage details:first-of-type { border-top: 0; }
.links { align-items: center; margin-top: 8px; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.filters label { flex: 1 1 160px; }
.files { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.files li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.files li img { max-width: 160px; max-height: 110px; border-radius: 6px; object-fit: cover; }
.files li audio { width: min(100%, 320px); }
.preview { display: block; max-width: 100%; max-height: 70vh; margin-bottom: 10px; border-radius: var(--radius); background: var(--hover); }
.file-open { display: inline-block; margin-bottom: 10px; }
.recorder-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.recorder-controls audio { width: min(100%, 320px); }
.messages { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.message { max-width: 92%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.message.mine { margin-inline-start: auto; background: var(--primary-soft); }
.message:target { outline: 3px solid var(--amber-dot); }
.reply-to { margin-block: 4px; padding-inline-start: 8px; border-inline-start: 3px solid var(--line); color: var(--ink-soft); font-size: .85rem; }
.message-tools { display: flex; gap: 12px; margin-top: 4px; color: var(--ink-soft); font-size: .82rem; }
.mention { padding-inline: 2px; border-radius: 4px; background: var(--amber-bg); color: inherit; }
.compose textarea { min-height: 64px; }
.bars { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(80px, 2fr) auto; align-items: center; gap: 10px; }
.bars progress { width: 100%; }
.reasons { margin: 0; padding-inline-start: 18px; font-size: .86rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.inline-form input { flex: 1 1 180px; width: auto; }
.late { color: var(--red); font-weight: 600; }
tr.high td, tr.suggested td { background: #fafcfd; }
tr.high td:first-child { border-inline-start: 3px solid var(--red-dot); }
tr.suggested td:first-child { border-inline-start: 3px solid var(--primary); }
.level[data-level="critical"] { color: var(--red); font-weight: 700; }
.level[data-level="high"] { color: var(--amber); font-weight: 700; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.calendar .weekday { color: var(--ink-soft); font-size: .76rem; font-weight: 600; text-align: center; }
.calendar .day { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 88px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.calendar .day.outside { border: 0; background: transparent; }
.calendar .date { color: var(--ink-soft); font-size: .74rem; }
.calendar .day-full { display: none; }
.chip { display: block; overflow: hidden; padding: 2px 6px; border-radius: 6px; background: var(--primary-soft); color: var(--ink); font-size: .76rem; font-weight: 600; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
.chip[data-kind^="pub_published"], .chip[data-kind="task_approved"] { background: var(--ok-bg); }
.chip[data-kind^="pub_failed"], .chip[data-kind="task_rejected"] { background: var(--red-bg); }
.chip[data-kind^="pub_pending"], .chip[data-kind^="pub_scheduled"] { background: var(--amber-bg); }
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 10px; overflow-x: auto; }
.column { min-width: 200px; padding: 8px; border-radius: var(--radius); background: var(--hover); }
.card { margin-bottom: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.card .row-end { justify-content: flex-start; margin-top: 4px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.inline-form select { width: auto; max-width: 100%; }
.checklist .item > span { flex: 1; min-width: 0; }
.participants { margin-top: -6px; margin-bottom: 12px; }
.office-preview h3 { margin-top: 14px; }
.office-preview h3:first-child { margin-top: 0; }
.office-doc { max-width: 75ch; }
.office-sheet td { white-space: pre-wrap; unicode-bidi: plaintext; min-width: 6ch; }
.office-slide { padding-block: 10px; border-top: 1px solid var(--line); }
.office-slide:first-child { border-top: 0; padding-top: 0; }
.kb-article { max-width: 80ch; }
.kb-article h3 { margin-top: 16px; }
.kb-article h3:first-child { margin-top: 0; }
.kb-list { margin: 6px 0 10px; padding-inline-start: 22px; }
textarea.tall { min-height: 260px; }
.timeline-wrap { overflow-x: auto; }
.timeline { width: 100%; min-width: 700px; height: auto; font: inherit; }
.timeline .label { fill: var(--ink); font-size: 13px; }
.timeline .axis { fill: var(--ink-soft); font-size: 11px; }
.timeline .bar { fill: #9fd3d1; }
.timeline .bar[data-status="approved"] { fill: var(--ok-dot); }
.timeline .bar[data-status="blocked"], .timeline .bar[data-status="on_hold"] { fill: var(--amber-dot); }
.timeline .bar[data-status="rejected"], .timeline .bar[data-status="cancelled"] { fill: var(--red-dot); }
.timeline .now { stroke: var(--red); stroke-width: 2; stroke-dasharray: 4 3; }
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 8px; }
.media figure { margin: 0; }
.media figcaption { color: var(--ink-soft); font-size: .8rem; }
.post-preview .text { padding: 10px; border-radius: 8px; background: var(--paper); }
.view-switch { margin-top: 10px; }
.panel-head .view-switch { margin: 0; }
.unavailable { color: var(--ink-soft); font-style: italic; }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--red); font-weight: 600; }

/* Tablet: the reviews column moves under the tasks. */
@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .page-columns { grid-template-columns: minmax(0, 1fr); }
}

/* Phone and small tablet: the sidebar becomes a drawer from the inline start. */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 40; width: min(300px, 86vw); height: auto; visibility: hidden; transform: translateX(100%); transition: transform .2s ease, visibility .2s; }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar:target, .sidebar[data-open] { visibility: visible; transform: none; }
  .sidebar:target + .scrim, .sidebar[data-open] + .scrim { position: fixed; inset: 0; z-index: 30; display: block; background: rgba(19, 41, 75, .4); }
  .menu-close { display: inline-flex; padding: 6px; border-radius: 8px; color: var(--ink); }
  .menu-button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
  .topbar-mark { display: inline; }
  .topbar { gap: 8px; padding-inline: 12px; }
  .top-actions form[action="/logout"] { display: none; }
  .sidebar-logout { display: block; padding: 0 10px 4px; }
}
@media (max-width: 760px) {
  .grid, .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .form-grid { gap: 10px; }
  main { padding: 14px 12px 40px; }
  .items li { flex-wrap: wrap; }
  .row-end { justify-content: flex-start; }
  th, td { padding: 7px 6px; }
  .work-list { margin-inline: -12px; }
  .panel { padding: 12px; }
  .list-row { padding-inline: 12px; }
  .filters label { flex-basis: 130px; }
  details.panel { padding: 0; }
  details.panel > summary { padding-inline: 12px; }
  details.panel > :not(summary) { margin-inline: 12px; }
  .page-title { align-items: flex-start; }
  .campaign-list li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .campaign-state { justify-content: flex-start; }
  .calendar { grid-template-columns: minmax(0, 1fr); }
  .calendar .weekday, .calendar .day.outside, .calendar .day:not(.busy) { display: none; }
  .calendar .day { min-height: 0; }
  .calendar .day-full { display: inline; }
  .calendar .day-number { display: none; }
}
@media (max-width: 360px) {
  .topbar-mark { display: none; }
  .work-row, .list-row { flex-wrap: wrap; }
  .work-row .button, .list-row .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}
