/* ================================================
   AGENTS LENS — DASHBOARD REDESIGN
   Premium editorial dark UI. Gold #D4AF37 on black.
   ================================================ */

:root {
  --bg:            #060609;
  --bg-1:          #0b0b10;
  --bg-2:          #101016;
  --surface:       #0f0f14;
  --surface-2:     #15151c;
  --surface-hi:    #1a1a22;
  --line:          rgba(255, 255, 255, 0.06);
  --line-2:        rgba(255, 255, 255, 0.10);
  --line-strong:   rgba(255, 255, 255, 0.18);

  --ink:           #f4f1ea;      /* warm white */
  --ink-2:         rgba(244, 241, 234, 0.72);
  --ink-3:         rgba(244, 241, 234, 0.50);
  --ink-4:         rgba(244, 241, 234, 0.32);
  --ink-5:         rgba(244, 241, 234, 0.18);

  --gold:          #D4AF37;
  --gold-hi:       #F0CF60;
  --gold-lo:       #8E7320;
  --gold-10:       rgba(212, 175, 55, 0.10);
  --gold-18:       rgba(212, 175, 55, 0.18);
  --gold-30:       rgba(212, 175, 55, 0.30);
  --gold-grad:     linear-gradient(135deg, #F0CF60 0%, #D4AF37 45%, #8E7320 100%);

  --ok:            #6EC08A;
  --warn:          #E8B55F;
  --err:           #E06C6C;
  --cool:          #7FA6D4;

  --shadow-card:   0 1px 0 rgba(255,255,255,0.03) inset, 0 20px 40px -20px rgba(0,0,0,0.6);
  --shadow-gold:   0 0 0 1px rgba(212,175,55,0.25), 0 10px 30px -10px rgba(212,175,55,0.25);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --font-ui:    'Montserrat', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono:  'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body {
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(212,175,55,0.08), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(127,166,212,0.06), transparent 55%),
    var(--bg);
}

button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font-family: inherit; color: inherit; }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,0.3); }

/* ================================================
   APP SHELL
   ================================================ */
.app {
  display: grid;
  grid-template-columns: 72px 1fr;
  height: 100vh;
  width: 100vw;
}

/* ---- Title bar (thin top) ---- */
.titlebar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 36px;
  background: rgba(6, 6, 9, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  z-index: 50;
  font-size: 11px;
  -webkit-app-region: drag;
}
.titlebar button, .titlebar .tb-btn, .titlebar-right .meta { -webkit-app-region: no-drag; }
.titlebar-brand { display: flex; align-items: center; gap: 8px; color: var(--ink-3); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; font-size: 10px; }
.titlebar-brand img { height: 18px; opacity: 0.9; }
.titlebar-brand .sep { color: var(--ink-5); }
.titlebar-brand .loc { color: var(--ink); letter-spacing: 0.02em; text-transform: none; font-weight: 500; }

.titlebar-right { display: flex; align-items: center; gap: 2px; }
.tb-btn {
  width: 28px; height: 28px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 11px;
  transition: background 0.18s, color 0.18s;
}
.tb-btn:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.tb-btn.close:hover { background: rgba(224,108,108,0.8); color: white; }

.titlebar .meta {
  display: inline-flex; align-items: center; gap: 14px;
  margin-right: 10px; color: var(--ink-3);
  font-family: var(--font-mono); font-size: 10px;
}
.titlebar .meta b { color: var(--ink); font-weight: 500; }
.titlebar .meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px rgba(110,192,138,0.8); }

/* ---- Left Rail ---- */
.rail {
  padding-top: 36px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent 40%);
  display: flex; flex-direction: column; align-items: center;
  padding-bottom: 14px;
}
.rail-logo {
  width: 44px; height: 44px;
  margin: 20px 0 22px;
  display: flex; align-items: center; justify-content: center;
}
.rail-logo img { width: 40px; height: 40px; object-fit: contain; }

.rail-sep { width: 28px; height: 1px; background: var(--line-2); margin: 4px 0 10px; }

.rail-items { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.rail-btn {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4); font-size: 15px;
  position: relative;
  transition: color 0.18s, background 0.18s;
}
.rail-btn:hover { color: var(--ink); background: rgba(255,255,255,0.04); }
.rail-btn.active { color: var(--gold); background: var(--gold-10); }
.rail-btn.active::before {
  content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 2px;
  background: var(--gold-grad); border-radius: 2px;
  box-shadow: 0 0 10px rgba(212,175,55,0.5);
}
.rail-btn .lbl {
  position: absolute; left: 54px; top: 50%; transform: translateY(-50%);
  background: var(--surface-hi); border: 1px solid var(--line-2);
  padding: 5px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 500; color: var(--ink-2);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s;
  z-index: 40;
}
.rail-btn:hover .lbl { opacity: 1; }

.rail-spacer { flex: 1; }
.rail-foot { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.rail-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(212,175,55,0.25), rgba(212,175,55,0.05));
  border: 1px solid var(--gold-30);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  margin-top: 10px;
}
.rail-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Main content area ---- */
.main {
  padding-top: 36px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Page header: breadcrumb, greeting, global actions */
.page-head {
  padding: 26px 36px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.012), transparent);
}
.eyebrow {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-4);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.eyebrow .date { color: var(--ink-3); }

.greeting {
  font-family: var(--font-serif); font-weight: 400;
  font-size: 30px; line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.greeting em {
  font-style: italic; color: var(--gold);
  font-weight: 500;
}

.page-head-right {
  display: flex; align-items: center; gap: 10px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line-2);
  font-size: 11px; color: var(--ink-2); font-weight: 500;
  transition: background 0.18s, border 0.18s;
}
.chip:hover { background: rgba(255,255,255,0.06); border-color: var(--line-strong); }
.chip i { color: var(--gold); font-size: 10px; }
.chip .k { color: var(--ink-3); font-family: var(--font-mono); font-size: 10px; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  background: var(--gold-grad); color: #0b0905;
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  box-shadow: 0 10px 25px -10px rgba(212,175,55,0.5);
  transition: transform 0.12s, box-shadow 0.18s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 15px 30px -12px rgba(212,175,55,0.6); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line-2);
  font-size: 12px; color: var(--ink-2); font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.btn-ghost i { font-size: 10px; color: var(--ink-3); }

/* Scrollable content region */
.scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
}
.page {
  padding: 22px 36px 40px;
  display: flex; flex-direction: column; gap: 22px;
  animation: fadeUp 0.35s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================================================
   CARD SYSTEM
   ================================================ */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.008));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 30%);
  pointer-events: none;
  opacity: 0.6;
}
.card.elevated {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
  border-color: var(--line-2);
}
.card.gold-edge {
  border-color: rgba(212,175,55,0.25);
  background:
    radial-gradient(400px 200px at 100% 0%, rgba(212,175,55,0.12), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.008));
}

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 10px;
}
.card-title i { color: var(--gold); font-size: 10px; }
.card-body { padding: 20px; }
.card-action {
  font-size: 11px; color: var(--ink-3); letter-spacing: 0.02em;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 0.15s;
}
.card-action:hover { color: var(--gold); }
.card-action i { font-size: 9px; }

/* Micro label */
.mlabel {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-4);
}

/* Stat numerals */
.numeral {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  font-feature-settings: 'lnum', 'tnum';
}
.numeral.gold { color: var(--gold); }
.numeral.xl { font-size: 56px; }
.numeral.lg { font-size: 40px; }
.numeral.md { font-size: 28px; }

/* Progress bars (hairline) */
.track {
  width: 100%; height: 3px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.track > span {
  display: block; height: 100%; border-radius: inherit;
  background: var(--gold-grad);
  transition: width 0.6s cubic-bezier(0.2,0.8,0.2,1);
}
.track.cool > span { background: linear-gradient(90deg, #7FA6D4, #B8D4EC); }
.track.silver > span { background: linear-gradient(90deg, #C0C0C0, #E5E5E5); }
.track.green > span { background: linear-gradient(90deg, #6EC08A, #A8E0BC); }
.track.thick { height: 6px; }

/* Delta pills */
.delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(110,192,138,0.1); color: var(--ok);
  border: 1px solid rgba(110,192,138,0.2);
}
.delta.down { background: rgba(224,108,108,0.1); color: var(--err); border-color: rgba(224,108,108,0.2); }
.delta.flat { background: rgba(255,255,255,0.04); color: var(--ink-3); border-color: var(--line-2); }

/* ================================================
   OVERVIEW — KPI hero row
   ================================================ */
.kpi-grid {
  display: grid; grid-template-columns: 1fr 1fr 1.35fr;
  gap: 18px;
}
.kpi {
  padding: 22px 22px 20px;
  display: flex; flex-direction: column;
  min-height: 168px;
}
.kpi .kpi-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 18px;
}
.kpi .kpi-num {
  display: flex; align-items: baseline; gap: 8px;
}
.kpi .kpi-num .unit {
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-3);
}
.kpi .kpi-sub {
  margin-top: 12px; font-size: 11px; color: var(--ink-3);
  display: flex; justify-content: space-between; align-items: center;
}
.kpi .spark { margin-top: 16px; }

/* Level card (big hero) */
.level-card {
  position: relative; overflow: hidden;
  background:
    radial-gradient(500px 240px at 100% 0%, rgba(212,175,55,0.18), transparent 60%),
    radial-gradient(400px 300px at 0% 100%, rgba(212,175,55,0.07), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
  border-color: rgba(212,175,55,0.25);
}
.level-card .shield {
  position: absolute; right: -20px; top: -10px;
  width: 130px; height: 130px;
  opacity: 0.12;
}
.level-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(212,175,55,0.12); border: 1px solid var(--gold-30);
  font-family: var(--font-mono); font-size: 10px; color: var(--gold);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.level-title {
  font-family: var(--font-serif); font-size: 22px; font-weight: 500;
  color: var(--ink); margin-top: 10px;
  font-style: italic;
}

/* ================================================
   Content cards two-column
   ================================================ */
.two-col {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px;
}
.three-col {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.four-col {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}

/* Focus list */
.focus-list { display: flex; flex-direction: column; }
.focus-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s;
}
.focus-item:last-child { border-bottom: none; }
.focus-item:hover { background: rgba(255,255,255,0.02); }
.focus-check {
  width: 20px; height: 20px; border-radius: 7px;
  border: 1.5px solid var(--line-strong);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.focus-check:hover { border-color: var(--gold); }
.focus-item.done .focus-check {
  background: var(--gold-grad); border-color: transparent;
  color: #0b0905;
}
.focus-item.done .focus-check::after {
  content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 10px;
}
.focus-item.done .focus-title { color: var(--ink-4); text-decoration: line-through; }

.focus-body { flex: 1; min-width: 0; }
.focus-title { font-size: 13px; font-weight: 500; color: var(--ink); transition: color 0.15s; }
.focus-meta { display: flex; align-items: center; gap: 10px; margin-top: 3px; font-size: 10px; color: var(--ink-4); }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--ink-3);
  padding: 2px 7px; border-radius: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  letter-spacing: 0.02em;
}
.tag.prio-high { color: #E8B55F; border-color: rgba(232,181,95,0.3); background: rgba(232,181,95,0.08); }
.tag.prio-med  { color: var(--cool); border-color: rgba(127,166,212,0.3); background: rgba(127,166,212,0.08); }
.tag.prio-low  { color: var(--ink-3); }
.tag .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.focus-xp {
  font-family: var(--font-mono); font-size: 10px; color: var(--gold);
  padding: 3px 7px; border-radius: 5px;
  background: var(--gold-10); border: 1px solid var(--gold-18);
  flex-shrink: 0;
}

/* Assistant card */
.assistant {
  display: flex; flex-direction: column; height: 100%;
}
.asst-messages {
  flex: 1; min-height: 180px; max-height: 280px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px; padding-right: 6px;
}
.asst-msg {
  max-width: 85%;
  padding: 10px 14px; border-radius: 14px;
  font-size: 12.5px; line-height: 1.55;
}
.asst-msg.user {
  align-self: flex-end;
  background: var(--gold-10); border: 1px solid var(--gold-18);
  color: var(--ink); border-bottom-right-radius: 4px;
}
.asst-msg.bot {
  align-self: flex-start;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  color: var(--ink-2); border-bottom-left-radius: 4px;
}
.asst-input {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 6px 6px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-2);
  transition: border 0.18s;
}
.asst-input:focus-within { border-color: var(--gold-30); }
.asst-input input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--ink); font-size: 13px; padding: 8px 0;
}
.asst-input input::placeholder { color: var(--ink-4); }
.asst-send {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--gold-grad); color: #0b0905;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}

/* Revenue pulse card */
.pulse {
  display: flex; align-items: center; gap: 20px;
}
.pulse .meter {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
}
.pulse .meter-top {
  display: flex; align-items: baseline; gap: 8px;
}
.pulse-goal { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }

/* Ring widget */
.ring-widget {
  width: 132px; height: 132px; position: relative; flex-shrink: 0;
}
.ring-widget svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-widget .r-bg { stroke: rgba(255,255,255,0.05); fill: none; stroke-width: 8; }
.ring-widget .r-fg { stroke: url(#ring-grad); fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.8s cubic-bezier(0.2,0.8,0.2,1); }
.ring-widget .r-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-widget .r-inner .num { font-family: var(--font-serif); font-size: 30px; font-weight: 500; color: var(--ink); line-height: 1; }
.ring-widget .r-inner .lbl { font-family: var(--font-mono); font-size: 9px; color: var(--ink-4); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 6px; }

/* Sparkline */
.spark-svg { width: 100%; height: 36px; display: block; }

/* ================================================
   TASKS — 3 column board
   ================================================ */
.board {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  flex: 1; min-height: 0;
}
.col {
  display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.col-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.col-head-row { display: flex; align-items: center; justify-content: space-between; }
.col-label { display: flex; align-items: center; gap: 9px; }
.col-dot {
  width: 7px; height: 7px; border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.col-label h3 {
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
}
.col-count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.col-list {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.col-foot { padding: 12px; border-top: 1px solid var(--line); }

.add-row {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  width: 100%; padding: 10px; border-radius: 10px;
  border: 1px dashed var(--line-strong);
  color: var(--ink-3); font-size: 11px; font-weight: 500;
  transition: all 0.18s;
}
.add-row:hover { border-color: var(--gold-30); color: var(--gold); background: var(--gold-10); }

/* Task card */
.task {
  padding: 12px 12px 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer;
  transition: background 0.15s, border 0.15s, transform 0.15s;
  position: relative;
}
.task:hover { background: rgba(255,255,255,0.045); border-color: var(--line-2); }
.task.done { opacity: 0.55; }
.task.done .t-title { text-decoration: line-through; color: var(--ink-3); }

.t-check {
  width: 18px; height: 18px; border-radius: 6px;
  border: 1.5px solid var(--line-strong); flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.t-check:hover { border-color: var(--gold); }
.task.done .t-check { background: var(--gold-grad); border-color: transparent; color: #0b0905; }
.task.done .t-check::after {
  content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 9px;
}

.t-body { flex: 1; min-width: 0; }
.t-title { font-size: 12.5px; font-weight: 500; line-height: 1.35; color: var(--ink); }
.t-meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.t-proj { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.04em; color: var(--ink-3); }

/* Project pill row */
.pills {
  display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto;
  padding-bottom: 2px;
}
.pill {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-2);
  font-size: 12px; color: var(--ink-2); font-weight: 500;
  transition: all 0.18s; white-space: nowrap;
}
.pill:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.pill.active { background: var(--gold-10); border-color: var(--gold-30); color: var(--gold); }
.pill .ct { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.pill.active .ct { color: var(--gold); opacity: 0.7; }

/* ================================================
   BUSINESS — pipeline / revenue / goals
   ================================================ */
.stage-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stage-row:last-child { border-bottom: none; }
.stage-row .sname { flex: 1; font-size: 12.5px; color: var(--ink-2); }
.stage-row .sct { font-family: var(--font-serif); font-size: 22px; font-weight: 500; color: var(--ink); }
.stage-row .sbar { width: 80px; }

.lead-card {
  padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  transition: all 0.15s;
}
.lead-card:hover { background: rgba(255,255,255,0.04); }
.lead-av {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(212,175,55,0.25), rgba(212,175,55,0.05));
  border: 1px solid var(--gold-30);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 500; font-size: 13px; color: var(--gold);
  flex-shrink: 0;
}
.lead-body { flex: 1; min-width: 0; }
.lead-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.lead-stage { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.02em; }
.lead-advance {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 11px;
  transition: all 0.15s;
}
.lead-advance:hover { background: var(--gold-10); color: var(--gold); }

/* Goals */
.goal-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.goal-row:last-child { border-bottom: none; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.goal-title { font-size: 12.5px; color: var(--ink); font-weight: 500; }
.goal-pct { font-family: var(--font-mono); font-size: 11px; color: var(--gold); }
.goal-dd { font-size: 10px; color: var(--ink-4); margin-top: 3px; font-family: var(--font-mono); letter-spacing: 0.02em; }

/* Revenue entries */
.rev-list { display: flex; flex-direction: column; }
.rev-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rev-row:last-child { border-bottom: none; }
.rev-src { font-size: 12.5px; color: var(--ink-2); }
.rev-date { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.rev-amt { font-family: var(--font-serif); font-size: 16px; font-weight: 500; color: var(--gold); }

/* ================================================
   CONTENT — calendar + analytics
   ================================================ */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-nav button { width: 28px; height: 28px; border-radius: 7px; color: var(--ink-3); font-size: 11px; }
.cal-nav button:hover { background: rgba(255,255,255,0.05); color: var(--ink); }
.cal-label { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); letter-spacing: 0.02em; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.cal-dow {
  font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-4);
  letter-spacing: 0.12em; text-transform: uppercase;
  text-align: center; padding: 6px 0 4px;
}
.cal-day {
  aspect-ratio: 1 / 1.05;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,0.015);
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: background 0.15s, border 0.15s;
  min-height: 72px;
}
.cal-day:hover { background: rgba(255,255,255,0.035); border-color: var(--line-2); }
.cal-day.today { background: var(--gold-10); border-color: var(--gold-30); }
.cal-day .num { font-family: var(--font-serif); font-size: 14px; color: var(--ink-2); line-height: 1; }
.cal-day.today .num { color: var(--gold); }
.cal-day .dots { margin-top: auto; display: flex; gap: 3px; flex-wrap: wrap; }
.cal-day .dots span {
  width: 5px; height: 5px; border-radius: 50%;
}
.d-ig { background: #E1306C; }
.d-tt { background: #fff; }
.d-yt { background: #FF0000; }
.d-li { background: #0A66C2; }
.d-fb { background: #1877F2; }

/* Analytics rows */
.plat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.plat-row:last-child { border-bottom: none; }
.plat-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  color: var(--ink-2); font-size: 13px;
}
.plat-body { flex: 1; }
.plat-name { font-size: 12.5px; color: var(--ink); font-weight: 500; }
.plat-meta { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); margin-top: 2px; }
.plat-num { font-family: var(--font-serif); font-size: 18px; font-weight: 500; color: var(--ink); }

/* ================================================
   CONTENT v2 — sub-tabs, 30-day cal, analytics
   ================================================ */
.subtabs {
  display: inline-flex; gap: 4px;
  padding: 4px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
}
.subtab {
  padding: 8px 16px; border-radius: 8px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.18s, color 0.18s;
}
.subtab:hover { color: var(--ink); }
.subtab.active { background: var(--gold-10); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-30); }
.subtab .ct { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.subtab.active .ct { color: var(--gold); opacity: 0.7; }

/* Month calendar */
.monthcal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.monthcal-title { font-family: var(--font-serif); font-size: 22px; font-weight: 500; color: var(--ink); letter-spacing: -0.01em; }
.monthcal-title em { font-style: italic; color: var(--gold); }
.monthcal-actions { display: flex; align-items: center; gap: 6px; }
.nav-btn { width: 30px; height: 30px; border-radius: 8px; color: var(--ink-3); font-size: 11px; display: flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s; }
.nav-btn:hover { background: rgba(255,255,255,0.05); color: var(--ink); }
.nav-btn.today { width: auto; padding: 0 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }

.monthcal {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.mc-dow {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-4);
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
}
.mc-dow:nth-child(7n) { border-right: none; }

.mc-day {
  min-height: 112px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.mc-day:nth-child(7n) { border-right: none; }
.mc-day:hover { background: rgba(255,255,255,0.02); }
.mc-day.blank { background: rgba(255,255,255,0.01); cursor: default; }
.mc-day.blank:hover { background: rgba(255,255,255,0.01); }
.mc-day.other { opacity: 0.4; }
.mc-day.today {
  background: linear-gradient(180deg, rgba(212,175,55,0.10), rgba(212,175,55,0.03));
}
.mc-day.today::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--gold-30);
}
.mc-num {
  font-family: var(--font-serif); font-size: 14px; font-weight: 500;
  color: var(--ink-2); line-height: 1;
  display: flex; justify-content: space-between; align-items: center;
}
.mc-day.today .mc-num { color: var(--gold); }
.mc-num .wk { font-family: var(--font-mono); font-size: 9px; color: var(--ink-5); letter-spacing: 0.08em; }

.mc-posts { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.mc-post {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 6px; border-radius: 5px;
  background: rgba(255,255,255,0.04);
  font-size: 10px; color: var(--ink-2);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  border-left: 2px solid var(--pc, #D4AF37);
}
.mc-post.draft { opacity: 0.55; border-left-style: dashed; }
.mc-post.scheduled { background: rgba(212,175,55,0.08); }
.mc-post i { font-size: 8px; flex-shrink: 0; opacity: 0.8; }
.mc-post .tt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }

.mc-more {
  font-size: 9.5px; color: var(--ink-4); font-family: var(--font-mono); padding: 2px 6px;
  cursor: pointer; border-radius: 4px; align-self: flex-start;
  transition: all 0.15s;
}
.mc-more:hover { color: var(--gold); background: rgba(212,175,55,0.08); }

.mc-expand-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: mcExpandFade 0.18s ease-out;
}
.mc-day.expanded {
  position: fixed; z-index: 100;
  min-height: 200px; max-height: 80vh;
  min-width: 220px;
  padding: 14px 16px;
  background: #0f1014;
  border: 1px solid var(--gold-30, rgba(212,175,55,0.3));
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
  overflow-y: auto;
  animation: mcExpandIn 0.22s cubic-bezier(0.25, 0.46, 0.45, 1.25) forwards;
  cursor: default;
  display: flex; flex-direction: column;
}
.mc-day.expanded::after { display: none; }
.mc-day.expanded .mc-num { font-size: 22px; }
.mc-day.expanded .mc-posts { gap: 5px; }
.mc-day.expanded .mc-post {
  padding: 8px 10px; font-size: 12px;
  border-left-width: 3px;
}
.mc-day.expanded .mc-post i { font-size: 11px; }

.mc-expand-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 8px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.mc-expand-count {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-4); letter-spacing: 0.08em;
  margin-left: 10px;
}
.mc-expand-close {
  width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 11px;
  background: transparent; border: none; cursor: pointer;
  transition: all 0.15s;
}
.mc-expand-close:hover { background: rgba(255,255,255,0.08); color: var(--ink); }

.mc-expand-add {
  margin-top: 6px; padding: 8px 12px;
  border: 1px dashed var(--line); border-radius: 8px;
  background: transparent; color: var(--ink-3);
  font-family: inherit; font-size: 11px; text-align: left;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 8px;
}
.mc-expand-add:hover {
  border-color: var(--gold-30, rgba(212,175,55,0.4));
  color: var(--gold); background: rgba(212,175,55,0.04);
}

@keyframes mcExpandIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes mcExpandFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Content summary strip */
.content-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.csum {
  padding: 18px 22px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.csum:last-child { border-right: none; }
.csum .v { font-family: var(--font-serif); font-size: 24px; font-weight: 500; line-height: 1; }
.csum .v.gold { color: var(--gold); }
.csum .l { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.12em; text-transform: uppercase; }
.csum .d { font-size: 11px; color: var(--ink-3); }

/* Platform legend */
.legend-row { display: flex; gap: 16px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3); }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--pc); }

/* ---- Analytics sub-tab ---- */
.an-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.an-card {
  position: relative; overflow: hidden;
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005));
  display: flex; flex-direction: column; gap: 12px;
  cursor: pointer;
  transition: transform 0.18s, border 0.18s, background 0.18s;
}
.an-card:hover { transform: translateY(-2px); border-color: var(--line-strong); background: rgba(255,255,255,0.035); }
.an-card.active {
  border-color: var(--gold-30);
  background:
    radial-gradient(300px 140px at 100% 0%, rgba(212,175,55,0.14), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
}
.an-card .top { display: flex; align-items: center; justify-content: space-between; }
.an-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: #fff;
  background: var(--pc);
  flex-shrink: 0;
}
.an-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.an-handle { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.an-num { font-family: var(--font-serif); font-size: 30px; font-weight: 500; color: var(--ink); line-height: 1; margin-top: 2px; letter-spacing: -0.01em; }
.an-sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.06em; text-transform: uppercase; }
.an-spark { height: 36px; }

.an-detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }

.an-hero {
  padding: 22px 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(500px 220px at 100% 0%, rgba(var(--pc-rgb), 0.22), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
  border-color: rgba(var(--pc-rgb), 0.4);
  overflow: hidden;
}
.an-hero-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.an-hero-id { display: flex; align-items: center; gap: 14px; }
.an-hero-id .an-icon { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
.an-hero-id .name { font-family: var(--font-serif); font-size: 24px; font-weight: 500; }
.an-hero-id .h { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.an-hero-num {
  display: flex; align-items: baseline; gap: 10px;
}
.an-hero-num .num { font-family: var(--font-serif); font-size: 56px; font-weight: 500; color: var(--ink); line-height: 1; letter-spacing: -0.02em; }

.an-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.an-stat { display: flex; flex-direction: column; gap: 4px; padding-right: 18px; }
.an-stat .l { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.1em; text-transform: uppercase; }
.an-stat .v { font-family: var(--font-serif); font-size: 22px; font-weight: 500; color: var(--ink); }

.an-chart {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
}
.an-chart-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.an-chart-label { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.12em; text-transform: uppercase; }

.top-posts { display: flex; flex-direction: column; gap: 10px; }
.tp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  transition: background 0.15s;
}
.tp-row:hover { background: rgba(255,255,255,0.04); }
.tp-thumb { width: 42px; height: 42px; border-radius: 8px; flex-shrink: 0;
  background: var(--pc); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 500; color: #000;
}
.tp-body { flex: 1; min-width: 0; }
.tp-title { font-size: 12.5px; color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-metric { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); margin-top: 3px; }
.tp-rank { font-family: var(--font-serif); font-size: 20px; color: var(--gold); font-weight: 500; width: 22px; text-align: center; }

/* ================================================
   INSIGHTS — chart, review
   ================================================ */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding: 0 6px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.bar {
  width: 100%; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, rgba(212,175,55,0.6), rgba(212,175,55,0.15));
  position: relative;
  min-height: 4px;
  transition: all 0.5s cubic-bezier(0.2,0.8,0.2,1);
}
.bar.today {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-lo) 100%);
  box-shadow: 0 0 20px rgba(212,175,55,0.3);
}
.bar-val { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.bar-lbl { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.06em; text-transform: uppercase; }

.review-field {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px;
}
.review-field label { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.12em; text-transform: uppercase; }
.review-field textarea {
  background: rgba(255,255,255,0.025); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
  color: var(--ink); font-size: 12.5px; line-height: 1.5;
  resize: none; min-height: 72px;
  transition: border 0.18s;
}
.review-field textarea:focus { outline: none; border-color: var(--gold-30); }
.review-field textarea::placeholder { color: var(--ink-4); }

/* Stat mini */
.qs-row { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.qs-row:last-child { border-bottom: none; }
.qs-lbl { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.1em; text-transform: uppercase; }
.qs-val { font-family: var(--font-serif); font-size: 22px; font-weight: 500; color: var(--ink); }
.qs-val.gold { color: var(--gold); }

/* Timer bar */
.timer-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background:
    linear-gradient(90deg, rgba(212,175,55,0.08), rgba(212,175,55,0.02));
  border: 1px solid var(--gold-30);
  border-radius: 14px;
}
.timer-dot {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--gold-10); border: 1px solid var(--gold-30);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: 13px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(212,175,55,0); }
}
.timer-info { flex: 1; }
.timer-label { font-size: 11px; color: var(--gold); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.timer-time { font-family: var(--font-serif); font-size: 24px; font-weight: 500; color: var(--ink); margin-top: 2px; line-height: 1; }
.timer-stop {
  width: 32px; height: 32px; border-radius: 9px;
  background: rgba(224,108,108,0.1); color: var(--err);
  border: 1px solid rgba(224,108,108,0.2);
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  transition: background 0.15s;
}
.timer-stop:hover { background: rgba(224,108,108,0.2); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 440px; max-width: calc(100vw - 48px);
  background: linear-gradient(180deg, #16161c, #0d0d12);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.8);
  animation: popIn 0.22s cubic-bezier(0.2,0.8,0.2,1);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.modal h2 { font-family: var(--font-serif); font-size: 22px; font-weight: 500; margin-bottom: 4px; }
.modal p.sub { font-size: 12px; color: var(--ink-4); margin-bottom: 22px; }
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.1em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  background: rgba(255,255,255,0.035); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 11px 14px;
  color: var(--ink); font-size: 13px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold-30); }
.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; padding: 9px; border-radius: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  color: var(--ink-3); font-size: 12px; font-weight: 500;
}
.seg button.active { background: var(--gold-10); border-color: var(--gold-30); color: var(--gold); }

.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn-primary { flex: 1; justify-content: center; padding: 12px; }
.modal-actions .btn-ghost { justify-content: center; padding: 12px 18px; }

/* Hairline divider */
.hr {
  height: 1px; background: var(--line);
  margin: 0;
}

/* Section header (editorial) */
.sec {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 4px 2px 0;
}
.sec h2 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: 20px; color: var(--ink);
  letter-spacing: -0.005em;
}
.sec h2 em { font-style: italic; color: var(--gold); font-weight: 500; }
.sec .sub { font-size: 11.5px; color: var(--ink-3); }

/* Utilities */
.row { display: flex; align-items: center; }
.stack { display: flex; flex-direction: column; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.grow { flex: 1; min-width: 0; min-height: 0; }

/* ============================================================
   CONTENT HUB — Calendar + Analytics
   ============================================================ */

/* Sub-tabs */
.subtabs {
  display: inline-flex; gap: 4px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 3px;
}
.subtab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: transparent; border: none;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.subtab:hover { color: var(--ink); }
.subtab.active {
  background: rgba(196,164,108,0.12);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(196,164,108,0.25);
}
.subtab i { font-size: 12px; }
.subtab .ct {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  color: var(--ink-2);
}
.subtab.active .ct { background: rgba(196,164,108,0.2); color: var(--gold); }

/* Summary strip — 4 columns */
.content-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.csum {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 22px;
  border-right: 1px solid var(--stroke);
}
.csum:last-child { border-right: none; }
.csum .l {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.csum .v {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.01em;
}
.csum .v.gold { color: var(--gold); }
.csum .d {
  font-size: 11px;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 5px;
}

/* Month calendar header */
.monthcal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--stroke);
}
.monthcal-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.monthcal-title em { font-style: italic; color: var(--gold); font-weight: 500; }
.monthcal-actions { display: flex; align-items: center; gap: 6px; }
.nav-btn {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--ink-2);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--ink); border-color: rgba(255,255,255,0.16); }
.nav-btn.today {
  color: var(--gold);
  border-color: rgba(196,164,108,0.3);
  text-transform: uppercase;
}
.nav-btn.today:hover { background: rgba(196,164,108,0.08); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(196,164,108,0.08);
  border: 1px solid rgba(196,164,108,0.3);
  color: var(--gold);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.15s;
}
.btn-ghost:hover { background: rgba(196,164,108,0.16); }

/* Month grid */
.monthcal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(110px, auto);
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--stroke);
  width: 100%;
}
.mc-dow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-4);
  text-transform: uppercase;
  padding: 10px 12px;
  background: rgba(0,0,0,0.25);
  border-right: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  grid-row: 1;
}
.mc-dow:nth-child(7n) { border-right: none; }

.mc-day {
  position: relative;
  padding: 8px 10px;
  border-right: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 110px;
  min-width: 0;
  overflow: hidden;
}
.mc-day:nth-child(7n) { border-right: none; }
.mc-day:hover { background: rgba(255,255,255,0.025); }
.mc-day.blank { background: rgba(0,0,0,0.15); cursor: default; }
.mc-day.blank:hover { background: rgba(0,0,0,0.15); }

.mc-day.today {
  background: rgba(196,164,108,0.06);
  box-shadow: inset 0 0 0 1px rgba(196,164,108,0.3);
}

.mc-num {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}
.mc-day.today .mc-num { color: var(--gold); }
.mc-num .wk {
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--gold);
  background: rgba(196,164,108,0.15);
  padding: 2px 5px;
  border-radius: 3px;
}

.mc-posts { display: flex; flex-direction: column; gap: 3px; }
.mc-post {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 6px;
  background: rgba(var(--pc-rgb, 255,255,255), 0.08);
  border-left: 2px solid var(--pc, var(--gold));
  border-radius: 3px;
  font-size: 10px;
  color: var(--ink-2);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}
.mc-post.draft {
  border-left-style: dashed;
  opacity: 0.65;
}
.mc-post.scheduled { background: rgba(196,164,108,0.05); }
.mc-post i { font-size: 9px; flex-shrink: 0; }
.mc-post .tt {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.mc-more {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-4);
  padding-left: 6px;
  letter-spacing: 0.04em;
}

.legend-row {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 22px;
  border-top: 1px solid var(--stroke);
  background: rgba(0,0,0,0.2);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }

/* ============ ANALYTICS ============ */
.an-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.an-card {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.an-card:hover {
  border-color: rgba(var(--pc-rgb), 0.3);
  transform: translateY(-1px);
}
.an-card.active {
  border-color: rgba(var(--pc-rgb), 0.6);
  box-shadow: 0 0 0 1px rgba(var(--pc-rgb), 0.3), 0 4px 20px rgba(var(--pc-rgb), 0.12);
}
.an-card .top { display: flex; align-items: center; justify-content: space-between; }
.an-icon {
  width: 32px; height: 32px; border-radius: 7px;
  background: var(--pc);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.an-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.an-handle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  margin-top: 2px;
}
.an-num {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}
.an-sub {
  font-size: 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.an-spark { margin-top: 2px; }

/* Detail grid */
.an-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
}

.an-hero {
  padding: 22px 24px;
  background: linear-gradient(180deg, rgba(var(--pc-rgb), 0.08) 0%, rgba(var(--pc-rgb), 0.02) 100%);
  border: 1px solid rgba(var(--pc-rgb), 0.25);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 18px;
}
.an-hero-top { display: flex; align-items: center; justify-content: space-between; }
.an-hero-id { display: flex; align-items: center; gap: 12px; }
.an-hero-id .name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}
.an-hero-id .h {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}
.an-hero-num {
  display: flex; align-items: baseline; gap: 10px;
}
.an-hero-num .num {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1;
}

.an-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0,0,0,0.25);
}
.an-stat {
  padding: 12px 14px;
  border-right: 1px solid var(--stroke);
  display: flex; flex-direction: column; gap: 4px;
}
.an-stat:last-child { border-right: none; }
.an-stat .l {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  text-transform: uppercase;
}
.an-stat .v {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}

.an-chart {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 14px 16px;
}
.an-chart-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.an-chart-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Top posts in detail */
.top-posts { display: flex; flex-direction: column; gap: 10px; }
.tp-row {
  display: grid;
  grid-template-columns: 22px 40px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  border-left: 3px solid var(--pc, var(--gold));
}
.tp-rank {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--gold);
  font-style: italic;
  text-align: center;
}
.tp-thumb {
  width: 40px; height: 40px; border-radius: 6px;
  background: var(--pc, var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.tp-title {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
}
.tp-metric {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-top: 3px;
}

.hr { height: 1px; background: var(--stroke); }

/* ================================================
   RESPONSIVE — phone / small screens  (Phase 2)
   Desktop is a fixed-height app with an internal scroll
   region and a 72px left rail. On phones we switch to a
   natural document scroll and move the rail to a fixed
   bottom tab bar, then collapse every multi-column grid.
   ================================================ */
@media (max-width: 760px) {
  /* Document-flow scrolling instead of the desktop's locked shell */
  html, body { overflow-x: hidden; overflow-y: auto; height: auto; }

  .app { grid-template-columns: 1fr; height: auto; min-height: 100vh; width: 100%; }

  /* ---- Title bar: keep brand + Theme/Settings, drop desktop-only clutter ---- */
  /* Push content below the iPhone status bar / Dynamic Island (standalone PWA) */
  /* In-flow (not fixed) on mobile so the page header below it is reachable, and
     padded below the iPhone status bar / Dynamic Island. */
  .titlebar { position: static; height: auto; min-height: 0; padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px; }
  .titlebar .meta { display: none; }                 /* hardcoded Session/Week stats */
  .tb-btn[title="Minimize"],
  .tb-btn[title="Maximize"],
  .tb-btn[title="Close"] { display: none; }           /* window controls are no-ops in a PWA */

  /* ---- Bottom tab bar removed — navigation is the Home block-launcher now ---- */
  .rail { display: none; }

  /* ---- Main + page ---- */
  .main { overflow: visible; padding-top: 0; padding-bottom: 0; }
  .scroll { overflow: visible; }
  .page { padding: 16px 14px calc(28px + env(safe-area-inset-bottom, 0px)); gap: 16px; }  /* no fixed tab bar to clear now */

  /* Page header stacks; actions wrap */
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; padding: 16px 14px 14px; }
  .page-head-right { flex-wrap: wrap; gap: 8px; }
  .greeting { font-size: 23px; }

  /* ---- Collapse multi-column grids ---- */
  .kpi-grid,
  .two-col,
  .three-col,
  .four-col,
  .an-detail-grid { grid-template-columns: 1fr; }
  .kpi { min-height: 0; }

  /* Tasks board: 3 columns stack, each grows naturally (no nested scroll on phone) */
  .board { display: flex; flex-direction: column; }
  .col { min-height: auto; }
  .col-list { max-height: none; overflow: visible; }

  /* Analytics / summary strips: pack to 2-up */
  .an-grid,
  .content-summary,
  .an-stats-row { grid-template-columns: repeat(2, 1fr); }

  .numeral.xl { font-size: 40px; }
  .numeral.lg { font-size: 32px; }

  /* ---- Calendars: keep the 7-day week, shrink the cells to fit ---- */
  .monthcal { grid-auto-rows: minmax(56px, auto); }
  .mc-day { min-height: 56px; padding: 4px; gap: 3px; }
  .mc-dow { padding: 6px 3px; font-size: 8px; letter-spacing: 0.04em; }
  .mc-num { font-size: 10px; }
  .mc-post { font-size: 8px; padding: 2px 4px; }
  .cal-grid { gap: 3px; }
  .cal-day { min-height: 52px; padding: 5px; }

  /* Modals fill the small screen */
  .modal { width: 100%; max-width: calc(100vw - 24px); padding: 22px; }

  /* ---- Home launcher: the "back to Home" button + big page blocks ---- */
  .mh-home-btn {
    align-self: flex-start;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px 7px 11px; border-radius: 999px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--line-2);
    color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  }
  .mh-home-btn i { font-size: 11px; color: var(--gold); }
  .mh-home-btn:active { background: rgba(255,255,255,0.08); }

  .mobile-home { padding-top: 6px; }
  /* Compact 2-up tile grid (scales to more pages); Content spans full width for its calendar. */
  .mh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .mh-block {
    position: relative; display: flex; flex-direction: column; gap: 9px;
    width: 100%; min-height: 106px; text-align: left;
    padding: 15px 15px 16px; border-radius: var(--r-lg);
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow-card);
    color: var(--ink);
    transition: transform 0.12s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }
  /* Press feedback: tile presses down + gold ring WHILE held (your finger controls how long);
     release navigates instantly — no scripted hold or bounce-back before the page switches. */
  .mh-block:active { transform: scale(0.93); border-color: var(--gold-30); box-shadow: 0 0 0 1px var(--gold-18), var(--shadow-card); }
  .mh-block.mh-span { grid-column: 1 / -1; min-height: 0; }
  .mh-block-head { display: flex; align-items: center; gap: 11px; }
  .mh-icon {
    width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px;
    display: grid; place-items: center;
    background: var(--gold-10); border: 1px solid var(--gold-18);
    color: var(--gold); font-size: 16px;
  }
  .mh-title { flex: 1; font-family: var(--font-serif); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
  .mh-head-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.02em; color: var(--ink-4); white-space: nowrap; }
  .mh-stat { font-family: var(--font-serif); font-size: 30px; line-height: 1; color: var(--ink); margin-top: auto; }
  .mh-stat small { font-size: 15px; color: var(--ink-4); }
  .mh-tile-lbl { font-size: 11.5px; color: var(--ink-3); }
  .mh-dim { color: var(--ink-4); }
  .mh-content .mh-cal { margin-top: 4px; }

  /* mini calendar inside the Content block (basic shell + post dots) */
  .mh-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 2px; }
  .mh-cal-day {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 7px 0 6px; border-radius: 9px;
    background: rgba(255,255,255,0.025); border: 1px solid var(--line);
  }
  .mh-cal-day.is-today { background: var(--gold-10); border-color: var(--gold-30); }
  .mh-cal-dow { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.04em; color: var(--ink-4); text-transform: uppercase; }
  .mh-cal-num { font-family: var(--font-serif); font-size: 14px; color: var(--ink-2); line-height: 1; }
  .mh-cal-day.is-today .mh-cal-num { color: var(--gold); }
  .mh-cal-dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
  .mh-cal-dot.on { background: var(--gold); box-shadow: 0 0 5px var(--gold); }
}

