/* Cervana Leadgen Ops — themed after cervanaai.com:
   warm cream paper with a faint grid, high-contrast serif display type,
   charcoal pill buttons, dusty-rose orbit line art, and one deliberately
   dark element: the terminal job console. */

:root {
  --bg: #f5f2eb;
  --grid: rgba(33, 33, 28, 0.05);
  --panel: #fcfaf5;
  --panel-2: #f1ede2;
  --line: #e2ddcf;
  --line-soft: #eae6da;
  --ink: #21211c;
  --muted: #6e6c63;
  --faint: #9b988c;
  --rose: #c5a49d;
  --live: #7fa569;
  --btn: #1e1e1b;
  --btn-hover: #3a3a34;
  --ok: #2c7a4b;
  --ok-tint: rgba(60, 142, 92, 0.13);
  --warn: #916408;
  --warn-tint: rgba(176, 125, 40, 0.14);
  --bad: #b23a31;
  --bad-tint: rgba(196, 69, 60, 0.11);
  --info: #35619b;
  --info-tint: rgba(59, 111, 181, 0.11);
  --dim-tint: #efebe0;
  --console-bg: #1b1b18;
  --console-text: #c9c6bb;
  --console-green: #9fbf88;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --side-w: 236px;
  --console-h: 40px;
  --r: 16px;
  --r-sm: 10px;
}

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

html { color-scheme: light; }

body {
  overflow-x: hidden;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--bg);
  background-size: 56px 56px, 56px 56px, auto;
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rose); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

::selection { background: var(--ink); color: var(--bg); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

/* -- Shell ---------------------------------------------------------------- */

.app { display: flex; min-height: 100vh; }

.side {
  width: var(--side-w);
  flex: 0 0 auto;
  border-right: 1px solid var(--line);
  background: var(--bg);
  padding: 26px 0 60px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 22px 24px;
}

.brand-mark {
  width: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.brand-mark img { width: 100%; height: auto; display: block; }

.brand-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand-name small {
  display: block;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 22px 22px 8px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 22px 8px 16px;
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: none;
  position: relative;
}

.nav a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  flex: 0 0 auto;
}

.nav a:hover { color: var(--ink); }

.nav a.active { color: var(--ink); font-weight: 500; }
.nav a.active::before { background: var(--live); }

.nav .step {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
  width: 18px;
  flex: 0 0 auto;
}

.nav .nbadge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
}

.nav .nbadge.warn { color: var(--warn); border-color: rgba(145, 100, 8, 0.35); background: var(--warn-tint); }
.nav .nbadge.go { color: var(--ok); border-color: rgba(44, 122, 75, 0.35); background: var(--ok-tint); }

.side-foot {
  padding: 24px 22px 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--faint);
  line-height: 1.8;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 0 40px calc(var(--console-h) + 260px);
  position: relative;
}

.orbits {
  position: absolute;
  top: -40px;
  right: -60px;
  width: 420px;
  height: 420px;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 34px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.topbar h1 {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.15;
}

.topbar .kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 3px 11px;
  margin-bottom: 10px;
}

.top-actions { margin-left: auto; display: flex; gap: 10px; padding-bottom: 2px; }

/* -- Buttons & forms ------------------------------------------------------ */

.btn {
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn:hover { background: rgba(33, 33, 28, 0.06); }

.btn.primary {
  background: var(--btn);
  color: #f7f5ef;
  border-color: var(--btn);
  font-weight: 500;
}

.btn.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }

.btn.danger {
  background: var(--bad);
  color: #fbf5f2;
  border-color: var(--bad);
  font-weight: 500;
}

.btn.danger:hover { background: #c54b41; border-color: #c54b41; }

.btn.quiet { border-color: var(--line); color: var(--muted); }
.btn.quiet:hover { color: var(--ink); border-color: var(--muted); background: transparent; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { background: var(--btn); }
.btn.danger:disabled:hover { background: var(--bad); }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  font-family: var(--body);
  font-size: 13.5px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 12px;
}

.field textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.65; resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.field .hint { font-size: 12px; color: var(--faint); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

/* -- Panels, tiles, notes ------------------------------------------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 24px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.panel h2 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 12px;
}

.panel .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; max-width: 68ch; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  margin-bottom: 22px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.tile { padding: 20px 22px 18px; border-right: 1px solid var(--line-soft); position: relative; }
.tile:last-child { border-right: none; }

.tile .num {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.tile .lbl {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.tile .tick { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.tick.teal { background: var(--ok); }
.tick.amber { background: var(--warn); }
.tick.red { background: var(--bad); }
.tick.blue { background: var(--info); }
.tick.gray { background: var(--faint); }

.tile .flow {
  position: absolute;
  right: -6px;
  top: 26px;
  color: var(--rose);
  font-family: var(--mono);
  font-size: 13px;
  z-index: 1;
}

.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  background: var(--panel);
  border-radius: var(--r-sm);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 22px;
  max-width: 100ch;
  position: relative;
  z-index: 1;
}

.note.red { border-left-color: var(--bad); }
.note.teal { border-left-color: var(--ok); }

/* Compact one-line notice for secondary facts - keeps views from stacking
   paragraph notes. */
.bar {
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  background: var(--panel);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.bar .t {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--warn);
  white-space: nowrap;
}

.bar.red { border-left-color: var(--bad); }
.bar.red .t { color: var(--bad); }
.bar.teal { border-left-color: var(--ok); }
.bar.teal .t { color: var(--ok); }

.note .t {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 5px;
  color: var(--warn);
}
.note.red .t { color: var(--bad); }
.note.teal .t { color: var(--ok); }

/* -- Chips ---------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--dim-tint);
  color: var(--muted);
  white-space: nowrap;
}

.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }

.chip.ok { color: var(--ok); background: var(--ok-tint); }
.chip.ok::before { background: var(--ok); }
.chip.review { color: var(--warn); background: var(--warn-tint); }
.chip.review::before { background: var(--warn); }
.chip.blocked { color: var(--bad); background: var(--bad-tint); }
.chip.blocked::before { background: var(--bad); }
.chip.sent { color: var(--info); background: var(--info-tint); }
.chip.sent::before { background: var(--info); }
.chip.dim::before { background: var(--faint); }

.pol {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  color: var(--faint);
  white-space: nowrap;
}

.pol.permitted { color: var(--ok); border-color: rgba(44, 122, 75, 0.45); border-style: solid; }
.pol.restricted { color: var(--warn); border-color: rgba(145, 100, 8, 0.45); border-style: solid; }
.pol.prohibited { color: var(--bad); border-color: rgba(178, 58, 49, 0.5); border-style: solid; }

/* -- Table ---------------------------------------------------------------- */

.tblwrap {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  overflow-x: auto;
  position: relative;
  z-index: 1;
}

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }

.tbl th {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tbl td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.tbl tr:last-child td { border-bottom: none; }

.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--panel-2); }

.tbl .co { color: var(--muted); font-size: 12px; }
.tbl .mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.filters input,
.filters select {
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
}

.filters input:focus,
.filters select:focus { outline: none; border-color: var(--ink); }

.filters input[type="search"] { min-width: 230px; }

.count-line { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--faint); margin-left: auto; }

/* -- Review cards --------------------------------------------------------- */

.rcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 18px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.rcard-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.rcard-head .who { font-family: var(--display); font-size: 15.5px; font-weight: 500; }
.rcard-head .co { color: var(--muted); }

.rcard-body { padding: 20px; display: grid; gap: 14px; }

.rcard .reason {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--warn);
  line-height: 1.6;
}

.rcard-actions {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid var(--line-soft);
  align-items: center;
}

.rcard-actions .status-msg { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: auto; }

/* -- Email draft rendering ------------------------------------------------ */

.draft {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  overflow: hidden;
}

.draft .d-subject {
  padding: 10px 15px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}

.draft .d-subject b { color: var(--faint); font-weight: 400; margin-right: 8px; }

.draft .d-body { padding: 15px; white-space: pre-wrap; color: var(--muted); max-height: 340px; overflow-y: auto; }

/* -- Drawer (lead detail) ------------------------------------------------- */

.drawer-veil {
  position: fixed;
  inset: 0;
  background: rgba(33, 33, 28, 0.35);
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 94vw);
  background: var(--panel);
  border-left: 1px solid var(--line);
  border-radius: 20px 0 0 20px;
  box-shadow: -18px 0 50px rgba(33, 33, 28, 0.12);
  z-index: 41;
  overflow-y: auto;
  padding: 28px 30px 60px;
}

.drawer .close { position: absolute; top: 20px; right: 22px; }

.drawer h2 { font-family: var(--display); font-size: 23px; font-weight: 500; margin-bottom: 2px; padding-right: 70px; }
.drawer .dco { color: var(--muted); margin-bottom: 14px; }

.drawer .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.dsec { border-top: 1px solid var(--line-soft); padding: 18px 0; }

.dsec h3 {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--faint);
  margin-bottom: 12px;
}

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 14px; font-size: 13px; }
.kv .k { color: var(--faint); }
.kv .v { color: var(--ink); overflow-wrap: anywhere; }
.kv .v.mono { font-family: var(--mono); font-size: 12px; }

.facts { list-style: none; display: grid; gap: 8px; }

.facts li { font-size: 13px; color: var(--ink); padding-left: 15px; position: relative; }

.facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
}

.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit input, .inline-edit select {
  flex: 1;
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 11px;
}
.inline-edit input:focus, .inline-edit select:focus { outline: none; border-color: var(--ink); }

/* -- Legal table ---------------------------------------------------------- */

.legal-row td:first-child { white-space: normal; min-width: 160px; }
.legal-row .note-cell { color: var(--muted); font-size: 12.5px; max-width: 62ch; }
.tbl tbody tr.legal-row { cursor: default; }
.tbl tbody tr.legal-row:hover { background: transparent; }

/* -- Console (the one dark element, like the site's terminal windows) ----- */

.console {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--console-bg);
  border-top: 1px solid #33332c;
}

.console-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: var(--console-h);
  padding: 0 18px;
  background: transparent;
  border: none;
  color: var(--console-text);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}

.console-head:hover { color: #efede4; }

.console-head .prompt { color: var(--console-green); }

.console-head .cstate { margin-left: auto; font-size: 11px; letter-spacing: 0.08em; }
.console-head .cstate.running { color: #d9b36a; }
.console-head .cstate.done { color: var(--console-green); }
.console-head .cstate.error { color: #e58a80; }

.console-log {
  display: none;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px 18px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.75;
  color: var(--console-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.console.open .console-log { display: block; }

.console-log .cline.err { color: #e58a80; }
.console-log .cline.sent { color: var(--console-green); }

.cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: var(--console-green);
  vertical-align: -2px;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* -- Deals kanban ---------------------------------------------------------- */

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  position: relative;
  z-index: 1;
}

.kcol {
  background: rgba(252, 250, 245, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
  min-height: 120px;
}

.kcol-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 4px 10px;
}

.kcol-head .kname {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.kcol-head .ksum { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }

.kcol.won { border-top: 2px solid var(--ok); }
.kcol.lost { opacity: 0.75; }

.kcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.kcard .kco { font-weight: 600; font-size: 13px; }
.kcard .kwho { color: var(--muted); font-size: 12px; margin-top: 1px; }
.kcard .kmrr { font-family: var(--display); font-size: 16px; margin-top: 6px; }
.kcard .kmrr small { font-family: var(--mono); font-size: 9.5px; color: var(--faint); letter-spacing: 0.1em; }

.kcard .kmove { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.kcard .kmove select {
  flex: 1;
  font-family: var(--body);
  font-size: 12px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.kcard .kmrr-edit {
  width: 90px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

/* -- Finance ---------------------------------------------------------------- */

.tile .num small { font-size: 15px; color: var(--faint); font-family: var(--body); font-weight: 400; }
.tile .approx { font-family: var(--mono); font-size: 9px; color: var(--faint); letter-spacing: 0.08em; margin-left: 5px; }

/* -- Command palette (⌘K) --------------------------------------------------- */

.pal-veil { position: fixed; inset: 0; background: rgba(33, 33, 28, 0.3); z-index: 70; }

.pal {
  position: fixed;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 24px 70px rgba(33, 33, 28, 0.25);
  z-index: 71;
  overflow: hidden;
}

.pal input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  padding: 15px 18px;
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
}

.pal input:focus { outline: none; }

.pal-list { max-height: 46vh; overflow-y: auto; padding: 6px; }

.pal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink);
}

.pal-item .pk {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  width: 52px;
  flex: 0 0 auto;
}

.pal-item .pd { color: var(--faint); font-size: 12px; margin-left: auto; }
.pal-item.sel, .pal-item:hover { background: var(--panel-2); }
.pal-empty { padding: 18px; color: var(--faint); font-size: 13px; text-align: center; }

.pal-foot {
  display: flex;
  gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--faint);
}

kbd {
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  padding: 1px 5px;
  color: var(--muted);
}

/* -- Today queues ----------------------------------------------------------- */

.today {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.tq {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
}

.tq h3 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 10px;
}

.tq h3 .n { font-family: var(--display); font-size: 17px; color: var(--ink); }
.tq h3 a { margin-left: auto; font-size: 11px; font-family: var(--body); text-transform: none; letter-spacing: 0; }

.tq-row {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-top: 1px solid var(--line-soft);
  padding: 7px 2px;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--body);
}

.tq-row:hover { color: var(--ink); background: var(--panel-2); }
.tq-row .co { color: var(--muted); }
.tq .allclear { color: var(--faint); font-size: 12.5px; padding: 6px 0 2px; }

/* -- Kanban drag & drop ----------------------------------------------------- */

.kcard[draggable="true"] { cursor: grab; }
.kcard.dragging { opacity: 0.45; }
.kcol.dropready { outline: 2px dashed var(--rose); outline-offset: -6px; }

/* -- Misc ----------------------------------------------------------------- */

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: rgba(252, 250, 245, 0.6);
  padding: 44px 26px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; }
.cfg { padding: 14px 18px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.cfg .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.cfg .v { font-family: var(--mono); font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }
.cfg .v.missing { color: var(--bad); }
.cfg .v.set { color: var(--ok); }

.toast {
  position: fixed;
  bottom: calc(var(--console-h) + 16px);
  right: 20px;
  z-index: 60;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-sm);
  font-size: 13px;
  padding: 11px 18px;
  max-width: 380px;
  box-shadow: 0 10px 30px rgba(33, 33, 28, 0.25);
}

.toast.err { background: var(--bad); color: #fbf5f2; }

.arm-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.arm-row input {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  width: 150px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}
.arm-row input:focus { outline: none; border-color: var(--bad); }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .main { padding-left: 18px; padding-right: 18px; }
  .orbits { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv .k { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  * { transition: none !important; }
}

/* -- Finance (Numbers) ------------------------------------------------------ */

.segbar {
  display: flex;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 3px;
  margin-bottom: 22px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  position: relative;
  z-index: 1;
}

.segbar button {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 8px 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.segbar button:hover { color: var(--ink); }
.segbar button.on { background: var(--ink); color: var(--bg); }
.segbar .segcount { opacity: 0.6; margin-left: 6px; }

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(240px, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  overflow: hidden;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.hero-main { padding: 24px 26px 18px; border-right: 1px solid var(--line-soft); min-width: 0; }
.hero-side { padding: 24px 26px 18px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.hero .cap {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

.hero-num {
  font-family: var(--display);
  font-size: 52px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-num small { font-family: var(--mono); font-size: 11px; color: var(--faint); letter-spacing: 0.1em; }

.hero-sub {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.delta {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.delta.up { color: var(--ok); background: var(--ok-tint); }
.delta.down { color: var(--bad); background: var(--bad-tint); }
.delta.flat { color: var(--muted); background: var(--dim-tint); }

.spark { display: block; width: 100%; height: 78px; margin-top: 16px; overflow: visible; }
.spark .fill { fill: var(--rose); opacity: 0.16; }
.spark .line { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.spark .dot { fill: var(--ink); }
.spark .base { stroke: var(--line); stroke-width: 1; }
.spark .glab { font-family: var(--mono); font-size: 8.5px; fill: var(--faint); letter-spacing: 0.1em; }

.sidestat { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sidestat .k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--faint); }
.sidestat .v { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.sidestat .v.pos { color: var(--ok); }
.sidestat .v.neg { color: var(--bad); }

.meter { height: 6px; border-radius: 999px; background: var(--dim-tint); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.meter i.teal { background: var(--ok); }
.meter i.amber { background: var(--warn); }
.meter i.red { background: var(--bad); }
.meter i.rose { background: var(--rose); }

/* MRR waterfall */
.wfall { display: flex; flex-direction: column; gap: 9px; }
.wrow { display: grid; grid-template-columns: 128px 1fr 100px; align-items: center; gap: 14px; }
.wrow .wk { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.wrow .wt { height: 16px; background: var(--dim-tint); border-radius: 4px; position: relative; overflow: hidden; }
.wrow .wt i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.wrow .wt i.up { background: var(--ok); opacity: 0.8; }
.wrow .wt i.down { background: var(--bad); opacity: 0.75; }
.wrow .wv { font-family: var(--mono); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.wrow .wv.up { color: var(--ok); }
.wrow .wv.down { color: var(--bad); }
.wrow.total { border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: 3px; }
.wrow.total .wk { color: var(--ink); font-weight: 500; }
.wrow.total .wv { font-family: var(--display); font-size: 17px; }

/* Small metric cards with a plain-English definition */
.mgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; border-top: 1px solid var(--line-soft); }
.mcard { padding: 16px 18px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.mcard:last-child { border-right: none; }
.mcard .mv { font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mcard .mv.good { color: var(--ok); }
.mcard .mv.bad { color: var(--bad); }
.mcard .mv.none { color: var(--faint); }
.mcard .mk { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.mcard .mh { font-size: 11.5px; color: var(--faint); margin-top: 6px; line-height: 1.5; }

/* Category cost bars */
.catrow { display: grid; grid-template-columns: 110px 1fr 132px; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.catrow:last-child { border-bottom: none; }
.catrow .ck { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.catrow .ct { height: 14px; background: var(--dim-tint); border-radius: 4px; overflow: hidden; display: flex; }
.catrow .ct i { display: block; height: 100%; }
.catrow .ct i.rec { background: var(--ink); opacity: 0.72; }
.catrow .ct i.one { background: var(--rose); }
.catrow .cv { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.catrow .cv small { color: var(--faint); font-size: 10px; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.ink { background: var(--ink); opacity: 0.72; }
.legend i.rose { background: var(--rose); }
.legend i.teal { background: var(--ok); }
.legend i.red { background: var(--bad); }

/* Cloud credit grants */
.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.gcard { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px 18px; background: var(--bg); }
.gcard.spent { opacity: 0.62; }
.gcard.expiring { border-color: rgba(145, 100, 8, 0.5); }
.gcard.expired { border-style: dashed; opacity: 0.6; }
.gcard .gh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.gcard .gp { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--faint); }
.gcard .gn { font-size: 13px; font-weight: 500; }
.gcard .gnum { font-family: var(--display); font-size: 25px; font-variant-numeric: tabular-nums; margin-top: 8px; }
.gcard .gnum small { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: 0.08em; }
.gcard .gmeta { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 8px; display: flex; justify-content: space-between; gap: 10px; }
.gcard .grm { margin-left: auto; }

.stackbar { display: flex; height: 22px; border-radius: 5px; overflow: hidden; background: var(--dim-tint); }
.stackbar i { display: block; height: 100%; }
.stackbar i.credit { background: var(--rose); }
.stackbar i.cash { background: var(--ink); opacity: 0.78; }

.mchart { display: flex; align-items: flex-end; gap: 5px; height: 108px; margin-top: 4px; }
.mcol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 0; }
.mcol .mseg { border-radius: 2px 2px 0 0; min-height: 1px; }
.mcol .mseg.credit { background: var(--rose); }
.mcol .mseg.cash { background: var(--ink); opacity: 0.78; border-radius: 0 0 2px 2px; }
.mcol .mlab { font-family: var(--mono); font-size: 8.5px; color: var(--faint); text-align: center; margin-top: 6px; letter-spacing: 0.04em; }
.mcol.now .mlab { color: var(--ink); }

.finhead { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.finhead h2 { margin-bottom: 0; }
.finhead .fh-note { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

.rowact { display: flex; gap: 6px; justify-content: flex-end; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-main { border-right: none; border-bottom: 1px solid var(--line-soft); }
  .hero-num { font-size: 40px; }
  .wrow { grid-template-columns: 96px 1fr 86px; gap: 10px; }
  .catrow { grid-template-columns: 84px 1fr 110px; gap: 10px; }
}
