/* Digilistan WhatsApp SaaS — theme tokens + base styles (Phase 0).
 * RULES (from the wa14 token bug): every var() name must match a definition
 * below character-for-character, INCLUDING dashes (--tx-2, never --tx2).
 * No hardcoded hex outside the two token blocks. Components use var() only.
 * Contrast was computed from these exact tokens (see ARCHITECTURE.md):
 *  - all text >= 4.5:1 in both themes
 *  - control boundaries (borders) >= 3:1 in both themes
 *  - dark bubbles: incoming vs outgoing 3.15:1 (fixed vs wa14's 1.35:1)
 *  - light bubbles: hue + alignment cues (green tint + right side + tail);
 *    their luminance gap alone is below 3:1 — documented exception, not a pass.
 * Timestamps (.tm) are 12px minimum, never dimmed below readable opacity. */

/* v0.7.0 fonts (design.md sections 2/13): self-hosted variable WOFF2,
 * reused from the digilistan.com WordPress build (v1.2.30). Latin subset
 * covers Roman Urdu (Latin script, LTR). NO Google Fonts CDN. */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/css/fonts/spacegrotesk-var.woff2') format('woff2');
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/css/fonts/inter-var.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* v0.7.0 surface system (design.md section 12). Depth comes from border
   * + shadow, not hex alone: dark/light layer steps are only ~1.07-1.10:1,
   * so a hex-only system melts together (the old sidebar/main failure).
   * Light elevated/overlay stay WHITE, distinguished by border + shadow;
   * darker greys are inset/secondary only, never elevated/overlay.
   * Border tokens are measured vs the raised surface they sit on:
   * default #767E88 = 4.11:1, strong #5B636D = 6.09:1 (both >= 3:1).
   * --border-subtle intentionally equals --border-default: no lighter
   * border passes 3:1, so subtlety comes from shadow, not a weaker line. */
  --surface-base: #F5F5F7;
  --surface-raised: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --surface-overlay: #FFFFFF;
  --surface-inset: #F0F0F2;
  --border-subtle: #767E88;
  --border-default: #767E88;
  --border-strong: #5B636D;
  --border-sidebar-edge: #767E88;
  --sidebar-bg: #141416;
  --sidebar-tx: #E6E8EA;
  --sidebar-tx-2: #B7BCC2;
  --sidebar-overlay: #242428;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow: var(--shadow-md);
  --btn-disabled-bg: #E5E7EB;
  --btn-disabled-tx: #4B5563;
  --color-brand-primary: #0B0B0D;
  --color-brand-accent: #00E5A0;
  --color-brand-text: #B9BEC7;
  --color-brand-white: #FFFFFF;
  --color-status-amber: #F59E0B;
  --color-status-red: #EF4444;
  --color-status-grey: #6B7280;
  /* Badge tints (design.md section 11, measured correction): raw status
   * hex as text FAILS AA in light theme (amber 2.15:1, mint ~1.5:1, red
   * 3.76:1 on white), so badges use a tinted pill + a contrast-passing
   * text variant. All four combos below measure >= 4.5:1 vs their pill. */
  --status-mint-bg: #D2F7E9;
  --status-mint-tx: #067647;
  --status-amber-bg: #FEF3C7;
  --status-amber-tx: #92400E;
  --status-red-bg: #FDECEB;
  --status-red-tx: #9B1C1C;
  --status-grey-bg: #E5E7EB;
  --status-grey-tx: #374151;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  --tx: #1A1D21;
  --tx-2: #3E4652;
  --tx-3: #57606A;
  --acc: #00E5A0;
  --acc-d: #067647;
  --ink: #0B0B0D;
  --danger: #C0392B;
  --bubble-in: #FFFFFF;
  --bubble-out: #D9F5C0;
  --bubble-out-tx: #101828;
  --btn-bg: #00E5A0;
  --btn-tx: #0B0B0D;
  --acc-soft: #D2F7E9;
  --acc-soft-tx: #067647;
  --danger-soft: #FDECEB;
  --danger-soft-tx: #9B1C1C;
  --danger-btn-bg: #C0392B;
  --danger-btn-tx: #FFFFFF;
  --warn-soft: #FEF3C7;
  --warn-soft-tx: #92400E;
  --tx-disabled: #5F6660;
  --av-0: #0E7490;
  --av-1: #047857;
  --av-2: #B45309;
  --av-3: #BE185D;
  --av-4: #7C3AED;
  --av-5: #1D4ED8;
  --av-6: #9A3412;
  --av-7: #065F46;
  --av-8: #831843;
  --av-9: #374151;
}

html[data-theme="dark"] {
  /* v0.7.0 dark surfaces (design.md section 12). Base returns to the
   * brand #0B0B0D; the sidebar is LIGHTER than the base (raised), the
   * opposite direction from v0.6.0, and separation is carried by the
   * sidebar-edge border, not by the 1.07:1 hex step alone.
   * Border tokens measured vs raised #141416: default #646B75 = 3.42:1,
   * strong #767E88 = 4.48:1, sidebar edge #767E88 = 4.48:1 (all >= 3:1).
   * --border-subtle equals --border-default for the same reason as light:
   * no lighter border passes 3:1. */
  --surface-base: #0B0B0D;
  --surface-raised: #141416;
  --surface-elevated: #1C1C1F;
  --surface-overlay: #242428;
  --surface-inset: #1C1C1F;
  --border-subtle: #646B75;
  --border-default: #646B75;
  --border-strong: #767E88;
  --border-sidebar-edge: #767E88;
  --sidebar-bg: #141416;
  --sidebar-tx: #E6E8EA;
  --sidebar-tx-2: #B7BCC2;
  --sidebar-overlay: #242428;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow: var(--shadow-md);
  --btn-disabled-bg: #2A2D33;
  --btn-disabled-tx: #B7BCC2;
  --color-brand-primary: #0B0B0D;
  --color-brand-accent: #00E5A0;
  --color-brand-text: #B9BEC7;
  --color-brand-white: #FFFFFF;
  --color-status-amber: #F59E0B;
  --color-status-red: #EF4444;
  --color-status-grey: #6B7280;
  /* Badge tints, dark theme (all >= 4.5:1 vs their pill, computed):
   * mint 8.78:1, amber 9.33:1, red 7.73:1, grey 7.63:1. */
  --status-mint-bg: #0F3D2C;
  --status-mint-tx: #7DF0C5;
  --status-amber-bg: #3D2C07;
  --status-amber-tx: #FCD34D;
  --status-red-bg: #3D1A17;
  --status-red-tx: #FF9D94;
  --status-grey-bg: #26292E;
  --status-grey-tx: #B7BCC2;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
  --tx: #E6E8EA;
  --tx-2: #B7BCC2;
  --tx-3: #8A9199;
  --acc: #00E5A0;
  --acc-d: #00E5A0;
  --ink: #FFFFFF;
  --danger: #FF6B5E;
  --bubble-in: #1D1F23;
  --bubble-out: #247A5A;
  --bubble-out-tx: #E6F4EA;
  --btn-bg: #00E5A0;
  --btn-tx: #0B0B0D;
  --acc-soft: #0F3D2C;
  --acc-soft-tx: #7DF0C5;
  --danger-soft: #3D1A17;
  --danger-soft-tx: #FF9D94;
  --danger-btn-bg: #FF6B5E;
  --danger-btn-tx: #1A0F0E;
  --warn-soft: #3D2C07;
  --warn-soft-tx: #FCD34D;
  --tx-disabled: #8A9199;
  --av-0: #0E7490;
  --av-1: #047857;
  --av-2: #B45309;
  --av-3: #BE185D;
  --av-4: #7C3AED;
  --av-5: #1D4ED8;
  --av-6: #9A3412;
  --av-7: #065F46;
  --av-8: #831843;
  --av-9: #374151;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--font-heading); }
body {
  margin: 0;
  background: var(--surface-base);
  color: var(--tx);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--acc-d); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border-default);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tx); font-weight: 700; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  /* v0.6.0: same shared button token as .btn-primary — the old
   * --ink text flipped per theme and failed in dark. */
  background: var(--btn-bg);
  color: var(--btn-tx);
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.brand small { display: block; color: var(--tx-3); font-weight: 400; font-size: 0.8125rem; }
.topbar nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--tx);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, filter 0.15s ease, transform 0.15s ease;
}
.btn:hover { border-color: var(--tx-3); }
.btn:active { transform: translateY(1px); }
/* v0.5.2 stray-button fix: author display rules (.btn inline-block,
 * .card block, ...) beat the UA stylesheet's [hidden] rule, so every
 * hidden button on the site was rendering — Contacts "Cancel edit",
 * Backup "Confirm restore", all Cleanup confirms, and more. This rule
 * restores hidden semantics site-wide; showing an element still works
 * by removing its hidden attribute, which restores its normal display. */
[hidden] { display: none !important; }
.btn:disabled, .btn-primary:disabled, .btn-danger:disabled {
  background: var(--btn-disabled-bg);
  border-color: var(--btn-disabled-bg);
  color: var(--btn-disabled-tx);
  opacity: 1;
  cursor: not-allowed;
}
.btn-primary {
  /* v0.6.0: ONE shared token in both themes (see token blocks). */
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-tx);
}
.btn-danger {
  background: var(--danger-btn-bg);
  border-color: var(--danger-btn-bg);
  color: var(--danger-btn-tx);
}
.btn-danger:hover { filter: brightness(0.97); }
/* v0.6.0: one disabled state for every control, not just buttons.
 * Before this, a disabled proof form looked enabled because only the
 * button faded. Disabled text keeps a measured token colour. */
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-inset);
  color: var(--tx-disabled);
  cursor: not-allowed;
  opacity: 1;
}
.btn-primary:hover { filter: brightness(0.95); }
/* v0.7.1 gated quick action: real grey fill from the disabled tokens,
 * never an opacity fade; the inner link stays a real link. */
.btn-gated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--btn-disabled-bg);
  border-color: var(--btn-disabled-bg);
  color: var(--btn-disabled-tx);
  cursor: not-allowed;
}
.btn-gated a { color: var(--btn-disabled-tx); text-decoration: underline; }
.btn-gated svg { flex-shrink: 0; }
.checklist .check-row .check-mark svg { display: block; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--tx);
  cursor: pointer;
  line-height: 1;
}
.icon-btn svg { width: 20px; height: 20px; display: block; }

.wrap { max-width: 960px; margin: 0 auto; padding: 32px 20px; }
.hero h1 { font-family: var(--font-heading); font-size: clamp(1.75rem, 5vw, 2rem); line-height: 1.2; margin: 8px 0; }
.hero p { color: var(--tx-2); max-width: 640px; }
.eyebrow { color: var(--tx-3); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 18px;
  /* v0.6.0: one card style — subtle shadow in both themes. */
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.25rem; font-weight: 600; line-height: 1.35; margin: 0 0 6px; }
.card h3 { font-size: 1rem; font-weight: 600; line-height: 1.4; margin: 14px 0 6px; }
.card p { color: var(--tx-2); margin: 0; font-size: 1rem; line-height: 1.5; }
.muted { color: var(--tx-3); font-size: 0.8125rem; line-height: 1.4; }

.login-card {
  max-width: 440px;
  margin: 48px auto;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-top: 3px solid var(--acc);
  border-radius: 16px;
  padding: 32px;
  animation: cardIn 0.35s ease both;
}
/* v0.6.0: entrance motion is transform-only. The old fade started at
 * opacity 0, so a screenshot mid-animation caught a near-invisible card
 * and read as a pale, low-contrast button. First paint is now full. */
@keyframes cardIn {
  from { transform: translateY(6px); }
  to { transform: translateY(0); }
}
/* v0.6.0: auth pages centre the card vertically instead of leaving
 * half the viewport blank above a top-aligned card. */
.auth-wrap {
  min-height: calc(100vh - 57px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 24px;
}
.auth-wrap .login-card { width: 100%; margin: 0; }
.login-card h1 { margin: 0 0 6px; font-size: clamp(1.25rem, 4vw, 1.5rem); line-height: 1.3; }
.login-card .muted { margin: 0 0 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 1rem; }
.field input {
  width: 100%;
  font-size: 1rem;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--tx);
  font: inherit;
  transition: border-color 0.15s ease;
}
.field input:hover { border-color: var(--tx-3); }
input, select, textarea { font-size: 1rem; }
.field input:focus { border-color: var(--acc); }
.field .hint { color: var(--tx-3); font-size: 13px; margin-top: 6px; }
.notice {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 16px;
  font-size: 1rem;
  color: var(--tx-2);
}
.notice.error { border-color: var(--danger); color: var(--tx); }

/* Timestamps: 12px minimum, full-strength colour (never faint 11px/72%). */
.tm { font-size: 0.8125rem; color: var(--tx-3); }

/* Bottom nav appears only on narrow screens (mobile pattern). */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface-raised);
  border-top: 1px solid var(--border-default);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.bottom-nav a, .bottom-nav button { color: var(--tx-2); text-decoration: none; font-size: 0.8125rem; text-align: center; background: none; border: 0; font-family: inherit; cursor: pointer; }
.bottom-nav a.active, .bottom-nav button.active { color: var(--tx); font-weight: 700; }
.bottom-nav a.active { color: var(--tx); font-weight: 700; }
.bottom-nav .nav-ic svg { width: 20px; height: 20px; display: block; margin: 0 auto 2px; color: var(--tx); }

/* v0.6.0: designed empty states — solid border + shadow like any card,
 * an icon disc, one sentence, one primary action. The old dashed box
 * read as a wireframe placeholder, especially inside another card. */
.empty-state {
  background: var(--surface-inset);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.empty-state strong { display: block; font-size: 16px; color: var(--tx); margin-bottom: 4px; }
.empty-state p { color: var(--tx-2); font-size: 1rem; margin: 0 0 8px; }
.empty-state p:last-child { margin-bottom: 0; }
.empty-state .btn { margin-top: 8px; }
.empty-ic {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--acc-soft);
  color: var(--acc-soft-tx);
  margin-bottom: 10px;
}
.empty-ic svg { width: 20px; height: 20px; display: block; }

/* ============ v0.6.0 design system: shared components ============ */

/* Status badges: one pill, four meanings, measured contrast both themes. */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--status-grey-bg);
  color: var(--status-grey-tx);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-acc { background: var(--status-mint-bg); border-color: var(--status-mint-bg); color: var(--status-mint-tx); }
.badge-danger { background: var(--status-red-bg); border-color: var(--status-red-bg); color: var(--status-red-tx); }
.badge-warn { background: var(--status-amber-bg); border-color: var(--status-amber-bg); color: var(--status-amber-tx); }

/* Loading skeletons: first paint shows structure, never the literal
 * word "loading". JS replaces these with real content or a final
 * error/empty state — a skeleton is never left standing. */
.skel {
  display: inline-block;
  width: 120px;
  max-width: 100%;
  height: 1em;
  border-radius: 6px;
  background: var(--surface-inset);
  vertical-align: middle;
  animation: skelPulse 1.2s ease-in-out infinite alternate;
}
.skel-block { display: grid; gap: 8px; }
.skel-block .skel { width: 100%; }
.skel-block .skel:nth-child(2) { width: 70%; }
.skel-block .skel:nth-child(3) { width: 45%; }
@keyframes skelPulse { from { opacity: 0.55; } to { opacity: 1; } }

/* Deterministic coloured-initial avatars: colour from a name hash,
 * white initials, every swatch measured >= 4.5:1 (see report). */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
.av-0 { background: var(--av-0); }
.av-1 { background: var(--av-1); }
.av-2 { background: var(--av-2); }
.av-3 { background: var(--av-3); }
.av-4 { background: var(--av-4); }
.av-5 { background: var(--av-5); }
.av-6 { background: var(--av-6); }
.av-7 { background: var(--av-7); }
.av-8 { background: var(--av-8); }
.av-9 { background: var(--av-9); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .avatar { width: 36px; height: 36px; }

/* Small tag chips for contact tags. */
.tag-chip {
  display: inline-block;
  padding: 1px 8px;
  margin: 0 4px 4px 0;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--surface-inset);
  color: var(--tx-2);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Usage progress bars: real used/limit counts only, capped at 100%. */
.meter { height: 8px; border-radius: 999px; background: var(--surface-inset); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--acc-d); }
.meter-warn > span { background: var(--warn-soft-tx); }
.meter-danger > span { background: var(--danger); }

/* Dashboard metric tiles: real counts only, never invented rows. */
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-tile {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat-tile .stat-value { font-size: 26px; font-weight: 800; line-height: 1.2; margin: 0 0 2px; }
.stat-tile .stat-label { color: var(--tx-2); font-size: 13px; margin: 0; }
.stat-tile .stat-note { color: var(--tx-3); font-size: 0.8125rem; margin: 4px 0 0; }

/* Styled file input: the native control stays (accessible, working);
 * a button-looking label sits over it, plus a filename readout. */
.file-input { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.file-input input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-input .file-name { color: var(--tx-2); font-size: 0.8125rem; }

/* Password visibility toggle + strength meter (register only). */
.pw-wrap { display: flex; gap: 8px; align-items: stretch; }
.pw-wrap input { flex: 1; min-width: 0; }
.pw-toggle { flex-shrink: 0; }
.pw-meter { height: 8px; border-radius: 999px; background: var(--surface-inset); overflow: hidden; margin-top: 8px; }
.pw-meter > span { display: block; height: 100%; border-radius: 999px; transition: width 0.2s ease; }
.pw-meter-label { font-size: 13px; color: var(--tx-2); margin-top: 4px; }

/* Upgrade cards replace bare gate sentences on gated pages: what the
 * plan includes, what higher plans add (from the real catalog), and a
 * CTA to Billing. Exactly one gating message per page. */
.upgrade-card {
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--acc-d);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface-inset);
  box-shadow: var(--shadow);
}
.upgrade-card h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 600; line-height: 1.4; }
.upgrade-card p { color: var(--tx-2); font-size: 1rem; margin: 0 0 8px; }
.upgrade-card .btn { margin-top: 6px; }

/* Formatted variable examples: {{1}} as a chip, never raw in prose. */
.var-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--surface-inset);
  border: 1px solid var(--border-default);
  color: var(--tx);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
}

/* Danger treatment for destructive cards (Cleanup) and their buttons. */
.card-danger { border-color: var(--danger); }
.card-danger > h2:first-child { color: var(--danger-soft-tx); }

/* API docs presentation: headings, tables, code blocks (content unchanged). */
.docs-table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; }
.docs-table th, .docs-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-default);
  font-size: 1rem;
  vertical-align: top;
}
.docs-table th { color: var(--tx-2); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; }
code, .code-block {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}
.code-block {
  display: block;
  background: var(--surface-inset);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 8px 0 16px;
  color: var(--tx);
}

/* Recent-activity rows on the dashboard: real notification data only. */
.act-list { display: grid; gap: 10px; margin-top: 12px; }
.act-row { display: flex; gap: 10px; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px solid var(--border-default); }
.act-row:last-child { border-bottom: 0; padding-bottom: 0; }
.act-row .act-title { font-weight: 600; font-size: 1rem; margin: 0; }
.act-row .act-body { color: var(--tx-2); font-size: 1rem; margin: 0; }

@media (max-width: 900px) {
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .hero h1 { font-size: 30px; }
  .cards { grid-template-columns: 1fr; }
  .wrap { padding-bottom: 76px; }
  .auth-wrap { padding-bottom: 76px; }
  .bottom-nav { display: flex; }
  .stat-tiles { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* v0.7.0 additions (design.md sections 8/9/14). */
.more-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 60;
}
.more-sheet {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-height: 75vh;
  overflow-y: auto;
  background: var(--surface-raised);
  border-top: 1px solid var(--border-default);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow-lg);
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
}
.more-sheet.open, .more-sheet-backdrop.open { display: block; }
.more-sheet h2 { font-size: 1.25rem; margin: 0 0 12px; }
.more-sheet .side-group { margin: 14px 0 4px; }
.more-sheet a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--tx);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}
.more-sheet a:hover { background: var(--surface-inset); }
.more-sheet a.active { background: var(--surface-inset); font-weight: 700; }
/* Contacts: desktop table, mobile cards (design.md section 14). */
.contact-table-wrap { overflow-x: auto; }
.contact-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.contact-table th, .contact-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border-default);
  vertical-align: top;
  min-height: 48px;
}
.contact-table th:first-child, .contact-table td:first-child { position: sticky; left: 0; background: var(--surface-raised); }
.contact-table th:last-child, .contact-table td:last-child { position: sticky; right: 0; background: var(--surface-raised); }
@media (max-width: 760px) {
  .contact-table-wrap { display: none; }
}
@media (min-width: 761px) {
  .contact-cards { display: none; }
}
/* Dashboard checklist + health strip (design.md section 8). */
.checklist { display: grid; gap: 10px; margin-top: 12px; }
.checklist .check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}
.checklist .check-row .check-mark { font-weight: 700; flex-shrink: 0; }
.health-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  margin-top: 12px;
}
/* Brand lockup image (design.md section 2): logo icon + wordmark. */
.brand-mark-img { width: 32px; height: 32px; border-radius: 8px; display: block; }
