/* ================================================================
   Pulse — design tokens ("Pulse dark" system, from Pulse App.dc.html)
   One committed dark theme: black canvas, #232323 panels, Sora display
   type, IBM Plex Sans body, IBM Plex Mono labels, single accent with a
   blinking live-dot motif. Accent is switchable (Settings → Appearance)
   via body[data-accent]; Ember is the default.
   ================================================================ */
:root {
  /* Surfaces */
  --color-canvas: 0 0 0;
  --color-surface: 35 35 35;            /* #232323 panels */
  --color-surface-muted: 30 30 30;      /* #1E1E1E dropdowns, modals */
  --color-surface-sunken: 52 52 52;     /* #343434 tracks, wells */
  --color-hover: 44 44 44;              /* #2C2C2C row hover */
  --color-active: 58 58 58;
  --color-selected: 44 44 44;

  /* Sidebar (its own, slightly-lifted black) */
  --side-bg: #141414;
  --side-border: #3F3F3F;
  --side-text: 252 251 248;             /* #FCFBF8 */

  /* Text */
  --color-text: 237 237 237;            /* #EDEDED */
  --color-text-muted: 168 168 168;      /* #A8A8A8 */
  --color-text-subtle: 151 151 151;     /* #979797 */

  /* Lines */
  --color-border: 58 58 58;             /* #3A3A3A card borders */
  --color-border-subtle: 45 45 45;      /* #2D2D2D row dividers */
  --color-border-strong: 69 69 69;      /* #454545 controls */
  --divider: #343434;                   /* section dividers inside panels */

  /* Accent — Ember (default). Cobalt/Forest override via body[data-accent]. */
  --color-accent: 255 77 0;
  --color-accent-hover: 255 107 43;
  --color-accent-subtle: 59 34 26;      /* #3B221A */
  --color-accent-ink: 255 138 92;       /* readable accent for text/links */
  --color-accent-foreground: 255 255 255;

  /* Semantic states (design chips: AHEAD / BEHIND / OFF TRACK / ON TRACK) */
  --color-success: 125 214 154; --color-success-subtle: 34 53 42;  --color-success-ink: 125 214 154;
  --color-warning: 255 138 92;  --color-warning-subtle: 59 34 26;  --color-warning-ink: 255 138 92;
  --color-danger: 178 58 16;    --color-danger-subtle: 72 26 12;   --color-danger-ink: 255 138 92;
  --color-info: 111 168 255;    --color-info-subtle: 30 42 61;     --color-info-ink: 143 185 255;

  /* Radii / shadows / motion */
  --radius-control: 10px; --radius-card: 16px; --radius-panel: 18px; --radius-pill: 9999px;
  --shadow-ambient: none;
  --shadow-raised: 0 1px 3px 0 rgba(0,0,0,.4);
  --shadow-pop: 0 14px 30px rgba(0,0,0,.55);
  --shadow-overlay: 0 24px 60px rgba(0,0,0,.7);
  --ease-standard: cubic-bezier(.2,0,0,1);
  --dur-fast: 120ms; --dur-base: 180ms;
  --modal-backdrop: rgb(0 0 0 / .6);

  /* Type */
  --font-display: 'Sora', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* Data-viz — monochrome-first slots: paper + gray defaults keep charts
     in the design's mono language; 3–6 are muted brights for customization. */
  --s1: #EDEDED; --s2: #8F8F8F; --s3: #FF6B2B; --s4: #7DD69A; --s5: #6FA8FF; --s6: #C9A6FF;
  --viz-grid: #363636;
  --viz-axis: #454545;
  --viz-spark: #5A5A5A;
  --area-alpha: .08;
  --grad-top: .16;
  --chevron-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23979797' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Accent variants — the three accent options shipped in the design file. */
body[data-accent="cobalt"] {
  --color-accent: 42 99 201; --color-accent-hover: 74 127 224;
  --color-accent-subtle: 24 37 61; --color-accent-ink: 122 163 240;
}
body[data-accent="forest"] {
  --color-accent: 20 127 74; --color-accent-hover: 36 152 95;
  --color-accent-subtle: 22 46 33; --color-accent-ink: 96 195 141;
}

/* ================= base ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  color: rgb(var(--color-text)); background: rgb(var(--color-canvas));
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
h1, h2, h3 { font-family: var(--font-display); }
::selection { background: rgb(var(--color-accent) / .45); }

.eyebrow {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: rgb(var(--color-text-subtle));
}

/* the Pulse wordmark: lowercase Sora + blinking accent dot */
.wordmark {
  display: inline-flex; align-items: baseline;
  font-family: var(--font-display); font-weight: 700; font-size: 24px;
  letter-spacing: -.045em; line-height: 1; color: rgb(var(--side-text));
}
/* live-data dots are green with a soft breathing pulse (v0.8.0); the brand
   wordmark keeps the ember hard-blink — it's the logo, not a data signal. */
.live-dot {
  display: inline-block; flex-shrink: 0; width: 6px; height: 6px;
  border-radius: 50%; background: rgb(var(--color-success));
  animation: pl-pulse-soft 3s ease-in-out infinite;
}
.wordmark .live-dot {
  width: 7px; height: 7px; margin-left: 4px;
  background: rgb(var(--color-accent));
  animation: pl-blink 2.4s steps(1) infinite;
  box-shadow: none;
}
@keyframes pl-blink { 0%, 45% { opacity: 1; } 50%, 95% { opacity: .2; } 100% { opacity: 1; } }
@keyframes pl-pulse-soft {
  0%   { opacity: 1;   box-shadow: 0 0 0 0 rgb(var(--color-success) / .45); }
  55%  { opacity: .55; box-shadow: 0 0 0 4px rgb(var(--color-success) / 0); }
  100% { opacity: 1;   box-shadow: 0 0 0 0 rgb(var(--color-success) / 0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ================= shell ================= */
.shell { display: flex; height: 100vh; min-height: 0; }
.sidebar {
  display: flex; flex-direction: column; width: 238px; flex-shrink: 0;
  background: var(--side-bg); border-right: 1px solid var(--side-border);
  padding: 24px 14px 18px; overflow: hidden;
  transition: transform var(--dur-base) var(--ease-standard);
}
.main { flex: 1; min-width: 0; overflow-y: auto; scroll-behavior: smooth; }
.page { max-width: 1120px; margin: 0 auto; padding: 30px 36px 64px; }

/* brand */
.brand { display: flex; align-items: center; padding: 0 10px 22px; }

/* sidebar section labels */
.side-label, .nav-group .eyebrow {
  display: block; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: rgb(var(--side-text) / .38); padding: 0 10px 8px;
}

/* client switcher */
.client-switch { padding: 0 0 20px; position: relative; }
.client-btn {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 10px; border: 1px solid rgb(255 255 255 / .12);
  border-radius: var(--radius-control); background: rgb(255 255 255 / .08); cursor: pointer;
  transition: background-color var(--dur-fast);
}
.client-btn:hover { background: rgb(255 255 255 / .12); }
.client-avatar {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 10px;
  background: rgb(var(--color-accent)); color: #141414;
}
.client-meta { flex: 1; min-width: 0; }
.client-name {
  display: block; font-size: 12.5px; font-weight: 500; color: rgb(var(--side-text));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-btn svg { color: rgb(var(--side-text) / .6); flex-shrink: 0; transition: transform var(--dur-base); }
.client-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: calc(100% - 12px); left: 0; right: 0; z-index: 50;
  background: rgb(var(--color-surface-muted)); border-radius: 12px;
  box-shadow: var(--shadow-pop); border: 1px solid var(--side-border);
  padding: 6px; display: none; max-height: 260px; overflow: auto;
}
.dropdown.open { display: block; }
.dropdown-head {
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgb(var(--side-text) / .35); padding: 6px 8px 5px;
}
.dropdown-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 7px 8px; border: 0; border-radius: 8px; background: transparent;
  cursor: pointer; font-size: 12.5px; font-weight: 500; color: rgb(var(--side-text) / .85);
  transition: background-color var(--dur-fast);
}
.dropdown-item:hover { background: rgb(255 255 255 / .08); }
.dropdown-item.selected { background: rgb(255 255 255 / .1); color: rgb(var(--side-text)); }
.dropdown-item .client-avatar { background: rgb(255 255 255 / .12); color: rgb(var(--side-text)); }
.dropdown-item .check {
  margin-left: auto; flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%;
  background: rgb(var(--color-accent)); opacity: 0;
}
.dropdown-item.selected .check { opacity: 1; }

/* nav — numbered items (01 Dashboard …) */
.nav { flex: 1; overflow-y: auto; margin: 0 -2px; padding: 0 2px; }
.nav-group { margin-bottom: 20px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; width: 100%;
  border: 0; background: transparent; text-align: left; cursor: pointer;
  border-radius: 8px; font-size: 13.5px; font-weight: 500;
  color: rgb(var(--side-text) / .72);
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.nav-item:hover { background: rgb(255 255 255 / .07); color: rgb(var(--side-text)); }
.nav-item.active { background: rgb(255 255 255 / .1); color: rgb(var(--side-text)); }
.nav-num {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: .06em; width: 18px; flex-shrink: 0;
  color: rgb(var(--side-text) / .4);
}
.nav-item.active .nav-num { color: rgb(var(--color-accent)); }
.nav-item .count {
  margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  background: rgb(255 255 255 / .08); color: rgb(var(--side-text) / .6);
  border-radius: var(--radius-pill); padding: 1px 7px;
}
.nav-item.active .count { background: rgb(var(--color-accent) / .2); color: rgb(var(--color-accent-ink)); }

/* sidebar footer */
.side-foot { border-top: 1px solid rgb(255 255 255 / .1); padding: 14px 10px 0; display: flex; flex-direction: column; gap: 10px; }
.side-user { display: flex; align-items: center; gap: 9px; }
.side-user-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: rgb(var(--color-accent)); color: #141414;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
}
.side-user-meta { flex: 1; min-width: 0; }
.side-user-name { display: block; font-size: 12.5px; font-weight: 500; color: rgb(var(--side-text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-role {
  display: block; font-family: var(--font-mono); font-size: 8.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--side-text) / .4);
}
.side-exit {
  font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .1em;
  color: rgb(var(--side-text) / .5); text-decoration: none; text-transform: uppercase;
  background: transparent; border: 0; cursor: pointer; flex-shrink: 0;
}
.side-exit:hover { color: rgb(var(--side-text)); }
.side-ver {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em;
  color: rgb(var(--side-text) / .3); text-transform: uppercase;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.side-ver a { color: rgb(var(--side-text) / .45); text-decoration: none; }
.side-ver a:hover { color: rgb(var(--side-text)); }

/* "by Bryckroad" lockup pinned under the version line (sidebar co-branding).
   The logo file is off-white; opacity does the dimming so one asset serves
   every surface. */
.side-byline {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; text-decoration: none;
  opacity: .45; transition: opacity var(--dur-base) var(--ease-standard);
}
.side-byline:hover { opacity: .8; }
.side-byline-label {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em;
  color: rgb(var(--side-text)); text-transform: uppercase;
}
.side-byline-logo { height: 13px; width: auto; display: block; }

/* ================= buttons, chips, fields ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; cursor: pointer; font-weight: 600; border-radius: var(--radius-pill);
  transition: background-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), opacity var(--dur-fast);
  height: 36px; padding: 0 16px; font-size: 13px; white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px rgb(var(--color-accent) / .5); }
.btn:active { transform: scale(.98); }
.btn-sm { height: 30px; padding: 0 13px; font-size: 12px; }
.btn-primary { background: rgb(var(--color-text)); color: #141414; }
.btn-primary:hover { opacity: .88; }
.btn-outline { background: transparent; color: rgb(var(--color-text)); border: 1px solid rgb(var(--color-border-strong)); }
.btn-outline:hover { background: rgb(var(--color-hover)); }
.btn-outline.is-on { background: rgb(var(--color-accent-subtle)); color: rgb(var(--color-accent-ink)); border-color: rgb(var(--color-accent) / .45); }
.btn-ghost { background: transparent; color: rgb(var(--color-text-muted)); }
.btn-ghost:hover { background: rgb(var(--color-hover)); color: rgb(var(--color-text)); }
.btn-soft { background: rgb(var(--color-accent-subtle)); color: rgb(var(--color-accent-ink)); }
.btn-soft:hover { background: rgb(var(--color-accent) / .28); }
.btn-accent { background: rgb(var(--color-accent)); color: rgb(var(--color-accent-foreground)); }
.btn-accent:hover { background: rgb(var(--color-accent-hover)); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; width: 30px; border: 0; cursor: pointer; background: transparent;
  border-radius: var(--radius-pill); color: rgb(var(--color-text-subtle));
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.icon-btn:hover { background: rgb(var(--color-hover)); color: rgb(var(--color-text)); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }

/* chips — tiny mono uppercase pills, straight from the design */
.chip {
  display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-pill);
  padding: 3px 9px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
}
.chip-success { background: rgb(var(--color-success-subtle)); color: rgb(var(--color-success-ink)); }
.chip-danger { background: rgb(var(--color-danger)); color: #FFFFFF; }
.chip-muted { background: rgb(var(--color-surface-sunken)); color: rgb(var(--color-text-muted)); }
.chip-warning { background: rgb(var(--color-warning-subtle)); color: rgb(var(--color-warning-ink)); }
.chip-info { background: rgb(var(--color-surface-sunken)); color: rgb(var(--color-text)); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* sync status pill (module heads) */
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: rgb(var(--color-text-subtle));
  white-space: nowrap;
}

/* ================= page header ================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .eyebrow { display: block; margin-bottom: 6px; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.page-sub { color: rgb(var(--color-text-subtle)); font-size: 12.5px; margin-top: 7px; font-weight: 400; }
.head-actions { display: flex; align-items: center; gap: 8px; position: relative; flex-wrap: wrap; }

/* range segment — 7D / 30D / 90D pills */
.rangeseg {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgb(var(--color-surface)); border: 1px solid rgb(var(--color-border));
  border-radius: var(--radius-pill); padding: 3px;
}
.rangeseg-btn {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 14px; border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  color: rgb(var(--color-text-muted));
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.rangeseg-btn:hover { color: rgb(var(--color-text)); }
.rangeseg-btn.is-on { background: rgb(var(--color-text)); color: #141414; }

/* footer note under page content */
.foot-note { font-size: 12px; color: rgb(var(--color-text-subtle)); margin-top: 16px; }

/* ================= module sections ================= */
.module { margin-bottom: 26px; border-radius: var(--radius-card); transition: box-shadow var(--dur-fast); }
.module.dragging { opacity: .45; }
.module.drop-above { box-shadow: 0 -3px 0 0 rgb(var(--color-accent)); }
.module-head { display: flex; align-items: center; gap: 11px; padding: 0 2px 12px; }
.module-icon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.module-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.module-meta {
  font-family: var(--font-mono); font-size: 9px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgb(var(--color-text-subtle)); margin-top: 2px;
}
.module-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.drag-handle { cursor: grab; }
.drag-handle:active { cursor: grabbing; }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-12 { grid-column: span 12; }

.card {
  background: rgb(var(--color-surface)); border-radius: var(--radius-card);
  border: 1px solid rgb(var(--color-border)); padding: 16px 18px; min-width: 0;
  position: relative;
}
.stat-trend { padding-bottom: 0; overflow: hidden; }

/* per-widget customize button — appears on card hover and in Edit layout mode */
.wedit {
  position: absolute; top: 8px; right: 8px; z-index: 6;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: 1px solid rgb(var(--color-border-strong));
  border-radius: var(--radius-pill); background: rgb(var(--color-surface));
  color: rgb(var(--color-text-subtle)); cursor: pointer;
  opacity: 0; transition: opacity var(--dur-fast), color var(--dur-fast);
}
.card:hover .wedit, body.editing .wedit { opacity: 1; }
.wedit:hover { color: rgb(var(--color-accent-ink)); }
.swatch-btn.swatch-auto { background: transparent; border: 2px dashed rgb(var(--color-border-strong)); }
.card-title { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; color: rgb(var(--color-text)); }
.card-sub { font-size: 11.5px; color: rgb(var(--color-text-subtle)); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

/* stat tile */
.stat { display: flex; flex-direction: column; gap: 4px; position: relative; }
.stat-label {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: rgb(var(--color-text-subtle));
}
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.stat-delta { display: flex; align-items: baseline; gap: 6px; font-size: 10.5px; color: rgb(var(--color-text-subtle)); margin-top: 1px; flex-wrap: wrap; }
.delta {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: var(--font-mono); font-weight: 600; font-size: 11.5px;
}
.delta.up { color: rgb(var(--color-success-ink)); }
.delta.down { color: rgb(var(--color-warning-ink)); }
.delta.flat { color: rgb(var(--color-text-subtle)); }
.stat-spark { position: absolute; right: 0; top: 2px; }

/* legend */
.legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: rgb(var(--color-text-muted)); }
.legend-key { width: 14px; height: 0; border-top: 3px solid; border-radius: 2px; }
.legend-key.swatch { width: 10px; height: 10px; border: 0; border-radius: 3px; }

/* chart */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.viz-tip {
  position: absolute; z-index: 30; pointer-events: none; display: none; min-width: 130px;
  background: rgb(var(--color-surface-muted)); border: 1px solid var(--side-border);
  border-radius: var(--radius-control); box-shadow: var(--shadow-pop); padding: 8px 10px;
}
.viz-tip .tip-date { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; color: rgb(var(--color-text-subtle)); margin-bottom: 4px; }
.viz-tip .tip-row { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 1px 0; }
.viz-tip .tip-key { width: 12px; height: 0; border-top: 3px solid; border-radius: 2px; flex-shrink: 0; }
.viz-tip .tip-val { font-family: var(--font-mono); font-weight: 600; color: rgb(var(--color-text)); }
.viz-tip .tip-name { color: rgb(var(--color-text-muted)); }

/* horizontal bar list (channels et al.) */
.hbars { display: flex; flex-direction: column; gap: 11px; }
.hbar { display: grid; grid-template-columns: 92px 1fr 52px; align-items: center; gap: 10px; border-radius: 8px; }
.hbar-label { font-size: 12px; font-weight: 500; color: rgb(var(--color-text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { display: block; height: 6px; border-radius: var(--radius-pill); background: rgb(var(--color-surface-sunken)); position: relative; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: var(--radius-pill); transition: opacity var(--dur-fast); min-width: 2px; }
.hbar:hover .hbar-fill { opacity: .82; }
.hbar-val { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: rgb(var(--color-text-muted)); text-align: right; font-variant-numeric: tabular-nums; }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  background: transparent; text-align: left;
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--color-text-subtle));
  padding: 8px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--divider);
}
table.data td { padding: 10px 12px; border-bottom: 1px solid rgb(var(--color-border-subtle)); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background-color var(--dur-fast); cursor: default; }
table.data tbody tr:hover { background: rgb(var(--color-hover)); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.num { font-family: var(--font-mono); font-weight: 500; font-size: 12px; }
table.data .sub { color: rgb(var(--color-text-subtle)); font-size: 10.5px; font-family: var(--font-mono); }

/* connections page */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.conn-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.conn-top { display: flex; align-items: center; gap: 11px; }
.conn-desc { font-size: 12.5px; color: rgb(var(--color-text-muted)); flex: 1; }
.conn-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--divider); padding-top: 12px; }

.switch { position: relative; width: 38px; height: 22px; background: transparent; border: 0; padding: 0; cursor: pointer; flex-shrink: 0; }
.switch-track { position: absolute; inset: 0; border-radius: var(--radius-pill); background: rgb(var(--color-border-strong)); transition: background-color var(--dur-base) var(--ease-standard); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #FDFDFD; transition: transform var(--dur-base) var(--ease-standard); }
.switch.is-on .switch-track { background: rgb(var(--color-accent)); }
.switch.is-on .switch-knob { transform: translateX(16px); }
.switch:focus-visible { outline: none; }
.switch:focus-visible .switch-track { box-shadow: 0 0 0 2px rgb(var(--color-accent) / .5); }

/* reviews / posts */
.review { border: 1px solid rgb(var(--color-border-subtle)); border-radius: 12px; padding: 10px 12px; background: rgb(var(--color-canvas) / .25); }
.review-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.review-name { font-size: 12.5px; font-weight: 600; }
.review-time { font-family: var(--font-mono); font-size: 10px; color: rgb(var(--color-text-subtle)); margin-left: auto; }
.review-text { font-size: 12px; color: rgb(var(--color-text-muted)); }
.stars { display: inline-flex; gap: 1px; color: #FFC96B; }

.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.post { border-radius: 12px; overflow: hidden; border: 1px solid rgb(var(--color-border-subtle)); }
.post-img { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: rgb(var(--color-text-subtle)); background: rgb(var(--color-surface-sunken)); }
.post-meta { display: flex; gap: 10px; padding: 6px 9px; font-family: var(--font-mono); font-size: 10px; color: rgb(var(--color-text-muted)); }
.post-meta span { display: inline-flex; align-items: center; gap: 3px; }

/* empty state */
.empty { text-align: center; padding: 56px 24px; }
.empty-icon { width: 52px; height: 52px; border-radius: 16px; background: rgb(var(--color-accent-subtle)); color: rgb(var(--color-accent-ink)); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty h3 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.empty p { color: rgb(var(--color-text-muted)); font-size: 13px; max-width: 380px; margin: 0 auto 16px; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: var(--modal-backdrop); z-index: 90; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 480px; max-height: 82vh; overflow-y: auto;
  background: rgb(var(--color-surface-muted)); border: 1px solid var(--side-border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-overlay); padding: 20px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.modal-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.modal-sub { font-size: 12.5px; color: rgb(var(--color-text-muted)); margin-bottom: 14px; }
.modal-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid rgb(var(--color-border-subtle)); }
.modal-row:last-child { border-bottom: 0; }

/* toast */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 9px; background: rgb(var(--color-surface-muted));
  border-radius: var(--radius-card); box-shadow: var(--shadow-pop); padding: 11px 14px;
  font-size: 13px; font-weight: 500; animation: toast-in .22s var(--ease-standard);
  border: 1px solid var(--side-border);
}
.toast svg { color: rgb(var(--color-accent)); flex-shrink: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* form fields */
.field {
  display: block; width: 100%; height: 38px; padding: 0 13px; font-size: 13.5px;
  font-family: inherit; color: rgb(var(--color-text)); background: #1C1C1C;
  border: 1px solid rgb(var(--color-border-strong)); border-radius: var(--radius-control);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field:hover { border-color: #5A5A5A; }
.field:focus { outline: none; border-color: rgb(var(--color-accent)); box-shadow: 0 0 0 3px rgb(var(--color-accent) / .12); }
.field::placeholder { color: rgb(var(--color-text-subtle)); }
select.field { appearance: none; -webkit-appearance: none; background-image: var(--chevron-url); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.field-label {
  display: block; margin-bottom: 6px; font-family: var(--font-mono); font-size: 9px;
  font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: rgb(var(--color-text-muted));
}

/* ranked-list table variant */
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: flex; gap: 12px; padding: 9px 4px; border-bottom: 1px solid rgb(var(--color-border-subtle)); align-items: flex-start; }
.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: rgb(var(--color-hover)); border-radius: 8px; }
.rank-num { font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: rgb(var(--color-text-subtle)); width: 20px; flex-shrink: 0; padding-top: 2px; text-align: right; }
.rank-main { flex: 1; min-width: 0; }
.rank-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rank-label { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-val { font-family: var(--font-mono); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-bar { display: block; height: 4px; border-radius: var(--radius-pill); background: rgb(var(--color-surface-sunken)); margin: 5px 0 3px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; border-radius: inherit; min-width: 2px; }
.rank-sub { font-family: var(--font-mono); font-size: 10px; color: rgb(var(--color-text-subtle)); }

/* goals — meters, expected-pace tick, progress rings */
.meter { position: relative; height: 8px; border-radius: var(--radius-pill); }
.meter-track { position: absolute; inset: 0; border-radius: inherit; background: rgb(var(--color-surface-sunken)); }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; min-width: 2px; transition: width var(--dur-base) var(--ease-standard); }
.meter-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; background: rgb(var(--color-accent)); border-radius: 1px; }
/* tone mapping (design): achieved/ahead → mint, on-track → paper, behind → ember-warm, off-track → burnt */
.tone-success .meter-fill { background: rgb(var(--color-success)); }
.tone-info .meter-fill { background: rgb(var(--color-text)); }
.tone-warning .meter-fill { background: rgb(var(--color-warning)); }
.tone-danger .meter-fill { background: rgb(var(--color-danger)); }
.ring-track { stroke: #363636; }
.tone-success .ring-fill { stroke: rgb(var(--color-success)); }
.tone-info .ring-fill { stroke: rgb(var(--color-text)); }
.tone-warning .ring-fill { stroke: rgb(var(--color-warning)); }
.tone-danger .ring-fill { stroke: rgb(var(--color-danger)); }
.goal-vals { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.goal-cur { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.goal-tgt { font-size: 13px; color: rgb(var(--color-text-subtle)); }

/* customize controls */
.modal-section {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: rgb(var(--color-text-subtle));
  margin: 16px 0 2px; padding: 0 4px;
}
.modal-section:first-child { margin-top: 4px; }
.swatches { display: flex; gap: 7px; }
.swatch-btn { width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer; transition: transform var(--dur-fast); }
.swatch-btn:hover { transform: scale(1.12); }
.swatch-btn.selected { box-shadow: 0 0 0 2px rgb(var(--color-surface-muted)), 0 0 0 4px rgb(var(--color-accent)); }
.seg { display: inline-flex; background: rgb(var(--color-surface-sunken)); border-radius: var(--radius-pill); padding: 2px; }
.seg button {
  border: 0; background: transparent; padding: 4px 13px; border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .05em;
  color: rgb(var(--color-text-muted)); cursor: pointer;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.seg button.is-on { background: rgb(var(--color-text)); color: #141414; }

/* settings list rows */
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgb(var(--color-border-subtle)); }
.set-row:last-child { border-bottom: 0; }
.set-key { font-size: 13px; font-weight: 500; }
.set-note { display: block; font-size: 11px; font-weight: 400; color: rgb(var(--color-text-subtle)); margin-top: 1px; }
.set-val { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: rgb(var(--color-text-muted)); display: inline-flex; align-items: center; gap: 7px; }

/* ================= motion =================
   Animations run only when a card scrolls into view: an IntersectionObserver
   stamps .in-view on each card, and every rule below requires it. Without
   .in-view (or under prefers-reduced-motion) elements simply show their
   final state. */
@media (prefers-reduced-motion: no-preference) {
  .card.in-view { animation: pl-fade-up .56s var(--ease-standard) both; }
  .in-view .viz-draw { stroke-dasharray: 1; animation: pl-draw 1.8s var(--ease-standard) both; animation-delay: calc(var(--d, 0) * 2ms); }
  .in-view .viz-fade { animation: pl-fade 1.4s var(--ease-standard) both; animation-delay: calc(440ms + var(--d, 0) * 2ms); }
  .in-view .viz-dot { transform-box: fill-box; transform-origin: center; animation: pl-pop .6s var(--ease-standard) both; animation-delay: calc(1040ms + var(--d, 0) * 2ms); }
  .in-view .viz-col { transform-box: fill-box; transform-origin: center bottom; animation: pl-rise 1s var(--ease-standard) both; animation-delay: calc(var(--d, 0) * 2ms); }
  .in-view .hbar-fill { transform-origin: left center; animation: pl-grow-x 1.1s var(--ease-standard) both; animation-delay: calc(var(--d, 0) * 2ms); }
  .in-view .meter-fill { transform-origin: left center; animation: pl-grow-x 1.2s var(--ease-standard) both; }
  .in-view .rank-bar span { transform-origin: left center; animation: pl-grow-x 1.1s var(--ease-standard) both; animation-delay: calc(var(--d, 0) * 2ms); }
  .in-view .donut-seg { animation: pl-seg 1.3s var(--ease-standard) both; animation-delay: calc(var(--d, 0) * 2ms); }
  .in-view .ring-fill { animation: pl-ring 1.6s var(--ease-standard) both; }
  .in-view table.data tbody tr, .in-view .rank-row { animation: pl-row .68s var(--ease-standard) both; }
  .in-view table.data tbody tr:nth-child(2), .in-view .rank-row:nth-child(2) { animation-delay: 60ms; }
  .in-view table.data tbody tr:nth-child(3), .in-view .rank-row:nth-child(3) { animation-delay: 120ms; }
  .in-view table.data tbody tr:nth-child(4), .in-view .rank-row:nth-child(4) { animation-delay: 180ms; }
  .in-view table.data tbody tr:nth-child(5), .in-view .rank-row:nth-child(5) { animation-delay: 240ms; }
  .in-view table.data tbody tr:nth-child(6), .in-view .rank-row:nth-child(6) { animation-delay: 300ms; }
  .in-view table.data tbody tr:nth-child(7), .in-view .rank-row:nth-child(7) { animation-delay: 360ms; }
  .in-view table.data tbody tr:nth-child(8), .in-view .rank-row:nth-child(8) { animation-delay: 420ms; }
  .in-view table.data tbody tr:nth-child(9), .in-view .rank-row:nth-child(9) { animation-delay: 480ms; }
  .in-view table.data tbody tr:nth-child(10), .in-view .rank-row:nth-child(10) { animation-delay: 540ms; }
  .in-view .post { animation: pl-fade-up .6s var(--ease-standard) both; }
  .in-view .post:nth-child(2) { animation-delay: 80ms; } .in-view .post:nth-child(3) { animation-delay: 160ms; }
  .in-view .post:nth-child(4) { animation-delay: 240ms; } .in-view .post:nth-child(5) { animation-delay: 320ms; }
  .in-view .post:nth-child(6) { animation-delay: 400ms; }
}
@keyframes pl-fade-up { from { opacity: 0; transform: translateY(6px); } }
@keyframes pl-fade { from { opacity: 0; } }
@keyframes pl-draw { from { stroke-dashoffset: 1; } }
@keyframes pl-rise { from { transform: scaleY(.02); } }
@keyframes pl-grow-x { from { transform: scaleX(.02); } }
@keyframes pl-seg { from { stroke-dasharray: 0 1000; } }
@keyframes pl-ring { from { stroke-dashoffset: var(--circ, 0); } }
@keyframes pl-row { from { opacity: 0; transform: translateY(4px); } }
@keyframes pl-pop { from { opacity: 0; transform: scale(.4); } }

/* animations disabled via Settings: zero-duration = jump straight to final
   state (also freezes the live-dots at full opacity) */
body.no-anim * { animation-duration: 0s !important; animation-delay: 0s !important; }

/* misc */
.is-refreshing { opacity: .55; transition: opacity var(--dur-fast); }
.hamburger { display: none; }
.mono-note { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: rgb(var(--color-text-subtle)); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3F3F3F; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1000px) {
  .col-3 { grid-column: span 6; }
  .col-4, .col-5, .col-7, .col-8 { grid-column: span 12; }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 80; transform: translateX(-110%); box-shadow: var(--shadow-overlay); }
  .sidebar.open { transform: none; }
  .hamburger { display: inline-flex; }
  .page { padding: 18px 14px 48px; }
  .col-3 { grid-column: span 6; }
  .posts { grid-template-columns: repeat(3, 1fr); }
}

/* ================================================================
   WordPress-plugin surfaces beyond the app shell
   ================================================================ */

/* The sidebar Exit control is an <a> in the plugin (wp_logout_url). */
a.side-exit { text-decoration: none; }

/* ---------- branded sign-in cover (views/login.php) ---------- */
.pl-login-body { background: rgb(var(--color-canvas)); }
.pl-login {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 30px; padding: 24px;
}
.pl-login .wordmark { font-size: 40px; color: rgb(var(--color-text)); }
.pl-login .wordmark .live-dot { width: 10px; height: 10px; margin-left: 5px; }
.pl-login-card {
  width: 100%; max-width: 380px;
  background: rgb(var(--color-surface));
  border: 1px solid rgb(var(--color-border));
  border-radius: var(--radius-panel);
  padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
}
.pl-login-title {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: rgb(var(--color-text-subtle)); margin: 0;
}
.pl-login-notice {
  font-size: 12.5px; padding: 10px 14px; border-radius: var(--radius-control);
  background: rgb(var(--color-info-subtle)); color: rgb(var(--color-info-ink));
}
.pl-login-notice.is-error { background: rgb(var(--color-accent-subtle)); color: rgb(var(--color-accent-ink)); }
.pl-login-form { display: flex; flex-direction: column; gap: 16px; }
.pl-field-group { display: flex; flex-direction: column; gap: 6px; }
.pl-field-label {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em;
  color: rgb(var(--color-text-muted));
}
.pl-field {
  width: 100%; box-sizing: border-box;
  font: 500 13.5px var(--font-body); color: rgb(var(--color-text));
  background: #1C1C1C;
  border: 1px solid rgb(var(--color-border-strong));
  border-radius: var(--radius-control);
  padding: 11px 13px; outline: none;
  transition: border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}
.pl-field:focus { border-color: rgb(var(--color-accent)); box-shadow: 0 0 0 3px rgb(var(--color-accent) / .12); }
.pl-login-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: -4px 0 0; font-size: 12px; color: rgb(var(--color-text-muted));
}
.pl-remember { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.pl-remember input { accent-color: rgb(var(--color-accent)); }
.pl-login-link { color: rgb(var(--color-accent-ink)); text-decoration: none; font-weight: 500; }
.pl-login-link:hover { text-decoration: underline; }
.pl-login-submit {
  width: 100%; border: 0; cursor: pointer;
  font: 600 13.5px var(--font-body);
  color: #141414; background: rgb(var(--color-text));
  border-radius: var(--radius-pill);
  padding: 12px 16px;
  transition: opacity var(--dur-fast) var(--ease-standard);
}
.pl-login-submit:hover { opacity: .88; }
.pl-login-or {
  display: flex; align-items: center; gap: 10px;
  color: rgb(var(--color-text-subtle));
  font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase;
}
.pl-login-or::before, .pl-login-or::after { content: ''; flex: 1; height: 1px; background: #363636; }
.pl-login-google { text-align: center; }
.pl-login-google a {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; box-sizing: border-box;
  font: 600 13px var(--font-body); color: rgb(var(--color-text));
  background: transparent;
  border: 1px solid rgb(var(--color-border-strong));
  border-radius: var(--radius-pill);
  padding: 11px 16px; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-standard);
}
.pl-login-google a:hover { background: rgb(var(--color-hover)); }
.pl-login-note {
  font-size: 11px; color: rgb(var(--color-text-subtle));
  max-width: 340px; text-align: center;
}

/* Client users get a pinned, non-interactive client card. */
.client-btn:disabled { cursor: default; }
.client-btn:disabled:hover { background: rgb(255 255 255 / .08); }

/* ---------- public legal pages (views/legal.php) ---------- */
.pl-legal-body { background: rgb(var(--color-canvas)); }
.pl-legal { max-width: 760px; margin: 0 auto; padding: 26px 20px 40px; }
.pl-legal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.pl-legal-brand { display: flex; align-items: center; text-decoration: none; color: inherit; }
.pl-legal-brand .wordmark { color: rgb(var(--color-text)); }
.pl-legal-signin {
  font-size: 12.5px; font-weight: 600; text-decoration: none;
  color: rgb(var(--color-text));
  padding: 8px 18px; border-radius: var(--radius-pill);
  border: 1px solid rgb(var(--color-border-strong));
}
.pl-legal-signin:hover { background: rgb(var(--color-hover)); }
.pl-legal-card {
  background: rgb(var(--color-surface));
  border: 1px solid rgb(var(--color-border));
  border-radius: var(--radius-panel);
  padding: 36px 40px 42px;
}
.pl-legal-card h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: 28px; letter-spacing: -.035em;
  margin: 8px 0 12px;
}
.pl-legal-card h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 16px; letter-spacing: -.02em;
  margin: 26px 0 8px;
}
.pl-legal-card p { font-size: 14px; margin: 0 0 12px; color: rgb(var(--color-text-muted)); }
.pl-legal-card p strong { color: rgb(var(--color-text)); }
.pl-legal-card ul { margin: 0 0 12px; padding-left: 22px; }
.pl-legal-card li { font-size: 14px; margin: 4px 0; color: rgb(var(--color-text-muted)); }
.pl-legal-intro { color: rgb(var(--color-text-muted)); }
.pl-legal-card a { color: rgb(var(--color-accent-ink)); font-weight: 500; text-decoration: none; }
.pl-legal-card a:hover { text-decoration: underline; }
.pl-legal-footer {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px;
  margin-top: 20px; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgb(var(--color-text-subtle));
}
.pl-legal-footer a { color: inherit; text-decoration: none; font-weight: 500; }
.pl-legal-footer a:hover { color: rgb(var(--color-text)); }
@media (max-width: 600px) { .pl-legal-card { padding: 26px 22px 30px; } }

/* Legal links under the sign-in card. */
.pl-login-legal {
  text-align: center; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgb(var(--color-text-subtle));
}
.pl-login-legal a { color: inherit; text-decoration: none; font-weight: 500; }
.pl-login-legal a:hover { color: rgb(var(--color-text)); }

/* "by Bryckroad" lockup — login page footer and legal-page header. */
.pl-byline {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none;
  opacity: .5; transition: opacity var(--dur-base) var(--ease-standard);
}
.pl-byline:hover { opacity: .85; }
.pl-byline-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  color: rgb(var(--color-text)); text-transform: uppercase;
}
.pl-byline-logo { height: 16px; width: auto; display: block; }
.pl-legal-brand .pl-byline-label { margin-left: 14px; }
.pl-legal-brand .pl-byline-logo { height: 14px; }

/* ================================================================
   v0.6.0 — live clients: list separation, wizard, sync states
   ================================================================ */

/* live vs demo chips */
.chip-live { background: rgb(var(--color-accent-subtle)); color: rgb(var(--color-accent-ink)); }
.chip-demo {
  background: rgb(255 255 255 / .09); color: rgb(var(--side-text) / .55);
  padding: 2px 7px; font-size: 8px; letter-spacing: .14em; flex-shrink: 0;
}
#page .chip-demo { background: rgb(var(--color-surface-sunken)); color: rgb(var(--color-text-subtle)); }
.client-btn .chip-demo { margin-left: auto; }

/* client dropdown sections */
.dropdown-sect {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgb(var(--side-text) / .45);
  padding: 8px 8px 4px; margin-top: 2px;
  border-top: 1px solid rgb(255 255 255 / .06);
}
.dropdown-sect:first-of-type { border-top: 0; margin-top: 0; }
.dropdown-sect .live-dot { width: 5px; height: 5px; }
.dropdown-empty { padding: 6px 8px 8px; font-size: 11.5px; color: rgb(var(--side-text) / .4); }
.dropdown-new {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 6px; padding: 8px;
  border: 1px dashed rgb(255 255 255 / .18); border-radius: 8px; background: transparent;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgb(var(--side-text) / .6); cursor: pointer;
  transition: color var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast);
}
.dropdown-new:hover { color: rgb(var(--side-text)); border-color: rgb(255 255 255 / .32); background: rgb(255 255 255 / .05); }

/* onboarding wizard steps */
.wiz-steps { display: flex; gap: 6px; margin: 2px 0 16px; }
.wiz-step {
  flex: 1; text-align: center; padding: 6px 4px;
  border-radius: 8px; border: 1px solid rgb(var(--color-border-subtle));
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--color-text-subtle));
}
.wiz-step.is-on { border-color: rgb(var(--color-accent) / .55); color: rgb(var(--color-accent-ink)); background: rgb(var(--color-accent-subtle)); }
.wiz-step.is-done { color: rgb(var(--color-text-muted)); }

/* loading skeletons (live data fetch) */
.skel { position: relative; overflow: hidden; background: rgb(var(--color-surface-sunken)); border-color: transparent; }
.skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / .05) 50%, transparent 80%);
  animation: pl-shimmer 1.6s linear infinite;
}
@keyframes pl-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
body.no-anim .skel::after { animation: none; }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }

/* agency table section rows */
.data tr.tsect td {
  padding: 14px 10px 6px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: rgb(var(--color-text-subtle));
  border-bottom: 1px solid rgb(var(--color-border-subtle)); background: transparent;
}
.data tr.tsect td .live-dot { margin-right: 6px; }
.data tr.tsect:hover td { background: transparent; }
.data tr.is-demo td { opacity: .82; }

/* ================================================================
   v0.8.0 — dashboard navigation & curation: sticky jump bar,
   pinned widgets under Goals, collapsible modules
   ================================================================ */

/* sticky jump bar — source bubbles that scroll the dashboard */
.jump-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 6px; overflow-x: auto;
  padding: 10px 2px 12px; margin: -6px 0 14px;
  background: rgb(var(--color-canvas) / .88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  scrollbar-width: none;
}
.jump-bar::-webkit-scrollbar { display: none; }
.jump-chip {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  border: 1px solid rgb(var(--color-border)); background: rgb(var(--color-surface));
  border-radius: var(--radius-pill); padding: 4px 13px 4px 5px; cursor: pointer;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: rgb(var(--color-text-muted));
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.jump-chip:hover { background: rgb(var(--color-hover)); color: rgb(var(--color-text)); }
.jump-chip.is-on {
  border-color: rgb(var(--color-accent) / .55);
  background: rgb(var(--color-accent-subtle)); color: rgb(var(--color-text));
}
.jump-ico {
  width: 18px; height: 18px; border-radius: 6px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
/* jump targets land just below the stuck bar */
.module { scroll-margin-top: 54px; }

/* pinned widgets — the source bubble sits fully above its card in a small
   header row, never straddling the card edge; the unpin control lives in
   that row too so it can't cover chart legends. */
.pin-cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pin-cell > * { flex-shrink: 0; } /* children keep natural height — the masonry span approximates it */
.pin-head { display: flex; align-items: center; gap: 6px; }
.pin-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgb(var(--color-surface-muted));
  border: 1px solid rgb(var(--color-border-strong));
  border-radius: var(--radius-pill); padding: 2px 9px 2px 7px;
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: rgb(var(--color-text-muted));
  white-space: nowrap;
}
.pin-tag .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pin-untag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: 0; border-radius: var(--radius-pill);
  background: transparent; color: rgb(var(--color-text-subtle)); cursor: pointer;
  opacity: 0; transition: opacity var(--dur-fast), color var(--dur-fast), background-color var(--dur-fast);
}
.pin-cell:hover .pin-untag, body.editing .pin-untag { opacity: 1; }
.pin-untag:hover { background: rgb(var(--color-hover)); color: rgb(var(--color-accent-ink)); }
/* repacked spans + dense flow + JS masonry (layoutPinned() sets each cell's
   row-span from its content height against the 8px track): cards hug their
   content, later cards slot into gaps under shorter neighbors, and pin
   order stops mattering */
.grid-pinned { grid-auto-flow: dense; grid-auto-rows: 8px; }

/* pin button rides next to the customize brush (visible on hover) */
.wedit.wpin { right: 40px; }
.wedit.wpin:hover { color: rgb(var(--color-accent-ink)); }

/* collapsible modules */
.mod-collapse svg { transition: transform var(--dur-base) var(--ease-standard); }
.module.is-collapsed .mod-collapse svg { transform: rotate(-90deg); }
.module.is-collapsed { margin-bottom: 14px; }
.module.is-collapsed .module-head {
  padding-bottom: 10px;
  border-bottom: 1px dashed rgb(var(--color-border-subtle));
}
