/* Stirps — design system */

:root {
  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Color: warm off-white base, olive/petrol/beige accents */
  --bg: #faf8f4;
  --bg-2: #f4f0e7;
  --surface: #ffffff;
  --surface-2: #fbf9f4;
  --line: #ece5d6;
  --line-2: #e1d8c2;
  --line-strong: #c9bfa3;

  --ink: #1a1f1a;
  --ink-2: #3b3f3a;
  --muted: #7c7466;
  --muted-2: #9a9282;

  --olive: #5b6e4f;
  --olive-2: #4a5b40;
  --olive-soft: #e3e7d8;
  --petrol: #3a5b6b;
  --petrol-2: #2c4a59;
  --petrol-soft: #d8e1e6;
  --beige: #c9b48a;
  --beige-soft: #f1ebde;
  --beige-deep: #a08658;

  --shadow-sm: 0 1px 2px rgba(60,50,30,0.04), 0 1px 1px rgba(60,50,30,0.03);
  --shadow-md: 0 6px 18px -8px rgba(60,50,30,0.10), 0 2px 4px rgba(60,50,30,0.04);
  --shadow-lg: 0 24px 60px -20px rgba(60,50,30,0.18), 0 6px 18px -10px rgba(60,50,30,0.08);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
}

[data-palette="terracota"] {
  --olive: #7a6b52; --olive-2: #685a44; --olive-soft: #e8e0cf;
  --petrol: #a85d3a; --petrol-2: #8d4d2f; --petrol-soft: #f0d9cc;
  --beige: #c9b48a; --beige-soft: #f1ebde;
}
[data-palette="mono"] {
  --olive: #1a1a1a; --olive-2: #000; --olive-soft: #ebe8e0;
  --petrol: #5b6e4f; --petrol-2: #4a5b40; --petrol-soft: #e3e7d8;
  --beige: #d9c9a8;
}
[data-palette="petrol_sand"] {
  --olive: #2d4a52; --olive-2: #1f3a3f; --olive-soft: #d6e1e4;
  --petrol: #b8a07a; --petrol-2: #9d885f; --petrol-soft: #ede0c9;
  --beige: #c9b48a;
}

[data-font="manrope"] { --font-sans: 'Manrope', system-ui, sans-serif; --font-display: 'Manrope', sans-serif; }
[data-font="geist"] { --font-sans: 'Geist', system-ui, sans-serif; --font-display: 'Newsreader', Georgia, serif; }

[data-density="compact"] {
  --pad-card: 18px;
  --pad-row: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; padding: 0; }
input, select { font: inherit; color: inherit; }
a { color: var(--petrol); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  color: var(--muted);
}

/* ============= APP SHELL ============= */
.app {
  display: grid;
  grid-template-columns: 268px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ============ SIDEBAR ============ */
.sb {
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 12px 10px;
  gap: 4px;
  overflow-y: auto;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.sb-brand-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(160deg, #f1ebde 0%, #e3e7d8 100%);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2);
}
.sb-brand-name {
  font-family: var(--font-display);
  font-weight: 500; font-size: 18px;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 144;
}
.sb-brand-sub {
  font-size: 11px; color: var(--muted);
  margin-top: 1px;
}
.sb-add {
  display: flex; align-items: center; gap: 8px;
  background: var(--ink); color: #f4f0e6;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-weight: 500;
  margin: 6px 4px 12px;
  transition: transform 0.1s ease;
}
.sb-add:hover { transform: translateY(-1px); }
.sb-add kbd { margin-left: auto; background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); color: #d4cdb8; }

.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-item {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  text-align: left;
  font-weight: 450;
}
.sb-item:hover { background: rgba(0,0,0,0.03); }
.sb-item-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(60,50,30,0.04), inset 0 0 0 1px var(--line);
}
.sb-badge {
  margin-left: auto;
  background: var(--olive-soft); color: var(--olive-2);
  font-size: 10.5px; font-weight: 600;
  padding: 1px 7px; border-radius: 999px;
}
.sb-section-label {
  font-size: 10.5px; text-transform: uppercase;
  color: var(--muted-2); letter-spacing: 0.08em;
  font-weight: 600;
  padding: 16px 10px 6px;
}
.sb-nav-sub .sb-item {
  font-size: 12.5px; color: var(--muted);
  padding: 5px 10px;
}
.sb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sb-count { margin-left: auto; font-size: 11px; color: var(--muted-2); }

.sb-spacer { flex: 1; min-height: 14px; }

.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-top: 1px solid var(--line);
  margin: 8px -4px -4px;
}
.sb-user-text { flex: 1; min-width: 0; }
.sb-user-name { font-size: 12.5px; font-weight: 550; }
.sb-user-plan { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.sb-user-more { padding: 4px; border-radius: 6px; color: var(--muted); }
.sb-user-more:hover { background: rgba(0,0,0,0.04); }

/* ============ MAIN ============ */
.main {
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* TopBar */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(250,248,244,0.85);
  backdrop-filter: saturate(140%) blur(8px);
  z-index: 5;
}
.crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted);
}
.crumb-current { color: var(--ink); font-weight: 500; }
.topbar-search {
  flex: 1; max-width: 460px;
  margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  cursor: text;
  transition: border-color 0.15s ease;
}
.topbar-search:hover { border-color: var(--line-strong); }
.topbar-search-text { flex: 1; font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.iconbtn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px;
  color: var(--muted);
  border: 1px solid transparent;
}
.iconbtn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }

.page { overflow: auto; flex: 1; }

/* ============ SHARED ============ */
.eyebrow {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted-2);
  font-weight: 600;
  margin-bottom: 6px;
}
h1 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.018em; font-size: 32px; line-height: 1.18; margin: 0; color: var(--ink); font-variation-settings: "opsz" 144; }
h1 em { font-style: italic; color: var(--olive-2); font-weight: 400; }
h1 span { font-weight: 300; color: var(--muted); }
h2 { font-family: var(--font-display); font-weight: 450; letter-spacing: -0.01em; font-size: 20px; margin: 0; }
h3 { font-family: var(--font-sans); font-weight: 600; font-size: 14px; letter-spacing: -0.005em; margin: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 13.5px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #f4f0e6; }
.btn-primary:hover { background: #2a2f28; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--line-strong); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  letter-spacing: 0.005em;
}
.pill-neutral { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill-olive { background: var(--olive-soft); color: var(--olive-2); }
.pill-petrol { background: var(--petrol-soft); color: var(--petrol-2); }
.pill-beige { background: var(--beige-soft); color: var(--beige-deep); }

.link { color: var(--petrol); font-weight: 500; font-size: 12.5px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.seg {
  display: inline-flex; gap: 0;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 2px;
}
.seg button {
  padding: 4px 10px; border-radius: 5px;
  font-size: 12px; color: var(--muted);
}
.seg .seg-on, .seg button.seg-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }

.seg-icon { width: 28px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }

/* ============ DASHBOARD ============ */
.page-dashboard { padding: 28px 32px 60px; max-width: 1280px; margin: 0 auto; width: 100%; }

.dash-hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px;
  margin-bottom: 28px;
  padding: 8px 0 24px;
}
.dash-greet {
  font-size: 38px; line-height: 1.2;
  letter-spacing: -0.022em;
  margin: 8px 0 12px;
  font-weight: 380;
  text-wrap: pretty;
}
.dash-sub { color: var(--muted); font-size: 13.5px; margin: 0; }

.hero-card {
  background: linear-gradient(155deg, var(--olive-soft) 0%, var(--beige-soft) 100%);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  padding: 22px 24px;
  position: relative;
}
.hero-card-eyebrow {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--olive-2);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.hero-card-title {
  font-family: var(--font-display);
  font-size: 21px; line-height: 1.25;
  margin: 10px 0 6px;
  font-weight: 450;
  letter-spacing: -0.01em;
}
.hero-card-sub { font-size: 13px; color: var(--ink-2); margin-bottom: 16px; }
.hero-card-actions { display: flex; gap: 8px; }

.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-bottom: 28px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 380;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
}
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.stat-delta { font-size: 11.5px; color: var(--muted-2); margin-top: 8px; }

.dash-grid {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px;
}
.col-span-7 { grid-column: span 7; }
.col-span-5 { grid-column: span 5; }

.activity { display: flex; flex-direction: column; }
.activity-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: background 0.1s ease;
}
.activity-row:hover { background: var(--surface-2); }
.activity-row:last-child { border-bottom: none; }
.activity-text { flex: 1; min-width: 0; }
.activity-line { font-size: 13px; color: var(--ink-2); }
.activity-line strong { color: var(--ink); font-weight: 550; }
.activity-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.activity-when { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }

.suggestions { display: flex; flex-direction: column; }
.sug { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.sug:last-child { border-bottom: none; }
.sug-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.sug-head svg { color: var(--beige-deep); }
.sug-conf { font-size: 11px; color: var(--muted); font-weight: 500; }
.sug-title { font-family: var(--font-display); font-size: 16px; font-weight: 450; letter-spacing: -0.005em; }
.sug-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.sug-source { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; font-style: italic; }
.sug-actions { display: flex; gap: 6px; margin-top: 12px; }

/* Timeline (dashboard, decorative) */
.timeline {
  position: relative;
  padding: 56px 24px 28px;
  height: 220px;
}
.timeline-track {
  position: absolute;
  left: 24px; right: 24px; top: 110px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong) 8%, var(--line-strong) 92%, transparent);
}
.tl-event {
  position: absolute; top: 0;
  transform: translateX(-50%);
  width: 130px;
}
.tl-event:nth-child(odd) { top: 0; }
.tl-event:nth-child(even) { top: 130px; }
.tl-dot {
  position: absolute; top: 110px;
  left: 50%; transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--olive);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-event:nth-child(2n) .tl-dot { background: var(--petrol); }
.tl-event:nth-child(3n) .tl-dot { background: var(--beige-deep); }
.tl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px 11px;
  font-size: 11.5px;
  box-shadow: var(--shadow-sm);
  text-wrap: pretty;
}
.tl-event:nth-child(odd) .tl-card { margin-bottom: 26px; }
.tl-event:nth-child(even) .tl-card { margin-top: 26px; }
.tl-year { font-family: var(--font-display); font-size: 14px; font-weight: 500; }
.tl-label { color: var(--ink-2); margin-top: 2px; line-height: 1.35; }
.tl-place { color: var(--muted-2); font-size: 10.5px; margin-top: 3px; }
.timeline-axis {
  position: absolute; left: 24px; right: 24px; bottom: 0;
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2);
}

.recent-people { display: flex; flex-direction: column; }
.recent-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.recent-row:hover { background: var(--surface-2); }
.recent-row:last-child { border-bottom: none; }
.recent-name { font-size: 13.5px; font-weight: 500; }
.recent-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.recent-row svg { color: var(--muted-2); }

.section-title { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; }

/* ============ TREE ============ */
.page-tree {
  display: flex; flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.tree-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  z-index: 4;
  gap: 12px;
  flex-wrap: wrap;
}
.tree-toolbar-left, .tree-toolbar-right {
  display: flex; align-items: center; gap: 8px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px; color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 500;
}
.chip:hover { border-color: var(--line-strong); }
.chip-on { background: var(--ink); color: #f4f0e6; border-color: var(--ink); }
.chip-on.chip-olive { background: var(--olive); border-color: var(--olive); }
.chip-on.chip-petrol { background: var(--petrol); border-color: var(--petrol); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.chip-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }

.tree-stat { font-size: 12.5px; color: var(--muted); }
.tree-stat strong { color: var(--ink); font-weight: 600; font-family: var(--font-display); }

.tree-canvas {
  flex: 1; position: relative;
  overflow: hidden;
  cursor: grab;
  user-select: none;
}
.tree-canvas:active { cursor: grabbing; }
.tree-bg {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle, rgba(90,80,55,0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.tree-world {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.tree-links {
  position: absolute; left: 0; top: 0;
  width: 4000px; height: 2000px;
  pointer-events: none;
}

.tnode {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease, opacity 0.2s ease;
  cursor: pointer;
}
.tnode:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tnode-strip { width: 4px; flex-shrink: 0; }
.tnode-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  flex: 1; min-width: 0;
}
.tnode-text { min-width: 0; flex: 1; }
.tnode-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.tnode-last { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tnode-meta {
  font-size: 11px; color: var(--muted-2);
  margin-top: 4px; font-family: var(--font-mono);
  display: flex; align-items: center; gap: 6px;
}
.tnode-living { width: 6px; height: 6px; border-radius: 50%; background: var(--olive); box-shadow: 0 0 0 3px var(--olive-soft); }

.tnode-tag {
  position: absolute; top: 8px; right: 10px;
  font-size: 9.5px; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600;
}
.tnode-focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px var(--olive-soft), var(--shadow-md);
}
.tnode-dim { opacity: 0.32; }

.gen-rail {
  position: absolute; left: 0; top: 60px; bottom: 0;
  width: 0;
  pointer-events: none;
  z-index: 2;
}
.gen-rail-row {
  position: absolute;
  left: 16px;
  display: flex; align-items: center;
  pointer-events: none;
}
.gen-rail-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.zoom-ctrl {
  position: absolute; bottom: 20px; right: 20px;
  display: flex; align-items: center; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px;
  box-shadow: var(--shadow-md);
  z-index: 3;
}
.zoom-ctrl button {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--ink-2);
}
.zoom-ctrl button:hover { background: var(--surface-2); }
.zoom-pct {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  padding: 0 8px;
  border-left: 1px solid var(--line);
  margin-left: 4px;
  height: 28px; display: inline-flex; align-items: center;
}

.tree-legend {
  position: absolute; bottom: 20px; left: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  z-index: 3;
  display: flex; flex-direction: column; gap: 5px;
}
.tree-legend-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--ink-2);
}
.legend-line { width: 18px; height: 1.5px; }
.legend-dashed { background: transparent; border-top: 1.5px dashed var(--beige); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

.hover-card {
  position: absolute; bottom: 20px;
  left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #f4f0e6;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 3;
  pointer-events: none;
}
.hover-card .avatar-wrap > div:last-child { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
.hover-card-name { font-weight: 600; font-size: 13px; }
.hover-card-meta { font-size: 11px; color: rgba(244,240,230,0.7); }
.hover-card-life { font-size: 10.5px; color: rgba(244,240,230,0.5); font-family: var(--font-mono); margin-top: 2px; }

/* ============ PROFILE ============ */
.page-profile { padding-bottom: 60px; }
.profile-banner {
  height: 180px;
  position: relative;
  overflow: hidden;
}
.profile-banner-pattern {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.04), transparent 50%);
}

.profile-head {
  display: flex; align-items: end; gap: 24px;
  padding: 0 32px;
  margin-top: -70px;
  position: relative;
  max-width: 1280px; margin-left: auto; margin-right: auto;
}
.profile-avatar-wrap { position: relative; }
.profile-avatar-wrap > .avatar-wrap > div:last-child {
  border: 4px solid var(--bg);
  box-shadow: var(--shadow-md);
}
.profile-photo-edit {
  position: absolute; bottom: 4px; right: 4px;
  width: 32px; height: 32px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}
.profile-titles { flex: 1; padding-bottom: 6px; }
.profile-eyebrow { display: flex; gap: 6px; margin-bottom: 6px; }
.profile-name {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variation-settings: "opsz" 144;
}
.profile-name span { font-weight: 300; color: var(--muted); }
.profile-meta {
  display: flex; gap: 22px; flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12.5px; color: var(--muted);
}
.profile-meta span { display: inline-flex; align-items: center; gap: 5px; }
.profile-actions { display: flex; gap: 6px; padding-bottom: 8px; }

.profile-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  margin: 28px auto 0;
  max-width: 1280px;
  overflow-x: auto;
}
.ptab {
  padding: 12px 16px;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.ptab:hover { color: var(--ink); }
.ptab-on { color: var(--ink); border-bottom-color: var(--ink); }

.profile-body {
  display: grid; grid-template-columns: 1fr 340px; gap: 24px;
  padding: 24px 32px;
  max-width: 1280px; margin: 0 auto;
}
.profile-main { min-width: 0; }
.profile-side { display: flex; flex-direction: column; gap: 18px; }

.profile-bio {
  font-family: var(--font-display);
  font-size: 17px; line-height: 1.55;
  color: var(--ink-2);
  letter-spacing: -0.005em;
  font-weight: 380;
  text-wrap: pretty;
  margin: 4px 0 18px;
}
.profile-callout {
  display: flex; gap: 10px; align-items: start;
  background: var(--olive-soft);
  border-left: 2px solid var(--olive);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 13px; color: var(--ink-2);
}
.profile-callout svg { color: var(--olive-2); margin-top: 2px; flex-shrink: 0; }
.profile-callout strong { color: var(--ink); }

.prof-h3 { font-family: var(--font-sans); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); margin: 24px 0 14px; }

.bio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 32px; }
.bio-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.bio-v { font-size: 14px; color: var(--ink); margin-top: 3px; font-weight: 500; }

.rel-group { margin-bottom: 24px; }
.rel-group:last-child { margin-bottom: 0; }
.rel-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 10px; }
.rel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rel-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.rel-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.rel-text { flex: 1; min-width: 0; }
.rel-name { font-size: 13.5px; font-weight: 550; }
.rel-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.rel-card svg { color: var(--muted-2); }

/* Profile timeline */
.ptl { padding: 8px 0; }
.ptl-row {
  display: grid; grid-template-columns: 64px 24px 1fr;
  gap: 14px; align-items: start;
  padding: 10px 0;
}
.ptl-year { font-family: var(--font-display); font-size: 18px; color: var(--ink); font-weight: 450; padding-top: 1px; }
.ptl-line { position: relative; height: 100%; min-height: 40px; }
.ptl-line::before { content: ""; position: absolute; left: 50%; top: 8px; bottom: -12px; width: 1px; background: var(--line-2); transform: translateX(-50%); }
.ptl-row:last-child .ptl-line::before { display: none; }
.ptl-dot { width: 10px; height: 10px; border-radius: 50%; margin: 6px auto; box-shadow: 0 0 0 3px var(--bg); position: relative; z-index: 1; }
.ptl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.ptl-title { font-size: 13.5px; font-weight: 550; }
.ptl-place { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ptl-note { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }

/* Docs grid in profile */
.docgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 14px; margin-top: 8px; }
.doc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  transition: transform 0.12s ease;
}
.doc-card:hover { transform: translateY(-2px); }
.doc-thumb {
  height: 110px;
  background: var(--beige-soft);
  position: relative;
  background-image:
    repeating-linear-gradient(45deg, rgba(90,80,55,0.04) 0 2px, transparent 2px 8px),
    linear-gradient(160deg, var(--beige-soft) 0%, #e7dec5 100%);
}
.doc-thumb-olive { background-image: repeating-linear-gradient(45deg, rgba(90,80,55,0.05) 0 2px, transparent 2px 8px), linear-gradient(160deg, #e8ecd9 0%, #d6dcc1 100%); }
.doc-thumb-petrol { background-image: repeating-linear-gradient(45deg, rgba(90,80,55,0.05) 0 2px, transparent 2px 8px), linear-gradient(160deg, #d8e1e6 0%, #b8c8cf 100%); }
.doc-thumb-beige { background-image: repeating-linear-gradient(45deg, rgba(90,80,55,0.05) 0 2px, transparent 2px 8px), linear-gradient(160deg, #f1ebde 0%, #e7dec5 100%); }
.doc-meta { padding: 10px 12px; }
.doc-title { font-size: 12.5px; font-weight: 550; }
.doc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* photos */
.photogrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px; }
.photo-tile {
  aspect-ratio: 4/5;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  position: relative;
  background: linear-gradient(155deg, #ddd5be 0%, #c7bb9b 100%);
  overflow: hidden;
}
.photo-tile-sepia { background: linear-gradient(155deg, #d8c5a0 0%, #b8a079 100%); }
.photo-tile-silver { background: linear-gradient(155deg, #d4d0c4 0%, #aba79b 100%); }
.photo-tile-cream { background: linear-gradient(155deg, #ece2cc 0%, #c9b48a 100%); }
.photo-tile-sepia2 { background: linear-gradient(155deg, #c4a986 0%, #8e7654 100%); }
.photo-cap {
  position: absolute; bottom: 8px; left: 10px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: rgba(40,30,15,0.65);
  background: rgba(255,253,245,0.7);
  padding: 1px 6px; border-radius: 3px;
}

/* places */
.places-map { display: grid; grid-template-columns: 1.4fr 1fr; min-height: 300px; }
.minimap { border-right: 1px solid var(--line); }
.places-list { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.place-row { display: grid; grid-template-columns: 16px 60px 1fr; gap: 10px; align-items: center; }
.place-dot { width: 10px; height: 10px; border-radius: 50%; }
.place-year { font-family: var(--font-display); font-size: 14px; }
.place-label { font-size: 13px; color: var(--ink-2); }

/* profile side */
.side-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mini-tree { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.mini-tree-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.mini-tree-row-self { padding: 8px 0; }
.mini-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  text-align: left;
}
.mini-pill:hover { border-color: var(--line-strong); }
.mini-pill-self { background: var(--olive-soft); border-color: var(--olive); padding: 5px 12px 5px 5px; font-weight: 600; }
.mini-tree-amp { font-family: var(--font-display); font-style: italic; color: var(--muted); font-size: 14px; }

.origin-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.origin-row { display: grid; grid-template-columns: 110px 1fr 36px; gap: 10px; align-items: center; }
.origin-label { font-size: 12px; color: var(--ink-2); }
.origin-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
.origin-fill { height: 100%; }
.origin-pct { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-align: right; }
.origin-note { font-size: 10.5px; color: var(--muted-2); margin-top: 12px; font-style: italic; }

.side-sug {
  display: flex; gap: 8px; align-items: start;
  padding: 10px 0;
  font-size: 12.5px;
  color: var(--ink-2);
  border-top: 1px solid var(--line);
}
.side-sug:first-of-type { border-top: none; padding-top: 6px; }
.side-sug svg { color: var(--beige-deep); flex-shrink: 0; margin-top: 2px; }

/* ============ SEARCH ============ */
.page-search { padding: 0 0 60px; }
.search-hero {
  background: linear-gradient(170deg, var(--beige-soft) 0%, var(--bg) 80%);
  border-bottom: 1px solid var(--line);
  padding: 40px 32px 36px;
  text-align: center;
}
.search-hero h1 { font-size: 36px; max-width: 600px; margin: 4px auto 8px; }
.search-sub { color: var(--muted); max-width: 540px; margin: 0 auto 24px; }
.search-bar {
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 8px 8px 8px 16px;
  box-shadow: var(--shadow-md);
}
.search-bar svg { color: var(--muted); }
.search-bar input { flex: 1; border: none; outline: none; font-size: 15px; padding: 8px 0; background: transparent; }
.search-filters { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.filter {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}
.filter select { border: none; outline: none; background: transparent; font-size: 12px; }
.filter-clear { font-size: 12px; color: var(--muted); padding: 5px 8px; }

.search-body { display: grid; grid-template-columns: 280px 1fr; gap: 24px; padding: 28px 32px; max-width: 1280px; margin: 0 auto; }
.search-side { display: flex; flex-direction: column; gap: 16px; }
.ssec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.ssec-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); font-weight: 600; margin-bottom: 12px; }
.archive-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.archive-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.archive-name { font-size: 12.5px; font-weight: 500; }
.archive-count { font-size: 11px; color: var(--muted); }

.search-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.record-list { display: flex; flex-direction: column; gap: 10px; }
.record {
  display: grid;
  grid-template-columns: 140px 1fr 60px auto;
  gap: 18px; align-items: center;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.15s ease;
}
.record:hover { border-color: var(--line-strong); }
.record-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.record-title { font-family: var(--font-display); font-size: 16px; font-weight: 450; letter-spacing: -0.005em; }
.record-meta { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.record-meta span { display: inline-flex; align-items: center; gap: 4px; }
.record-source { color: var(--muted-2); font-style: italic; }
.record-hint { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--olive-2); margin-top: 6px; background: var(--olive-soft); padding: 3px 9px; border-radius: 999px; width: fit-content; }
.conf-ring {
  --p: 80;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: conic-gradient(var(--olive) calc(var(--p) * 1%), var(--line) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.conf-ring::before { content: ""; position: absolute; inset: 4px; background: var(--surface); border-radius: 50%; }
.conf-ring span { position: relative; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.record-actions { display: flex; align-items: center; gap: 4px; }
.iconbtn-sm { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--muted); }
.iconbtn-sm:hover { background: var(--surface-2); }

/* ============ DOCUMENTS ============ */
.page-docs { padding: 28px 32px 60px; max-width: 1280px; margin: 0 auto; }
.docs-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; }
.docs-sub { color: var(--muted); margin: 8px 0 0; max-width: 480px; }
.docs-actions { display: flex; gap: 8px; }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  display: flex; align-items: center; gap: 18px;
  background: var(--surface-2);
  margin-bottom: 24px;
  transition: all 0.15s ease;
}
.dropzone-on { border-color: var(--olive); background: var(--olive-soft); }
.dropzone-icon {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--olive);
  flex-shrink: 0;
}
.dropzone-text { flex: 1; }
.dropzone-text strong { display: block; font-size: 15px; margin-bottom: 4px; }
.dropzone-text span { font-size: 13px; color: var(--muted); }
.dropzone-tags { display: flex; gap: 6px; flex-shrink: 0; }

.docs-filterbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.docs-view { display: flex; gap: 4px; }

.docs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;
}
.doc-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.doc-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.doc-thumb-lg {
  height: 200px;
  position: relative;
  background-image:
    repeating-linear-gradient(45deg, rgba(90,80,55,0.05) 0 2px, transparent 2px 10px),
    linear-gradient(160deg, var(--beige-soft) 0%, #d8c9a4 100%);
}
.doc-thumb-corner {
  position: absolute; top: 0; right: 0;
  border-style: solid;
  border-width: 0 24px 24px 0;
  border-color: transparent rgba(160,134,88,0.3) transparent transparent;
}
.doc-thumb-stamp {
  position: absolute; bottom: 12px; left: 12px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
}
.doc-tile-meta { padding: 12px 14px; }
.doc-tile-title { font-size: 13.5px; font-weight: 550; }
.doc-tile-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ============ PEOPLE ============ */
.page-people { padding: 28px 32px 60px; max-width: 1280px; margin: 0 auto; }
.people-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.people-tools { display: flex; gap: 12px; align-items: center; }
.people-search { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.people-search input { border: none; outline: none; font-size: 13px; min-width: 200px; background: transparent; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.person-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.person-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.person-card-text { flex: 1; min-width: 0; }
.person-card-name { font-size: 14px; font-weight: 550; }
.person-card-meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.person-card-occ { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.person-card-gen { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }

/* ============ TIMELINE PAGE ============ */
.page-timeline { padding: 28px 32px 60px; max-width: 880px; margin: 0 auto; }
.big-timeline { margin-top: 24px; }
.big-tl-row { display: grid; grid-template-columns: 90px 28px 1fr; gap: 18px; align-items: start; padding: 8px 0; }
.big-tl-year { font-family: var(--font-display); font-size: 26px; font-weight: 380; letter-spacing: -0.02em; padding-top: 4px; }
.big-tl-line { position: relative; height: 100%; min-height: 60px; }
.big-tl-line::before { content: ""; position: absolute; left: 50%; top: 12px; bottom: -16px; width: 1px; background: var(--line-2); transform: translateX(-50%); }
.big-tl-row:last-child .big-tl-line::before { display: none; }
.big-tl-dot { position: absolute; left: 50%; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--olive); transform: translateX(-50%); box-shadow: 0 0 0 4px var(--bg); }
.big-tl-card { padding: 14px 18px; }
.big-tl-title { font-family: var(--font-display); font-size: 17px; font-weight: 450; }
.big-tl-place { font-size: 12px; color: var(--muted); margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }

/* ============ COMMAND PALETTE ============ */
.cmdk-backdrop {
  position: fixed; inset: 0;
  background: rgba(40,35,25,0.32);
  backdrop-filter: blur(4px);
  display: flex; justify-content: center;
  padding-top: 12vh;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.cmdk {
  width: 600px; max-width: 92vw;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise 0.2s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cmdk-input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.cmdk-input svg { color: var(--muted); }
.cmdk-input input { flex: 1; border: none; outline: none; font-size: 15px; background: transparent; }
.cmdk-list { max-height: 60vh; overflow-y: auto; padding: 6px; }
.cmdk-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); font-weight: 600; padding: 10px 10px 4px; }
.cmdk-item {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
}
.cmdk-item:hover { background: var(--surface-2); }
.cmdk-item-text { flex: 1; min-width: 0; }
.cmdk-item-name { font-weight: 550; }
.cmdk-item-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.cmdk-item svg:last-child { color: var(--muted-2); }
.cmdk-action { color: var(--ink-2); }
.cmdk-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ============ MOBILE SHOWCASE ============ */
.mobile-stage { padding: 28px 32px 60px; max-width: 1280px; margin: 0 auto; }
.mobile-stage-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 28px; }
.mobile-sub { color: var(--muted); margin: 8px 0 0; max-width: 480px; }
.mobile-row { display: flex; gap: 60px; justify-content: center; flex-wrap: wrap; padding: 24px 0; }
.mobile-frame-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mobile-cap { font-size: 12px; color: var(--muted); font-weight: 500; }

/* Mobile screens (inside iOS frame) */
.m-screen {
  height: 100%; width: 100%;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  font-size: 13px;
  position: relative;
}
.m-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px 10px;
}
.m-back {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.m-title { font-family: var(--font-display); font-size: 17px; font-weight: 500; }
.m-pills { display: flex; gap: 6px; padding: 0 14px 12px; overflow-x: auto; }
.m-pill { padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.m-pill-on { background: var(--ink); color: #f4f0e6; border-color: var(--ink); }

.m-tree { flex: 1; padding: 10px 16px 90px; display: flex; flex-direction: column; gap: 6px; align-items: center; overflow-y: auto; }
.m-tree-gen { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.m-leaf { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.m-leaf-male { border-left: 3px solid #2c4a59; }
.m-leaf-female { border-left: 3px solid #a85d3a; }
.m-leaf-olive { border-left: 3px solid var(--olive); }
.m-leaf-petrol { border-left: 3px solid var(--petrol); }
.m-leaf-beige { border-left: 3px solid var(--beige-deep); }
.m-leaf-self { background: var(--olive-soft); border-color: var(--olive); border-left-width: 3px; }
.m-leaf-av { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.m-leaf-n { font-size: 12.5px; font-weight: 600; }
.m-self { font-family: var(--font-mono); font-size: 9.5px; background: var(--olive); color: #f4f0e6; padding: 1px 5px; border-radius: 3px; margin-left: 4px; vertical-align: middle; }
.m-leaf-y { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.m-amp { font-family: var(--font-display); font-style: italic; font-size: 14px; color: var(--muted); }
.m-line { width: 1.5px; height: 16px; background: var(--line-strong); }

.m-fab {
  position: absolute; bottom: 76px; right: 16px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--ink); color: #f4f0e6;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
}
.m-tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 4px 22px;
}
.m-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 9.5px; color: var(--muted);
  padding: 4px 0;
  font-weight: 500;
}
.m-tab-on { color: var(--olive-2); }

/* Mobile profile */
.m-screen-profile { background: var(--bg); }
.m-pbanner {
  height: 120px;
  background: linear-gradient(160deg, var(--olive-soft) 0%, var(--beige-soft) 100%);
}
.m-pbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 16px 10px;
  z-index: 2;
}
.m-pbar-title { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.m-phead { padding: 0 18px; margin-top: -56px; position: relative; z-index: 1; }
.m-pav {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: linear-gradient(155deg, #c2d4dc 0%, #93b1bd 100%);
  border: 4px solid var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 26px;
  color: #1f3e4d;
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}
.m-ptags { display: flex; gap: 4px; margin-bottom: 6px; }
.m-pchip { font-size: 10px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); font-weight: 600; }
.m-pchip-olive { background: var(--olive-soft); color: var(--olive-2); border-color: transparent; }
.m-pname { font-family: var(--font-display); font-size: 24px; font-weight: 450; letter-spacing: -0.015em; line-height: 1.1; }
.m-pname span { font-weight: 300; color: var(--muted); }
.m-pmeta { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.m-pmeta-row { display: flex; gap: 12px; margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.m-pmeta-row span { display: inline-flex; align-items: center; gap: 3px; }

.m-ptabs { display: flex; gap: 4px; padding: 14px 18px 10px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.m-ptab { font-size: 11.5px; color: var(--muted); padding: 4px 10px; white-space: nowrap; font-weight: 500; }
.m-ptab-on { color: var(--ink); border-bottom: 1.5px solid var(--ink); padding-bottom: 6px; margin-bottom: -7px; }

.m-pbody { flex: 1; padding: 14px 14px 80px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.m-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.m-card-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); font-weight: 600; margin-bottom: 6px; }
.m-card-bio { font-family: var(--font-display); font-size: 13.5px; line-height: 1.55; margin: 0; color: var(--ink-2); }
.m-card-bio em { font-style: italic; color: var(--olive-2); }

.m-tl { display: flex; flex-direction: column; gap: 6px; }
.m-tl-row { display: grid; grid-template-columns: 36px 14px 1fr; gap: 10px; align-items: center; font-size: 11.5px; }
.m-tl-y { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.m-tl-d { width: 8px; height: 8px; border-radius: 50%; }

.m-card-sug { display: flex; gap: 10px; align-items: start; background: var(--olive-soft); border-color: transparent; }
.m-card-sug svg { color: var(--olive-2); margin-top: 2px; }
.m-sug-t { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.m-sug-s { font-size: 11px; color: var(--olive-2); margin-top: 1px; }

/* Hide scrollbars softly */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* Responsive */
@media (max-width: 1100px) {
  .dash-hero { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .col-span-7, .col-span-5 { grid-column: span 12; }
  .profile-body { grid-template-columns: 1fr; }
  .search-body { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 80px 1fr; }
  .sb-brand-text, .sb-item span:not(.sb-badge):not(.sb-count), .sb-section-label, .sb-user-text, .sb-add span, .sb-add kbd { display: none; }
  .sb-add { justify-content: center; padding: 10px; }
  .sb-item { justify-content: center; padding: 9px; }
  .sb-dot { display: none; }
}
