/* ================================================================
   Iain's Desktop  —  Dashboard styles
   ================================================================ */

:root {
  --bg:       #0d1117;
  --surface:  #161b22;
  --border:   #30363d;
  --text:     #e6edf3;
  --muted:    #8b949e;
  --radius:   16px;

  --rose-col:  #f43f5e;
  --amber-col: #f59e0b;
  --blue-col:  #3b82f6;
  --teal-col:  #14b8a6;
  --purple-col:#a78bfa;
  --orange-col:#fb923c;
}

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

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 74px; /* room for the two stacked tickers (scroll clearance is on main's padding-bottom) */
}

/* ── Header ─────────────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 44px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 16px;
  position: relative;
}
.hdr-ref {
  position: absolute;
  bottom: 5px;
  right: 10px;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.35;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  pointer-events: none;
}
.card-ref {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.35;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.settings-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s, color .15s;
}
.settings-btn:hover { border-color: var(--text); color: var(--text); }

.greeting {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.clock-block {
  text-align: right;
}

.clock {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.date-line {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.01em;
}

.local-wx         { font-size: 0.8rem; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.local-wx-temp    { font-weight: 600; color: var(--text); }
.local-wx-desc    { font-size: 0.7rem; color: var(--muted); }
/* Sunrise / sunset block — beside the clock, before the timezone strip */
.sun-block        { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.sun-row          { display: flex; align-items: center; gap: 4px; font-size: 1rem; font-weight: 700;
                    font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.sun-row .sun-ic  { font-size: 0.95rem; }
.sun-row .sun-ar  { font-size: 0.85rem; font-weight: 900; }
.sun-row .sun-time{ color: var(--text); }
.sun-rise .sun-ic { color: #fbbf24; }
.sun-rise .sun-ar { color: #fbbf24; }
.sun-set  .sun-ic { color: #f97316; }
.sun-set  .sun-ar { color: #6366f1; }
@media (max-width: 900px) { .sun-block { display: none; } }
.tz-strip          { display: flex; gap: 18px; align-items: center; }
.tz-item           { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tz-city           { font-size: 0.6rem; color: var(--muted); text-transform: uppercase;
                     letter-spacing: 0.06em; white-space: nowrap; }
.tz-time           { font-size: 0.92rem; font-weight: 600; font-variant-numeric: tabular-nums;
                     color: var(--text); line-height: 1.2; }
.tz-wx             { font-size: 0.68rem; color: var(--muted); line-height: 1; }
@media (max-width: 900px) { .tz-strip { display: none; } }
.fx-strip          { display: flex; gap: 18px; align-items: center; }
.fx-item           { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.fx-code           { font-size: 0.6rem; color: var(--muted); text-transform: uppercase;
                     letter-spacing: 0.06em; white-space: nowrap; }
.fx-rate           { font-size: 0.88rem; font-weight: 600; font-variant-numeric: tabular-nums;
                     color: var(--text); line-height: 1.2; }
.fx-trend          { font-size: 0.58rem; line-height: 1; }
.fx-3mo            { font-size: 0.56rem; font-weight: 700; line-height: 1; margin-top: 1px;
                     padding: 1px 4px; border-radius: 4px; cursor: help; }
.fx-buy-good       { color: #22c55e; background: rgba(34,197,94,.13); }
.fx-buy-poor       { color: #ef4444; background: rgba(239,68,68,.13); }
.fx-buy-flat       { color: var(--muted); background: rgba(255,255,255,.05); }
.fx-sep            { width: 1px; height: 16px; background: rgba(255,255,255,.12); flex-shrink: 0;
                     align-self: center; margin: 0 2px; }
@media (max-width: 900px) { .fx-strip { display: none; } }

/* ── Main grid ───────────────────────────────────────────── */
main {
  flex: 1;
  padding: 32px 44px 92px; /* bottom: clear the two stacked fixed tickers (72px) + ~20px gap above the SCREEN ticker */
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ── Card base ───────────────────────────────────────────── */
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
}

/* Coloured top accent bar */
.app-card::before {
  content: '';
  display: block;
  height: 3px;
  width: 100%;
  flex-shrink: 0;
}

/* Per-colour theming */
.app-card[data-color="rose"]   { border-color: rgba(244, 63, 94, .22);  background: rgba(244, 63, 94, .05); }
.app-card[data-color="rose"]::before   { background: var(--rose-col); }

.app-card[data-color="amber"]  { border-color: rgba(245,158, 11, .22);  background: rgba(245,158, 11, .05); }
.app-card[data-color="amber"]::before  { background: var(--amber-col); }

.app-card[data-color="blue"]   { border-color: rgba( 59,130,246, .22);  background: rgba( 59,130,246, .05); }
.app-card[data-color="blue"]::before   { background: var(--blue-col); }

.app-card[data-color="teal"]   { border-color: rgba( 20,184,166, .22);  background: rgba( 20,184,166, .05); }
.app-card[data-color="teal"]::before   { background: var(--teal-col); }

.app-card[data-color="purple"] { border-color: rgba(167,139,250, .22);  background: rgba(167,139,250, .05); }
.app-card[data-color="purple"]::before { background: var(--purple-col); }

.app-card[data-color="orange"] { border-color: rgba(251,146, 60, .22);  background: rgba(251,146, 60, .05); }
.app-card[data-color="orange"]::before { background: var(--orange-col); }

.app-card[data-color="empty"] {
  background: rgba(22,27,34,.4);
  border-color: var(--border);
  border-style: dashed;
  cursor: default;
}
.app-card[data-color="empty"]::before { height: 0; }

/* Hover lift */
.app-card:not(.placeholder):hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,.45);
}

.app-card.placeholder {
  opacity: .4;
  cursor: default;
}

/* ── Card sections ───────────────────────────────────────── */
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 10px;
  flex-shrink: 0;
}

.app-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.app-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  letter-spacing: -0.01em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background .4s;
  flex-shrink: 0;
}
.status-dot.online  { background: #22c55e; box-shadow: 0 0 6px #22c55e99; }
.status-dot.offline { background: #ef4444; }

.widget-body {
  flex: 1;
  padding: 4px 20px 12px;
  font-size: 0.85rem;
  overflow: hidden;
}

.widget-body.muted p {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.84rem;
}

.loading { color: var(--muted); font-style: italic; font-size: 0.82rem; }

.card-footer {
  padding: 10px 20px 16px;
  border-top: 1px solid rgba(255,255,255,.05);
  flex-shrink: 0;
}

.launch-btn {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: .03em;
  text-transform: uppercase;
  transition: color .15s;
}
.launch-btn:hover { color: var(--text); }

/* ── Birthday widget rows ────────────────────────────────── */
.bd-event {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.bd-event:last-child { border-bottom: none; }

.bd-emoji { font-size: 1rem; flex-shrink: 0; }

.bd-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bd-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 99px;
  white-space: nowrap;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.bd-badge.today  { background: #fef3c7; color: #78350f; }
.bd-badge.soon   { background: rgba(244,63,94,.18); color: #fda4af; }
.bd-badge.normal { background: rgba(255,255,255,.07); color: var(--muted); }

.bd-offline {
  color: #ef4444;
  font-size: 0.82rem;
  margin-top: 4px;
}

/* ── Placeholder centre text ─────────────────────────────── */
.placeholder-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-bottom: 12px;
}
.placeholder-body .plus {
  font-size: 2rem;
  color: var(--border);
  line-height: 1;
}
.placeholder-body p {
  font-size: 0.78rem;
  color: var(--border);
}

/* ── World widget ────────────────────────────────────────── */
.world-section { margin-bottom: 7px; }
.world-section:last-child { margin-bottom: 0; }

.world-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

/* Temperature — compact single line */
.world-temp {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}
.world-temp .big   { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.03em; }
.world-temp .feels { font-size: 0.7rem; color: var(--muted); }
.world-temp .desc  { font-size: 0.7rem; color: var(--muted); }

/* Clocks */
.world-clocks { display: flex; flex-direction: column; gap: 2px; }
.world-clock-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.world-clock-city { font-size: 0.75rem; color: var(--muted); }
.world-clock-time { font-size: 0.85rem; font-weight: 700;
                    font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* FX rows with sparkline + trend */
.world-fx-row2 {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.world-fx-pair2  { font-size: 0.72rem; color: var(--muted); width: 34px; flex-shrink: 0; }
.world-fx-rate2  { font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; width: 52px; flex-shrink: 0; }
.world-fx-spark  { flex: 1; line-height: 0; }
.world-fx-trend  { font-size: 0.68rem; font-weight: 700; flex-shrink: 0; width: 44px; text-align: right; }
.trend-up   { color: #22c55e; }
.trend-down { color: #ef4444; }
.trend-flat { color: var(--muted); }

.world-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.05);
  margin: 5px 0;
}

.app-card.no-click { cursor: default; }
.app-card.no-click:hover { transform: none; box-shadow: none; }

/* ── Claude sessions list ────────────────────────────────── */
.sess-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
  color: var(--text);
}
.sess-item:hover { background: rgba(167,139,250,.12); }
.sess-item.empty { opacity: .3; cursor: default; }
.sess-item.empty:hover { background: none; }

.sess-icon { font-size: 0.9rem; flex-shrink: 0; width: 18px; text-align: center; }
.sess-title {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.sess-note {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

/* ── Key Claude chats ────────────────────────────────────── */
.kc-body   { display: flex; flex-direction: column; gap: 2px; }
.kc-item   { display: flex; align-items: center; gap: 8px; padding: 6px 6px;
             border-radius: 7px; text-decoration: none; color: var(--text);
             border-bottom: 1px solid rgba(255,255,255,.05); transition: background .12s; }
.kc-item:last-child { border-bottom: none; }
.kc-item:hover { background: rgba(167,139,250,.12); }
.kc-icon   { font-size: 0.9rem; flex-shrink: 0; }
.kc-title  { flex: 1; font-size: 0.82rem; font-weight: 500; white-space: nowrap;
             overflow: hidden; text-overflow: ellipsis; }
.kc-arrow  { font-size: 0.75rem; color: var(--muted); flex-shrink: 0; }
.kc-item:hover .kc-arrow { color: #a78bfa; }
.kc-empty  { font-size: 0.78rem; color: var(--muted); line-height: 1.5; padding: 8px 0; }
.kc-empty code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; font-size: 0.72rem; }

/* ── Sale items list ─────────────────────────────────────── */
.sale-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
}
.sale-item:last-child { border-bottom: none; }
.sale-item-link {
  text-decoration: none;
  cursor: pointer;
}
.sale-item-link:hover { color: var(--accent); }

/* ── News ticker ─────────────────────────────────────────── */
/* ── Custom ticker tape ──────────────────────────────────────── */
.custom-tape {
  width: 100%;
  height: 34px;
  background: rgba(251,191,36,.06);
  border-bottom: 1px solid rgba(251,191,36,.18);
  display: flex;
  align-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.tape-label {
  padding: 0 12px;
  font-size: 1rem;
  flex-shrink: 0;
  opacity: .7;
}
.tape-viewport {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(to right, transparent 0%, black 2%, black 98%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 2%, black 98%, transparent 100%);
}
.tape-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  flex-shrink: 0;
}
@keyframes tape-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.tape-item {
  display: inline-flex;
  align-items: center;
  padding: 0 28px;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
}
.tape-dot {
  color: rgba(251,191,36,.4);
  font-size: 0.45rem;
  flex-shrink: 0;
}
.tape-sym { font-weight: 700; }
.tape-up  { color: #22c55e; }
.tape-dn  { color: #ef4444; }
/* ── Tape settings textarea ─────────────────────────────────── */
.tape-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8rem;
  padding: 8px 10px;
  resize: vertical;
  min-height: 90px;
  font-family: inherit;
  line-height: 1.6;
  box-sizing: border-box;
}
.tape-textarea:focus { outline: none; border-color: #60a5fa; }
.tape-hint { font-size: 0.68rem; color: var(--muted); margin-top: 4px; }

.news-ticker {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 36px;
  background: #0a0e14;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 200;
  overflow: hidden;
}
/* second ticker sits directly above the news ticker */
.ent-ticker { bottom: 36px; z-index: 199; }
.ticker-label.ent-label { background: #a78bfa; color: #1a1030; }

.ticker-label {
  background: #ef4444;
  color: #fff;
  padding: 0 13px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  gap: 5px;
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(to right, transparent 0%, black 2%, black 98%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 2%, black 98%, transparent 100%);
}

.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 26px;
  font-size: 0.79rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color .12s;
}
.ticker-item:hover { color: var(--text); }

.ticker-source {
  font-size: 0.65rem;
  font-weight: 700;
  color: #60a5fa;
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.ticker-sep {
  color: var(--border);
  font-size: 0.5rem;
  flex-shrink: 0;
}

.ticker-loading {
  padding: 0 20px;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

.ticker-no-token {
  padding: 0 20px;
  font-size: 0.76rem;
  color: var(--muted);
}
.ticker-no-token a { color: #60a5fa; }

/* ── Version badge ───────────────────────────────────────── */
.version-badge {
  position: fixed;
  bottom: 38px; /* sit just above news ticker */
  right: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  color: rgba(139,148,158,.4);
  letter-spacing: .04em;
  pointer-events: none;
  z-index: 100;
  font-variant-numeric: tabular-nums;
}
.version-num  { font-weight: 700; color: rgba(139,148,158,.55); }
.version-sep  { opacity: .4; }
.version-date { opacity: .7; }

/* ── Stock widget ────────────────────────────────────────── */
.stock-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.stock-row:last-of-type { border-bottom: none; }
.stock-private-row { opacity: .7; }
.stock-err-row     { opacity: .45; }

.stock-emoji  { font-size: 0.85rem; flex-shrink: 0; width: 20px; text-align: center; }
.stock-sym-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.stock-sym  { font-size: 0.78rem; font-weight: 700; color: var(--text); letter-spacing: .02em; }
.stock-co   { font-size: 0.65rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stock-spark { flex-shrink: 0; line-height: 0; }
.stock-nums  { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; gap: 1px; }
.stock-price { font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stock-chg   { font-size: 0.64rem; font-weight: 700; }
.stock-up    { color: #22c55e; }
.stock-dn    { color: #ef4444; }
.stock-err   { font-size: 0.7rem; color: var(--muted); }

.stock-private-tag  { font-size: 0.62rem; font-weight: 700; background: #1f2937; color: #9ca3af; border-radius: 4px; padding: 1px 6px; flex-shrink: 0; }
.stock-private-note { font-size: 0.65rem; color: var(--muted); flex-shrink: 0; }

.stock-updated { font-size: 0.62rem; color: var(--muted); opacity: .5; text-align: right; padding-top: 4px; }

/* ── Quote widget ────────────────────────────────────────── */
.quote-body  { display: flex; flex-direction: column; gap: 6px; }
.quote-mark  { font-size: 1.6rem; line-height: .8; color: rgba(167,139,250,.3); font-family: Georgia, serif; margin-bottom: -2px; }
.quote-text  { font-size: 0.82rem; line-height: 1.55; color: var(--text); font-style: italic; }
.quote-author{ font-size: 0.74rem; color: var(--muted); font-weight: 600; }

/* ── Fact widget ─────────────────────────────────────────── */
.fact-body       { display: flex; flex-direction: column; height: 100%; justify-content: center; gap: 8px; }
.fact-date-label { font-size: 0.62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fact-text       { font-size: 0.82rem; line-height: 1.55; color: var(--text); }

/* ── Anthropic widget ────────────────────────────────────── */
.anth-body      { display: flex; flex-direction: column; gap: 7px; height: 100%; }
.anth-meta-row  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.anth-val       { font-size: 0.84rem; font-weight: 700; color: var(--text); }
.anth-sep       { color: var(--muted); font-size: 0.7rem; }
.anth-fund      { font-size: 0.76rem; color: var(--muted); }
.anth-invest    { font-size: 0.72rem; color: var(--muted); }
.anth-models    { display: flex; flex-wrap: wrap; gap: 4px; }
.anth-pill      { font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; letter-spacing: .03em; }
.anth-latest    { background: rgba(251,146,60,.18);  color: #fb923c; border: 1px solid rgba(251,146,60,.3); }
.anth-flagship  { background: rgba(167,139,250,.18); color: #a78bfa; border: 1px solid rgba(167,139,250,.3); }
.anth-balanced  { background: rgba(59,130,246,.18);  color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
.anth-fast      { background: rgba(20,184,166,.18);  color: #2dd4bf; border: 1px solid rgba(20,184,166,.3); }
.anth-links     { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.anth-links a   { font-size: 0.72rem; color: #60a5fa; text-decoration: none; }
.anth-links a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  header { padding: 20px 24px 16px; }
  main   { padding: 20px 24px 32px; }
  .greeting  { font-size: 1.3rem; }
  .clock     { font-size: 1.7rem; }
}
@media (max-width: 420px) {
  .app-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   Settings drawer
   ================================================================ */
/* ── Countdown board modal ───────────────────────────────────── */
.cdb-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 400;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.cdb-overlay.open { opacity: 1; pointer-events: all; }
.cdb-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(.97);
  width: 560px; max-width: 94vw;
  max-height: 82vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  z-index: 401;
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.cdb-modal.open { opacity: 1; pointer-events: all; transform: translate(-50%,-50%) scale(1); }
.cdb-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.cdb-close {
  background: none; border: none; color: var(--muted);
  font-size: 1rem; cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: color .1s;
}
.cdb-close:hover { color: var(--text); }
.cdb-body { flex: 1; overflow-y: auto; padding: 16px 22px 8px; }
.cdb-foot { padding: 14px 22px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
.cdb-row {
  display: grid;
  grid-template-columns: 42px 1fr 140px 34px 34px;
  gap: 7px; align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.cdb-row:last-child { border-bottom: none; }
.cdb-add-row {
  display: grid;
  grid-template-columns: 42px 1fr 140px 34px auto;
  gap: 7px; align-items: center;
  padding-top: 14px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
.cdb-inp {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text);
  padding: 5px 8px; font-size: 0.82rem; width: 100%;
  font-family: inherit; box-sizing: border-box;
}
.cdb-inp:focus { outline: none; border-color: #60a5fa; }
.cdb-emoji { text-align: center; font-size: 1rem; }
.cdb-annual {
  cursor: pointer; font-size: 0.85rem; text-align: center;
  opacity: .3; transition: opacity .15s; user-select: none;
}
.cdb-annual.on { opacity: 1; filter: drop-shadow(0 0 4px #60a5fa88); }
.cdb-del {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 0.9rem; opacity: .45;
  padding: 4px; border-radius: 6px; transition: opacity .1s, color .1s;
}
.cdb-del:hover { opacity: 1; color: #ef4444; }
.cdb-label { font-size: 0.72rem; color: var(--muted); margin-bottom: 6px; }
/* Tape countdown items */
.tape-cd { cursor: pointer; }
.tape-cd:hover { color: #fbbf24; }
.tape-cd-days { font-weight: 700; color: #fbbf24; }
.tape-cd-today { font-weight: 800; color: #22c55e; }

.settings-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.settings-overlay.open { opacity: 1; pointer-events: all; }

.settings-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 380px;
  background: #161b22;
  border-left: 1px solid #30363d;
  z-index: 301;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.settings-drawer.open { transform: translateX(0); }

.sdrawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px 18px;
  border-bottom: 1px solid #30363d;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.sdrawer-close {
  background: none; border: none; color: var(--muted);
  font-size: 1rem; cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: color .1s;
}
.sdrawer-close:hover { color: var(--text); }

.sdrawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 8px;
}

.sdrawer-foot {
  padding: 14px 22px 18px;
  border-top: 1px solid #30363d;
  flex-shrink: 0;
}

.sbtn-save {
  width: 100%;
  padding: 10px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.sbtn-save:hover { background: #2563eb; }

/* Settings sections */
.ssection {
  border-bottom: 1px solid #21262d;
  padding: 18px 22px;
}
.ssection:last-child { border-bottom: none; }

.ssection-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Row items (clocks, currencies, weather locations) */
.srow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #21262d;
}
.srow:last-of-type { border-bottom: none; }

.srow-icon  { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.srow-label { flex: 1; font-size: 0.84rem; }
.srow-sub   { font-size: 0.72rem; color: var(--muted); }
.srow-del {
  background: none; border: none; color: #ef4444;
  cursor: pointer; font-size: 0.9rem; padding: 2px 6px;
  border-radius: 4px; opacity: .6;
}
.srow-del:hover { opacity: 1; }

/* Add-new form */
.sadd-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.sadd-form.single { grid-template-columns: 1fr; }
.sadd-form input, .sadd-form select {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.82rem;
  padding: 7px 10px;
  outline: none;
  transition: border-color .15s;
}
.sadd-form input:focus, .sadd-form select:focus { border-color: #3b82f6; }
.sadd-form input::placeholder { color: var(--muted); }

.sadd-btn {
  grid-column: 1 / -1;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px;
  cursor: pointer;
  transition: background .12s;
}
.sadd-btn:hover { background: #2d333b; }

/* Toggle + slider */
.stoggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.stoggle-label { font-size: 0.84rem; }

.stoggle {
  position: relative;
  width: 40px; height: 22px;
}
.stoggle input { opacity: 0; width: 0; height: 0; }
.stoggle-slider {
  position: absolute; inset: 0;
  background: #30363d;
  border-radius: 22px;
  cursor: pointer;
  transition: background .2s;
}
.stoggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.stoggle input:checked + .stoggle-slider { background: #3b82f6; }
.stoggle input:checked + .stoggle-slider::before { transform: translateX(18px); }

.sspeed-row { padding: 8px 0; }
.sspeed-label { font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; }
input[type=range].sspeed-input {
  width: 100%;
  accent-color: #3b82f6;
}

/* App link rows */
.sapp-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
  align-items: start;
}
.sapp-row:last-child { border-bottom: none; }
.sapp-icon-big { font-size: 1.2rem; padding-top: 2px; }
.sapp-fields { display: flex; flex-direction: column; gap: 5px; }
.sapp-fields input {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 7px;
  color: var(--text);
  font-size: 0.8rem;
  padding: 5px 9px;
  outline: none;
  width: 100%;
}
.sapp-fields input:focus { border-color: #3b82f6; }

/* ── Servers widget ─────────────────────────────── */
.srv-block { padding: 8px 0; border-bottom: 1px solid #21262d; }
.srv-block:last-child { border-bottom: none; }
.srv-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.srv-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.srv-badge { font-size: 0.68rem; font-weight: 700; letter-spacing: .06em; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; }
.srv-safe    { background: #14532d; color: #4ade80; border: 1px solid #16a34a; }
.srv-busy    { background: #7c2d12; color: #fb923c; border: 1px solid #ea580c; }
.srv-offline { background: #1f2937; color: #6b7280; border: 1px solid #374151; }
.srv-error   { font-size: 0.76rem; color: #6b7280; padding: 2px 0; }
.srv-stat-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.srv-stat-label { font-size: 0.72rem; color: var(--muted); min-width: 32px; }
.srv-stat-val   { font-size: 0.72rem; color: #9ca3af; flex: 1; }
.srv-bar-wrap   { width: 52px; height: 5px; background: #21262d; border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.srv-bar        { height: 100%; border-radius: 3px; transition: width .4s; }
.srv-jobs-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 5px 0 3px; }
.srv-job        { font-size: 0.78rem; color: #f87171; display: flex; align-items: center; gap: 5px; margin-bottom: 2px; }
.srv-job-dot    { width: 6px; height: 6px; background: #ef4444; border-radius: 50%; flex-shrink: 0; }
.srv-job-idle   { color: #4ade80; }
.srv-job-idle::before { content: '✓ '; }
.srv-docker-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 5px 0 3px; }
.srv-docker-row   { display: flex; justify-content: space-between; font-size: 0.74rem; margin-bottom: 2px; }
.srv-docker-name  { color: #60a5fa; }
.srv-docker-status{ color: #4b5563; font-size: 0.68rem; }

/* ── Health widget ───────────────────────────────────────────── */
.health-body  { padding: 4px 0; }
.health-row   { display: flex; align-items: center; gap: 5px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.health-row:last-child { border-bottom: none; }
.health-lbl   { font-size: 0.72rem; color: var(--muted); min-width: 88px; flex-shrink: 0; }
.health-val   { font-size: 0.82rem; color: var(--text); font-weight: 600; }
.health-date  { font-size: 0.68rem; color: var(--muted); font-weight: 400; margin-left: auto; }
.health-asof  { font-size: 0.68rem; color: var(--muted); padding: 2px 12px 4px; }
.health-asof-title { font-size: 0.72rem; font-weight: 700; color: #f43f5e; margin-bottom: 6px;
                    padding-bottom: 5px; border-bottom: 1px solid rgba(255,255,255,.08); }
.h-trend      { font-size: 0.7rem; font-weight: 700; }
.h-good       { color: #22c55e; }
.h-bad        { color: #ef4444; }
.h-date       { font-size: 0.66rem; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* ── RUH → CPT widget ───────────────────────────────────────── */
.ruh-vs-body    { padding: 4px 0; }
.ruh-vs-row     { display: flex; align-items: center; gap: 8px; padding: 7px 0;
                  border-bottom: 1px solid rgba(255,255,255,.05); }
.ruh-vs-row:last-of-type { border-bottom: none; }
.ruh-leading    { background: rgba(251,191,36,.07); border-radius: 8px;
                  margin: 0 -6px; padding-left: 6px; padding-right: 6px; }
.ruh-vs-left    { display: flex; align-items: center; gap: 5px; flex-shrink: 0; min-width: 96px; }
.ruh-vs-emoji   { font-size: 1rem; flex-shrink: 0; }
.ruh-vs-name    { font-size: 0.82rem; font-weight: 700; flex-shrink: 0; min-width: 42px; }
.ruh-iain       { color: #fc4c02; }
.ruh-shaun      { color: #0080ff; }
.ruh-vs-crown   { font-size: 0.82rem; flex-shrink: 0; }
.ruh-vs-bar-wrap{ flex: 1; height: 6px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; }
.ruh-iain-bar   { height: 100%; background: #fc4c02; border-radius: 99px; transition: width .5s; }
.ruh-shaun-bar  { height: 100%; background: #0080ff; border-radius: 99px; transition: width .5s; }
.ruh-vs-stats   { text-align: right; flex-shrink: 0; min-width: 70px; }
.ruh-vs-km      { font-size: 0.82rem; font-weight: 700; color: var(--text); display: block; }
.ruh-vs-sub     { font-size: 0.66rem; color: var(--muted); display: block; }
.ruh-vs-period  { font-size: 0.66rem; color: var(--muted); padding-top: 6px; }
.ruh-vs-empty   { opacity: .7; }

/* RUH tile — 2 lines per rider */
.ruh-r2         { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.ruh-r2:last-of-type { border-bottom: none; }
.ruh-leading    { background: rgba(251,191,36,.07); border-radius: 8px; margin: 0 -6px; padding: 8px 6px; }
.ruh-r2-top     { display: flex; align-items: center; gap: 6px; }
.ruh-r2-top .ruh-vs-emoji { font-size: 1.05rem; }
.ruh-r2-top .ruh-vs-name  { font-size: 0.92rem; font-weight: 700; }
.ruh-r2-top .ruh-vs-crown { font-size: 0.85rem; }
.ruh-r2-pts     { margin-left: auto; font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ruh-r2-pts small { font-size: 0.6rem; font-weight: 600; color: var(--muted); }
.ruh-r2-bot     { margin: 6px 0 4px; }
.ruh-r2-bot .ruh-vs-bar-wrap { height: 7px; }
.ruh-r2-sub     { font-size: 0.68rem; color: var(--muted); }

/* ── AI Investments widget ───────────────────────────────────── */
.ai-body  { padding: 2px 0; }
.ai-row   { display: grid; grid-template-columns: 1.4rem 1fr auto; gap: 6px;
            align-items: baseline; padding: 4px 0;
            border-bottom: 1px solid rgba(255,255,255,.05); font-size: 0.78rem; }
.ai-row:last-child { border-bottom: none; }
.ai-emoji { font-size: 0.9rem; }
.ai-name  { font-weight: 600; color: var(--text); }
.ai-val   { font-size: 0.72rem; font-weight: 700; color: #a78bfa; white-space: nowrap; }
.ai-note  { display: none; }

/* ── FX USD holder labels ────────────────────────────────────── */
.fx-usd-good { font-size: 0.65rem; color: #22c55e; font-weight: 700; margin-left: 3px; }
.fx-usd-bad  { font-size: 0.65rem; color: #ef4444; font-weight: 700; margin-left: 3px; }

/* ── Quote divider ───────────────────────────────────────────── */
.quote-divider { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 8px 0; }

/* ── Fact divider ────────────────────────────────────────────── */
.fact-divider  { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 6px 0; }
.fact-text     { font-size: 0.78rem; color: var(--text); line-height: 1.5; }

/* ── World clock weather ─────────────────────────────────────── */
.world-clock-wx { font-size: 0.78rem; color: #9ca3af; margin: 0 auto 0 6px; white-space: nowrap; }

/* ── Health extras ───────────────────────────────────────────── */
.health-pulse { font-size: 0.72rem; color: var(--muted); font-weight: 400; }

/* ── Anthropic extras ────────────────────────────────────────── */
.anth-founders  { font-size: 0.74rem; color: #9ca3af; margin-bottom: 3px; }
.anth-mission   { font-size: 0.72rem; color: var(--muted); margin-bottom: 6px; font-style: italic; }
.anth-ctx       { font-size: 0.6rem; color: rgba(255,255,255,.4); margin-left: 3px; }
.anth-products  { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; margin-bottom: 5px; }
.anth-product   { font-size: 0.67rem; padding: 2px 7px; background: rgba(255,255,255,.06); border-radius: 99px; color: #9ca3af; }
.anth-invest    { font-size: 0.72rem; color: #9ca3af; margin-bottom: 4px; }

/* ── Countdown widget ────────────────────────────────────────── */
.cd-body    { padding: 2px 0; }
.cd-row     { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.cd-row:last-child { border-bottom: none; }
.cd-emoji   { font-size: 1rem; width: 24px; flex-shrink: 0; text-align: center; }
.cd-name    { font-size: 0.82rem; color: var(--text); flex: 1; }
.cd-days    { font-size: 0.78rem; font-weight: 700; color: var(--muted); min-width: 60px; text-align: right; }
.cd-today   .cd-days { color: #f59e0b; }
.cd-soon    .cd-days { color: #22c55e; }
.cd-near    .cd-days { color: #60a5fa; }
.cd-date    { font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cd-planner { font-size: 0.72rem; opacity: .6; }

/* ── Orders widget ───────────────────────────────────────── */
.rvy-body   { padding: 2px 0; }
.rvy-row    { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 0.78rem;
              border-bottom: 1px solid rgba(255,255,255,.05); }
.rvy-row:last-child { border-bottom: none; }
.rvy-target { flex-shrink: 0; width: 40px; font-size: 0.7rem; color: var(--amber-col); font-weight: 600; }
.rvy-name   { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.rvy-pm     { flex-shrink: 0; font-weight: 700; color: var(--amber-col); font-variant-numeric: tabular-nums; }
.rvy-pm small { font-weight: 400; color: var(--muted); }
.rvy-tick    { color: #2f8a5c; font-weight: 800; }

.ord-body   { padding: 2px 0; }
.ord-empty  { font-size: 0.78rem; color: var(--muted); padding: 10px 0; text-align: center; }
.ord-row    { display: flex; align-items: center; gap: 8px; padding: 6px 0;
              border-bottom: 1px solid rgba(255,255,255,.05); }
.ord-row:last-child { border-bottom: none; }
.ord-icon   { font-size: 1.1rem; width: 22px; flex-shrink: 0; text-align: center; }
.ord-detail { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.ord-item   { font-size: 0.8rem; color: var(--text); white-space: nowrap;
              overflow: hidden; text-overflow: ellipsis; }
.ord-desc   { font-size: 0.67rem; color: var(--muted); white-space: normal; line-height: 1.3; }
.ord-meta   { font-size: 0.67rem; color: var(--muted); }
.ord-status { font-size: 0.67rem; font-weight: 600; padding: 2px 6px; border-radius: 99px;
              white-space: nowrap; }
.ord-pending  { background: rgba(251,191,36,.15);  color: #fbbf24; }
.ord-shipped  { background: rgba(96,165,250,.15);  color: #60a5fa; }
.ord-delivered{ background: rgba(34,197,94,.15);   color: #22c55e; }

/* ── RUH elevation ───────────────────────────────────────── */
.ruh-elev   { font-size: 0.72rem; color: #a78bfa; min-width: 52px; }

/* ── Anthropic articles ──────────────────────────────────── */
.anth-articles { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 4px; }
.anth-article  { font-size: 0.7rem; color: #60a5fa; text-decoration: none;
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anth-article:hover { text-decoration: underline; }
/* My Claude usage */
.anth-usage      { margin: 6px 0; padding: 7px 9px; background: rgba(255,255,255,.03);
                   border: 1px solid var(--border); border-radius: 9px; }
.anth-usage-row  { display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
                   font-size: 0.74rem; padding: 1px 0; }
.anth-usage-lbl  { color: var(--muted); }
.anth-usage-val  { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.anth-usage-tok  { color: var(--muted); font-weight: 400; font-size: 0.66rem; }
.anth-usage-warn { font-size: 0.7rem; font-weight: 700; margin-top: 4px; padding: 3px 7px; border-radius: 6px; }
.anth-usage-warn.anth-usage-warn { background: rgba(245,158,11,.15); color: #f59e0b; }
.anth-usage-over { background: rgba(239,68,68,.18) !important; color: #ef4444 !important; }
.anth-usage-title{ font-size: 0.66rem; color: var(--muted); text-transform: uppercase;
                   letter-spacing: .05em; margin-bottom: 5px; }
.cu-row          { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.cu-lbl          { font-size: 0.7rem; color: var(--muted); width: 56px; flex-shrink: 0; }
.cu-track        { flex: 1; height: 7px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.cu-fill         { height: 100%; border-radius: 99px; transition: width .5s; }
.cu-ok           { background: #22c55e; } .cu-ok.cu-pct   { color: #22c55e; }
.cu-warn         { background: #f59e0b; } .cu-warn.cu-pct { color: #f59e0b; }
.cu-over         { background: #ef4444; } .cu-over.cu-pct { color: #ef4444; }
.cu-pct          { font-size: 0.72rem; font-weight: 800; width: 40px; text-align: right;
                   flex-shrink: 0; font-variant-numeric: tabular-nums; background: none; }
.cu-sub          { font-size: 0.62rem; color: var(--muted); margin-top: 4px; }

/* ── Claude usage (detailed) widget ──────────────────────────── */
.clu-body        { padding: 2px 0; }
.clu-head        { display: flex; gap: 10px; margin-bottom: 8px; }
.clu-big         { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em;
                   font-variant-numeric: tabular-nums; line-height: 1; display: flex;
                   flex-direction: column; gap: 2px; }
.clu-big2        { color: var(--muted); }
.clu-unit        { font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
                   letter-spacing: .08em; color: var(--muted); }
.clu-label       { font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
                   letter-spacing: .07em; color: var(--muted); margin: 9px 0 4px; }
/* per-day bars */
.clu-chart       { display: flex; align-items: flex-end; gap: 5px; height: 42px; }
.clu-day         { flex: 1; display: flex; flex-direction: column; align-items: center;
                   justify-content: flex-end; gap: 3px; height: 100%; }
.clu-bar         { width: 100%; max-width: 16px; background: linear-gradient(#d97706,#f59e0b);
                   border-radius: 3px 3px 0 0; min-height: 2px; }
.clu-dl          { font-size: 0.56rem; color: var(--muted); }
/* per-model rows */
.clu-models      { display: flex; flex-direction: column; gap: 3px; }
.clu-mrow        { display: flex; align-items: center; gap: 7px; font-size: 0.74rem; }
.clu-mdot        { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.clu-opus        { background: #f59e0b; } .clu-sonnet { background: #a78bfa; } .clu-haiku { background: #22c55e; }
.clu-mname       { flex: 1; color: var(--text); }
.clu-mtok        { color: var(--muted); font-variant-numeric: tabular-nums; }
.clu-mcost       { font-weight: 700; font-variant-numeric: tabular-nums; width: 56px; text-align: right; }
/* token split */
.clu-split       { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.clu-srow        { display: flex; justify-content: space-between; font-size: 0.7rem; }
.clu-srow span:first-child { color: var(--muted); }
.clu-srow span:last-child  { font-variant-numeric: tabular-nums; }
.clu-foot        { margin-top: 8px; }

/* ── My Tasks widget ─────────────────────────────────────────── */
.tasks-body     { padding: 4px 0; }
.tasks-empty    { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.tasks-note     { font-size: 0.78rem; color: var(--muted); }
.tasks-connect  { font-size: 0.78rem; color: #60a5fa; text-decoration: none; }
.tasks-connect:hover { text-decoration: underline; }
.tasks-stats    { display: flex; gap: 8px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.tasks-stat     { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.tasks-num      { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.tasks-overdue-num { color: #ef4444; }
.tasks-done-num { color: #22c55e; }
.tasks-label    { font-size: 0.58rem; color: var(--muted); text-transform: uppercase;
                  letter-spacing: .02em; text-align: center; line-height: 1.15; }
.tasks-item     { font-size: 0.78rem; color: var(--text); padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.04);
                  display: flex; align-items: baseline; gap: 6px; }
.tasks-item:last-child { border-bottom: none; }
.tasks-item-done { color: var(--muted); text-decoration: line-through; }
.tasks-check    { color: var(--muted); flex-shrink: 0; transition: color .15s; }
.tasks-clickable { cursor: pointer; border-radius: 6px; padding: 3px 6px; margin: 0 -6px; transition: background .12s; }
.tasks-clickable:hover { background: rgba(34,197,94,.1); }
.tasks-clickable:hover .tasks-check { color: #22c55e; }
.tasks-clickable:hover .tasks-check::before { content: '✓'; }
.tasks-clickable:hover .tasks-check { font-size: 0; }
.tasks-clickable:hover .tasks-check::before { font-size: 0.78rem; }
.tasks-completing { opacity: .5; pointer-events: none; }

/* Completed · last 5 days */
.tasks-5d       { display: flex; gap: 6px; margin-bottom: 8px; padding-bottom: 8px;
                  border-bottom: 1px solid rgba(255,255,255,.08); }
.t5             { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
                  background: rgba(255,255,255,.03); border-radius: 7px; padding: 5px 0; }
.t5-num         { font-size: 0.95rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.t5-day         { font-size: 0.55rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.t5-today       { background: rgba(34,197,94,.12); }
.t5-today .t5-num { color: #22c55e; }

/* ── Security widget ─────────────────────────────────────────── */
.sec-body          { padding: 2px 0; }
.sec-section-label { font-size: 0.65rem; color: var(--muted); text-transform: uppercase;
                     letter-spacing: .07em; margin-bottom: 4px; }
.sec-row           { display: flex; align-items: center; gap: 7px; padding: 4px 0; }
.sec-device        { margin-bottom: 2px; }
.sec-icon          { font-size: 0.78rem; width: 18px; flex-shrink: 0; }
.sec-name          { font-size: 0.8rem; color: var(--text); flex: 1; }
.sec-detail        { font-size: 0.72rem; font-weight: 600; }
.sec-green         { color: #4ade80; }
.sec-amber         { color: #fbbf24; }
.sec-red           { color: #f87171; }
.sec-checks        { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 0 5px 25px; }
.sec-check         { font-size: 0.65rem; padding: 1px 7px; border-radius: 99px; }
.sec-chk-ok        { background: rgba(74,222,128,.12); color: #4ade80; border: 1px solid rgba(74,222,128,.2); }
.sec-chk-fail      { background: rgba(248,113,113,.12); color: #f87171; border: 1px solid rgba(248,113,113,.2); }

/* ── Wall Planner widget ─────────────────────────────────────── */
.wp-body           { padding: 2px 0; }
.wp-entry          { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0 7px 10px;
                     border-left: 3px solid var(--wp-color, #6366f1);
                     margin-bottom: 5px; border-radius: 0 6px 6px 0;
                     background: rgba(255,255,255,.03); }
.wp-today          { background: rgba(255,255,255,.07) !important; }
.wp-date-col       { display: flex; flex-direction: column; align-items: center;
                     min-width: 32px; flex-shrink: 0; }
.wp-day            { font-size: 0.65rem; color: var(--muted); text-transform: uppercase;
                     letter-spacing: .06em; }
.wp-dmy            { font-size: 0.82rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.wp-text           { font-size: 0.78rem; color: #d1d5db; line-height: 1.4; flex: 1; padding-top: 2px; }
.wp-line           { padding: 1px 0; }
.wp-line + .wp-line { border-top: 1px solid rgba(255,255,255,.05); margin-top: 2px; padding-top: 3px; }
.wp-today .wp-dmy  { color: #fbbf24; }
.wp-today .wp-text { color: var(--text); font-weight: 600; }
.wp-empty          { display: flex; flex-direction: column; align-items: center;
                     justify-content: center; padding: 16px 0; gap: 8px; }
.wp-empty-icon     { font-size: 1.6rem; }
.wp-empty-text     { font-size: 0.78rem; color: var(--muted); text-align: center; }
.wp-empty-key      { font-size: 0.68rem; color: #60a5fa; background: rgba(96,165,250,.1);
                     padding: 3px 8px; border-radius: 5px; }

/* ── TickTick Team Sync ─────────────────────────────── */
.tsync-body        { padding: 4px 0; }
.tsync-status      { display: flex; align-items: center; gap: 7px;
                     font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
                     letter-spacing: .06em; margin-bottom: 8px; }
.tsync-dot         { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tsync-active .tsync-dot  { background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.tsync-idle .tsync-dot    { background: #6b7280; }
.tsync-active      { color: #4ade80; }
.tsync-idle        { color: #9ca3af; }
.tsync-stats       { display: flex; gap: 12px; margin-bottom: 8px; }
.tsync-stat        { font-size: 0.75rem; color: var(--muted); }
.tsync-stat b      { color: var(--text); font-weight: 700; margin-right: 2px; }
/* Team Sync — per-person rows */
.tm-row            { display: flex; align-items: center; gap: 6px; padding: 5px 0;
                     border-bottom: 1px solid rgba(255,255,255,.05); text-decoration: none; color: inherit; }
.tm-row:last-child { border-bottom: none; }
.tm-link           { cursor: pointer; border-radius: 7px; margin: 0 -6px; padding: 5px 6px; transition: background .12s; }
.tm-link:hover     { background: rgba(20,184,166,.12); }
.tm-link:hover .tm-name { color: #2dd4bf; }
.tm-name           { font-size: 0.8rem; font-weight: 600; color: var(--text); flex: 1; min-width: 0;
                     white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-kanban         { font-size: 0.55rem; font-weight: 700; background: rgba(36,113,163,.22);
                     color: #6db3e8; border-radius: 4px; padding: 1px 4px; margin-left: 5px; vertical-align: middle; }
.tm-stat           { font-size: 0.66rem; font-weight: 600; padding: 2px 7px; border-radius: 99px;
                     white-space: nowrap; flex-shrink: 0; }
.tm-open           { background: rgba(255,255,255,.06); color: var(--text); }
.tm-late           { background: rgba(239,68,68,.15); color: #ef4444; }
.tm-done           { background: rgba(34,197,94,.13); color: #22c55e; font-variant-numeric: tabular-nums; }
.tm-legend         { font-size: 0.6rem; color: var(--muted); text-align: right; padding-top: 6px;
                     text-transform: uppercase; letter-spacing: .04em; }
.tsync-row         { display: flex; align-items: center; gap: 8px;
                     font-size: 0.78rem; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.tsync-row:last-of-type { border-bottom: none; }
.tsync-tag         { font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
                     padding: 1px 5px; border-radius: 4px;
                     background: rgba(20,184,166,.2); color: #2dd4bf; flex-shrink: 0; }
.tsync-title       { color: #d1d5db; flex: 1; }
.tsync-ts          { font-size: 0.68rem; color: var(--muted); margin-top: 8px; }
.tsync-note        { font-size: 0.78rem; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }
.tsync-open        { display: inline-block; font-size: 0.75rem; color: #60a5fa;
                     text-decoration: none; margin-top: 4px; }
.tsync-open:hover  { text-decoration: underline; }

/* ── Family Flights ─────────────────────────────── */
.fl-body           { padding: 2px 0; }
.fl-row            { display: flex; align-items: center; gap: 8px; padding: 5px 0;
                     border-bottom: 1px solid rgba(255,255,255,.06); }
.fl-row:last-child { border-bottom: none; }
.fl-today          { background: rgba(251,191,36,.06); border-radius: 6px;
                     padding: 5px 8px; margin: 0 -8px; border-bottom: none !important; }
.fl-badge          { font-size: 0.6rem; font-weight: 800; text-transform: uppercase;
                     padding: 2px 5px; border-radius: 4px; flex-shrink: 0;
                     min-width: 38px; text-align: center; letter-spacing: .03em; }
.fl-badge-now      { background: rgba(251,191,36,.25); color: #fbbf24; }
.fl-badge-soon     { background: rgba(239,68,68,.2);   color: #f87171; }
.fl-badge-near     { background: rgba(59,130,246,.2);  color: #60a5fa; }
.fl-badge-far      { background: rgba(107,114,128,.15);color: #9ca3af; }
.fl-route-col      { flex: 1; min-width: 0; }
.fl-route          { font-size: 0.76rem; color: var(--text); white-space: nowrap; }
.fl-route b        { font-weight: 700; }
.fl-arr            { color: var(--muted); font-weight: 400; }
.fl-status         { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
                     margin-right: 6px; vertical-align: middle; flex-shrink: 0; }
.fl-status-ok      { background: #22c55e; }
.fl-status-bad     { background: #ef4444; box-shadow: 0 0 5px rgba(239,68,68,.7); }
.fl-via            { display: block; font-size: 0.62rem; color: var(--muted); margin-top: 1px; }
.fl-meta           { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; flex-shrink: 0; }
.fl-num            { font-size: 0.64rem; color: var(--muted); font-family: monospace; letter-spacing: .04em; }
.fl-ref            { font-size: 0.62rem; color: #d4a72c; font-family: monospace; letter-spacing: .06em; font-weight: 700; }
.fl-time           { font-size: 0.7rem; font-weight: 700; color: var(--text); }
.fl-pax-row        { display: flex; gap: 3px; flex-shrink: 0; }
.fl-pax            { width: 18px; height: 18px; border-radius: 50%; display: flex;
                     align-items: center; justify-content: center;
                     font-size: 0.58rem; font-weight: 800; flex-shrink: 0; }
.fl-iain           { background: rgba(59,130,246,.3);  color: #93c5fd; }
.fl-julia          { background: rgba(167,139,250,.3); color: #c4b5fd; }
.fl-emily          { background: rgba(74,222,128,.3);  color: #86efac; }
.fl-luca           { background: rgba(251,191,36,.3);  color: #fcd34d; }
.fl-max            { background: rgba(251,146,60,.3);  color: #fdba74; }
.fl-term           { font-size: 0.6rem; color: var(--muted); background: rgba(255,255,255,.06);
                     border-radius: 5px; padding: 1px 6px; white-space: nowrap; flex-shrink: 0; }
.fl-more           { font-size: 0.66rem; color: var(--muted); text-align: right; padding-top: 6px; }
/* Portfolio widget */
.pf-total          { background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 10px;
                     padding: 10px 12px; margin-bottom: 8px; }
.pf-total-l        { font-size: 0.62rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.pf-held           { color: var(--muted); opacity: .8; margin-left: 4px; text-transform: none; }
.pf-total-r        { font-size: 1.25rem; font-weight: 800; margin-top: 2px; }
.pf-total-pct      { font-size: 0.8rem; font-weight: 700; margin-left: 4px; }
.pf-total-val      { font-size: 0.66rem; color: var(--muted); margin-top: 2px; }
.pf-total-cost     { opacity: .75; margin-left: 4px; }
.pf-rows           { display: flex; flex-direction: column; gap: 2px; }
.pf-row            { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 7px;
                     text-decoration: none; color: var(--text); transition: background .12s; }
.pf-row:hover      { background: rgba(255,255,255,.05); }
.pf-emoji          { font-size: 0.95rem; flex-shrink: 0; }
.pf-name           { flex: 1; min-width: 0; font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-co             { color: var(--muted); }
.pf-px             { font-size: 0.74rem; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.pf-day            { font-size: 0.64rem; margin-left: 4px; }
.pf-ret            { font-size: 0.74rem; font-weight: 700; min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.pf-pending        { color: var(--muted); font-weight: 500; font-size: 0.6rem; text-transform: uppercase; letter-spacing: .4px; }
/* Reviews widget */
.rv-total          { margin-bottom: 10px; }
.rv-total-main     { font-size: 0.8rem; color: var(--muted); }
.rv-done           { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.rv-todo-tag       { font-size: 0.66rem; color: #f59e0b; background: rgba(245,158,11,.14);
                     border-radius: 20px; padding: 1px 8px; margin-left: 6px; }
.rv-bar            { display: block; height: 6px; background: rgba(255,255,255,.08);
                     border-radius: 99px; overflow: hidden; margin-top: 6px; }
.rv-bar > span     { display: block; height: 100%; background: #22c55e; border-radius: 99px; }
.rv-rows           { display: flex; flex-direction: column; gap: 7px; }
.rv-row            { display: flex; align-items: center; gap: 8px; }
.rv-emoji          { font-size: 0.9rem; flex-shrink: 0; }
.rv-name           { font-size: 0.72rem; white-space: nowrap; flex-shrink: 0; min-width: 76px; }
.rv-bar-sm         { flex: 1; margin-top: 0; height: 5px; }
.rv-nums           { font-size: 0.7rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rv-nums b         { color: var(--text); }
.rv-todo           { color: #f59e0b; margin-left: 3px; }
.rv-clear          { color: #22c55e; margin-left: 3px; }
.pf-up             { color: #22c55e; }
.pf-dn             { color: #f43f5e; }
/* Track & Trace widget */
.tt-tot            { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; font-size: 0.72rem; color: var(--muted); }
.tt-b              { background: rgba(255,255,255,.05); border-radius: 20px; padding: 2px 9px; }
.tt-b b            { color: var(--text); }
.tt-over           { color: #f43f5e; } .tt-amber { color: #f59e0b; } .tt-high { color: #a78bfa; }
.tt-rows           { display: flex; flex-direction: column; gap: 2px; }
.tt-row            { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 0.76rem; }
.tt-dot            { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tt-dot.rag-red    { background: #f43f5e; } .tt-dot.rag-amber { background: #f59e0b; } .tt-dot.rag-green { background: #22c55e; }
.tt-name           { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-c              { font-weight: 700; font-variant-numeric: tabular-nums; }
.tt-mini           { font-size: 0.62rem; font-weight: 700; }
.tt-nd             { font-size: 0.66rem; color: var(--muted); min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.fl-empty          { font-size: 0.78rem; color: var(--muted); padding: 16px 0; text-align: center; }

/* ── Planet System widget ── */
.planet-stages { display: flex; flex-direction: column; gap: 5px; }
.planet-row { display: flex; justify-content: space-between; font-size: 13px; }
.planet-row b { font-variant-numeric: tabular-nums; }
.planet-flag { margin-top: 9px; font-size: 12px; color: #b3542e; }
