/* ObVS global stylesheet.
   Extracted from rendering.py BASE_TEMPLATE 2026-07-25. Previously inlined into
   every page render (~69KB per request); now served once and cached.
   Per-user accent override is still injected inline — it must vary per user. */

/* ============================================================================
   ObVS palettes — one recipe, hue rotated.

   Every palette sets the SAME nine values: five surfaces, two borders, three
   text tones and an accent. Everything else (gradients, washes, insets) is
   DERIVED from those via var() below, so a structural change lands in all
   eight palettes at once. Do not hand-write per-palette gradients.

   :root is Clay, the default. Dark variants override only the palette values.
   Light variants additionally override status colours and shadows.
   ========================================================================== */

:root {
  /* --- palette: Clay (default) --- */
  --bg-body: #121211;
  --bg-surface: #1a1a18;
  --bg-card: #222220;
  --bg-elevated: #2a2926;
  --bg-input: #0e0e0d;
  --border: #33322e;
  --border-light: #43413b;
  --text-primary: #edebe6;
  --text-secondary: #a8a49b;
  --text-muted: #85837c;
  --accent: #d98e4a;
  --accent-hover: #e39f63;
  --accent-subtle: rgba(217,142,74,0.13);

  /* --- shared: status --- */
  --danger: #e5534b;
  --danger-hover: #f06860;
  --danger-subtle: rgba(229,83,75,0.12);
  --success: #56d364;
  --success-subtle: rgba(86,211,100,0.12);
  --warning: #e3b341;
  --warning-subtle: rgba(227,179,65,0.12);

  /* --- shared: shape, type, motion --- */
  --radius: 8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  --transition: 0.15s ease;
  /* Text on an accent/danger fill. White reads on every palette:
     the light palettes deliberately use darkened accents. */
  --text-on-accent: #ffffff;

  /* --- derived: shared by every palette, never redefine per-palette --- */
  --border-focus: var(--accent);
  --nav-gradient: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
  --bg-gradient-val:
    radial-gradient(ellipse at 20% 10%, var(--accent-subtle) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, var(--accent-subtle) 0%, transparent 55%),
    var(--bg-surface);

  /* --- dark-mode depth cues (light palettes override these) --- */
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --btn-gradient: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(0,0,0,0.1) 100%);
  --input-inset: inset 0 2px 4px rgba(0,0,0,0.5);
  --card-gradient: linear-gradient(160deg, rgba(255,255,255,0.025) 0%, rgba(0,0,0,0.0) 100%);
  --bg-pattern-color: rgba(255,255,255,0.025);
}

/* Explicit alias so the picker can name the default like any other palette. */
.theme-clay { }

.theme-sage {
  --bg-body: #111312;
  --bg-surface: #191c1a;
  --bg-card: #1f2220;
  --bg-elevated: #272b27;
  --bg-input: #0d0f0e;
  --border: #2f332f;
  --border-light: #3d423c;
  --text-primary: #eaede8;
  --text-secondary: #a2aa9d;
  --text-muted: #828a7e;
  --accent: #8aae72;
  --accent-hover: #9bbd84;
  --accent-subtle: rgba(138,174,114,0.13);
}

.theme-harbor {
  --bg-body: #101214;
  --bg-surface: #181b1f;
  --bg-card: #1e2226;
  --bg-elevated: #262b30;
  --bg-input: #0c0e10;
  --border: #2e3338;
  --border-light: #3c424a;
  --text-primary: #e8ebef;
  --text-secondary: #9ba3ad;
  --text-muted: #7e858e;
  --accent: #6e92c4;
  --accent-hover: #82a2d2;
  --accent-subtle: rgba(110,146,196,0.13);
}

.theme-plum {
  --bg-body: #131114;
  --bg-surface: #1c1920;
  --bg-card: #232027;
  --bg-elevated: #2b2730;
  --bg-input: #0f0e10;
  --border: #35303a;
  --border-light: #443d4a;
  --text-primary: #ede8ef;
  --text-secondary: #a79fab;
  --text-muted: #867e8a;
  --accent: #a87bb0;
  --accent-hover: #b78cbe;
  --accent-subtle: rgba(168,123,176,0.13);
}

.theme-ember {
  --bg-body: #131110;
  --bg-surface: #1d1918;
  --bg-card: #241f1e;
  --bg-elevated: #2d2725;
  --bg-input: #0f0e0d;
  --border: #36302d;
  --border-light: #453e39;
  --text-primary: #efe9e6;
  --text-secondary: #aba29c;
  --text-muted: #8a817c;
  --accent: #c86b52;
  --accent-hover: #d57e66;
  --accent-subtle: rgba(200,107,82,0.13);
}

.theme-pine {
  --bg-body: #101312;
  --bg-surface: #181c1b;
  --bg-card: #1e2322;
  --bg-elevated: #262c2b;
  --bg-input: #0c0f0e;
  --border: #2e3533;
  --border-light: #3c4442;
  --text-primary: #e7edeb;
  --text-secondary: #9aa5a3;
  --text-muted: #7e8887;
  --accent: #5fa396;
  --accent-hover: #74b3a7;
  --accent-subtle: rgba(95,163,150,0.13);
}

/* ---------------------------------------------------------------------------
   Light palettes. Deliberately paper/newsprint grey, never white — and their
   accents are darkened, since the dark-palette accents fail contrast on light.
   ------------------------------------------------------------------------ */

.theme-paper,
.theme-ash,
.theme-light {
  /* status: darkened so they read on a light surface */
  --danger: #a33c33;
  --danger-hover: #bd4a40;
  --danger-subtle: rgba(163,60,51,0.10);
  --success: #2f6b3f;
  --success-subtle: rgba(47,107,63,0.10);
  --warning: #8a6415;
  --warning-subtle: rgba(138,100,21,0.10);
  /* depth cues inverted for light */
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.15);
  --btn-gradient: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(0,0,0,0.04) 100%);
  --input-inset: inset 0 2px 3px rgba(0,0,0,0.08);
  --card-gradient: linear-gradient(160deg, rgba(255,255,255,0.9) 0%, rgba(0,0,0,0.0) 100%);
  --bg-pattern-color: rgba(0,0,0,0.04);
}

.theme-paper,
.theme-light {
  /* Dark canvas, light paper. Text tokens here are the CANVAS values;
     .card / inputs re-declare them dark further down. */
  --bg-body: #1a1917;
  --bg-surface: #221f1d;
  --bg-card: #f1efe9;
  --bg-elevated: #e9e7e0;
  --bg-input: #fbfaf7;
  --border: #37322d;
  --border-light: #4a443c;
  --text-primary: #efece6;
  --text-secondary: #c0b9ae;
  --text-muted: #978f84;
  --accent: #a76a2e;
  --accent-hover: #8f5822;
  --accent-subtle: rgba(167,106,46,0.10);
}

/* ---------------------------------------------------------------------------
   Light palettes are "dark canvas, light paper": the page is dark, content
   surfaces are light. Re-declaring the text tokens INSIDE those light surfaces
   means every descendant flips automatically — including the ~1,200 inline
   style='color:var(--text-primary)' attributes, which would otherwise render
   dark-on-dark out on the canvas.
   ------------------------------------------------------------------------ */
.theme-paper .card, .theme-light .card,
.theme-paper input, .theme-paper select, .theme-paper textarea,
.theme-light input, .theme-light select, .theme-light textarea {
  --text-primary: #242220;
  --text-secondary: #55514a;
  --text-muted: #6f6b63;
  --border: #d3cfc6;
  --border-light: #c2bdb2;
  color: var(--text-primary);
}
.theme-ash .card,
.theme-ash input, .theme-ash select, .theme-ash textarea {
  --text-primary: #1f2221;
  --text-secondary: #4e5251;
  --text-muted: #666a68;
  --border: #cfd1cf;
  --border-light: #bec1be;
  color: var(--text-primary);
}
/* Nav chrome follows the dark canvas, not the light cards. */
.theme-paper, .theme-light { --nav-gradient: linear-gradient(180deg, #2a2723 0%, #1a1917 100%); }
.theme-ash { --nav-gradient: linear-gradient(180deg, #292b29 0%, #191a19 100%); }

.theme-ash {
  --bg-body: #191a19;
  --bg-surface: #202220;
  --bg-card: #f0f1f0;
  --bg-elevated: #e6e7e6;
  --bg-input: #fafbfa;
  --border: #333634;
  --border-light: #454845;
  --text-primary: #ecefed;
  --text-secondary: #b8bcba;
  --text-muted: #8f9391;
  --accent: #356f63;
  --accent-hover: #2a5c52;
  --accent-subtle: rgba(53,111,99,0.10);
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--text-primary);
  font: 14px/1.6 var(--font);
  background: var(--bg-surface);
}
h1,h2,h3,h4 { font-weight: 600; color: var(--text-primary); }
h2 { font-size: 20px; margin: 0 0 12px; letter-spacing: -0.2px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: var(--accent-hover); }

/* === Layout: sidebar + content + bottom bar === */
body {
  display: flex;
  flex-direction: column;
}
.app-shell {
  flex: 1 1 auto;
  display: flex;
  min-height: 0; /* allow children to scroll */
}
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 48px; /* leave bottom-bar visible */
  width: 240px;
  background: var(--nav-gradient);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 2px 0 12px rgba(0,0,0,0.35);
  z-index: 200;
  transform: translateX(-105%);
  transition: transform 180ms ease-out;
  visibility: hidden;
}
.sidebar.open {
  transform: translateX(0);
  visibility: visible;
}
.sidebar-backdrop {
  position: fixed;
  inset: 0 0 48px 0;
  background: rgba(0,0,0,0.25);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}
.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-primary);
  font: inherit;
  flex-shrink: 0;
}
.menu-trigger:hover {
  background: var(--accent-subtle);
  border-color: var(--border);
}
.menu-trigger .apps-pill {
  width: 34px;
  height: 34px;
  font-size: 20px;
  border-width: 2px;
}
.menu-trigger .mt-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  min-width: 0;
}
.menu-trigger .active-app-label {
  font: 600 12px var(--font);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.sidebar-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-header .apps-pill {
  width: 38px;
  height: 38px;
  font-size: 24px;
  border-width: 2px;
}
.sidebar-header-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.sidebar-header-info .active-app-label {
  font: 600 13px var(--font);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px;
}
.sidebar-nav .ud-status-bar {
  padding: 4px 6px 8px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  margin-bottom: 1px;
}
.sidebar-nav a:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
}
.sidebar-nav .dd-app-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 15px;
}
.sidebar-nav .dd-app-name {
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.content-area {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.wrap {
  width: 100%;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}
.wrap.bg-plain { background: var(--bg-surface); }
.wrap.bg-gradient { background: var(--bg-gradient-val); }
.wrap.bg-graphic {
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle cx='7' cy='7' r='1.5' fill='%23aab' opacity='0.11'/%3E%3Ccircle cx='37' cy='22' r='1' fill='%23aab' opacity='0.09'/%3E%3Ccircle cx='52' cy='42' r='1.5' fill='%23aab' opacity='0.11'/%3E%3Ccircle cx='20' cy='47' r='1' fill='%23aab' opacity='0.08'/%3E%3Cpath d='M15 30l3-3 3 3-3 3z' fill='%23aab' opacity='0.07'/%3E%3Cpath d='M45 10l2-2 2 2-2 2z' fill='%23aab' opacity='0.07'/%3E%3Cline x1='0' y1='0' x2='60' y2='60' stroke='%23aab' stroke-width='0.3' opacity='0.04'/%3E%3C/g%3E%3C/svg%3E");
}
.bottom-bar {
  position: relative;
  color: var(--text-primary);
  padding: 0 12px;
  height: 48px;
  font: 600 13px var(--font);
  background: var(--nav-gradient);
  border-top: 1px solid var(--border);
  box-shadow: 0 -1px 3px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
}
.bottom-bar .nav-display { flex: 1; min-width: 0; }
.bottom-bar .realm-seal-brand { flex-shrink: 0; }
/* Hide legacy top bar styles (kept for compat) */
.top { display: none; }
/* macOS Electron: leave room for traffic-light window controls */
.platform-mac .sidebar-header { padding-top: 32px; }
.sub {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-secondary);
}
.sub:empty {
  display: none;
}
.pad { padding: 20px 16px; max-width: 960px; margin: 0 auto; }

/* === Nav Mini Display === */
.nav-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 6px;
}
.realm-seal-brand {
  display: flex;
  align-items: center;
  padding: 0 12px;
  user-select: none;
  pointer-events: none;
}
.nav-display-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 4px 12px;
  border-radius: var(--radius);
  background: var(--bg-body);
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}
.nav-display-inner:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}
.nav-display-inner.drop-open {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
#tlBellDrop {
  display:none;
  position:absolute;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  z-index:200;overflow-y:auto;max-height:400px;
  box-shadow:0 6px 20px rgba(0,0,0,.25);
}
.nav-display-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--text-on-accent);
  font: 700 10px var(--font);
  flex-shrink: 0;
}
.nav-display-badge.empty {
  background: var(--bg-elevated);
  color: var(--text-muted);
}
.nav-display-text {
  font: 12px var(--font);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* === Navigation === */
.main-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.main-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
  font: 600 13px var(--font);
  transition: all var(--transition);
}
.main-link:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
  border-color: var(--accent);
}
.app-selector {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.app-selector:hover { background: var(--accent-subtle); }
.app-selector::-webkit-details-marker { display: none; }
.apps-pill {
  width: 45px;
  height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 3px solid var(--border-light);
  color: var(--text-on-accent);
  background: var(--bg-elevated);
  font-size: 30px;
  pointer-events: none;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}
.apps-pill.st-available { border-color: var(--success); }
.apps-pill.st-busy { border-color: var(--warning); }
.apps-pill.st-offline { border-color: var(--text-muted); }
.active-app-label {
  font: 600 14px var(--font);
  color: var(--text-primary);
  white-space: nowrap;
}
.main-menu {
  position: static;
  display: inline-flex;
}
.main-menu > summary::-webkit-details-marker { display: none; }
.main-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius) 0;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 20;
}
.main-menu {
  position: relative;
}
.main-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}
.main-dropdown a:last-child { border-bottom: none; }
.main-dropdown .dd-app-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.95;
}
.main-dropdown .dd-app-name { line-height: 1; }
.main-dropdown a:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
}

/* === User menu === */
.user-menu { position: relative; z-index: 15; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-pill {
  width: 45px;
  height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 3px solid var(--border-light);
  color: var(--text-on-accent);
  background: var(--accent);
  font: 600 30px var(--font);
  transition: all var(--transition);
  box-sizing: border-box;
}
.user-pill:hover { transform: scale(1.08); }
.user-pill.st-available { border-color: var(--success); }
.user-pill.st-busy { border-color: var(--warning); }
.user-pill.st-offline { border-color: var(--text-muted); }
.user-dropdown {
  position: fixed;
  right: 0;
  top: 56px;
  width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 0 0 0 var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px;
}
.user-dropdown a {
  display: block;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: all var(--transition);
}
.user-dropdown a:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
}
.user-dropdown form {
  margin: 4px 0 0;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.user-dropdown button { width: 100%; }
.ud-status-bar {
  display: flex;
  gap: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 2px 4px 4px;
  border: 1px solid var(--border-light);
}
.ud-status-bar label {
  flex: 1;
  text-align: center;
  padding: 5px 0;
  font: 500 10px var(--font);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
  background: var(--bg-input);
  border-right: 1px solid var(--border-light);
}
.ud-status-bar label:last-child { border-right: none; }
.ud-status-bar input { display: none; }
.ud-status-bar input:checked + span { font-weight: 700; }
.ud-status-bar label.st-avail input:checked ~ span { color: var(--success); }
.ud-status-bar label.st-avail:has(input:checked) { background: var(--success-subtle); color: var(--success); }
.ud-status-bar label.st-busy input:checked ~ span { color: var(--warning); }
.ud-status-bar label.st-busy:has(input:checked) { background: var(--warning-subtle); color: var(--warning); }
.ud-status-bar label.st-off input:checked ~ span { color: var(--text-muted); }
.ud-status-bar label.st-off:has(input:checked) { background: var(--bg-elevated); color: var(--text-muted); }

/* === Cards === */
.card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
}

/* === Buttons === */
button {
  padding: 7px 14px;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  background-image: var(--btn-gradient);
  color: var(--text-primary);
  font: 500 12px var(--font);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.06);
}
button:hover {
  background: var(--border-light);
  border-color: var(--border-light);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}
button:active { transform: scale(0.98); box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); }
.danger-btn {
  border-color: var(--danger);
  background: var(--danger-subtle);
  color: var(--danger);
}
.danger-btn:hover {
  background: var(--danger);
  color: var(--text-on-accent);
}
.ok {
  background: var(--success-subtle);
  border-color: rgba(86,211,100,0.3);
  color: var(--success);
}

/* === Forms === */
input[type=text], input[type=password], input[type=file], input[type=date], input[type=time], select {
  width: 100%;
  max-width: 360px;
  padding: 7px 10px;
  font: 13px var(--font);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  box-shadow: var(--input-inset);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
}
textarea {
  width: 100%;
  min-height: 360px;
  padding: 12px;
  font: 13px/1.5 var(--font-mono);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  resize: vertical;
  box-sizing: border-box;
  outline: none;
}
textarea:focus { border-color: var(--border-focus); }

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
th {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font: 500 11px var(--font);
  padding: 8px 10px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  color: var(--text-primary);
}
tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
tr:hover td { background: var(--accent-subtle); }

/* === Modals === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 460px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}
.modal-card h3 { margin: 0 0 8px; font-size: 16px; }
.modal-card p { margin: 10px 0; color: var(--text-secondary); }
.modal-card .modal-actions { display: flex; gap: 8px; margin-top: 16px; }

/* === Login === */
.pill-off {
  width: 45px;
  height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
  box-sizing: border-box;
}
.login-seal-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 30px;
}
.login-seal {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid var(--border-light);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-sizing: border-box;
  user-select: none;
}
.login-seal:hover {
  border-color: var(--accent);
  transform: scale(1.06);
  box-shadow: 0 0 40px rgba(91,141,239,0.25);
}
.login-seal:active { transform: scale(0.97); }
.login-seal-label {
  margin-top: 16px;
  color: var(--text-muted);
  font: 500 12px var(--font);
  letter-spacing: 0.5px;
}
.login-panel { max-width: 400px; margin: 0 auto; text-align: center; }
.login-panel form { text-align: left; }
.login-panel .login-links { margin-top: 8px; font-size: 12px; }

/* === Settings / Control Panel === */
/* Settings page takes full viewport — override .pad/.wrap constraints when settings-wrap is present */
.pad:has(> h2 + .settings-wrap), .pad:has(> .settings-wrap) {
  max-width: none;
  padding: 8px 12px 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.wrap:has(.settings-wrap) { overflow: hidden; }
.pad:has(.settings-wrap) > h2 { flex-shrink: 0; margin: 4px 0 8px; }

.settings-wrap {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}
.settings-tree {
  width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0;
  flex-shrink: 0;
  transition: width 0.2s ease;
  scrollbar-width: none;
}
.settings-tree::-webkit-scrollbar { display: none; }
.settings-tree.collapsed { width: 44px; }
.st-toggle {
  display: flex; align-items: center; justify-content: center; width: 100%; padding: 8px 0; cursor: pointer;
  color: var(--text-muted); font-size: 16px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
  transition: color var(--transition); user-select: none; background: none; border-left: none; border-right: none; border-top: none;
}
.st-toggle:hover { color: var(--accent); background: var(--accent-subtle); }
.st-toggle-arrow { display: inline-block; transition: transform 0.2s ease; }
.settings-tree.collapsed .st-toggle-arrow { transform: rotate(180deg); }
.st-group { margin: 0; }
.st-group-label {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; font: 600 11px var(--font);
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer;
  user-select: none; transition: color var(--transition); white-space: nowrap; overflow: hidden;
}
.st-group-label:hover { color: var(--text-primary); }
.st-group-label .st-arrow { font-size: 8px; transition: transform 0.15s ease; display: inline-block; width: 10px; flex-shrink: 0; }
.st-group-label .st-group-text { overflow: hidden; transition: opacity 0.15s ease; }
.settings-tree.collapsed .st-group-label { display: none; }
.st-group.collapsed .st-arrow { transform: rotate(-90deg); }
.st-group.collapsed .st-children { display: none; }
.settings-tree.collapsed .st-group.collapsed .st-children { display: block; }
.st-children { margin: 0; padding: 0; }
.st-item {
  display: flex; align-items: center; gap: 7px; padding: 6px 12px 6px 28px; font: 12px var(--font);
  color: var(--text-secondary); cursor: pointer; text-decoration: none; transition: all var(--transition);
  border-left: 2px solid transparent; white-space: nowrap; overflow: hidden;
}
.st-item:hover { background: var(--accent-subtle); color: var(--text-primary); }
.st-item.active { background: var(--accent-subtle); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.st-icon { font-size: 13px; flex-shrink: 0; width: 16px; text-align: center; }
.st-item-text { overflow: hidden; text-overflow: ellipsis; transition: opacity 0.15s ease; }
.settings-tree.collapsed .st-item { padding: 8px 0; justify-content: center; gap: 0; border-left: 2px solid transparent; }
.settings-tree.collapsed .st-item-text { display: none; }
.settings-tree.collapsed .st-icon { font-size: 16px; }
.settings-main { flex: 1; overflow-y: auto; background: var(--bg-surface); min-width: 0; scrollbar-width: none; }
.settings-main::-webkit-scrollbar { display: none; }
.settings-panel { display: none; padding: 20px 24px; }
.settings-panel.active { display: block; }
.settings-panel h3 { font: 600 15px var(--font); color: var(--text-primary); margin: 0 0 6px; }
.settings-panel .panel-desc { font-size: 12px; color: var(--text-secondary); margin: 0 0 16px; text-indent: 0; padding-left: 0; max-width: none; }
.cp-summary {
  margin: 0 0 10px; font-size: 12px; color: var(--text-secondary);
  text-indent: 0; padding-left: 0; max-width: none;
}
.cp-content p { text-indent: 0; padding-left: 0; max-width: none; }
.cp-action {
  display: inline-flex; align-items: center; text-decoration: none; padding: 7px 14px;
  border: 1px solid var(--border-light); background: var(--bg-elevated); color: var(--text-primary);
  font: 500 12px var(--font); border-radius: var(--radius-sm); transition: all var(--transition);
}
.cp-action:hover { background: var(--border-light); color: var(--text-on-accent); }
.cp-locked {
  display: inline-block; padding: 5px 10px; border: 1px solid rgba(229,83,75,0.3);
  background: var(--danger-subtle); color: var(--danger); font-size: 12px; border-radius: var(--radius-sm);
}
@media (max-width: 700px) {
  .settings-tree { width: 44px; }
  .settings-tree .st-group-label { display: none; }
  .settings-tree .st-item { padding: 8px 0; justify-content: center; gap: 0; }
  .settings-tree .st-item-text { display: none; }
  .settings-tree .st-icon { font-size: 16px; }
  .settings-tree.expanded-mobile { width: 220px; position: absolute; top: 0; left: 0; bottom: 0; z-index: 10; box-shadow: 4px 0 12px rgba(0,0,0,0.3); }
  .settings-tree.expanded-mobile .st-group-label { display: flex; }
  .settings-tree.expanded-mobile .st-item { padding: 6px 12px 6px 28px; justify-content: flex-start; gap: 7px; }
  .settings-tree.expanded-mobile .st-item-text { display: inline; }
  .settings-panel { padding: 14px; }
}

/* === Files (Explorer) === */
.drive-explorer { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-height: 480px; }
.drive-tree { width: 200px; background: var(--bg-card); border-right: 1px solid var(--border); overflow-y: auto; padding: 8px 0; flex-shrink: 0; }
.drive-tree-item { display: flex; align-items: center; gap: 6px; padding: 5px 10px; font: 12px var(--font); color: var(--text-secondary); cursor: pointer; text-decoration: none; transition: all var(--transition); border-left: 2px solid transparent; }
.drive-tree-item:hover { background: var(--accent-subtle); color: var(--text-primary); }
.drive-tree-item.active { background: var(--accent-subtle); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.drive-tree-item.indent1 { padding-left: 24px; }
.drive-tree-item.indent2 { padding-left: 40px; }
.drive-tree-icon { font-size: 14px; flex-shrink: 0; }
.drive-main { flex: 1; display: flex; flex-direction: column; background: var(--bg-surface); }
.drive-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--bg-card); flex-wrap: wrap; }
.drive-toolbar button, .drive-toolbar label { font: 500 11px var(--font); padding: 5px 10px; }
.drive-toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }
.drive-address { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--bg-surface); font: 12px var(--font); color: var(--text-secondary); overflow-x: auto; }
.drive-address a, .drive-address span { text-decoration: none; color: var(--text-secondary); padding: 2px 4px; border-radius: 3px; white-space: nowrap; }
.drive-address a:hover { color: var(--accent); background: var(--accent-subtle); }
.drive-address .addr-sep { color: var(--text-muted); font-size: 10px; }
.drive-address .addr-current { color: var(--text-primary); font-weight: 600; }
.drive-list { flex: 1; overflow-y: auto; overflow-x: auto; }
.drive-list table { border: none; border-radius: 0; min-width: 560px; }
.drive-list th { position: sticky; top: 0; z-index: 1; background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 7px 10px; font-size: 10px; }
.drive-list td { padding: 5px 10px; font-size: 12px; border-bottom: 1px solid var(--border); }
.drive-list tr:hover td { background: var(--accent-subtle); }
.drive-list tr.selected td { background: rgba(91,141,239,0.18); }
.drive-list .file-icon { font-size: 15px; margin-right: 6px; vertical-align: middle; }
.drive-list .file-name { font-weight: 500; color: var(--text-primary); }
.drive-list .file-name a { text-decoration: none; color: var(--text-primary); }
.drive-list .file-name a:hover { color: var(--accent); }
.drive-meta { font-size: 11px; color: var(--text-muted); }
.drive-status { padding: 6px 12px; border-top: 1px solid var(--border); font: 11px var(--font); color: var(--text-muted); background: var(--bg-card); display: flex; justify-content: space-between; }
#upload-progress-bar { display:none; margin:6px 0 0; width:100%; height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
#upload-progress-fill { height:100%; width:0%; background:var(--accent); transition:width 0.2s; border-radius:3px; }
#upload-status-text { display:none; font-size:11px; color:var(--text-muted); margin-top:3px; }
@keyframes obvs-spin { to { transform: rotate(360deg); } }
.obvs-spinner { display:inline-block; width:18px; height:18px; border:2px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:obvs-spin 0.7s linear infinite; vertical-align:middle; }
#obvs-offline-bar { display:none; position:fixed; top:0; left:0; right:0; z-index:99998; background:var(--danger-subtle); border-bottom:1px solid var(--danger); color:var(--danger); font-size:12px; padding:6px 16px; text-align:center; }
@media (max-width: 700px) {
  .drive-toolbar { flex-wrap: wrap; }
}
.drive-actions { display: inline-flex; gap: 3px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  text-decoration: none; font-size: 13px; line-height: 1;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent); }
.share-list { margin: 0; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.share-row { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border: 1px solid var(--border); background: var(--bg-card); border-radius: var(--radius-sm); font-size: 10px; }
.share-row form { margin: 0; }
.share-user-select { max-width: 160px; width: 160px; font-size: 11px; padding: 3px 6px; }
.share-panel { display: none; margin-top: 4px; }
.sharing-inline { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.folder-chip { display: inline-flex; align-items: center; text-decoration: none; padding: 5px 10px; border: 1px solid var(--border-light); background: var(--bg-elevated); color: var(--text-primary); font: 500 12px var(--font); border-radius: var(--radius-sm); transition: all var(--transition); }
.folder-chip:hover { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent); }
.folder-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; align-items: center; }
.folder-entry { display: inline-flex; align-items: center; gap: 4px; }
.folder-entry form { margin: 0; }
@media (max-width: 750px) { .drive-tree { display: none; } }

/* === Tex === */
.text-pad-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px;
}
.text-pad-toolbar .tool-grow { flex: 1 1 220px; }
.text-pad-toolbar input, .text-pad-toolbar select { max-width: none; width: 100%; }
.tex-status { margin: 0 0 10px; color: var(--success); font-size: 12px; }

/* === Home grid === */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.home-app-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none;
  padding: 20px 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  text-align: center;
  transition: all var(--transition);
}
.home-app-card:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(91,141,239,0.15);
}
.home-app-icon { font-size: 28px; margin-bottom: 8px; position: relative; display: inline-block; }
.home-app-badge { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: var(--text-on-accent); font: 700 10px var(--font); display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; box-sizing: border-box; border: 2px solid var(--bg-card); }
.home-app-name { color: var(--text-primary); font: 600 13px var(--font); margin-bottom: 3px; }
.home-app-desc { color: var(--text-muted); font-size: 11px; }
.home-app-card { position: relative; }
.home-nav-toggle { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 3px; cursor: pointer; font: 500 10px var(--font); color: var(--text-muted); }
.home-nav-toggle input { width: 14px; height: 14px; margin: 0; cursor: pointer; accent-color: var(--accent); }
.home-nav-toggle input:disabled { cursor: default; opacity: 0.5; }
.home-nav-label { line-height: 1; }
.home-apply-bar { justify-content: center; padding: 12px; position: sticky; bottom: 0; background: var(--bg-card); border-top: 1px solid var(--border); }
.home-apply-bar button { padding: 8px 24px; background: var(--accent); color: var(--text-on-accent); border: none; border-radius: var(--radius-sm); font: 600 13px var(--font); cursor: pointer; transition: background var(--transition); }
.home-apply-bar button:hover { background: var(--accent-hover); }

/* === App Central === */
.ac-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.ac-tab { padding: 10px 20px; font: 600 13px var(--font); color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition); }
.ac-tab:hover { color: var(--text-primary); }
.ac-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ac-grid { display: flex; flex-direction: column; gap: 8px; }
.ac-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color var(--transition); }
.ac-card:hover { border-color: var(--border-light); }
.ac-icon { font-size: 28px; flex-shrink: 0; width: 36px; text-align: center; }
.ac-info { flex: 1; min-width: 0; }
.ac-info h3 { margin: 0; font-size: 14px; }
.ac-info p { margin: 2px 0 0; font-size: 11px; color: var(--text-muted); }
.ac-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ac-badge { font: 600 10px var(--font); padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.ac-badge.stock { background: var(--accent-subtle); color: var(--accent); }
.ac-badge.bolton { background: var(--success-subtle); color: var(--success); }
.ac-badge.add-on { background: var(--success-subtle); color: var(--success); }
.ac-btn { padding: 6px 14px; border: none; border-radius: var(--radius-sm); font: 600 12px var(--font); cursor: pointer; transition: all var(--transition); }
.ac-btn.primary { background: var(--accent); color: var(--text-on-accent); }
.ac-btn.primary:hover { background: var(--accent-hover); }
.ac-btn.danger { background: var(--danger-subtle); color: var(--danger); border: 1px solid var(--danger); }
.ac-btn.danger:hover { background: var(--danger); color: var(--text-on-accent); }
.ac-installed { font: 500 11px var(--font); color: var(--success); }

/* === Messages === */
.comm-wrap { display: flex; height: calc(100vh - 140px); max-height: 800px; min-height: 400px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-surface); }
.comm-sidebar { width: 260px; background: var(--bg-card); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; transition: width 0.2s ease; }
.comm-sidebar.collapsed { width: 58px; }
.comm-sidebar-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; overflow: hidden; white-space: nowrap; }
.comm-sidebar-head h3 { font: 600 13px var(--font); color: var(--text-primary); margin: 0; }
.comm-sidebar.collapsed .comm-sidebar-head { padding: 8px; justify-content: center; }
.comm-sidebar.collapsed .comm-sidebar-head h3 { display: none; }
.comm-status-toggle { padding: 6px 10px; border-bottom: 1px solid var(--border); }
.comm-status-toggle .ud-status-bar { font-size: 11px; }
.comm-sidebar.collapsed .comm-status-toggle { display: none; }
.comm-toggle { background: var(--bg-elevated); border: 1px solid var(--border-light); color: var(--text-secondary); cursor: pointer; font-size: 12px; padding: 4px 8px; border-radius: var(--radius-sm); transition: all 0.15s; line-height: 1; }
.comm-toggle:hover { color: var(--text-on-accent); background: var(--accent); border-color: var(--accent); }
.comm-contacts { flex: 1; overflow-y: auto; padding: 6px; }
.comm-sidebar.collapsed .comm-contacts { padding: 4px; }
.comm-contact { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; border: none; background: none; width: 100%; text-align: left; transition: all 0.15s; }
.comm-sidebar.collapsed .comm-contact { justify-content: center; padding: 6px 4px; gap: 0; }
.comm-sidebar.collapsed .comm-contact-info { display: none; }
.comm-contact:hover { background: var(--accent-subtle); }
.comm-contact.active { background: var(--accent); }
.comm-contact.active .comm-contact-name { color: var(--text-on-accent); }
.comm-contact.active .comm-contact-preview { color: rgba(255,255,255,0.7); }
.comm-avatar { position: relative; width: 36px; height: 36px; flex-shrink: 0; }
.comm-avatar-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; background: var(--bg-elevated); color: var(--text-secondary); font-weight: 600; font-family: var(--font); border: 2px solid transparent; box-sizing: border-box; }
.comm-avatar-icon.status-available { border-color: var(--success); }
.comm-avatar-icon.status-busy { border-color: var(--warning); }
.comm-avatar-icon.status-offline { border-color: var(--text-muted); }
.comm-unread-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: var(--text-on-accent); font: 700 10px var(--font); display: flex; align-items: center; justify-content: center; padding: 0 4px; box-sizing: border-box; border: 2px solid var(--bg-card); z-index: 1; }
.comm-status-dot { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg-card); }
.comm-status-dot.available { background: var(--success); }
.comm-status-dot.busy { background: var(--warning); }
.comm-status-dot.offline { background: var(--text-muted); }
.comm-contact-info { flex: 1; min-width: 0; }
.comm-contact-name { font: 600 13px var(--font); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comm-contact-preview { font: 12px var(--font); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.comm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.comm-chat-header { padding: 10px 14px; background: var(--bg-card); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.comm-chat-header .comm-avatar-icon { width: 28px; height: 28px; font-size: 13px; }
.comm-chat-header-info { flex: 1; }
.comm-chat-header-name { font: 600 13px var(--font); color: var(--text-primary); }
.comm-chat-header-status { font: 11px var(--font); color: var(--text-muted); }
.comm-back-btn { display: none; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 18px; padding: 0 4px; }
.comm-bio-btn { background: none; border: 1px solid var(--border-light); color: var(--text-secondary); cursor: pointer; font: 11px var(--font); padding: 4px 10px; border-radius: var(--radius-sm); }
.comm-bio-btn:hover { color: var(--accent); border-color: var(--accent); }
.comm-messages { flex: 1; overflow-y: auto; padding: 14px 20px 14px 14px; display: flex; flex-direction: column; gap: 4px; min-height: 0; background-color: var(--bg-body); background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle cx='7' cy='7' r='1.5' fill='%23888' opacity='0.07'/%3E%3Ccircle cx='37' cy='22' r='1' fill='%23888' opacity='0.06'/%3E%3Ccircle cx='52' cy='42' r='1.5' fill='%23888' opacity='0.07'/%3E%3Ccircle cx='20' cy='47' r='1' fill='%23888' opacity='0.05'/%3E%3Cpath d='M15 30l3-3 3 3-3 3z' fill='%23888' opacity='0.04'/%3E%3Cpath d='M45 10l2-2 2 2-2 2z' fill='%23888' opacity='0.04'/%3E%3C/g%3E%3C/svg%3E"); }
.comm-msg { max-width: 72%; padding: 8px 13px; font: 13px var(--font); line-height: 1.5; word-wrap: break-word; }
.comm-msg.sent { background: var(--accent); color: var(--text-on-accent); border-radius: 18px 18px 4px 18px; }
.comm-msg.received { background: var(--bg-elevated); color: var(--text-primary); border-radius: 18px 18px 18px 4px; }
.comm-msg a { color: inherit; text-decoration: underline; }
.comm-msg.received a { color: var(--accent); }
.comm-msg.received[style*="background"] a { color: inherit; }
.comm-timestamp-divider { text-align: center; font: 11px var(--font); color: var(--text-muted); margin: 12px 0 8px; opacity: 0.7; }
.comm-input { display: flex; border-top: 1px solid var(--border); background: var(--bg-card); flex-shrink: 0; }
.comm-input input { flex: 1; background: transparent; color: var(--text-primary); border: none; padding: 12px 14px; font: 13px var(--font); outline: none; max-width: none; }
.comm-input button { background: var(--accent); color: var(--text-on-accent); border: none; padding: 12px 20px; font: 600 12px var(--font); cursor: pointer; }
.comm-input button:hover { opacity: 0.9; }
.comm-empty { display: flex; align-items: center; justify-content: center; flex: 1; color: var(--text-muted); font: 13px var(--font); }
.comm-bio-overlay { display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 10; align-items: center; justify-content: center; padding: 20px; }
.comm-bio-overlay.visible { display: flex; }
.comm-bio-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; max-height: 80%; display: flex; flex-direction: column; overflow: hidden; }
.comm-bio-titlebar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.comm-bio-titlebar h3 { margin: 0; font: 600 13px var(--font); color: var(--text-primary); }
.comm-bio-close { background: none; border: 1px solid var(--border-light); color: var(--text-secondary); cursor: pointer; font: 12px var(--font); padding: 4px 12px; border-radius: var(--radius-sm); }
.comm-bio-close:hover { color: var(--text-primary); border-color: var(--accent); }
.comm-bio-body { padding: 14px; overflow-y: auto; flex: 1; }
.comm-bio-body .bio-content { font: 13px/1.6 var(--font); color: var(--text-secondary); }
.comm-bio-body .bio-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 8px 0; }
/* Messages — new elements */
.comm-sidebar-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.comm-tab { flex: 1; padding: 7px 0; background: none; border: none; border-bottom: 2px solid transparent; font: 500 12px var(--font); color: var(--text-muted); cursor: pointer; transition: all 0.15s; }
.comm-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.comm-tab-panel { flex: 1; overflow-y: auto; padding: 6px; }
.comm-sidebar.collapsed .comm-sidebar-tabs { display: none; }
.comm-sidebar.collapsed .comm-tab-panel { padding: 4px; }
.comm-new-channel-btn { width: 100%; margin-top: 6px; padding: 7px 10px; background: var(--accent-subtle); border: 1px dashed var(--accent); color: var(--accent); border-radius: var(--radius-sm); font: 500 12px var(--font); cursor: pointer; transition: all 0.15s; }
.comm-new-channel-btn:hover { background: var(--accent); color: var(--text-on-accent); }
.comm-channel-icon { background: var(--accent-subtle) !important; color: var(--accent) !important; border-color: var(--border) !important; font-weight: 700; }
.comm-empty-list { color: var(--text-muted); font-size: 12px; padding: 12px; font-style: italic; }
.comm-conn-bar { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 12px; background: var(--danger-subtle); color: var(--danger); font-size: 0.78rem; border-bottom: 1px solid var(--danger); flex-shrink: 0; }
.comm-spinner { display: flex; align-items: center; justify-content: center; height: 60px; flex-shrink: 0; }
.comm-typing-indicator { min-height: 18px; padding: 2px 12px; color: var(--text-muted); font-size: 0.76rem; font-style: italic; flex-shrink: 0; }
.comm-input-row { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--bg-card); }
.comm-text-input { flex: 1; padding: 8px 10px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font: 13px var(--font); outline: none; }
.comm-text-input:focus { border-color: var(--accent); }
.comm-send-btn { padding: 8px 16px; background: var(--accent); color: var(--text-on-accent); border: none; border-radius: var(--radius-sm); font: 600 12px var(--font); cursor: pointer; flex-shrink: 0; transition: background 0.15s; }
.comm-send-btn:hover { background: var(--accent-hover); }
.comm-attach-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--bg-elevated); border: 1px solid var(--border); cursor: pointer; font-size: 16px; flex-shrink: 0; transition: all 0.15s; }
.comm-attach-btn:hover { background: var(--accent-subtle); border-color: var(--accent); }
.comm-msg-wrap { display: flex; flex-direction: column; margin-bottom: 6px; }
.comm-msg-wrap.sent { align-items: flex-end; padding-right: 10px; }
.comm-msg-wrap.received { align-items: flex-start; padding-left: 10px; }
.comm-msg-sender { font: 600 10px var(--font); color: var(--text-muted); margin-bottom: 2px; padding: 0 4px; }
.comm-file-attachment { margin: 2px 0; }
.comm-file-image { max-width: 220px; max-height: 180px; border-radius: var(--radius-sm); cursor: pointer; display: block; }
.comm-file-link { color: var(--accent); text-decoration: none; font-size: 13px; }
.comm-file-link:hover { text-decoration: underline; }
/* Modal */
.comm-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 900; display: flex; align-items: center; justify-content: center; }
.comm-modal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); width: 360px; max-width: 95vw; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.comm-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.comm-modal-head h3 { margin: 0; font: 600 14px var(--font); color: var(--text-primary); }
.comm-modal-head button { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1; }
.comm-modal-head button:hover { color: var(--text-primary); }
.comm-modal-body { padding: 14px 16px; overflow-y: auto; }
.comm-modal-body p { margin: 0 0 10px; }
.comm-modal-body label { font: 500 12px var(--font); color: var(--text-secondary); }
.comm-modal-body input[type=text] { padding: 7px 10px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font: 13px var(--font); margin-top: 4px; }
.comm-modal-body input[type=text]:focus { outline: none; border-color: var(--accent); }
@media(max-width:700px) {
  .comm-wrap { height: calc(100vh - 100px); flex-direction: column; }
  .comm-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .comm-sidebar.hidden { display: none; }
  .comm-main.hidden { display: none; }
  .comm-back-btn { display: inline-block; }
  .comm-msg { max-width: 88%; }
}

/* === Calendar === */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-nav button { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-light); padding: 6px 12px; cursor: pointer; font: 500 12px var(--font); border-radius: var(--radius-sm); }
.cal-nav button:hover { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }
.cal-nav .cal-title { font: 600 16px var(--font); color: var(--text-primary); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-hdr { background: var(--bg-card); color: var(--text-muted); font: 600 10px var(--font); text-align: center; padding: 8px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.cal-day { min-height: 72px; border: 1px solid var(--border); padding: 4px 5px; background: var(--bg-surface); font-size: 11px; }
.cal-day.today { background: var(--accent-subtle); border-color: var(--accent); }
.cal-day.other-month { background: var(--bg-body); opacity: 0.45; }
.cal-day .day-num { font: 600 12px var(--font); color: var(--text-secondary); margin-bottom: 3px; cursor: pointer; }
.cal-day .day-num:hover { color: var(--accent); }
.cal-evt { display: block; font-size: 10px; padding: 2px 4px; margin: 2px 0; border-radius: 3px; color: var(--text-on-accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-evt:hover { filter: brightness(1.15); }
.cal-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.cal-form input, .cal-form select { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-light); padding: 6px 10px; font: 13px var(--font); border-radius: var(--radius-sm); }
.cal-form button { background: var(--accent); color: var(--text-on-accent); border: none; padding: 7px 16px; cursor: pointer; font: 600 12px var(--font); border-radius: var(--radius-sm); margin-top: 8px; }
.cal-form button:hover { background: var(--accent-hover); }

/* === Contacts === */
.ct-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.ct-tab { padding: 8px 20px; font: 600 13px var(--font); color: var(--text-secondary); cursor: pointer; border: 1px solid var(--border); background: var(--bg-surface); border-radius: var(--radius-sm); transition: all 0.15s; }
.ct-tab:hover { color: var(--text-primary); background: var(--bg-elevated); }
.ct-tab.active { color: var(--text-on-accent); background: var(--accent); border-color: var(--accent); }
.ct-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ct-toolbar input[type=text] { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-light); padding: 7px 10px; font: 13px var(--font); flex: 1; max-width: 300px; border-radius: var(--radius-sm); }
.ct-toolbar button { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-light); padding: 7px 14px; cursor: pointer; font: 500 12px var(--font); border-radius: var(--radius-sm); }
.ct-toolbar button:hover { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }
.ct-toolbar .ct-count { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.ct-panel { display: none; }
.ct-panel.active { display: block; }
.ct-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 12px; transition: border-color var(--transition); cursor: pointer; text-decoration: none; }
.ct-card:hover { border-color: var(--accent); background: var(--accent-subtle); }
.ct-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--text-on-accent); display: flex; align-items: center; justify-content: center; font: 600 14px var(--font); flex-shrink: 0; }
.ct-avatar.biz { border-radius: var(--radius-sm); background: var(--success); }
.ct-info { flex: 1; min-width: 0; }
.ct-name { font: 600 13px var(--font); color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.ct-name .ct-badge { font: 500 9px var(--font); padding: 1px 6px; border-radius: 8px; background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.3px; }
.ct-name .ct-badge.realm { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent); }
.ct-sub { font-size: 11px; color: var(--text-secondary); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-actions { display: flex; gap: 4px; flex-shrink: 0; }
.ct-actions button { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 4px 10px; font-size: 11px; cursor: pointer; border-radius: var(--radius-sm); }
.ct-actions button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.ct-actions button.del:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-subtle); }
.ct-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.ct-form input, .ct-form textarea, .ct-form select { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-light); padding: 7px 10px; font: 13px var(--font); width: 100%; box-sizing: border-box; margin-bottom: 8px; border-radius: var(--radius-sm); }
.ct-form textarea { height: 50px; resize: vertical; min-height: auto; font-family: var(--font); }
.ct-form label { font: 500 11px var(--font); color: var(--text-muted); display: block; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.3px; }
.ct-form select { cursor: pointer; }
.ct-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ct-form h4 { margin: 0 0 10px; font-size: 13px; color: var(--text-primary); }
.ct-detail { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.ct-detail-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ct-detail-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--text-on-accent); display: flex; align-items: center; justify-content: center; font: 600 20px var(--font); flex-shrink: 0; }
.ct-detail-avatar.biz { border-radius: var(--radius); background: var(--success); }
.ct-detail-name { font: 600 18px var(--font); color: var(--text-primary); }
.ct-detail-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.ct-acct-list { margin-top: 12px; }
.ct-acct { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 4px; background: var(--bg-surface); }
.ct-acct-platform { font: 600 10px var(--font); text-transform: uppercase; letter-spacing: 0.4px; color: var(--accent); min-width: 60px; }
.ct-acct-id { font: 13px var(--font); color: var(--text-primary); flex: 1; }
.ct-acct-label { font: 11px var(--font); color: var(--text-muted); }
.ct-acct-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 2px 6px; }
.ct-acct-del:hover { color: var(--danger); }
.ct-add-acct { display: flex; gap: 6px; align-items: end; flex-wrap: wrap; margin-top: 10px; }
.ct-add-acct select, .ct-add-acct input { margin-bottom: 0; }
.ct-add-acct select { width: 120px; }
.ct-add-acct input { flex: 1; min-width: 140px; }
.ct-pb-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 12px; }
.ct-pb-card:hover { border-color: var(--border-light); }
.ct-pb-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ct-pb-status.available { background: var(--success); }
.ct-pb-status.busy { background: var(--warning); }
.ct-pb-status.offline { background: var(--text-muted); }
.ct-letter { font: 600 11px var(--font); color: var(--text-muted); text-transform: uppercase; padding: 6px 0 2px 4px; letter-spacing: 0.5px; }

/* === Library === */
.lib-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.lib-tab { padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); text-decoration: none; font: 600 12px var(--font); }
.lib-tab:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.lib-tab.active { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.lib-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; }
.lib-meta { color: var(--text-secondary); font-size: 12px; margin-top: 4px; }
.lib-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.lib-btn { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); padding: 7px 12px; font: 500 12px var(--font); border-radius: var(--radius-sm); text-decoration: none; }
.lib-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.lib-chip { display: inline-block; padding: 4px 8px; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border-light); color: var(--text-muted); font-size: 11px; margin: 2px 4px 0 0; }

@media (max-width: 760px) {
  .lib-grid { grid-template-columns: 1fr; }
}

/* === Admin guide: dark amber terminal "paper" aesthetic === */
.admin-guide-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: none;
  margin: 0;
  padding: 8px 0 40px;
}

/* Sticky collapsible TOC dropdown — stays at top of scrolling pane */
.admin-guide-toc-dropdown {
  position: sticky;
  top: 0;
  z-index: 5;
  align-self: stretch;
  background: var(--bg-surface);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.4);
  overflow: hidden;
}
.admin-guide-toc-dropdown > summary {
  cursor: pointer;
  padding: 10px 16px;
  font: 600 12px 'Menlo', 'Consolas', monospace;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: background 0.15s ease;
}
.admin-guide-toc-dropdown > summary::-webkit-details-marker { display: none; }
.admin-guide-toc-dropdown > summary::after {
  content: '▾';
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.2s ease;
  color: var(--accent);
}
.admin-guide-toc-dropdown[open] > summary::after { transform: rotate(180deg); }
.admin-guide-toc-dropdown > summary:hover { background: var(--bg-elevated); }
.admin-guide-toc-body {
  padding: 8px 16px 14px;
  border-top: 1px solid var(--border);
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: none;
}
.admin-guide-toc-body::-webkit-scrollbar { display: none; }
.admin-guide-toc-body .toc-card { background: transparent; border: none; padding: 0; box-shadow: none; }
.admin-guide-toc-body .toc-card h3 { display: none; }
.admin-guide-toc-body .toc-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
@media (max-width: 700px) {
  .admin-guide-toc-body .toc-list { columns: 1; }
}
.admin-guide-toc-body .toc-list li { margin: 2px 0; break-inside: avoid; }
.admin-guide-toc-body .toc-list .toc-level-2 { margin-left: 0; }
.admin-guide-toc-body .toc-list .toc-level-3 { margin-left: 14px; font-size: 11px; }
.admin-guide-toc-body .toc-list a {
  text-decoration: none;
  color: var(--accent);
  font: 12px 'Georgia', 'Charter', serif;
  line-height: 1.4;
  display: block;
  padding: 1px 0;
}
.admin-guide-toc-body .toc-list a:hover { color: var(--accent-hover); }

/* Dark paper pages — terminal amber on charcoal */
.admin-guide-pages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.guide-page {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px 64px;
  box-shadow:
    0 8px 24px rgba(0,0,0,0.55),
    0 2px 4px rgba(0,0,0,0.4),
    inset 0 0 0 1px rgba(200,140,60,0.03);
  font: 14px/1.65 'Georgia', 'Charter', 'Iowan Old Style', serif;
  position: relative;
}
.guide-page::before {
  /* Subtle warm grain */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image: radial-gradient(rgba(200,140,60,0.02) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.6;
}
.guide-page > * { position: relative; }
@media (max-width: 700px) {
  .guide-page { padding: 22px 28px; font-size: 13px; }
}

/* Typography — muted amber headings */
.guide-page h1, .guide-page h2, .guide-page h3, .guide-page h4 {
  font-family: 'Georgia', 'Charter', serif;
  color: var(--accent);
  scroll-margin-top: 60px;
}
.guide-page h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  letter-spacing: -0.3px;
}
.guide-page h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}
.guide-page h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 16px 0 6px;
  color: var(--accent);
}
.guide-page h4 {
  font-size: 13px;
  font-weight: 700;
  margin: 12px 0 4px;
  color: var(--accent);
  font-variant: small-caps;
  letter-spacing: 0.5px;
}
.guide-page p {
  margin: 8px 0;
  max-width: 72ch;
  text-indent: 0;
  padding-left: 0;
  color: var(--text-secondary);
}
.guide-page ul, .guide-page ol {
  margin: 8px 0 12px 22px;
  max-width: 72ch;
  padding-left: 0;
  color: var(--text-secondary);
}
.guide-page li { margin: 4px 0; padding-left: 0.35rem; }
.guide-page strong { color: var(--accent-hover); font-weight: 700; }
.guide-page em { color: var(--accent); font-style: italic; }
.guide-page a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.guide-page a:hover { color: var(--accent-hover); border-bottom-style: solid; }

/* Inline code: muted phosphor on darker chip */
.guide-page code {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  color: var(--accent);
  font: 0.88em 'Menlo', 'Consolas', monospace;
}
/* Code blocks: deep terminal black */
.guide-page pre {
  background: var(--bg-input);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 10px 0;
  font: 12.5px/1.5 'Menlo', 'Consolas', monospace;
  box-shadow: inset 0 0 0 1px rgba(200,140,60,0.03);
}
.guide-page pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
}

/* Blockquotes: muted phosphor callout */
.guide-page blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  color: var(--accent);
  font-style: italic;
}
.guide-page blockquote p { margin: 0; max-width: none; color: inherit; }
.guide-page blockquote strong { font-style: normal; color: var(--accent-hover); }

/* Tables — phosphor grid */
.guide-page .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin: 10px 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.guide-page .md-table th {
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
  padding: 6px 10px;
  text-align: left;
  border-bottom: 2px solid var(--accent);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.guide-page .md-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-secondary);
}
.guide-page .md-table tr:nth-child(even) td { background: rgba(200,140,60,0.025); }
.guide-page .md-table tr:last-child td { border-bottom: none; }
.guide-page .md-table tr:hover td { background: rgba(200,140,60,0.05); }
.guide-page .md-table code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.92em;
}

/* Horizontal rule as page divider */
.guide-page hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 18px 0;
}
