/* ─────────────────────────────────────────────────────────────────────────
   Dev Task Dashboard — calm, modern, low-chrome.
   Soft canvas · one accent · whitespace over borders · subtle depth.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  /* ── Brand anchor: deep navy ── */
  --navy-900: #0a1d32;
  --navy-800: #0f2740;   /* sidebar, primary surfaces dark */
  --navy-700: #16344f;

  /* ── Accent: teal (single interactive hue, full scale) ── */
  --teal-50:  #e6f5f4;
  --teal-100: #c4e8e6;
  --teal-200: #8fd4d1;
  --teal-500: #0e8f8f;   /* primary actions */
  --teal-600: #0c7d7d;
  --teal-700: #0a6a6b;

  /* ── Neutrals: cool greys tinted toward navy so they harmonize ── */
  --ink:    #16202e;     /* primary text */
  --muted:  #4c5765;     /* secondary text */
  --faint:  #7a8593;     /* tertiary / placeholders */
  --canvas: #f4f6f9;     /* page background */
  --surface:#ffffff;     /* panels / cards */
  --line:   #e1e6ee;     /* hairlines */
  --soft:   #eef1f6;     /* inset / readonly / hover */

  /* ── Semantic (same tonal weight as the accent) ── */
  --ok:     #0f8a52; --ok-bg:     #e3f5ec;
  --warn:   #b06d05; --warn-bg:   #fbefda;
  --danger: #c93d3d; --danger-bg: #fbe8e8;
  --info:   #2563c9; --info-bg:   #e7eefb;

  /* Back-compat aliases (older rules reference these) */
  --navy: var(--navy-800);
  --accent: var(--teal-500);
  --accent-600: var(--teal-600);
  --accent-soft: var(--teal-50);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(10,29,50,.06);
  --shadow: 0 1px 3px rgba(10,29,50,.07), 0 8px 24px rgba(10,29,50,.06);
  --shadow-lg: 0 12px 40px rgba(10,29,50,.16);
  --sidebar-w: 240px; --topbar-h: 60px; --maxw: 1080px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.015em; font-weight: 700; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; }
.mono { font-family: ui-monospace, "Cascadia Code", monospace; }

/* ── App shell ── */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.sidebar .brand { display: flex; align-items: center; gap: 11px; color: var(--ink);
  font-weight: 700; font-size: 14.5px; padding: 18px 18px; }
.sidebar .brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; display: grid; place-items: center; flex: none; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.brand .sub { color: var(--faint); font-weight: 500; font-size: 12px; display: block; }

.side-nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; }
.side-nav .nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--faint); padding: 16px 10px 6px; font-weight: 700; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px;
  border-radius: var(--radius-sm); color: var(--muted); font-size: 14px; font-weight: 500; }
.side-nav a:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.side-nav a.active { background: var(--accent-soft); color: var(--accent-600); font-weight: 600; }
.side-nav a .ico { width: 18px; height: 18px; flex: none; }
.side-nav a .ico-ext { width: 13px; height: 13px; margin-left: auto; opacity: .5; }

.side-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.side-foot .who { color: var(--ink); font-weight: 600; }
.side-foot .email { color: var(--faint); font-size: 12px; word-break: break-all; margin-bottom: 10px; }
.side-foot .clk { margin-bottom: 12px; }
.side-foot .btn.block { width: 100%; }

/* ── Top bar ── */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  background: rgba(247,249,252,.8); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.topbar .crumb { color: var(--muted); font-size: 13.5px; }
.topbar .crumb b { color: var(--ink); }
.topbar .crumb a { color: var(--muted); }
.topbar .crumb .sep { color: var(--faint); margin: 0 4px; }
.topbar .topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar .right { display: flex; align-items: center; gap: 12px; }

.content { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 28px; }

/* Hamburger only exists on mobile; hidden on desktop (high specificity so it
   beats the base .btn display rule). */
.menu-btn.menu-btn { display: none; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .content { margin-left: 0; }
  .menu-btn.menu-btn { display: inline-flex; }
}

/* ── Headings ── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; }
.page-head .lead { color: var(--muted); margin: 0; font-size: 14px; }

.task-head { margin-bottom: 24px; }
.task-head h1 { margin: 4px 0 10px; font-size: 26px; line-height: 1.2; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--accent);
  text-transform: uppercase; font-family: ui-monospace, monospace; }
.task-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.owner-chip { font-size: 13px; color: var(--muted); }
.owner-chip::before { content: "Owner: "; color: var(--faint); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn.danger { background: #fff; border-color: var(--danger-bg); color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.block { flex: 1; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }
.inline { display: inline; }

/* ── Pills / badges ── */
.badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.status-pill { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  background: var(--soft); color: var(--muted); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; }
/* Status pills: cohesive ramp — neutral → info → teal-active → done */
.status-new { background: var(--soft); color: var(--muted); }
.status-ready { background: var(--info-bg); color: var(--info); }
.status-in-progress { background: var(--teal-50); color: var(--teal-700); }
.status-completed { background: var(--ok-bg); color: var(--ok); }

/* ── Due-date badges ── */
.due-badge { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  white-space: nowrap; align-self: flex-start; }
.due-overdue { background: var(--danger-bg); color: var(--danger); }
.due-soon { background: var(--warn-bg); color: var(--warn); }
.due-ok { background: var(--soft); color: var(--muted); }

/* ── Flash ── */
.flash { padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; }
.flash.success { background: var(--ok-bg); color: #0d5b34; }
.flash.error { background: var(--danger-bg); color: #8c2420; }

/* ── Clockify connect banner ── */
.clockify-connect { background: var(--accent-soft); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 22px; }
.clockify-connect .row { display: flex; gap: 14px; align-items: center;
  justify-content: space-between; flex-wrap: wrap; }

/* ── Dashboard cards ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ticket { background: var(--surface); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 11px;
  transition: box-shadow .15s, transform .08s; min-width: 0; }
.ticket:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.ticket .t-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ticket .t-num { font-size: 12px; color: var(--faint); font-weight: 700;
  font-family: ui-monospace, monospace; }
.ticket h3 { margin: 0; font-size: 15.5px; line-height: 1.35; }
.ticket h3 a { color: var(--ink); }
.ticket .t-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.ticket .t-meta .v { color: var(--ink); font-weight: 500; }
.ticket .t-repo { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted);
  background: var(--soft); padding: 4px 9px; border-radius: 7px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ticket .t-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.empty { background: var(--surface); border-radius: var(--radius); padding: 56px;
  text-align: center; color: var(--muted); box-shadow: var(--shadow-sm); }

/* ── Task page layout: main work + quiet side rail ── */
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 28px; align-items: start; }
.task-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.task-rail { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 900px) { .task-layout { grid-template-columns: 1fr; } }

/* ── The single hero action ── */
.action-hero { background: var(--surface); border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; }
.action-hero.is-mine { background: linear-gradient(180deg, #fff, #fbfdff);
  border: 1px solid var(--line); box-shadow: none; }
.action-hero.is-blocked { background: var(--danger-bg); }
.hero-text { display: flex; flex-direction: column; gap: 3px; }
.hero-text strong { font-size: 15px; color: var(--ink); }
.hero-text span { font-size: 13px; color: var(--muted); }
.btn.lg { padding: 11px 20px; font-size: 15px; font-weight: 600; border-radius: var(--radius-sm); }

.timer-block { width: 100%; }
.timer-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tb-tag { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; min-width: 170px; background: var(--surface); color: var(--ink); }
.tb-status { display: block; margin-top: 10px; font-size: 13px; color: var(--faint); font-weight: 500; }
.tb-status.live { color: var(--ok); font-weight: 600; }
.tb-status.err { color: var(--danger); }

/* ── Panels (calm content blocks) ── */
.panel { background: var(--surface); border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--shadow-sm); min-width: 0; }
.panel-h { margin: 0 0 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; }

/* Attachments list (right rail) */
.attach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.attach-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm);
  text-decoration: none; transition: background .12s; }
.attach-row:hover { background: var(--soft); text-decoration: none; }
.attach-ico { flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--teal-50);
  color: var(--teal-700); display: grid; place-items: center; font-size: 9px; font-weight: 800;
  letter-spacing: .02em; }
.attach-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.attach-name { color: var(--ink); font-size: 13.5px; font-weight: 500; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.attach-size { color: var(--faint); font-size: 12px; }
.attach-dl { color: var(--faint); flex: none; }
.attach-row:hover .attach-dl { color: var(--teal-600); }

/* Confirmed / read-only banner */
.confirmed-banner { display: flex; align-items: center; gap: 12px;
  background: var(--ok-bg); color: #0d5b34; border-radius: var(--radius);
  padding: 16px 18px; }
.confirmed-banner svg { color: var(--ok); flex: none; }
.confirmed-banner strong { display: block; font-size: 14.5px; }
.confirmed-banner span { font-size: 13px; color: #2c6e4c; }

/* Internal notes — highlighted callout (direct dev guidance) */
.notes-panel { background: var(--teal-50); border-left: 4px solid var(--teal-500);
  box-shadow: none; }
.notes-h { display: flex; align-items: center; gap: 7px; color: var(--teal-700); }
.notes-panel .richtext { color: var(--ink); }

/* ── Side-rail cards ── */
.rail-card { background: var(--surface); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.rail-card.subtle { background: transparent; box-shadow: none; padding: 4px 16px; }
.rail-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--faint); font-weight: 700; }
.status-form { display: flex; flex-direction: column; gap: 10px; }
.btn.danger-outline { background: #fff; border-color: #f0c4c2; color: var(--danger); font-weight: 600; }
.btn.danger-outline:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ── Facts list ── */
.facts { margin: 0; display: grid; grid-template-columns: 70px 1fr; gap: 9px 12px; align-items: baseline; }
.facts dt { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  font-weight: 600; }
.facts dd { margin: 0; color: var(--ink); font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere; }

.repo-link { font-size: 13px; overflow-wrap: anywhere; }

/* ── Status select ── */
.status-select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: var(--surface); color: var(--ink); }

/* ── Generic form fields ── */
.field { display: block; margin-bottom: 16px; }
.field .lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit;
  color: var(--ink); background: var(--surface); }
.field input:focus, .field select:focus, .status-select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { background: var(--soft); color: var(--muted); }
.form-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

/* ── Rich text ── */
.richtext { font-size: 14.5px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere;
  overflow: hidden; }
/* Any image in a memo — raw <img> from the HTML or our generated ones — is
   clamped to the card width so oversized attachments can't blow out the layout. */
.richtext img { max-width: 100% !important; height: auto !important; display: block; }
.richtext table { max-width: 100%; display: block; overflow-x: auto; }
.richtext p { margin: 0 0 12px; }
.richtext p:last-child { margin-bottom: 0; }
.richtext ul, .richtext ol { margin: 0 0 12px; padding-left: 20px; }
.richtext li { margin: 3px 0; }
.richtext a { color: var(--accent); overflow-wrap: anywhere; }
.richtext code { background: var(--soft); padding: 1px 5px; border-radius: 5px;
  font-family: ui-monospace, monospace; font-size: 13px; }
.richtext pre { background: var(--soft); padding: 12px; border-radius: var(--radius-sm); overflow: auto; }
.richtext blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--line); color: var(--muted); }
.memo-img { max-width: 100%; height: auto; border-radius: var(--radius-sm);
  margin: 8px 0; display: block; }
.memo-img-fallback { display: inline-block; font-size: 12px; color: var(--faint);
  background: var(--soft); padding: 2px 8px; border-radius: 6px; margin: 2px 0; }
.gh-ico { flex: none; }

/* ── Sign-in ── */
.signin { max-width: 400px; margin: 11vh auto; text-align: center; }
.signin .panel { padding: 40px 32px; }
.signin .mark-lg { width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 18px;
  display: grid; place-items: center; font-weight: 800; font-size: 22px; color: #fff; background: var(--navy); }
.signin h1 { font-size: 21px; margin: 0 0 6px; }
.signin p { color: var(--muted); margin: 0 0 24px; }

/* ── Count chip ── */
.count-chip { font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }

/* ── Table controls (search / status / sort) ── */
.table-controls { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.ctrl-search { flex: 1; min-width: 220px; padding: 9px 13px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: var(--ink); }
.ctrl-select { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; background: var(--surface); color: var(--ink); cursor: pointer; }
.ctrl-search:focus, .ctrl-select:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }

/* ── Tickets table ── */
.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; }
table.tickets { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tickets thead th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
  border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
table.tickets thead th[data-sort]:hover { color: var(--ink); }
table.tickets thead th.sorted-asc::after { content: " ↑"; color: var(--accent); }
table.tickets thead th.sorted-desc::after { content: " ↓"; color: var(--accent); }
table.tickets thead th.col-actions { cursor: default; }
table.tickets tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tickets tbody tr:last-child td { border-bottom: 0; }
table.tickets tbody tr.trow { cursor: pointer; transition: background .12s; }
table.tickets tbody tr.trow:hover { background: var(--teal-50); }
table.tickets tbody tr.trow:hover .row-title { color: var(--teal-700); }
table.tickets tbody tr.trow:hover .row-chevron { color: var(--teal-600); transform: translateX(3px); }
.col-num { width: 96px; color: var(--faint); font-size: 12.5px; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-title { color: var(--ink); font-weight: 600; }
.cell-owner { color: var(--muted); }
.cell-from { color: var(--muted); font-size: 13px; max-width: 200px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cell-from a { color: var(--accent); }
.row-chevron { color: var(--faint); font-size: 22px; line-height: 1; font-weight: 400;
  display: inline-block; transition: transform .12s, color .12s; }

/* Modern pill-style action button */
.btn-pill { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--teal-500); color: #fff; border: 0; padding: 7px 14px; border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 600; transition: background .12s, transform .04s; }
.btn-pill:hover { background: var(--teal-600); }
.btn-pill:active { transform: translateY(1px); }
.btn-pill svg { margin-left: -2px; }
.btn-pill.ghost { background: var(--soft); color: var(--faint); cursor: not-allowed; }
.btn-pill.open-pill { background: var(--soft); color: var(--teal-700); text-decoration: none; }
.btn-pill.open-pill:hover { background: var(--teal-50); }
.open-pill { display: none; } /* desktop: row-click + chevron suffice */

/* ── Payment badge (Completed tab) ── */
.pay-badge { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pay-badge.confirmed { background: var(--ok-bg); color: var(--ok); }
.pay-badge.pending { background: var(--soft); color: var(--muted); }

/* ── Toasts (bottom-right; lifted above the floating timer when present) ── */
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
body:has(.float-timer) .toast-stack { bottom: 92px; }
.toast { background: var(--navy-800); color: #fff; padding: 11px 16px 11px 15px;
  border-left: 4px solid var(--teal-500); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-size: 14px; max-width: 320px; animation: toast-in .18s ease-out; }
.toast.success { border-left-color: var(--teal-500); }
.toast.error { border-left-color: var(--danger); }
.toast.fade-out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .toast-stack { right: 12px; bottom: 12px; left: 12px; align-items: stretch; } }

/* ── Floating timer (task page, bottom-right) ── */
.float-timer { position: fixed; right: 22px; bottom: 22px; z-index: 55;
  display: flex; align-items: center; gap: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px;
  box-shadow: var(--shadow); animation: ft-rise .2s ease-out; }
.float-timer.is-running { border-color: var(--teal-200);
  background: linear-gradient(180deg, #fff, var(--teal-50)); }
@keyframes ft-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.timer-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; }
.float-timer.is-running .timer-dot { background: var(--teal-500);
  box-shadow: 0 0 0 0 rgba(14,143,143,.5); animation: ft-pulse 2s infinite; }
@keyframes ft-pulse { 0% { box-shadow: 0 0 0 0 rgba(14,143,143,.5); }
  70% { box-shadow: 0 0 0 8px rgba(14,143,143,0); } 100% { box-shadow: 0 0 0 0 rgba(14,143,143,0); } }
.ft-main { display: flex; flex-direction: column; line-height: 1.2; }
.timer-clock { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums;
  font-family: ui-monospace, monospace; color: var(--ink); letter-spacing: -.02em; }
.timer-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.tag-select { padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; min-width: 140px; background: var(--surface); color: var(--ink); }
.tag-select:disabled { background: var(--soft); color: var(--muted); }
.float-timer .btn { padding: 8px 13px; }
@media (max-width: 560px) {
  .float-timer { right: 12px; left: 12px; bottom: 12px; flex-wrap: wrap; }
  .tag-select { flex: 1; }
}

/* ── Modal ── */
.modal-root[hidden] { display: none; }
.modal-root { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,29,50,.45);
  backdrop-filter: blur(2px); animation: fade-in .15s ease-out; }
.modal { position: relative; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 26px; width: min(440px, calc(100vw - 40px));
  animation: modal-in .18s cubic-bezier(.2,.7,.3,1); }
.modal-title { margin: 0 0 8px; font-size: 18px; }
.modal-body { margin: 0 0 22px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ── Admin "view as" dropdown ── */
.viewas { position: relative; }
.viewas-btn { display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 7px 12px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.viewas-btn:hover { background: var(--soft); }
.viewas-active { color: var(--teal-700); }
.viewas-menu { position: absolute; right: 0; top: calc(100% + 6px); width: 280px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 10px; }
.viewas-menu[hidden] { display: none; }
.viewas-search { width: 100%; padding: 8px 11px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; margin-bottom: 8px; }
.viewas-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.viewas-clear { width: 100%; text-align: left; background: var(--soft); border: 0; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--muted); padding: 7px 10px; border-radius: var(--radius-sm);
  margin-bottom: 8px; }
.viewas-clear:hover { color: var(--ink); }
.viewas-list { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.viewas-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  background: none; border: 0; cursor: pointer; text-align: left; padding: 8px 10px;
  border-radius: var(--radius-sm); font: inherit; width: 100%; }
.viewas-item:hover { background: var(--teal-50); }
.vi-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.vi-email { font-size: 12px; color: var(--faint); }
.viewas-empty { color: var(--faint); font-size: 13px; padding: 10px; text-align: center; }

/* ── Impersonation banner ── */
.impersonation-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--warn-bg); color: #6b4505; font-size: 13.5px; padding: 9px 28px; }
.impersonation-bar .link { color: #6b4505; font-weight: 700; text-decoration: underline; }

/* ── Earnings page ── */
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 10px 14px; margin-bottom: 18px; }
.period-arrow { width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: 10px; font-size: 22px; color: var(--ink); background: var(--soft);
  text-decoration: none; line-height: 1; }
.period-arrow:hover { background: var(--teal-50); color: var(--teal-700); text-decoration: none; }
.period-arrow.disabled { color: var(--faint); background: transparent; cursor: default; }
.period-center { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.period-label { font-weight: 700; font-size: 15px; color: var(--ink); }
.period-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--teal-700); background: var(--teal-50); padding: 1px 8px; border-radius: 999px; }

.period-entries { width: 100%; border-collapse: collapse; font-size: 14px; }
.period-entries td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.period-entries tr:last-child td { border-bottom: 0; }
.pe-date { width: 64px; color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.pe-desc { color: var(--ink); }
.pe-dur { width: 80px; text-align: right; white-space: nowrap; color: var(--muted);
  font-variant-numeric: tabular-nums; }

.earn-hero { background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); color: #fff;
  border-radius: var(--radius); padding: 32px 28px; margin-bottom: 18px; box-shadow: var(--shadow); }
.earn-period { font-size: 13px; color: #9fb6cf; font-weight: 600; }
.earn-amount { font-size: 44px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px;
  font-variant-numeric: tabular-nums; }
.earn-amount.muted { color: #6f8aa8; }
.earn-sub { font-size: 13px; color: #9fb6cf; }

.earn-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 3px; }
.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  font-weight: 700; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 12px; color: var(--faint); }
.earn-note { font-size: 13px; color: var(--muted); }
@media (max-width: 700px) {
  .earn-stats { grid-template-columns: 1fr; }
  .earn-amount { font-size: 36px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE — phones & small tablets. Sidebar already collapses to a drawer at
   900px; below 700px we tune spacing, stack controls, and turn the data table
   into tap-friendly cards so devs can triage and pick up on the move.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  .container { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
  .topbar .right { display: none; } /* the connect hint; banner still shows below */
  .page-head { gap: 10px; }
  .page-head h1 { font-size: 21px; }
  .task-head h1 { font-size: 21px; }

  /* Filter/sort controls stack full-width */
  .table-controls { flex-direction: column; gap: 8px; }
  .ctrl-search, .ctrl-select { width: 100%; min-width: 0; }

  /* Table → clean ticket cards (not a relabeled table).
     Note: selectors are scoped to `table.tickets tbody` so they outweigh the
     desktop `table.tickets tbody td` rules (borders, padding). */
  .table-wrap { background: transparent; box-shadow: none; overflow: visible; }
  table.tickets thead { display: none; }
  table.tickets, table.tickets tbody { display: block; }
  table.tickets tbody tr.trow {
    display: block; background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 12px;
  }
  /* Reset every cell first: no borders, no padding, left-aligned */
  table.tickets tbody td {
    display: block; padding: 0; border-bottom: 0; text-align: left; vertical-align: baseline;
  }
  table.tickets tbody td::before { display: none; }

  table.tickets tbody td[data-label="Task"] { color: var(--faint); font-size: 12px;
    font-weight: 700; letter-spacing: .02em; margin-bottom: 4px; }
  table.tickets tbody td[data-label="Title"] { margin-bottom: 12px; }
  table.tickets tbody td[data-label="Title"] .row-title { font-size: 16px; font-weight: 700;
    line-height: 1.3; color: var(--ink); display: block; }
  table.tickets tbody td[data-label="Owner"] { color: var(--muted); font-size: 13px; margin-top: 10px; }
  table.tickets tbody td[data-label="Owner"]::before { content: "Owner · "; color: var(--faint); display: inline; }

  /* Badge cells flow inline on one wrapping row */
  table.tickets tbody td[data-label="Status"],
  table.tickets tbody td[data-label="Due"],
  table.tickets tbody td[data-label="Payment"] {
    display: inline-flex; margin: 0 6px 0 0; vertical-align: middle;
  }

  /* Actions: full-width tap target on its own line.
     Must reset the desktop `.col-actions { width:1%; nowrap; text-align:right }`. */
  table.tickets tbody td.col-actions {
    display: block; width: auto; white-space: normal; text-align: left; margin-top: 14px;
  }
  table.tickets tbody td.col-actions .row-chevron { display: none; }
  table.tickets tbody td.col-actions .js-pickup { display: block; width: 100%; }
  table.tickets tbody td.col-actions .btn-pill {
    display: flex; width: 100%; box-sizing: border-box;
    justify-content: center; padding: 12px; font-size: 14px; }

  /* Task detail: side rail already stacks under main at 900px; tighten cards */
  .panel { padding: 18px 16px; }
  .rail-card { padding: 14px; }

  /* Floating timer → full-width docked bar, controls wrap and grow */
  .float-timer { right: 10px; left: 10px; bottom: 10px; gap: 10px; padding: 10px 12px; }
  .float-timer .ft-main { order: -1; }
  .float-timer .tag-select { flex: 1 1 100%; order: 3; }
  .float-timer .btn { flex: 1; }
  .timer-clock { font-size: 22px; }

  /* Modal fills more of the screen, actions stack */
  .modal { width: calc(100vw - 28px); padding: 22px; }

  /* Comfortable tap targets everywhere */
  .btn { padding: 10px 15px; }
  .btn.small { padding: 8px 12px; }
}

/* Honor reduced-motion preferences (mobile users often enable this) */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===========================================================================
   MyCTO - portal-specific components layered on the dev-dash design system.
   Same tokens (navy + teal accent), same calm low-chrome feel.
   =========================================================================== */

/* -- Login (Microsoft + email code) -- */
.auth-wrap { max-width: 440px; margin: 9vh auto; }
.auth-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 36px 34px; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 22px; }
.auth-brand img { width: 40px; height: 40px; object-fit: contain; }
.auth-brand b { font-size: 18px; color: var(--ink); }
.auth-brand .sub { display: block; font-size: 12px; color: var(--faint); font-weight: 500; }
.auth-card h1 { font-size: 20px; margin: 0 0 4px; text-align: center; }
.auth-card .lead { color: var(--muted); text-align: center; margin: 0 0 22px; font-size: 14px; }
.btn-ms { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--navy-800); color: #fff; border: 0; padding: 12px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.btn-ms:hover { background: var(--navy-700); text-decoration: none; }
.btn-ms svg { width: 18px; height: 18px; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin: 20px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-card .field input { padding: 11px 13px; }
.auth-card .btn.primary { width: 100%; padding: 12px; font-weight: 600; font-size: 15px; }
.code-input { letter-spacing: .5em; text-align: center; font-size: 22px !important;
  font-family: ui-monospace, monospace; font-weight: 700; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }

/* -- Dashboard stat grid -- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; margin-bottom: 22px; }
.dash-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile .t-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; }
.tile .t-value { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; }
.tile .t-hint { font-size: 12.5px; color: var(--faint); }
.tile.accent { background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); color: #fff; }
.tile.accent .t-label { color: #9fb6cf; }
.tile.accent .t-value { color: #fff; }
.tile.accent .t-hint { color: #9fb6cf; }
.tile a { color: inherit; }

/* -- Hours gauge (monthly limiter) -- */
.gauge { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 22px 24px; }
.gauge-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; flex-wrap: wrap; }
.gauge-head .g-num { font-size: 26px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.gauge-head .g-num .of { color: var(--faint); font-size: 16px; font-weight: 600; }
.gauge-bar { height: 12px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 999px; background: var(--teal-500); transition: width .4s; }
.gauge.over .gauge-fill { background: var(--danger); }
.gauge.warn .gauge-fill { background: var(--warn); }
.gauge-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px;
  color: var(--muted); }
.gauge-over-pill { background: var(--danger-bg); color: var(--danger); font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; }

/* -- Facts / definition rows used across pages -- */
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 12px 18px; align-items: start; }
.kv dt { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  font-weight: 700; padding-top: 2px; }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; gap: 4px 0; } .kv dd { margin-bottom: 10px; } }

/* -- CTO-type radio cards (Engagement page) -- */
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.choice-card { position: relative; border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: border-color .12s, background .12s; }
.choice-card:hover { border-color: var(--teal-200); }
.choice-card input { position: absolute; opacity: 0; }
.choice-card:has(input:checked) { border-color: var(--teal-500); background: var(--teal-50); }
.cc-title { font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px; }
.cc-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.cc-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.choice-card:has(input:checked) .cc-dot { border-color: var(--teal-500); background: var(--teal-500);
  box-shadow: inset 0 0 0 3px #fff; }

/* -- Contact / people cards -- */
.person-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px 22px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar { width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--teal-50); color: var(--teal-700); font-weight: 800; font-size: 19px; }
.person-meta { flex: 1; min-width: 0; }
.person-meta .pn { font-size: 16px; font-weight: 700; color: var(--ink); }
.person-meta .pe { font-size: 13px; color: var(--muted); word-break: break-all; }
.person-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.support-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.support-row:last-child { border-bottom: 0; }
.support-row .sr-l { font-weight: 600; color: var(--ink); }
.support-row .sr-d { font-size: 12.5px; color: var(--faint); }

/* -- Contacts list -- */
.contact-list { display: flex; flex-direction: column; }
.contact-row { display: flex; align-items: center; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--line); }
.contact-row:last-child { border-bottom: 0; }
.contact-row .cr-name { font-weight: 600; color: var(--ink); }
.contact-row .cr-sub { font-size: 12.5px; color: var(--faint); }
.contact-row .cr-tags { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* -- Billing: invoices + subscription -- */
.sub-list { display: flex; flex-direction: column; }
.sub-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sub-row:last-child { border-bottom: 0; }
.sub-row .sub-name { font-weight: 600; color: var(--ink); }
.sub-row .sub-meta { font-size: 12.5px; color: var(--faint); }
.sub-row .sub-amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.sub-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 999px; }
.sub-kind.seat { background: var(--teal-50); color: var(--teal-700); }
.sub-kind.addon { background: var(--info-bg); color: var(--info); }
.inv-status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.inv-paid { background: var(--ok-bg); color: var(--ok); }
.inv-open { background: var(--warn-bg); color: var(--warn); }
.inv-void { background: var(--soft); color: var(--muted); }

/* -- Section heading inside a page -- */
.section-h { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 700; margin: 26px 0 12px; }
.panel + .panel { margin-top: 16px; }
.muted-note { font-size: 13px; color: var(--muted); background: var(--soft); border-radius: var(--radius-sm);
  padding: 12px 14px; }

/* -- Account picker (login: multiple accounts) -- */
.choose-list { display: flex; flex-direction: column; gap: 8px; }
.choose-row { display: flex; align-items: center; gap: 14px; width: 100%; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; font: inherit; text-align: left; transition: border-color .12s, background .12s; }
.choose-row:hover { border-color: var(--teal-500); background: var(--teal-50); }
.choose-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.choose-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.choose-role { font-size: 12.5px; color: var(--faint); }
.choose-arrow { color: var(--faint); font-size: 18px; font-weight: 700; }
.choose-row:hover .choose-arrow { color: var(--teal-600); }

/* -- Assigned-CTO card with "how I work" footer -- */
.cto-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; }
.cto-card .cto-card-head { box-shadow: none; border-radius: 0; }
.cto-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--soft); }
.cto-foot-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cto-foot-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--faint); font-weight: 700; }
.cto-foot-type { font-size: 15px; font-weight: 700; color: var(--teal-700); }
.cto-foot-desc { font-size: 13px; color: var(--muted); }

/* A little extra breathing room above a section heading that follows a card. */
.section-h.spaced { margin-top: 32px; }

/* -- Subscription total banner (entitlement page) -- */
.total-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-top: 18px; padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); color: #fff; }
.total-banner .tb-label { display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: #9fb6cf; font-weight: 700; }
.total-banner .tb-sub { display: block; font-size: 13px; color: #9fb6cf; margin-top: 2px; }
.total-banner .tb-sub a { color: #c4e8e6; }
.total-banner .tb-amount { font-size: 30px; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; }
.total-banner .tb-per { font-size: 15px; font-weight: 600; color: #9fb6cf; }

/* -- Sidebar "switch companies" (multi-tenant) -- */
.switch-co { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--soft); text-decoration: none;
  transition: border-color .12s, background .12s; }
.switch-co:hover { border-color: var(--teal-200); background: var(--teal-50); text-decoration: none; }
.switch-co-l { display: flex; flex-direction: column; min-width: 0; }
.switch-co-label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--faint); font-weight: 700; }
.switch-co-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.switch-co-action { flex: none; font-size: 12px; font-weight: 700; color: var(--teal-600); }

/* ===========================================================================
   MyCTO redesign — value-led, plain-spoken, CEO-friendly.
   =========================================================================== */

/* -- Topbar tagline -- */
.topbar-tag { font-size: 12.5px; color: var(--faint); font-weight: 500; }
@media (max-width: 900px) { .topbar-tag { display: none; } }

/* -- Welcome hero (Home) -- */
.welcome { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; margin-bottom: 22px; }
@media (max-width: 820px) { .welcome { grid-template-columns: 1fr; } }
.welcome-main { background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff; border-radius: var(--radius); padding: 28px 30px; box-shadow: var(--shadow); }
.welcome-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #7fd4d1; margin-bottom: 8px; }
.welcome-main h1 { color: #fff; font-size: 26px; margin: 0 0 8px; line-height: 1.2; }
.welcome-main .sub { color: #b9cbe0; font-size: 14.5px; line-height: 1.6; margin: 0 0 18px; max-width: 46ch; }
.welcome-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome-cta .btn.primary { background: var(--teal-500); border-color: var(--teal-500); }
.welcome-cta .btn.primary:hover { background: var(--teal-600); border-color: var(--teal-600); }
.welcome-cta .btn.on-dark { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.welcome-cta .btn.on-dark:hover { background: rgba(255,255,255,.16); }

/* The three promises strip inside the hero */
.promises { display: flex; gap: 18px; margin-top: 22px; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.12); flex-wrap: wrap; }
.promise { display: flex; gap: 9px; align-items: flex-start; flex: 1; min-width: 150px; }
.promise svg { width: 18px; height: 18px; color: #7fd4d1; flex: none; margin-top: 1px; }
.promise .p-t { font-size: 13px; font-weight: 700; color: #fff; }
.promise .p-d { font-size: 12px; color: #9fb6cf; line-height: 1.4; }

/* Value panel beside the hero */
.welcome-side { background: var(--surface); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.welcome-side .ws-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; }
.welcome-side .ws-amount { font-size: 34px; font-weight: 800; color: var(--ink); letter-spacing: -.02em;
  margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.welcome-side .ws-amount .per { font-size: 16px; font-weight: 600; color: var(--faint); }
.welcome-side .ws-hint { font-size: 13px; color: var(--muted); }

/* -- Value comparison: one lean mini-bar + a savings line -- */
.vcompare { margin-top: auto; padding-top: 16px; }
.vc-mini { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; margin-bottom: 9px; }
.vc-mini-fill { height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-500), var(--teal-600)); }
.vc-stat { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.vc-stat strong { color: var(--teal-700); font-weight: 800; }

/* -- Engagement: separate the planner from the CTO-type choice above it -- */
.planner { margin-top: 30px; }
.guard-intro { margin-bottom: 14px; }
.guard-intro h2 { margin: 0 0 3px; font-size: 18px; }
.guard-intro p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 60ch; }

/* -- Hours donut -- */
.donut { position: relative; display: grid; place-items: center; flex: none; }
.donut svg { width: 100%; height: 100%; }
.donut-mid { position: absolute; text-align: center; display: flex; flex-direction: column; line-height: 1.1; }
.donut-num { font-size: 22px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.donut-sub { font-size: 11px; color: var(--faint); font-weight: 600; }

/* Hours block: donut + meaning side by side */
.hours-card { display: flex; gap: 22px; align-items: center; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px 24px; flex-wrap: wrap; }
.hours-card .hc-body { flex: 1; min-width: 200px; }
.hours-card .hc-body h3 { margin: 0 0 4px; font-size: 16px; }
.hours-card .hc-body p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.hours-card .hc-cap { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* -- Section heading with a "see all" link on the right -- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 32px 0 12px; }
.section-head .section-h { margin: 0; }
.section-head a { font-size: 13px; font-weight: 600; }

/* -- Service pillars (evangelize what's included) -- */
.pillars { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.pillar { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 18px; display: flex; flex-direction: column; gap: 7px; }
.pillar .pi-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--teal-50);
  color: var(--teal-700); display: grid; place-items: center; }
.pillar .pi-ico svg { width: 18px; height: 18px; }
.pillar .pi-t { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.pillar .pi-d { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* ===========================================================================
   MyCTO polish pass — modern, calm, CEO-friendly. Topbar CTO chip, icon tiles,
   graceful empty states.
   =========================================================================== */

/* -- Topbar: assigned CTO chip + chat/email -- */
.topbar { height: 64px; }
.topbar-cto { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.tc-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid;
  place-items: center; background: var(--teal-50); color: var(--teal-700);
  font-weight: 800; font-size: 12.5px; }
.tc-meta { display: flex; flex-direction: column; line-height: 1.15; margin-right: 2px; }
.tc-label { font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--faint); font-weight: 700; }
.tc-name { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.tc-btn { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid;
  place-items: center; color: var(--muted); background: var(--soft);
  transition: background .12s, color .12s; }
.tc-btn:hover { background: var(--teal-50); color: var(--teal-700); text-decoration: none; }
.tc-btn svg { width: 15px; height: 15px; }
@media (max-width: 720px) { .topbar-cto .tc-meta { display: none; } }
@media (max-width: 560px) { .topbar .right .btn.primary { display: none; } }

/* -- Tiles: modern, with optional icon + graceful empties -- */
.tile { border: 1px solid transparent; transition: box-shadow .15s, transform .08s, border-color .12s; }
.tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.tile-icon { position: relative; }
.tile-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--teal-50);
  color: var(--teal-700); display: grid; place-items: center; margin-bottom: 4px; }
.tile-ico svg { width: 17px; height: 17px; }
.tile .t-value { line-height: 1.1; }

/* Empty-state tile: dashed, inviting, never a bare dash */
.tile-empty { border: 1.5px dashed var(--line); background: var(--canvas); box-shadow: none; }
.tile-empty:hover { border-color: var(--teal-300, var(--teal-200)); background: var(--teal-50); }
.tile-empty .t-label { color: var(--faint); }
.tile-empty .t-empty-cta { font-size: 14px; font-weight: 700; color: var(--teal-600); margin-top: 2px; }
.tile-empty .tile-ico { background: var(--soft); color: var(--faint); }

/* -- Generic empty / setup prompt block -- */
.setup-prompt { display: flex; align-items: center; gap: 14px; background: var(--teal-50);
  border: 1px solid var(--teal-100); border-radius: var(--radius); padding: 16px 18px; }
.setup-prompt .sp-ico { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid;
  place-items: center; background: #fff; color: var(--teal-600); }
.setup-prompt .sp-ico svg { width: 19px; height: 19px; }
.setup-prompt .sp-body { flex: 1; min-width: 0; }
.setup-prompt .sp-t { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.setup-prompt .sp-d { font-size: 13px; color: var(--muted); }

/* Friendly empty card (e.g. no tasks) — centered, soft */
.empty-soft { text-align: center; padding: 40px 24px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.empty-soft .es-ico { width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 12px;
  display: grid; place-items: center; background: var(--teal-50); color: var(--teal-600); }
.empty-soft .es-ico svg { width: 24px; height: 24px; }
.empty-soft h3 { margin: 0 0 4px; font-size: 16px; }
.empty-soft p { margin: 0 auto 14px; color: var(--muted); font-size: 13.5px; max-width: 42ch; }

/* -- Softer, more modern panels overall -- */
.panel { border: 1px solid var(--line); box-shadow: none; }
.welcome-side { border: 1px solid var(--line); }
.hours-card, .cto-card, .person-card { border: 1px solid var(--line); }

/* Tighter section headings */
.section-h { margin: 22px 0 10px; }
.section-h.spaced { margin-top: 30px; }

/* -- My Plan: hero + includes + collapsible legal terms -- */
.plan-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: #fff; border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow); }
.plan-hero h2 { color: #fff; }
.plan-hero .badge.ok { background: rgba(127,212,209,.18); color: #c4e8e6; }
.plan-hero .hint { color: #9fb6cf; }
.plan-hero-r { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.plan-hero-r a.hint { color: #c4e8e6; }
.ph-amount { font-size: 32px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ph-per { font-size: 15px; font-weight: 600; color: #9fb6cf; }
@media (max-width: 560px) { .plan-hero-r { text-align: left; } }

/* The friendly "what you get" list — give the rich text room to breathe */
.plan-includes { font-size: 14.5px; }
.plan-includes strong { color: var(--ink); }
.plan-includes ul { margin: 6px 0 14px; }
.plan-includes li { margin: 5px 0; }

/* Collapsible legal terms */
.terms-expander { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.terms-expander summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted);
  list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.terms-expander summary::-webkit-details-marker { display: none; }
.terms-expander summary::before { content: "▸"; color: var(--faint); transition: transform .15s; }
.terms-expander[open] summary::before { transform: rotate(90deg); }
.terms-expander summary:hover { color: var(--ink); }
.terms-expander .richtext { font-size: 13px; color: var(--muted); max-height: 360px; overflow-y: auto;
  padding-right: 8px; }

/* ===========================================================================
   Cost planner — two simple guardrails: a monthly work LIMIT and a purchase
   approval threshold. One slider + one clear number each.
   =========================================================================== */
.vc-note { display: block; margin-top: 4px; font-size: 11px; color: var(--faint); }

/* Each guardrail: slider on the left, a single bold readout on the right. */
.guard { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; }
@media (max-width: 760px) { .guard { grid-template-columns: 1fr; gap: 22px; } }

.guard-control { min-width: 0; }
.pl-field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.guard-control .lbl { font-size: 14px; color: var(--ink); font-weight: 600; }
.pl-val { font-size: 17px; font-weight: 800; color: var(--teal-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.guard-control .hint { display: block; margin-top: 12px; }

/* Range slider — themed across browsers */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px;
  border-radius: 999px; background: var(--soft); outline: none; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%; background: var(--teal-500);
  border: 4px solid #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%;
  background: var(--teal-500); border: 4px solid #fff; box-shadow: var(--shadow-sm); cursor: pointer; }
input[type=range]:focus { box-shadow: 0 0 0 3px var(--accent-soft); }

/* The bold single-number readout */
.guard-readout { background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); color: #fff;
  border-radius: var(--radius); padding: 22px 24px; }
.gr-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: #9fb6cf; font-weight: 700; margin-bottom: 6px; }
.gr-amount { display: block; font-size: 38px; font-weight: 800; letter-spacing: -.02em;
  line-height: 1; font-variant-numeric: tabular-nums; }
.gr-sub { display: block; font-size: 12.5px; color: #b9cbe0; margin-top: 10px; }

/* Threshold examples readout (light card with example purchases) */
.guard-readout.alt { background: var(--surface); border: 1px solid var(--line); color: var(--ink); padding: 18px 20px; }
.guard-readout.alt .gr-label { color: var(--teal-700); }
.thresh-examples { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.thresh-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--soft); }
.thresh-row .te-label { font-size: 13px; color: var(--ink); }
.thresh-row .te-tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.thresh-row.auto .te-tag { background: var(--ok-bg); color: var(--ok); }
.thresh-row.asks { background: var(--warn-bg); }
.thresh-row.asks .te-tag { background: #fff; color: var(--warn); }

/* ===========================================================================
   Route progress bar — a slim teal bar that animates during page navigation,
   giving instant feedback while the next page's data loads server-side.
   =========================================================================== */
#route-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  pointer-events: none; opacity: 0; transition: opacity .2s ease; }
#route-progress.active { opacity: 1; }
#route-progress .rp-bar { height: 100%; width: 0;
  background: linear-gradient(90deg, var(--teal-500), var(--teal-300, #5bbfbb));
  box-shadow: 0 0 8px rgba(14,143,143,.5); transition: width .2s ease; border-radius: 0 2px 2px 0; }

/* Skeleton shimmer — for any block we render as a placeholder while it loads. */
.skeleton { position: relative; overflow: hidden; background: var(--soft); border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  transform: translateX(-100%); animation: skeleton-sweep 1.3s infinite; }
@keyframes skeleton-sweep { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }
