/* ── Tabs and panel content ──────────────────────────────────────────────── */

#nav { display: flex; border-bottom: 1px solid var(--rule); }
.nav-btn {
  flex: 1;
  border: none;
  border-right: 1px solid var(--rule);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  padding: 0;
}
.nav-btn:last-child { border-right: none; }
.nav-btn:hover { background: rgba(127,233,245,0.05); }
.nav-btn.active {
  color: var(--phosphor);
  background: rgba(127,233,245,0.07);
  box-shadow: inset 0 -1px 0 var(--phosphor);
}

#panels { min-height: 0; }
.panel { height: 100%; overflow-y: auto; padding: var(--pad); }

.row { display: flex; gap: 8px; margin-bottom: 16px; }
.rule { border: none; border-top: 1px solid var(--rule); margin: 22px 0; }

/* Console ---------------------------------------------------------------- */

#panel-console { display: flex; flex-direction: column; }
#console-log { flex: 1; overflow-y: auto; }

.msg { margin-bottom: 16px; }
.msg .who {
  display: block;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 5px;
  color: var(--text-faint);
}
.msg .body { font-family: var(--sans); font-size: 13.5px; font-weight: 300; line-height: 1.6; }
.msg.jarvis .who { color: var(--arc); }
.msg.jarvis .body { color: var(--text); }
.msg.user .body { color: var(--text-quiet); }
.msg.error .who { color: var(--alert); }
.msg.error .body { color: var(--alert); font-family: var(--mono); font-size: 11.5px; }
.msg.working .body { color: var(--amber); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; }

#console-form { display: flex; gap: 8px; padding-top: 14px; border-top: 1px solid var(--rule); }

/* Cards ------------------------------------------------------------------ */

.card {
  border: 1px solid var(--rule);
  border-left: 2px solid var(--rule);
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--bg-panel);
}
.card h4 {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text);
}
.card .meta { margin: 0; font-size: 10px; letter-spacing: .04em; color: var(--text-faint); }
.card .snip { margin: 7px 0 0; font-family: var(--sans); font-size: 12.5px; font-weight: 300; color: var(--text-quiet); }
.card.unread { border-left-color: var(--phosphor); }
.card.bad    { border-left-color: var(--alert); }
.empty { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.failure { color: var(--alert); font-size: 11.5px; line-height: 1.6; margin: 0; }

/* Fields ----------------------------------------------------------------- */

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-quiet);
  margin-bottom: 6px;
}
.field textarea { min-height: 132px; resize: vertical; font-family: var(--sans); font-weight: 300; line-height: 1.6; }
.note { font-size: 10px; line-height: 1.65; color: var(--text-faint); margin: -6px 0 16px; }
.note.warn { color: var(--amber); }

/* Portfolio -------------------------------------------------------------- */

#pf-total { font-family: var(--mono); font-size: 34px; font-weight: 300; margin: 4px 0 2px; color: var(--text); font-variant-numeric: tabular-nums; }
#pf-delta { margin: 0; font-size: 12px; letter-spacing: .06em; }
.gain { color: var(--ok); }
.loss { color: var(--alert); }
.pf-grid { display: grid; grid-template-columns: 1.1fr .7fr .7fr .8fr auto; gap: 6px; margin: 12px 0 18px; }

/* Approval gate ---------------------------------------------------------- */

#confirm-layer {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 9, 0.86);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  z-index: 200;
  padding: 22px;
}
.confirm-box {
  width: min(620px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--rule-strong);
  padding: 26px;
  box-shadow: 0 0 80px rgba(53,208,232,0.08);
  animation: rise .26s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.confirm-box h3 {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 300;
  margin: 0 0 4px;
  color: var(--text);
}
.confirm-box .label { display: block; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.confirm-actions .go { border-color: var(--ok); color: var(--ok); }
.confirm-actions .go:hover { background: rgba(110,231,168,.1); border-color: var(--ok); color: var(--ok); }
.confirm-actions .no { border-color: var(--alert); color: var(--alert); }
.confirm-actions .no:hover { background: rgba(255,107,94,.1); border-color: var(--alert); color: var(--alert); }
.confirm-actions .spacer { flex: 1; }

/* ── Filter chips ─────────────────────────────────────────────────────────── */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 6px 11px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--text-dim); border-color: var(--text-faint); }
.chip.on {
  color: var(--phosphor);
  border-color: var(--arc);
  background: color-mix(in srgb, var(--arc) 12%, transparent);
}
.chip:focus-visible { outline: 1px solid var(--phosphor); outline-offset: 2px; }

.hint { margin: 0 0 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--text-faint); }

/* ── Mail ─────────────────────────────────────────────────────────────────── */
.mrow {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 11px;
  padding: 12px 12px 12px 11px;
  border: 1px solid var(--rule);
  border-left: 2px solid transparent;
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  cursor: pointer;
  margin-bottom: 7px;
  transition: border-color .15s, background .15s;
}
.mrow:hover { border-color: var(--text-faint); }
.mrow.unread { border-left-color: var(--arc); background: color-mix(in srgb, var(--arc) 6%, transparent); }

.mrow .mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--rule);
  border-radius: 50%;
}
.mrow.unread .mark { color: var(--phosphor); border-color: var(--arc); }

.mrow-main { min-width: 0; }
.mrow-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mrow .who {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mrow.unread .who { color: var(--text); }
.mrow .when {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.mrow h4 {
  margin: 5px 0 3px;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text-dim);
}
.mrow.unread h4 { font-weight: 400; color: var(--text); }
.mrow .snip {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-faint);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.mrow.open .snip { display: none; }
.mrow-body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-dim);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow-y: auto;
}
.mrow.open .mrow-body { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--rule); }

/* ── Calendar ─────────────────────────────────────────────────────────────── */
.day-head {
  margin: 16px 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--phosphor);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--rule);
}
.day-head:first-child { margin-top: 0; }

.evt {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 55%, transparent);
}
.evt:last-child { border-bottom: 0; }
.evt-time {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--phosphor);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.evt-time.allday { font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.evt h4 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
}
.evt .meta { margin: 3px 0 0; font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
