/* ===========================================================================
   CONTENT FLOW — content library
   Same "ops console" system as Beacon and Compass (Space Grotesk / JetBrains
   Mono, panel + form + table conventions; copied from compass.css) with its
   own accent - violet - plus a serif reading view for devotionals and the
   upload preview. Content Flow additions are at the end of this file.
   =========================================================================== */

:root {
  --ink:        #0e1218;   /* page */
  --panel:      #161c26;   /* raised surface */
  --panel-2:    #1c232f;   /* inputs / nested */
  --line:       #28303d;   /* hairlines */
  --text:       #e7ecf3;
  --muted:      #8b97a8;

  --accent:      #a084ff;   /* brand — Content Flow violet */
  --accent-soft: #c4b2ff;

  --ok:         #2fb87a;
  --warning:    #f5a524;
  --critical:   #e5484d;
  --offline:    #6b7280;

  --risk-low:      var(--ok);
  --risk-medium:   var(--warning);
  --risk-high:     #ff8a3d;
  --risk-critical: var(--critical);

  --type-standard:  #6b7280;
  --type-normal:    var(--accent);
  --type-emergency: var(--critical);

  --radius:     12px;
  --shadow:     0 6px 24px rgba(0,0,0,.35);

  /* surfaces/text that differ between themes (see the light palette below) */
  --glow:          #182231;               /* page background highlight */
  --topbar-bg:     rgba(14,18,24,.7);
  --on-accent:     #140a2e;               /* text on accent / ok / critical buttons */
  --on-ok:         #06231a;
  --on-critical:   #2a0607;
  --ok-hover:      #45d996;
  --critical-hover:#ff6167;
  --critical-text: #ffb3b5;               /* error text on a tinted background */
  --focus-ring:    rgba(160,132,255,.18);
  --card-shadow:   0 20px 60px rgba(0,0,0,.4);
  color-scheme: dark;                     /* native controls, scrollbars, date pickers */
}

/* Light theme - <html data-theme="light">, chosen per account from the account
   menu (top right). 'auto' follows the device's setting: the same palette,
   applied when the browser reports a light preference. Status/brand hues are
   deepened so they keep enough contrast as text on white. The two blocks must
   stay identical. */
:root[data-theme="light"] {
  --ink: #eef2f7; --panel: #ffffff; --panel-2: #f4f6fa; --line: #d8dfe9;
  --text: #142033; --muted: #5a6679;
  --accent: #6b4fd8; --accent-soft: #5a3fc4;
  --ok: #188454; --warning: #9a6a00; --critical: #c9302f; --offline: #6b7280;
  --risk-high: #c25a12; --type-standard: #5b6472;
  --shadow: 0 6px 20px rgba(20,30,50,.08);
  --glow: #ffffff; --topbar-bg: rgba(255,255,255,.82);
  --on-accent: #ffffff; --on-ok: #ffffff; --on-critical: #ffffff;
  --ok-hover: #1f9d63; --critical-hover: #e0413f; --critical-text: #a3232a;
  --focus-ring: rgba(107,79,216,.22); --card-shadow: 0 20px 50px rgba(20,30,50,.14);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --ink: #eef2f7; --panel: #ffffff; --panel-2: #f4f6fa; --line: #d8dfe9;
    --text: #142033; --muted: #5a6679;
    --accent: #6b4fd8; --accent-soft: #5a3fc4;
    --ok: #188454; --warning: #9a6a00; --critical: #c9302f; --offline: #6b7280;
    --risk-high: #c25a12; --type-standard: #5b6472;
    --shadow: 0 6px 20px rgba(20,30,50,.08);
    --glow: #ffffff; --topbar-bg: rgba(255,255,255,.82);
    --on-accent: #ffffff; --on-ok: #ffffff; --on-critical: #ffffff;
    --ok-hover: #1f9d63; --critical-hover: #e0413f; --critical-text: #a3232a;
    --focus-ring: rgba(107,79,216,.22); --card-shadow: 0 20px 50px rgba(20,30,50,.14);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 70% -10%, var(--glow) 0%, var(--ink) 55%);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.muted { color: var(--muted); }
.empty-dash { font-family: "Space Grotesk", system-ui, sans-serif; } /* same dash in mono columns as elsewhere */

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  background: radial-gradient(circle at 35% 30%, rgba(160,132,255,.22), transparent 70%);
  box-shadow: 0 0 10px 1px rgba(160,132,255,.35);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-sep { width: 1px; height: 22px; background: var(--line); }
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: .04em; }
.brand-tag  { color: var(--muted); font-size: 13px; }

.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-link {
  color: var(--muted); text-decoration: none;
  padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.is-active { color: var(--text); background: var(--panel); box-shadow: inset 0 -2px 0 var(--accent); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 28px; }

/* ---- flash ---- */
.flash {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 8px; margin-bottom: 22px;
}

/* ---- summary strip ---- */
.summary {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  justify-content: space-between; margin-bottom: 26px;
}
.summary-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.stat b { color: var(--text); font-size: 16px; }
.stat::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.stat--draft::before       { background: var(--offline); }
.stat--submitted::before   { background: var(--warning); }
.stat--approved::before    { background: var(--ok); }
.stat--rejected::before    { background: var(--critical); }
.stat--in-progress::before { background: var(--accent); }
.stat--implemented::before { background: var(--ok); }
.stat--closed::before      { background: var(--offline); }
.stat--mine::before        { background: var(--accent-soft); }

a.stat { text-decoration: none; cursor: pointer; transition: opacity .15s, border-color .15s; }
a.stat:hover { border-color: var(--muted); }
a.stat.is-off { opacity: .38; }
a.stat.is-off b { color: var(--muted); }
.filter-reset { color: var(--accent-soft); text-decoration: none; }
.filter-reset:hover { text-decoration: underline; }
.summary-meta { font-size: 13px; color: var(--muted); }

/* ---- dashboard cards ---- */
.dash-grid {
  display: grid; gap: 16px; margin-bottom: 30px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.dash-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.dash-card h3 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.dash-card .big { font-size: 32px; font-weight: 700; font-family: "JetBrains Mono", monospace; }
.dash-card .big.accent { color: var(--accent-soft); }
.dash-card .big.warn { color: var(--warning); }
.dash-card p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.dash-card a.dash-link { color: var(--accent-soft); text-decoration: none; font-size: 13px; }
.dash-card a.dash-link:hover { text-decoration: underline; }

.section-title { font-size: 16px; margin: 30px 0 12px; }

/* ---- admin pages ---- */
.page-head { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; }
.page-head-text { flex: 1; min-width: 240px; }

.cols { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.cols--wide { grid-template-columns: 1fr; }
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 20px; }
.panel h2 { margin: 0 0 16px; font-size: 16px; }
.panel--narrow { max-width: 460px; }

/* ---- forms ---- */
.form { display: flex; flex-direction: column; gap: 13px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.form-row { display: flex; gap: 13px; flex-wrap: wrap; }
.form-row label { flex: 1; min-width: 160px; }
.form-row label.narrow { flex: 0 0 140px; }
/* Filter bars: a single row of fields, buttons and checkboxes lined up on the bottom edge. */
.form.filters { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.form.filters .check { padding-bottom: 10px; }
.form.filters .narrow { flex: 0 0 170px; }
.form input, .form select, .form textarea {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 9px 11px; font: inherit; font-size: 14px;
  width: 100%; min-width: 0;
}
.form textarea { resize: vertical; min-height: 64px; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring);
}
.form .check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.form .check input { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); border: none; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 8px; text-decoration: none;
}
.btn:hover { background: var(--accent-soft); }
.btn--ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn--ghost:hover { color: var(--text); background: var(--panel-2); }
.btn--ok { background: var(--ok); color: var(--on-ok); }
.btn--ok:hover { background: var(--ok-hover); }
.btn--danger { background: var(--critical); color: var(--on-critical); }
.btn--danger:hover { background: var(--critical-hover); }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.is-clickable { cursor: pointer; }
.table tr.is-clickable:hover { background: var(--panel-2); }
.table .num { text-align: right; }
.row-actions { text-align: right; white-space: nowrap; } /* stays a table cell, so it lines up with the row */
.row-actions > * + * { margin-left: 14px; }
.row-actions a { color: var(--accent-soft); text-decoration: none; font-size: 13px; }
.row-actions a:hover { text-decoration: underline; }
.row-actions form { display: inline; margin: 0; }
.link-danger { background: none; border: none; color: var(--critical); cursor: pointer; font: inherit; font-size: 13px; padding: 0; }
.link-danger:hover { text-decoration: underline; }

/* ---- pills (status / risk / type) ---- */
.pill { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.pill--draft       { background: rgba(139,151,168,.15); color: var(--muted); }
.pill--submitted   { background: rgba(245,165,36,.15);  color: var(--warning); }
.pill--approved    { background: rgba(47,184,122,.15);  color: var(--ok); }
.pill--rejected    { background: rgba(229,72,77,.15);   color: var(--critical); }
.pill--in-progress { background: rgba(160,132,255,.15);  color: var(--accent-soft); }
.pill--implemented { background: rgba(47,184,122,.15);  color: var(--ok); }
.pill--backed-out  { background: rgba(229,72,77,.15);   color: var(--critical); }
.pill--closed      { background: rgba(139,151,168,.15); color: var(--muted); }
.pill--cancelled   { background: rgba(139,151,168,.15); color: var(--muted); text-decoration: line-through; }

.pill--risk-low      { background: rgba(47,184,122,.15); color: var(--ok); }
.pill--risk-medium   { background: rgba(245,165,36,.15); color: var(--warning); }
.pill--risk-high     { background: rgba(255,138,61,.16); color: var(--risk-high); }
.pill--risk-critical { background: rgba(229,72,77,.15);  color: var(--critical); }

.pill--type-standard  { background: rgba(107,114,128,.18); color: var(--type-standard); }
.pill--type-normal    { background: rgba(160,132,255,.15);  color: var(--accent-soft); }
.pill--type-emergency { background: rgba(229,72,77,.15);   color: var(--critical); }

/* ---- change detail ---- */
.change-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.change-ref { font-family: "JetBrains Mono", monospace; color: var(--muted); font-size: 14px; }
.change-title { margin: 4px 0 10px; font-size: 22px; }
.change-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.change-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .change-grid { grid-template-columns: 1fr; } .cols { grid-template-columns: 1fr; } }

.field-block { margin-bottom: 18px; }
.field-block h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.field-block p, .field-block div.text { margin: 0; white-space: pre-wrap; font-size: 14px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; color: var(--text); text-decoration: none; }
.tag:hover { border-color: var(--accent); }

/* approval progress */
.approval-box { display: flex; flex-direction: column; gap: 8px; }
.approval-bar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.approval-bar-fill { height: 100%; background: var(--ok); border-radius: 999px; transition: width .2s; }
.approval-count { font-size: 13px; color: var(--muted); }
.approval-votes { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.approval-vote { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.approval-vote .v-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.approval-vote .v-dot.approved { background: var(--ok); }
.approval-vote .v-dot.rejected { background: var(--critical); }

/* ---- timeline (change history) ---- */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { position: relative; padding: 0 0 20px 24px; border-left: 2px solid var(--line); }
.timeline-item:last-child { border-color: transparent; padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -6px; top: 2px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--panel);
}
.timeline-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.timeline-meta b { color: var(--text); font-weight: 600; }
.timeline-note { font-size: 14px; white-space: pre-wrap; }
.timeline-empty { color: var(--muted); font-size: 13px; }

/* checklist box (link devices/systems/sites/brands to a change) */
.check-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 220px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: var(--panel-2);
}
.check-list label { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13.5px; padding: 4px 0; }
.check-list label input { width: auto; }
.check-list-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

/* ---- schedule view ---- */
.schedule-day { margin-bottom: 26px; }
.schedule-date { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.schedule-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; text-decoration: none; color: var(--text);
}
.schedule-item:hover { border-color: var(--accent); }
.schedule-item.risk-high, .schedule-item.risk-critical { border-left-color: var(--critical); }
.schedule-time { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--muted); flex: 0 0 110px; }
.schedule-title { flex: 1; min-width: 0; font-weight: 600; }
.schedule-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 400; }

/* ---- empty state ---- */
.empty { text-align: center; padding: 60px 20px; }
.empty h2 { margin: 0 0 8px; }
.empty p { color: var(--muted); max-width: 420px; margin: 0 auto 18px; }

/* ---- settings: sub-nav, manage cards ---- */
.subnav {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 22px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.subnav-link {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 6px 13px; border-radius: 8px;
}
.subnav-link:hover { color: var(--text); background: var(--panel); }
.subnav-link.is-active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }

.field-hint { display: block; font-size: 12px; margin-top: 2px; }
.flag {
  font-family: "Space Grotesk", sans-serif; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  background: rgba(245,165,36,.15); color: var(--warning);
  padding: 2px 6px; border-radius: 5px; vertical-align: middle;
}
.flag--danger, .flag--critical { background: rgba(220,53,69,.15); color: var(--critical); }
.flag--warning { background: rgba(245,165,36,.15); color: var(--warning); }
.flag--ok { background: rgba(47,184,122,.15); color: var(--ok); }
.flag--muted, .flag--unmonitored { background: var(--panel-2); color: var(--muted); }

/* ---- Settings > Developer (tabs, banner) ---- */
.page-tabs { display: flex; gap: 2px; margin: 0 0 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.page-tab {
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 9px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.page-tab:hover { color: var(--text); }
.page-tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.tab-intro { margin: 0 0 18px; }
.migration-banner {
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 16px; margin-bottom: 22px; font-size: 14px;
}
.migration-banner a { margin-left: 8px; font-weight: 600; color: var(--accent-soft); }
.migration-banner--error { border-color: var(--critical); background: rgba(229,72,77,.10); }
.migration-banner--warn  { border-color: var(--warning);  background: rgba(245,165,36,.10); }
.link { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; padding: 0; text-decoration: none; }
.link:hover { text-decoration: underline; }
.chip {
  display: inline-flex; align-items: center; padding: 6px 13px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  text-decoration: none; font-size: 13px;
}
.chip--on { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.manage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.manage-grid--hub { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.manage-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px 16px; text-decoration: none; color: var(--text);
  transition: border-color .15s, color .15s;
}
.manage-card:hover { border-color: var(--accent); color: var(--accent-soft); }
.manage-card svg { width: 30px; height: 30px; color: var(--accent-soft); }
.manage-card:hover svg { color: var(--accent); }
.manage-card-title { font-weight: 600; font-size: 14px; color: var(--text); }
.manage-card:hover .manage-card-title { color: var(--text); }

/* approval rules matrix */
.rules-table th, .rules-table td { text-align: center; }
.rules-table td input { width: 64px; text-align: center; margin: 0 auto; }
.rules-table .rules-row-label { text-align: left; font-weight: 600; }

/* ---- login + auth ---- */
.login-body {
  min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 600px at 50% -10%, rgba(160,132,255,.10), transparent), var(--ink);
}
.login-card {
  width: 380px; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 30px 28px; box-shadow: var(--card-shadow);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-brand .brand-name { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: .5px; }
.login-tag { margin: 4px 0 20px; font-size: 13px; }
.login-error {
  background: rgba(229,72,77,.12); border: 1px solid rgba(229,72,77,.4); color: var(--critical-text);
  padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px;
}
.login-form .btn.login-submit { width: 100%; justify-content: center; margin-top: 4px; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0 14px; }
.login-or span { white-space: nowrap; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-ms { width: 100%; justify-content: center; display: inline-flex; align-items: center; gap: 9px; }
.login-sso { text-align: center; }
.ms-logo { width: 16px; height: 16px; display: block; }
.login-logo { display: inline-flex; margin-bottom: 18px; color: var(--accent); }
.login-logo svg { width: 42px; height: 42px; }

/* current user menu: click the pill for theme / sign out */
.nav-account { position: relative; margin-left: 10px; font-size: 13px; line-height: 1; }
.nav-user {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2);
  color: var(--text); white-space: nowrap; font: inherit; cursor: pointer;
}
.nav-user:hover { border-color: var(--muted); }
.nav-user-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px 1px rgba(47,184,122,.6); }
.nav-role { color: var(--muted); font-weight: 400; }
.nav-caret { width: 13px; height: 13px; opacity: .6; margin-left: 1px; }
.account-dropdown[hidden] { display: none; }
.account-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 220px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 4px;
}
.account-dropdown-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 2px 6px 4px; }
.theme-toggle { display: flex; gap: 6px; margin-bottom: 6px; }
.theme-toggle form { flex: 1; margin: 0; }
.theme-opt {
  width: 100%; padding: 6px 0; font: 500 13px "Space Grotesk", sans-serif; cursor: pointer;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px;
}
.theme-opt:hover { color: var(--text); }
.theme-opt.is-active { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.account-dropdown-item {
  display: block; padding: 7px 6px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 13.5px;
}
.account-dropdown-item:hover { background: var(--panel-2); }
.account-dropdown-item--danger:hover { color: var(--critical); }

/* generic fieldset (device as-built groups, etc.) */
.fields { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 12px; margin: 2px 0; }
.fields legend { padding: 0 6px; font-size: 13px; color: var(--muted); }

/* documents list (device attachments) */
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.doc-item a { color: var(--accent-soft); text-decoration: none; font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item .doc-meta { font-size: 12px; color: var(--muted); flex: none; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
  .wrap { padding: 18px; }
  .cols { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ Assets (network map, views/assets.php) */
.asset-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 10px; }
.asset-site-form select { min-width: 240px; }
.asset-toolbar input[type="search"] { flex: 1; min-width: 200px; max-width: 360px; }
.asset-toggle { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.asset-toggle input { width: auto; }
.asset-zoom { display: flex; gap: 4px; margin-left: auto; }
.asset-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.asset-legend span { display: inline-flex; align-items: center; gap: 6px; }
.asset-key { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
.asset-key--site { background: var(--text); }
.asset-key--shared { background: #8b7cf6; }
.asset-key--device { background: var(--muted); }
.asset-key.crit-critical { background: var(--risk-critical); }
.asset-key.crit-high { background: var(--risk-high); }
.asset-key.crit-medium { background: var(--risk-medium); }
.asset-key.crit-low { background: var(--risk-low); }

/* The map page uses the full window width (other pages keep .wrap's 1160px). */
.wrap:has(.asset-canvas--map) { max-width: none; }
.asset-canvas { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
#asset-map { display: block; width: 100%; height: calc(100vh - 230px); min-height: 560px; cursor: grab; touch-action: none; }
#asset-map:active { cursor: grabbing; }
.asset-hover { font-size: 13px; padding: 8px 14px; border-top: 1px solid var(--line); min-height: 18px; }
/* Details drawer: slides in from the right over the map (views/assets_overview.php). */
.asset-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 100%); box-sizing: border-box; overflow: auto;
                padding: 18px 20px 24px; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--card-shadow);
                transform: translateX(100%); visibility: hidden; transition: transform .28s ease, visibility 0s linear .28s; }
.asset-canvas.has-drawer .asset-drawer { transform: none; visibility: visible; transition: transform .28s ease, visibility 0s; }
.asset-drawer-close { position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent;
                      background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.asset-drawer-close:hover { color: var(--text); border-color: var(--line); background: var(--panel-2); }
.asset-drawer-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.asset-drawer .asset-panel-head { padding-right: 34px; }
@media (prefers-reduced-motion: reduce) { .asset-drawer, .asset-canvas.has-drawer .asset-drawer { transition: none; } }
.asset-panel-head h2 { margin: 2px 0 12px; }
.asset-panel-kind { font-size: 12px; color: var(--muted); }
.asset-panel-field { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.asset-panel-field span:last-child { text-align: right; overflow-wrap: anywhere; }
.asset-panel-desc { font-size: 13.5px; margin: 10px 0 0; }
.asset-panel-section { margin-top: 16px; }
.asset-panel-section h3 { font-size: 13px; color: var(--muted); font-weight: 500; margin: 0 0 6px; }
.asset-panel-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.asset-panel-list li { padding: 4px 0; }

.asset-box rect { fill: var(--panel-2); fill-opacity: .55; stroke: var(--line); stroke-width: 1; }
.asset-box-label { fill: var(--muted); font-size: 13px; font-weight: 600; }
.asset-link { stroke-width: 1; stroke-opacity: .7; }
.asset-link--site { stroke: var(--text); stroke-opacity: .45; stroke-width: 1.4; }
.asset-link--system { stroke: var(--muted); }
.asset-link--system.is-shared { stroke: #8b7cf6; }
.asset-link--unassigned { stroke: var(--muted); stroke-opacity: .35; stroke-dasharray: 3 3; }
.asset-node { stroke: var(--panel); stroke-width: 1.5; cursor: pointer; }
.asset-node--site { fill: var(--text); }
.asset-node--device { fill: var(--muted); }
.asset-node--device.is-shared { fill: #8b7cf6; }
.asset-node.crit-critical { fill: var(--risk-critical); }
.asset-node.crit-high { fill: var(--risk-high); }
.asset-node.crit-medium { fill: var(--risk-medium); }
.asset-node.crit-low { fill: var(--risk-low); }
.asset-node--system:not([class*="crit-"]) { fill: var(--accent); }
.asset-label { font-size: 12px; fill: var(--text); pointer-events: none; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.asset-label--site { font-weight: 600; font-size: 13px; }
.asset-label--device { display: none; fill: var(--muted); font-size: 11px; }
#asset-map.is-near .asset-label--device,
.asset-label--device.is-near, .asset-label--device.is-match { display: block; }
#asset-map.is-focused .asset-node:not(.is-near), #asset-map.is-focused .asset-label:not(.is-near) { opacity: .15; }
#asset-map.is-focused .asset-link:not(.is-near) { opacity: .06; }
#asset-map.is-focused .asset-link.is-near { stroke-opacity: 1; stroke-width: 1.6; }
#asset-map.is-searching:not(.is-focused) .asset-node:not(.is-match) { opacity: .2; }
.asset-node.is-match { stroke: var(--accent); stroke-width: 3; }
.asset-node.is-selected { stroke: var(--accent); stroke-width: 3; }

@media (max-width: 1000px) {
  .asset-zoom { margin-left: 0; }
}

/* Assets > List (views/assets_list.php). Each system has its own colour, passed in as --sys. */
.asset-site-form { margin: 0 0 12px; }
.asset-list-count { margin-left: auto; font-size: 13px; }
.asset-list-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 14px; font-size: 13px; }
.asset-list-clear { margin-left: 6px; font-size: 13px; }
.sys-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sys-chip { --sys: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px;
            font: inherit; font-size: 12.5px; line-height: 1.4; color: var(--text); white-space: nowrap;
            background: color-mix(in srgb, var(--sys) 16%, transparent); border: 1px solid color-mix(in srgb, var(--sys) 55%, transparent); }
.sys-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--sys); flex: none; }
button.sys-chip { cursor: pointer; }
button.sys-chip:hover { background: color-mix(in srgb, var(--sys) 28%, transparent); }
.sys-chip.is-on { background: var(--sys); border-color: var(--sys); color: #fff; }
.sys-chip.is-on i { background: #fff; }
.sys-chip--none { --sys: var(--muted); border-style: dashed; }
.asset-table.is-filtering tbody .sys-chip:not(.is-on) { opacity: .45; }
.asset-list-wrap { padding: 0; overflow-x: auto; }
.asset-table { margin: 0; }
.asset-table th { padding: 0; white-space: nowrap; }
.asset-table th button { all: unset; display: block; box-sizing: border-box; width: 100%; padding: 10px 12px; cursor: pointer; font-weight: 600; }
.asset-table th button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.asset-table th button::after { content: "↕"; margin-left: 6px; color: var(--muted); opacity: .5; font-weight: 400; }
.asset-table th[aria-sort="ascending"] button::after { content: "↑"; opacity: 1; color: var(--accent); }
.asset-table th[aria-sort="descending"] button::after { content: "↓"; opacity: 1; color: var(--accent); }
.asset-table td { vertical-align: top; }
.asset-list-none { padding: 18px; margin: 0; }

/* Assets > List: documents column and its popover */
.asset-table th.asset-docs-col, .asset-table td.asset-docs-col { width: 1%; text-align: center; }
.doc-btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line);
           background: var(--panel-2); color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }
.doc-btn:hover, .doc-btn[aria-expanded="true"] { border-color: var(--accent); }
.doc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.doc-pop { position: fixed; z-index: 50; min-width: 220px; max-width: min(420px, calc(100vw - 16px)); max-height: 320px; overflow: auto;
           padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--card-shadow); }
.doc-pop a { display: flex; justify-content: space-between; gap: 14px; padding: 7px 9px; border-radius: 6px; color: var(--text);
             text-decoration: none; font-size: 13px; }
.doc-pop a span { overflow-wrap: anywhere; }
.doc-pop a small { color: var(--muted); white-space: nowrap; }
.doc-pop a:hover, .doc-pop a:focus { background: var(--panel-2); color: var(--accent); outline: none; }

/* ===========================================================================
   Content Flow additions
   =========================================================================== */

/* ---- small utilities ---- */
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.text-warning { color: var(--warning); }
.tight { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.plain-list a, .table td a, .crumbs a, .history-list a { color: var(--accent-soft); text-decoration: none; }
.plain-list a:hover, .table td a:hover, .crumbs a:hover, .history-list a:hover { text-decoration: underline; }
.crumbs { margin: 0 0 6px; font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cols--even { grid-template-columns: 1fr 1fr; }
.cols--reader { grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 900px) { .cols--even, .cols--reader { grid-template-columns: 1fr; } }

/* ---- content type chips (WFYT / TWFT) ---- */
:root { --twft: #f0b45a; --wfyt: #4fd1c5; }
:root[data-theme="light"] { --twft: #a8660b; --wfyt: #0f8a80; }
@media (prefers-color-scheme: light) { :root[data-theme="auto"] { --twft: #a8660b; --wfyt: #0f8a80; } }
.type-chip {
  display: inline-block; font: 700 10.5px "JetBrains Mono", monospace; letter-spacing: .06em;
  padding: 3px 7px; border-radius: 5px; vertical-align: middle;
  color: var(--accent-soft); background: rgba(160,132,255,.14);
}
.type-chip--twft { color: var(--twft); background: color-mix(in srgb, var(--twft) 15%, transparent); }
.type-chip--wfyt { color: var(--wfyt); background: color-mix(in srgb, var(--wfyt) 15%, transparent); }

/* ---- dashboard ---- */
.dash-grid--types { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.type-card { display: flex; flex-direction: column; gap: 14px; }
.type-card--twft { border-top: 3px solid var(--twft); }
.type-card--wfyt { border-top: 3px solid var(--wfyt); }
.type-card-head { display: flex; align-items: center; gap: 10px; }
.type-card-head h2 { margin: 0; font-size: 17px; }
.type-card .btn { align-self: flex-start; }
.today-link {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text);
  padding: 12px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line);
}
.today-link:hover { border-color: var(--accent); }
.today-title { font: 600 17px "Source Serif 4", Georgia, serif; }
.today-scripture { font-size: 13px; }
.today-missing { margin: 0; }
.type-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0; }
.type-stats div { display: flex; flex-direction: column; gap: 3px; }
.type-stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.type-stats dd { margin: 0; font: 600 14px "JetBrains Mono", monospace; }
@media (max-width: 520px) { .type-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---- browse ---- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select, .toolbar input[type=search] {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 11px; font: inherit; font-size: 14px;
}
.toolbar input[type=search] { min-width: 220px; flex: 1; max-width: 360px; }
.toolbar-spacer { flex: 1; }
.devo-table tr.is-today td { background: color-mix(in srgb, var(--ok) 7%, transparent); }

/* ---- reading view ---- */
.devo { padding: 34px 40px; }
.devo-label { margin: 0 0 14px; display: flex; gap: 8px; align-items: center; }
.devo-title { font: 600 30px/1.2 "Source Serif 4", Georgia, serif; margin: 0 0 10px; letter-spacing: -.01em; }
.devo-subtitle { font: italic 18px "Source Serif 4", Georgia, serif; color: var(--muted); margin: -4px 0 12px; }
.devo-scripture {
  font: italic 16.5px/1.55 "Source Serif 4", Georgia, serif; margin: 0 0 22px;
  padding-left: 14px; border-left: 3px solid var(--accent); color: var(--text);
}
.devo-scripture--sub { margin-top: -12px; }
.devo-body { font: 17px/1.75 "Source Serif 4", Georgia, serif; max-width: 68ch; }
.devo-body p { margin: 0 0 1.05em; }
.devo-soulfood {
  margin: 24px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted);
}
.devo-soulfood b { color: var(--text); }
.devo--compact { padding: 6px 2px 2px; }
.devo--compact .devo-title { font-size: 22px; }
.devo--compact .devo-body { font-size: 15.5px; }
@media (max-width: 600px) { .devo { padding: 22px 18px; } .devo-title { font-size: 24px; } }

.table--kv td { padding: 7px 4px; font-size: 13.5px; }
.table--kv td:first-child { width: 42%; }
.history-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.history-list li { display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border-radius: 7px; font-size: 13.5px; }
.history-list li.is-active { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--accent); }

/* ---- upload ---- */
.type-pick { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.type-pick legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; padding: 0; }
.form .type-option {
  flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); cursor: pointer;
}
.form .type-option:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.form .type-option input { width: auto; margin: 0; }
.paste-box summary { cursor: pointer; font-size: 13px; color: var(--accent-soft); margin-bottom: 8px; }
.paste-box textarea { width: 100%; font: 13px/1.5 "JetBrains Mono", monospace; }
.format-sample {
  font: 12.5px/1.55 "JetBrains Mono", monospace; white-space: pre-wrap; margin: 0;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px;
}

/* ---- upload preview ---- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.kpi-n { font: 600 17px "JetBrains Mono", monospace; }
.kpi-l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi--warn { border-color: color-mix(in srgb, var(--warning) 55%, var(--line)); }
.kpi--warn .kpi-n { color: var(--warning); }
.kpi--bad { border-color: color-mix(in srgb, var(--critical) 55%, var(--line)); }
.kpi--bad .kpi-n { color: var(--critical); }

.notice {
  padding: 9px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.notice--warn { background: rgba(245,165,36,.10); border-color: rgba(245,165,36,.35); }
.notice--bad { background: rgba(229,72,77,.10); border-color: rgba(229,72,77,.4); color: var(--critical-text); }
.notice a { color: var(--accent-soft); }

.confirm-panel { margin-bottom: 18px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.confirm-row { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.confirm-form { flex: 1; min-width: 300px; }
.confirm-side { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form--inline { flex-direction: row; align-items: flex-end; }

.entry-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.entry { border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.entry > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px;
  padding: 10px 14px; font-size: 14px;
}
.entry > summary::-webkit-details-marker { display: none; }
.entry > summary:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.entry--warn { border-left: 3px solid var(--warning); }
.entry--bad { border-left: 3px solid var(--critical); }
.entry--ok { border-left: 3px solid var(--ok); }
.entry-date { flex: 0 0 120px; color: var(--muted); font-size: 12.5px; }
.entry-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.entry-meta { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.entry-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.entry-body .notice:first-child { margin-top: 12px; }
@media (max-width: 600px) { .entry > summary { flex-wrap: wrap; gap: 6px 12px; } .entry-date { flex-basis: auto; } }

/* ---- sign-in (Microsoft only) ---- */
.login-sso--only { display: flex; flex-direction: column; gap: 12px; }
.login-sso--only .field-hint { margin: 0; }


/* ---- Publish to Aletheia wizard ---- */
.wizard-steps { list-style: none; display: flex; gap: 8px; margin: 0 0 20px; padding: 0; flex-wrap: wrap; }
.wizard-steps li {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted);
  padding: 7px 14px 7px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
}
.wizard-steps li span {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font: 600 12px "JetBrains Mono", monospace; background: var(--panel-2); color: var(--muted);
}
.wizard-steps li.is-active { color: var(--text); border-color: var(--accent); }
.wizard-steps li.is-active span { background: var(--accent); color: var(--on-accent); }
.wizard-steps li.is-done span { background: var(--ok); color: var(--on-ok); }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.review-head h2 { margin: 0; }
.review-tools { margin: 6px 0 4px; }
.review-tools .check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.review-row { display: flex; gap: 10px; align-items: flex-start; }
.review-row > details { flex: 1; min-width: 0; }
.review-act { flex: 0 0 290px; display: flex; align-items: center; min-height: 42px; }
.review-act select {
  width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13.5px;
}
.review-act select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.hide-quiet .review-row.is-quiet { display: none; }
.entry--quiet { border-left: 3px solid var(--line); opacity: .8; }
.al-rows { margin: 12px 0 4px; }
.al-rows th { padding: 6px 4px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 10px; }
.compare--single { grid-template-columns: 1fr; }
.devo--aletheia { border-left: 1px dashed var(--line); padding-left: 18px; }
.publish-confirm { margin-top: 16px; position: sticky; bottom: 12px; box-shadow: var(--card-shadow); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.publish-confirm p { margin: 0; }
.publish-confirm .form-actions { margin: 0; }
.backup summary { cursor: pointer; color: var(--accent-soft); margin-top: 4px; }
.backup pre { max-height: 320px; overflow: auto; font-size: 11.5px; white-space: pre-wrap; word-break: break-word;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
@media (max-width: 900px) {
  .review-row { flex-direction: column; gap: 4px; }
  .review-act { flex-basis: auto; width: 100%; min-height: 0; }
  .compare { grid-template-columns: 1fr; }
  .devo--aletheia { border-left: none; padding-left: 0; border-top: 1px dashed var(--line); padding-top: 12px; }
}
.author-note { margin: 0; }
.author-note a { color: var(--accent-soft); }
.delete-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.table tr.is-editing td { background: var(--panel-2); }
