/* BCN_Pipeline — design system
   Brand: ink #201E1E and signal orange #F58634 (sampled from the BCN logo).
   Type: Archivo variable; condensed widths for headings and figures echo the BCN wordmark.
   Signature element: the activation "route" — a fibre line with checkpoints. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
  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: "Archivo";
  src: url("../fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
                 U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* brand */
  --ink: #201e1e;
  --ink-2: #2c2a29;
  --ink-3: #3a3736;
  --signal: #f58634;
  --signal-hover: #e8741f;
  --signal-text: #a3500c;      /* orange that passes AA on white */
  --signal-wash: #fff1e6;
  /* neutrals */
  --canvas: #eceef0;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --line: #dadde1;
  --line-soft: #e8eaed;
  --text: #201e1e;
  --text-2: #565c64;
  --text-3: #80868e;
  /* status */
  --ok: #17734a;      --ok-bg: #e3f3ea;
  --warn: #8f5300;    --warn-bg: #fff1d6;
  --danger: #b42318;  --danger-bg: #fdeceb;
  --info: #1b5bb5;    --info-bg: #e7effb;
  --muted: #565c64;   --muted-bg: #eef0f2;
  /* tracker: green = done, amber = in progress, red = sent back / overdue / on hold, grey = not yet */
  --t-done: #1f8f52;  --t-active: #e09b07;  --t-alert: #c8321f;  --t-todo: #c9ced4;
  /* type */
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14.5px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 28px; --fs-2xl: 40px;
  /* shape */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --shadow-pop: 0 12px 32px -8px rgba(32, 30, 30, .28), 0 2px 6px rgba(32, 30, 30, .08);
  --sidebar: 248px;
  --topbar: 60px;
  --focus: 0 0 0 3px rgba(245, 134, 52, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-base); line-height: 1.5; color: var(--text);
  background: var(--canvas); font-stretch: 100%; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: rgba(32, 30, 30, .3); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: 20px 0; }
code { font-size: .92em; background: var(--muted-bg); padding: 1px 5px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.15; letter-spacing: -.005em; }
h1 { font-size: var(--fs-xl); font-stretch: 78%; font-weight: 750; }
h2 { font-size: var(--fs-lg); font-stretch: 85%; }
h3 { font-size: var(--fs-md); font-stretch: 92%; }
p { margin: 0 0 12px; }
small, .small { font-size: var(--fs-sm); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-stretch: 75%; font-weight: 700; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ------------------------------------------------------------------ app shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--ink); color: #e9e6e3;
  display: flex; flex-direction: column; padding: 18px 14px 14px; overflow-y: auto; z-index: 40;
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 18px; text-decoration: none; }
.sidebar .brand img { width: 74px; height: auto; }
.sidebar .brand span { font-stretch: 80%; font-weight: 600; font-size: 13px; line-height: 1.2; color: #b9b3ae; border-left: 1px solid #45403e; padding-left: 12px; }
.nav-group { margin-top: 10px; }
.nav-group > p { margin: 14px 10px 6px; font-size: 12px; color: #8f8883; font-weight: 500; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: var(--r-sm);
  text-decoration: none; color: #d9d4d0; font-weight: 500; position: relative;
}
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; opacity: .8; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.is-active { background: var(--ink-3); color: #fff; }
.nav a.is-active::before {
  content: ""; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 3px 3px 0; background: var(--signal);
}
.nav a.is-active svg { opacity: 1; stroke: var(--signal); }
.nav .count {
  margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--signal); color: var(--ink);
  font-size: 12px; font-weight: 700; text-align: center; line-height: 20px;
}
.nav .count.quiet { background: #45403e; color: #e9e6e3; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid #36322f; font-size: 12px; color: #8f8883; }
.sidebar-foot img { width: 26px; opacity: .9; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 75; height: var(--topbar); background: rgba(236, 238, 240, .92);
  backdrop-filter: blur(8px); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  border-bottom: 1px solid var(--line);
}
.topbar .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input[type=search] {
  width: 100%; height: 38px; min-height: 38px; padding: 0 12px 0 36px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); font: inherit; color: var(--text);
}
.search > svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; stroke: var(--text-3); }
.search kbd {
  position: absolute; right: 9px; top: 9px; font: 600 11px var(--font); color: var(--text-3); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px; background: var(--surface-2);
}
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-pop); overflow: hidden;
}
.search-results:empty { display: none; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 10px 14px; text-decoration: none; border-top: 1px solid var(--line-soft); }
.search-results a:first-child { border-top: 0; }
.search-results a:hover, .search-results a:focus { background: var(--surface-2); }
.search-results .empty { padding: 14px; color: var(--text-2); }
.topbar .spacer { flex: 1; }
.icon-btn {
  position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text);
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); }
.icon-btn svg { width: 19px; height: 19px; stroke: currentColor; }
.icon-btn #notif-badge { position: absolute; inset: 0; pointer-events: none; }
.icon-btn .dot {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--signal); color: var(--ink); font-size: 11px; font-weight: 750; line-height: 18px; text-align: center;
  border: 2px solid var(--canvas);
}

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 6px; z-index: 50;
}
.menu-pop a, .menu-pop button {
  display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm);
  text-decoration: none; background: none; border: 0; font: inherit; color: var(--text); cursor: pointer; text-align: left;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.menu-pop .who b { display: block; }
.menu-pop.notif { width: min(400px, calc(100vw - 24px)); padding: 0; }
.menu-pop .danger-item { color: var(--danger); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; font-stretch: 85%;
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
img.avatar { object-fit: cover; background: var(--muted-bg); }
.avatar.xl { width: 96px; height: 96px; font-size: 34px; }
.avatar-edit { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar.signal { background: var(--signal); color: var(--ink); }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; }
.user-btn:hover { background: var(--surface); }
.user-btn .meta { line-height: 1.2; }
.user-btn .meta b { display: block; font-size: 13.5px; }
.user-btn .meta span { font-size: 12px; color: var(--text-2); }

.content { padding: 28px 32px 64px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .lede { color: var(--text-2); margin: 6px 0 0; max-width: 70ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 8px; }
.crumbs a { color: var(--text-2); }

/* ------------------------------------------------------------------ layout helpers */
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.stack > * + * { margin-top: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.sticky-side { position: sticky; top: calc(var(--topbar) + 20px); }

/* ------------------------------------------------------------------ panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h2, .panel-head h3 { font-size: 16.5px; font-stretch: 88%; }
.panel-head .sub { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.panel-body { padding: 18px; }
.panel-body.tight { padding: 6px 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); background: var(--surface-2); border-radius: 0 0 var(--r-md) var(--r-md); }
.panel.callout { border-color: var(--signal); box-shadow: inset 4px 0 0 var(--signal); }
.panel.callout.danger { border-color: #e9a29c; box-shadow: inset 4px 0 0 var(--danger); }
.panel.flat { background: var(--surface-2); }

/* ------------------------------------------------------------------ buttons */
.btn {
  --bg: var(--surface); --fg: var(--text); --bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px;
  border-radius: var(--r-sm); border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font: 600 14px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; }
.btn:hover { --bg: var(--surface-2); --bd: #c4c8ce; }
.btn.primary { --bg: var(--signal); --fg: var(--ink); --bd: var(--signal); font-weight: 700; }
.btn.primary:hover { --bg: var(--signal-hover); --bd: var(--signal-hover); }
.btn.dark { --bg: var(--ink); --fg: #fff; --bd: var(--ink); }
.btn.dark:hover { --bg: var(--ink-3); --bd: var(--ink-3); }
.btn.ok { --bg: var(--ok); --fg: #fff; --bd: var(--ok); }
.btn.ok:hover { --bg: #0f5f3b; --bd: #0f5f3b; }
.btn.danger { --bg: var(--surface); --fg: var(--danger); --bd: #eab3ae; }
.btn.danger:hover { --bg: var(--danger-bg); }
.btn.danger.solid { --bg: var(--danger); --fg: #fff; --bd: var(--danger); }
.btn.ghost { --bg: transparent; --bd: transparent; }
.btn.ghost:hover { --bg: var(--surface-2); --bd: transparent; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--signal-text); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------------ pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px;
  font-weight: 600; line-height: 20px; white-space: nowrap; background: var(--muted-bg); color: var(--muted);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.neutral { background: var(--signal-wash); color: var(--signal-text); }
.pill.muted { background: var(--muted-bg); color: var(--muted); }
.tag { display: inline-block; padding: 0 7px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; color: var(--text-2); line-height: 20px; }
.ref { font-size: 12.5px; color: var(--text-3); font-weight: 500; letter-spacing: .01em; }

/* ------------------------------------------------------------------ forms */
.field { display: grid; gap: 6px; align-content: start; }
.field + .field { margin-top: 14px; }
.field label, .label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--text-2); }
.field .error { font-size: 12.5px; color: var(--danger); font-weight: 600; }
.req::after { content: " *"; color: var(--signal-text); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=search],
input[type=number], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #c9cdd2; border-radius: var(--r-sm);
  background: var(--surface); font: inherit; color: var(--text);
}
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23565c64' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--signal); box-shadow: var(--focus); }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--danger); }
input::placeholder, textarea::placeholder { color: #9aa0a7; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .field + .field { margin-top: 0; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section { padding: 22px 0; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.form-section:first-child { border-top: 0; padding-top: 4px; }
.form-section > header h3 { font-size: 15.5px; }
.form-section > header p { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--signal); flex: none; }
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  flex: 1; min-width: 150px; display: flex; gap: 10px; align-items: center; padding: 11px 13px; border: 1px solid #c9cdd2;
  border-radius: var(--r-sm); cursor: pointer; font-weight: 600;
}
.choice input { accent-color: var(--signal); width: 18px; height: 18px; margin: 0; }
.choice:has(input:checked) { border-color: var(--signal); background: var(--signal-wash); }
.money { position: relative; display: block; }
.money input { padding-left: 26px; text-align: right; }
.money::before { content: "₦"; position: absolute; left: 10px; top: 9px; color: var(--text-3); font-weight: 600; }
.input-group { display: flex; gap: 8px; }
.input-group > input { flex: 1; }

.drop {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed #b9bec5;
  border-radius: var(--r-md); background: var(--surface-2); cursor: pointer;
}
.drop:hover, .drop.is-over { border-color: var(--signal); background: var(--signal-wash); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop .drop-icon { width: 38px; height: 38px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.drop .drop-icon svg { width: 18px; height: 18px; stroke: var(--text-2); }
.drop b { display: block; font-size: 14px; }
.drop span { font-size: 12.5px; color: var(--text-2); }
.drop.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.drop.has-file .drop-icon svg { stroke: var(--ok); }
.drop[aria-invalid=true] { border-color: var(--danger); background: var(--danger-bg); }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.linked { cursor: pointer; }
.table tbody tr.linked:hover td { background: #fafafb; }
.table .title-cell { min-width: 170px; }
.table .due { margin-left: 0; }
.table .title-cell a { font-weight: 650; text-decoration: none; }
.table .title-cell a:hover { text-decoration: underline; }
.table .title-cell .ref { display: block; margin-top: 1px; }
.table td.actions { text-align: right; white-space: nowrap; }
.table.compact td { padding: 9px 14px; }
.dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 9px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ signature: the activation route */
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: relative; }
.route li { position: relative; padding-top: 30px; text-align: center; min-width: 0; }
.route li::before { /* the line into this checkpoint */
  content: ""; position: absolute; top: 10px; left: -50%; right: 50%; height: 4px; border-radius: 2px;
  background-image: repeating-linear-gradient(90deg, var(--t-todo) 0 8px, transparent 8px 13px);
}
.route li:first-child::before { display: none; }
.route li.done::before, .route li.skipped::before { background: var(--t-done); }
.route li.current::before { background: linear-gradient(90deg, var(--t-done), var(--t-active)); }
.route li.rejected::before, .route li.alert::before { background: linear-gradient(90deg, var(--t-done), var(--t-alert)); }
.route li .node {
  position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--t-todo); z-index: 1; display: grid; place-items: center;
}
.route li.done .node { background: var(--t-done); border-color: var(--t-done); }
.route li.done .node::after, .pipeline .route li.live .node::after {
  content: ""; width: 6px; height: 3px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px);
}
.route li.skipped .node { background: var(--surface); border-color: var(--t-done); border-style: dashed; }
.route li.current .node { background: var(--t-active); border-color: var(--t-active); box-shadow: 0 0 0 5px rgba(224, 155, 7, .22); }
.route li.rejected .node, .route li.alert .node { background: var(--t-alert); border-color: var(--t-alert); box-shadow: 0 0 0 5px rgba(200, 50, 31, .16); }
.route li.rejected .node::after, .route li.alert .node::after { content: "!"; color: #fff; font-size: 12px; font-weight: 800; line-height: 1; }
.route .r-label { display: block; font-weight: 650; font-size: 13.5px; font-stretch: 88%; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route li.todo .r-label { color: var(--text-2); font-weight: 550; }
.route .r-meta { display: block; font-size: 12px; color: var(--text-2); padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route li.done .r-meta { color: var(--ok); }
.route li.current .r-meta { color: var(--warn); font-weight: 600; }
.route li.rejected .r-meta, .route li.alert .r-meta { color: var(--danger); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .route li.current .node { animation: pulse 2.4s ease-out infinite; }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224, 155, 7, .55); } 70% { box-shadow: 0 0 0 10px rgba(224, 155, 7, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 155, 7, 0); } }
}
.legend-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-row .l-done { background: var(--t-done); } .legend-row .l-active { background: var(--t-active); }
.legend-row .l-alert { background: var(--t-alert); } .legend-row .l-todo { background: var(--surface); border: 2px solid var(--t-todo); }

/* pipeline (dashboard): the same route, with counts */
.pipeline { padding: 22px 18px 18px; }
.pipeline .route li { padding-top: 0; }
.pipeline .route li::before { top: 58px; height: 3px; background: var(--t-todo); background-image: none; }
.pipeline .route li .node { top: 50px; }
.pipeline .p-count { display: block; height: 44px; font-size: 38px; line-height: 44px; font-stretch: 70%; font-weight: 750; text-decoration: none; }
.pipeline .p-count.zero { color: #b6bbc1; }
.pipeline .route li .r-label { margin-top: 38px; }
.pipeline a.stop { text-decoration: none; display: block; border-radius: var(--r-sm); }
.pipeline .route li.has .node { background: var(--t-active); border-color: var(--t-active); }
.pipeline .route li.has .p-count { color: #a86f00; }
.pipeline .route li.alert .node { background: var(--t-alert); border-color: var(--t-alert); }
.pipeline .route li.alert .p-count { color: var(--t-alert); }
.pipeline .route li.live .node { background: var(--t-done); border-color: var(--t-done); }
.pipeline .route li.live .p-count { color: var(--t-done); }
.pipeline .route li.none .node { border-color: var(--t-todo); }
.pipeline .route li.none .r-label { color: var(--text-2); font-weight: 550; }
.pipeline a.stop:hover .r-label { text-decoration: underline; }

/* mini track (delivery cards) */
.track { display: flex; gap: 4px; margin: 12px 0 6px; }
.track span { flex: 1; height: 6px; border-radius: 3px; background: #dfe2e6; }
.track span.done { background: var(--t-done); }
.track span.current { background: var(--t-active); }
.track.alert span.current { background: var(--t-alert); }
.track-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }

/* vertical timeline (history) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 7px; bottom: -7px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text-3); }
.timeline li.ok::after { border-color: var(--ok); background: var(--ok); }
.timeline li.signal::after { border-color: var(--t-active); background: var(--t-active); }
.timeline li.danger::after { border-color: var(--danger); background: var(--danger); }
.timeline .t-text { font-size: 14px; }
.timeline .t-meta { font-size: 12.5px; color: var(--text-2); }

/* delivery steps list on project page */
.steps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
.steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.steps li:first-child { border-top: 0; }
.steps .s-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 2px solid #cfd3d8; color: var(--text-3); background: var(--surface); }
.steps .s-dot svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 3; }
.steps li.done .s-dot { background: var(--t-done); border-color: var(--t-done); color: #fff; }
.steps li.current { background: #fff6e0; }
.steps li.current.alert { background: var(--danger-bg); }
.steps li.current.alert .s-dot { border-color: var(--t-alert); color: var(--t-alert); }
.steps li.current .s-dot { border-color: var(--t-active); color: #a86f00; background: #fff; }
.steps .s-title { font-weight: 600; }
.steps li.todo .s-title { color: var(--text-2); font-weight: 500; }
.steps .s-detail { font-size: 13px; color: var(--text-2); }
.steps .s-when { font-size: 12.5px; color: var(--text-2); text-align: right; white-space: nowrap; }

/* ------------------------------------------------------------------ dashboard */
.greeting h1 { font-size: 34px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.kpi { padding: 16px 18px; border-left: 1px solid var(--line-soft); text-decoration: none; display: block; }
.kpi:first-child { border-left: 0; }
.kpi .k-value { font-size: 36px; line-height: 1; font-stretch: 70%; font-weight: 750; display: block; margin-bottom: 6px; }
.kpi .k-label { font-weight: 600; font-size: 13.5px; }
.kpi .k-note { font-size: 12.5px; color: var(--text-2); }
.kpi.alert .k-value { color: var(--danger); }
a.kpi:hover { background: var(--surface-2); }
.kpi .unit { font-size: 16px; font-weight: 600; margin-left: 2px; color: var(--text-2); }

.queue { list-style: none; margin: 0; padding: 0; }
.queue li { border-top: 1px solid var(--line-soft); }
.queue li:first-child { border-top: 0; }
.queue a { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 18px 13px 0; text-decoration: none; }
.queue a:hover { background: var(--surface-2); }
.queue .q-bar { align-self: stretch; border-radius: 0 3px 3px 0; background: var(--line); }
.queue .tone-warn .q-bar { background: var(--t-active); }
.queue .tone-danger .q-bar { background: var(--danger); }
.queue .tone-default .q-bar { background: var(--t-active); }
.queue .q-main b { display: block; font-size: 14.5px; }
.queue .q-action { font-weight: 650; color: var(--warn); font-size: 13px; }
.queue .tone-danger .q-action { color: var(--danger); }
.queue .q-detail { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue .q-when { font-size: 12.5px; color: var(--text-2); text-align: right; white-space: nowrap; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.feed li:first-child { border-top: 0; }
.feed .f-meta { font-size: 12px; color: var(--text-2); }
.feed li > span:first-child svg { width: 18px; height: 18px; stroke: var(--danger); margin-top: 2px; }
.feed a { font-weight: 600; text-decoration: none; }
.feed a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ project page */
.project-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; }
.project-head h1 { font-size: 32px; }
.project-head .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; color: var(--text-2); font-size: 13.5px; }
.route-panel { padding: 22px 12px 18px; overflow-x: auto; }
.route-panel .route { min-width: 720px; }
.status-line { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.decide-box textarea { min-height: 70px; }
.fin { width: 100%; border-collapse: collapse; font-size: 14px; }
.fin th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.fin td { padding: 10px; border-bottom: 1px solid var(--line-soft); }
.fin td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin tr:last-child td { border-bottom: 0; }
.doc { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.doc:first-child { border-top: 0; }
.doc .doc-ic { width: 36px; height: 40px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--text-2); flex: none; }
.doc .doc-ic.pdf { color: var(--danger); }
.doc .doc-main { min-width: 0; flex: 1; }
.doc .doc-main b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .doc-main span { font-size: 12.5px; color: var(--text-2); }
.notice { display: flex; gap: 12px; padding: 13px 16px; border-radius: var(--r-md); background: var(--info-bg); color: #163f78; font-size: 14px; }
.notice.warn { background: var(--warn-bg); color: #6a3e00; }
.notice.danger { background: var(--danger-bg); color: #7d1a12; }
.notice.ok { background: var(--ok-bg); color: #0f4f32; }
.notice svg { width: 18px; height: 18px; flex: none; stroke: currentColor; margin-top: 1px; }
.notice b { font-weight: 700; }

/* ------------------------------------------------------------------ tabs, filters, pagination */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--text-2); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { color: var(--text); border-bottom-color: var(--signal); }
.tabs .c { font-size: 12px; background: var(--muted-bg); color: var(--text-2); border-radius: 999px; padding: 0 7px; line-height: 19px; }
.tabs a.is-active .c { background: var(--ink); color: #fff; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.filters input[type=search] { max-width: 280px; min-height: 36px; }
.filters select { width: auto; min-height: 36px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: 13px; font-weight: 600; color: var(--text-2); }
.chip:hover { border-color: #b9bec5; color: var(--text); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .c { font-weight: 700; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 13.5px; color: var(--text-2); }

/* ------------------------------------------------------------------ delivery board */
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.job { display: flex; flex-direction: column; }
.job .panel-body { flex: 1; }
.job h3 { font-size: 17px; }
.job h3 a { text-decoration: none; }
.job h3 a:hover { text-decoration: underline; }
.job .j-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin-top: 12px; }
.job .j-meta dt { color: var(--text-2); }
.job .j-meta dd { margin: 0; font-weight: 600; }
.job .j-next { font-size: 13px; color: var(--text-2); margin-top: 10px; }
.job .j-next b { color: var(--text); }
.due { font-size: 12.5px; font-weight: 700; margin-left: 6px; }
.due.late { color: var(--danger); }
.due.soon { color: var(--warn); }

/* ------------------------------------------------------------------ dialogs, toasts, empty */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-lg); width: min(520px, calc(100vw - 24px)); box-shadow: var(--shadow-pop); color: var(--text); }
dialog.modal.wide { width: min(720px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(32, 30, 30, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 6px; }
.modal-head h2 { font-size: 19px; }
.modal-head p { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; }
.modal-body { padding: 12px 20px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 18px; }
@media (prefers-reduced-motion: no-preference) {
  dialog.modal[open] { animation: rise .16s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
.toasts { position: fixed; top: 72px; right: 20px; z-index: 100; display: grid; gap: 8px; width: min(400px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--ink); color: #fff; box-shadow: var(--shadow-pop); font-size: 14px; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; stroke: currentColor; }
.toast.success svg { stroke: #6fd3a2; }
.toast.error { background: #7d1a12; }
.toast.info svg { stroke: var(--signal); }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 0 0 8px; }
.toast.leaving { opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; }
.empty { text-align: center; padding: 36px 20px; color: var(--text-2); }
.empty svg { width: 34px; height: 34px; stroke: #aab0b7; margin: 0 auto 10px; display: block; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

.notif-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.notif-list a { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 12px 16px; text-decoration: none; border-top: 1px solid var(--line-soft); }
.notif-list li:first-child a { border-top: 0; }
.notif-list a:hover { background: var(--surface-2); }
.notif-list .n-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: transparent; }
.notif-list .unread .n-dot { background: var(--signal); }
.notif-list .n-msg { font-size: 13.5px; }
.notif-list .unread .n-msg { font-weight: 600; }
.notif-list .n-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.notif-foot { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--line-soft); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.notif-foot:hover { background: var(--surface-2); }

/* ------------------------------------------------------------------ auth (sign in, forgot / reset password) */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px; color: #f3ece6;
  background: radial-gradient(1200px 700px at 15% 0%, #3d2b20 0%, rgba(61, 43, 32, 0) 60%),
              radial-gradient(900px 600px at 100% 100%, #33241b 0%, rgba(51, 36, 27, 0) 60%), #241914;
}
.auth-page .auth-logo { width: 300px; max-width: 70vw; margin-bottom: 38px; }
.auth-card {
  width: min(460px, 100%); padding: 32px 34px 30px; border-radius: 14px;
  background: rgba(255, 244, 235, .045); border: 1px solid rgba(255, 236, 222, .14);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
}
.auth-card h1 { font-size: 26px; font-stretch: 90%; color: #fff; }
.auth-card .sub { color: #cdbfb4; margin: 8px 0 24px; font-size: 15px; }
.auth-card .field label { color: #eadfd6; }
.auth-card input[type=email], .auth-card input[type=password], .auth-card input[type=text] {
  background: rgba(255, 244, 235, .07); border-color: rgba(255, 236, 222, .2); color: #fff; min-height: 46px; font-size: 15px;
}
.auth-card input::placeholder { color: #9d8f85; }
.auth-card input:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(245, 134, 52, .35); }
.auth-card .pw-wrap button { top: 9px; color: #cdbfb4; }
.auth-card .pw-wrap button:hover { background: rgba(255, 255, 255, .08); }
.auth-card .pw-wrap button svg { width: 18px; height: 18px; stroke: currentColor; }
.auth-card .check { color: #eadfd6; }
.auth-card .btn.primary { height: 48px; font-size: 16px; margin-top: 6px; }
.auth-card .btn.primary svg { width: 18px; height: 18px; }
.auth-card .link { display: block; text-align: center; margin-top: 18px; color: #d8cbc1; font-size: 14.5px; text-decoration: none; }
.auth-card .link:hover { color: #fff; text-decoration: underline; }
.auth-card .hint { color: #b5a79d; }
.auth-card .notice { margin-bottom: 18px; background: rgba(255, 244, 235, .08); color: #f3ece6; }
.auth-card .notice.danger { background: rgba(200, 50, 31, .22); color: #ffd9d3; }
.auth-card .notice.ok { background: rgba(31, 143, 82, .22); color: #d4f5e2; }
.auth-foot { margin-top: 26px; font-size: 13px; color: #a0928a; text-align: center; }
.auth-page .toasts .toast { background: #f6f1ec; color: var(--ink); }
.auth-page .toasts .toast.error { background: #fdeceb; color: #7d1a12; }

/* ------------------------------------------------------------------ errors */
.error-page { max-width: 560px; margin: 60px auto; text-align: left; }
.error-page .code { font-size: 96px; font-stretch: 62%; font-weight: 800; color: var(--signal); line-height: 1; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .sticky-side { position: static; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(32, 30, 30, .4); z-index: 35; }
  .topbar .menu-btn { display: grid; }
  .topbar { padding: 0 14px; }
  .content { padding: 20px 16px 56px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); }
  .form-section { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .user-btn .meta, .search kbd { display: none; }
  h1 { font-size: 24px; }
  .project-head h1 { font-size: 26px; }
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpi .k-value { font-size: 30px; }
  .jobs { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .queue .q-when { display: none; }
  .table.stack-sm thead { display: none; }
  .table.stack-sm tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
  .table.stack-sm td { display: block; padding: 2px 0; border: 0; }
  .table.stack-sm td.actions { text-align: left; padding-top: 8px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; }
}
@media print {
  .sidebar, .topbar, .page-head .actions, .toasts { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}

/* inline icons inside text */
svg.inline { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; stroke: currentColor; }
.j-next svg, .panel-foot .muted svg { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; stroke: currentColor; }

/* notifications drop-down inside the generic menu */
.menu-pop.notif .notif-list a { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 12px 16px; border-radius: 0; align-items: start; }
.menu-pop.notif .notif-head button { width: auto; padding: 0; display: inline; }
.menu-pop.notif a.notif-foot { display: block; text-align: center; border-radius: 0 0 var(--r-md) var(--r-md); padding: 11px; }
.notif-list .n-msg, .notif-list .n-meta { display: block; }
.grid > .field + .field, .choice-row + .field { margin-top: 0; }
.menu-pop svg { width: 16px; height: 16px; stroke: currentColor; flex: none; }
.menu-pop form { margin: 0; }
.queue .q-main { min-width: 0; }
.queue .q-detail { display: block; }
.queue .q-action { display: block; }

/* ------------------------------------------------------------------ guided tour */
.tour-shade { position: fixed; inset: 0; z-index: 200; background: transparent; }
.tour-shade.dark { background: rgba(26, 20, 17, .62); }
.tour-spot {
  position: fixed; z-index: 201; border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--t-active), 0 0 0 9999px rgba(26, 20, 17, .62);
}
.tour-card {
  position: fixed; z-index: 202; width: min(380px, calc(100vw - 24px)); background: var(--surface); color: var(--text);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 18px 20px 16px; outline: none;
}
.tour-card.centered { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 24px)); padding: 26px 28px 20px; }
.tour-card h2 { font-size: 20px; font-stretch: 85%; margin: 6px 0 8px; }
.tour-card.centered h2 { font-size: 26px; }
.tour-card p { color: var(--text-2); font-size: 14.5px; line-height: 1.55; margin: 0 0 14px; }
.tour-card .tour-more { font-size: 13.5px; margin-top: -4px; }
.tour-top { display: flex; justify-content: space-between; align-items: center; }
.tour-count { font-size: 12.5px; font-weight: 600; color: var(--warn); }
.tour-skip { background: none; border: 0; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; padding: 2px 4px; text-decoration: underline; text-underline-offset: 2px; }
.tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tour-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--t-todo); }
.tour-dots i.past { background: var(--t-done); }
.tour-dots i.on { background: var(--t-active); width: 18px; border-radius: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .tour-spot { transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; }
}

/* ------------------------------------------------------------------ user guide */
.guide { font-size: 15px; line-height: 1.6; }
.guide .panel-body { padding: 28px 34px 36px; max-width: 900px; }
.guide h2 { font-size: 24px; font-stretch: 82%; margin: 34px 0 12px; padding-top: 6px; }
.guide .g-section:first-child h2 { margin-top: 0; }
.guide h3 { font-size: 17px; margin: 24px 0 8px; }
.guide p, .guide li { color: #33383e; }
.guide ul, .guide ol { padding-left: 22px; margin: 0 0 14px; }
.guide li { margin-bottom: 6px; }
.guide figure { margin: 16px 0 22px; }
.guide figure img { width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 8px 24px -16px rgba(0,0,0,.4); }
.guide figcaption { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.g-table { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: 14px; }
.g-table th { text-align: left; font-size: 12.5px; color: var(--text-2); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.g-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.g-key td:first-child { width: 120px; font-weight: 600; white-space: nowrap; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot.done { background: var(--t-done); } .dot.active { background: var(--t-active); } .dot.alert { background: var(--t-alert); }
.dot.todo { border: 2px solid var(--t-todo); background: #fff; }
.kbd { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); }
.g-faq dt { font-weight: 700; margin-top: 14px; }
.g-faq dd { margin: 4px 0 0; color: #33383e; }
.guide-toc .panel-body { display: grid; gap: 2px; padding: 10px 12px 14px; }
.guide-toc a { text-decoration: none; padding: 6px 8px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; }
.guide-toc a.sub { font-weight: 500; padding-left: 22px; color: var(--text-2); font-size: 13.5px; }
.guide-toc a:hover { background: var(--surface-2); }
.guide h2, .guide h3 { scroll-margin-top: 80px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-wrap button { position: absolute; right: 6px; top: 6px; height: 28px; min-width: 36px; padding: 0 8px; border: 0; background: none; font: 600 12.5px var(--font); color: var(--text-2); cursor: pointer; border-radius: 4px; display: grid; place-items: center; }
.pw-wrap button:hover { background: var(--surface-2); }

/* ------------------------------------------------------------------ Nkem AI, the assistant */
:root { --nk-orange: #F37226; --nk-orange-hi: #F8873F; }

/* the brand marks (components/nkem_brand.html). Only the background, halo and sparkle ever move; the N stays still. */
.nk-mark, .nk-logo { display: block; flex: none; overflow: visible; }
.nk-mark .nk-halo, .nk-mark .nk-bg, .nk-mark .nk-spark, .nk-mark .nk-glow { transform-box: fill-box; transform-origin: center; }
.nk-nav { width: 18px; height: 18px; }
.nk-page-title { margin: 0 0 6px; line-height: 0; }
.nk-page-logo { height: 34px; width: auto; }

/* thinking: background breathes, sparkle brightens, a soft halo expands and fades. One 2 s loop. */
@media (prefers-reduced-motion: no-preference) {
  [data-nk-state="thinking"] .nk-bg { animation: nk-bg 2s ease-in-out infinite; }
  [data-nk-state="thinking"] .nk-spark { animation: nk-spark 2s ease-in-out infinite; }
  [data-nk-state="thinking"] .nk-glow { animation: nk-glow 2s ease-in-out infinite; }
  [data-nk-state="thinking"] .nk-halo { animation: nk-halo 2s cubic-bezier(.2, .6, .35, 1) infinite; }
  /* streaming: just a quiet sparkle until the answer is complete */
  [data-nk-state="streaming"] .nk-spark { animation: nk-spark-soft 2s ease-in-out infinite; }
  @keyframes nk-bg { 0%, 100% { transform: scale(1); fill: var(--nk-orange); } 50% { transform: scale(1.035); fill: var(--nk-orange-hi); } }
  @keyframes nk-spark { 0%, 100% { transform: scale(.86); opacity: .82; } 50% { transform: scale(1.12); opacity: 1; } }
  @keyframes nk-glow { 0%, 100% { transform: scale(.8); opacity: 0; } 50% { transform: scale(1.1); opacity: .9; } }
  @keyframes nk-halo { 0% { transform: scale(.98); opacity: .42; } 80%, 100% { transform: scale(1.38); opacity: 0; } }
  @keyframes nk-spark-soft { 0%, 100% { transform: scale(.94); opacity: .88; } 50% { transform: scale(1.05); opacity: 1; } }
}

/* the launcher: the full logo on a light pill; the icon alone on small screens */
.nkem-launch {
  position: fixed; right: 24px; bottom: 24px; z-index: 60; display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 16px 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: 650 14px var(--font); letter-spacing: -.01em; white-space: nowrap;
  cursor: pointer; box-shadow: 0 12px 30px -12px rgba(32, 30, 30, .45), 0 2px 6px -2px rgba(32, 30, 30, .12);
  touch-action: none; user-select: none; -webkit-user-select: none; transition: box-shadow .15s, border-color .15s;
}
.nkem-launch:hover { border-color: #f6b98e; box-shadow: 0 14px 32px -12px rgba(243, 114, 38, .45), 0 2px 6px -2px rgba(32, 30, 30, .12); }
.nkem-launch:focus-visible { outline: 3px solid rgba(243, 114, 38, .45); outline-offset: 2px; }
.nkem-launch[aria-expanded="true"] { display: none; }
.nk-launch-icon { width: 27px; height: 26px; }
.nkem-launch-text { line-height: 1; }
.nkem-launch[data-nk-state="thinking"] { border-color: #f6b98e; }

.nkem-panel {
  position: fixed; right: 20px; bottom: 20px; top: calc(var(--topbar) + 14px); z-index: 70; width: min(430px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; overflow: hidden;
}
.nkem-panel[hidden] { display: none; }
.nkem-head { display: flex; align-items: center; gap: 12px; padding: 14px 10px 12px 16px; border-bottom: 1px solid var(--line-soft); min-height: 64px; }
.nk-head-logo { height: 30px; width: auto; }
.nkem-sub { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-2); padding-left: 12px; border-left: 1px solid var(--line); line-height: 1.25; }
.nkem-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.nkem-hello { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 14px; font-size: 14px; }
.nkem-hello p { margin: 0 0 12px; color: #33383e; }
.nkem-hello.compact .nkem-chips { display: none; }
.nkem-hello.compact p { margin: 0; font-size: 13px; color: var(--text-2); }
.nkem-chips { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.nkem-chips .chip { height: auto; min-height: 32px; padding: 6px 12px; text-align: left; color: var(--text); cursor: pointer; font: 600 13px var(--font); line-height: 1.35; }
.nkem-chips .chip:hover { border-color: var(--nk-orange); background: var(--signal-wash); }
.nkem-panel.is-busy .nkem-chips .chip { opacity: .55; cursor: not-allowed; }

/* messages: Nkem's answers carry its icon; the icon box is fixed so nothing jumps when the state changes */
.nkem-row { display: flex; align-items: flex-start; gap: 9px; max-width: 96%; align-self: flex-start; }
.nkem-av { width: 28px; height: 28px; flex: none; margin-top: 3px; display: grid; place-items: center; }
.nk-avatar { width: 28px; height: 27px; }
.nkem-msg { max-width: 92%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.nkem-row .nkem-msg { max-width: none; min-width: 0; flex: 0 1 auto; min-height: 40px; }
.nkem-msg p { margin: 0 0 8px; } .nkem-msg p:last-child { margin-bottom: 0; }
.nkem-msg ul, .nkem-msg ol { margin: 4px 0 8px; padding-left: 20px; } .nkem-msg li { margin-bottom: 3px; }
.nkem-msg code { font-size: 12.5px; }
.nkem-msg.user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.nkem-msg.assistant { background: var(--surface); border: 1px solid var(--line-soft); border-top-left-radius: 4px; }
.nkem-msg.assistant a { color: var(--signal-text); font-weight: 600; }
.nkem-msg.error { background: var(--danger-bg); border-color: #f1c4bf; color: #7d1a12; }
.nkem-retry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.nkem-retry .btn { height: 32px; padding: 0 12px; font-size: 13px; }
.nkem-retry small { color: #9a3b30; font-size: 12px; }
.nkem-status { align-self: flex-start; font-size: 12.5px; color: var(--text-2); font-style: italic; padding-left: 41px; }
.nkem-thinking { display: inline-flex; align-items: center; min-height: 20px; color: var(--text-2); font-size: 13.5px; }
.nkem-thinking .dots { display: inline-block; width: 1.2em; text-align: left; }
@media (prefers-reduced-motion: no-preference) {
  .nkem-thinking .dots::after { content: "…"; animation: nk-dots 2s steps(4, end) infinite; display: inline-block; overflow: hidden; vertical-align: bottom; width: 0; }
  @keyframes nk-dots { to { width: 1.2em; } }
}
@media (prefers-reduced-motion: reduce) { .nkem-thinking .dots::after { content: "…"; } }

.nkem-input { display: flex; gap: 8px; align-items: flex-end; padding: 12px 12px 6px; border-top: 1px solid var(--line-soft); }
.nkem-input textarea { min-height: 42px; max-height: 160px; resize: none; padding: 10px 12px; font-size: 14px; }
.nkem-input .btn { width: 42px; height: 42px; padding: 0; flex: none; }
.nkem-input .btn:disabled { opacity: .5; cursor: not-allowed; }
.nkem-foot { font-size: 11.5px; color: var(--text-3); margin: 0; padding: 0 14px 10px; }
body.touring .nkem-panel { display: none; }
@media (max-width: 600px) {
  .nkem-panel { right: 0; left: 0; bottom: 0; top: 0; width: 100%; border-radius: 0; z-index: 90; }
  /* compact: the orange icon on its own */
  .nkem-launch { right: 14px; bottom: 14px; height: auto; padding: 0; border: 0; background: none; border-radius: 14px; box-shadow: 0 10px 24px -10px rgba(243, 114, 38, .65); }
  .nkem-launch:hover { box-shadow: 0 10px 24px -10px rgba(243, 114, 38, .8); }
  .nk-launch-icon { width: 46px; height: 44px; }
  .nkem-launch-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nk-head-logo { height: 26px; }
  .nkem-sub { display: none; }
  .nkem-head { justify-content: space-between; }
  .nkem-head .icon-btn:first-of-type { margin-left: auto; }
}
@media print { .nkem-launch, .nkem-panel { display: none !important; } }

/* moving Nkem AI around */
.nkem-launch.dragging, .nkem-panel.dragging { cursor: grabbing; transition: none; }
.nkem-launch.dragging { transform: scale(1.04); box-shadow: 0 16px 34px -12px rgba(32, 30, 30, .5); }
.nkem-head { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.nkem-head button { cursor: pointer; }
.nkem-panel.floating { bottom: auto; right: auto; }
.nkem-panel.dragging { box-shadow: 0 24px 48px -16px rgba(32, 30, 30, .55); opacity: .97; }
@media (min-width: 1280px) {
  /* a docked panel gets room beside the page instead of hiding part of it */
  body.nkem-open:not(.nkem-floating) .content { padding-right: 474px; }
  body.nkem-open.nkem-floating .content { padding-right: 32px; }
}
@media (max-width: 600px) {
  .nkem-head { cursor: default; }
  .nkem-panel.floating { left: 0 !important; top: 0 !important; height: auto !important; bottom: 0; right: 0; }
}
.nav a svg.nk-mark { stroke: none; opacity: 1; }
