:root {
  color-scheme: light;
  --ink: #172027;
  --muted: #63717b;
  --faint: #87949c;
  --line: #dce3e7;
  --line-strong: #c8d2d8;
  --bg: #f3f5f6;
  --panel: #ffffff;
  --panel-soft: #f9fbfb;
  --accent: #007a70;
  --accent-soft: #dff3ef;
  --warn: #a35d00;
  --warn-soft: #fff1d6;
  --danger: #b3292d;
  --danger-soft: #ffe5e6;
  --blue: #2862a7;
  --blue-soft: #e4edf8;
  --shadow: 0 12px 34px rgba(30, 43, 52, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef2f3 0, var(--bg) 340px),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(640px, 1.2fr);
  gap: 20px;
  align-items: end;
  padding-bottom: 18px;
}

.brand-block {
  min-width: 0;
}

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 5px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
  letter-spacing: 0;
}

#clock {
  margin-top: 9px;
  color: var(--muted);
  font-weight: 700;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 10px;
}

.status-tile,
.metric-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.status-tile {
  min-height: 78px;
  padding: 13px;
  border-radius: 8px;
}

.status-tile .label,
.metric-label,
.metric-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-tile strong {
  display: block;
  margin-top: 10px;
  font-size: 17px;
}

.status-tile[data-state="good"] strong {
  color: var(--accent);
}

.status-tile[data-state="bad"] strong {
  color: var(--danger);
}

.status-tile[data-state="warn"] strong {
  color: var(--warn);
}

.command-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 13px;
  background: #e7ecef;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #edc679;
  border-radius: 8px;
  color: #714000;
  background: var(--warn-soft);
  font-size: 13px;
  font-weight: 800;
}

.icon-button,
.full-button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.full-button {
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-button.secondary,
.secondary-fill {
  color: #075f58;
  background: var(--accent-soft);
  border: 1px solid #abd9d1;
}

.icon-button.warning {
  color: #714000;
  background: var(--warn-soft);
  border: 1px solid #edc679;
}

.danger-fill {
  color: #8f1722;
  background: #ffe5e8;
  border: 1px solid #f4b7bf;
}

.icon-button.danger {
  color: #7f171b;
  background: var(--danger-soft);
  border: 1px solid #f2b5b8;
}

.icon-button.kill-switch {
  color: #fff;
  background: #7f1d1d;
  border: 1px solid #7f1d1d;
}

.icon-button.kill-switch:hover {
  background: #991b1b;
  border-color: #991b1b;
}

.icon-button.ghost {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
}

.ghost-fill {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.metric-panel {
  min-height: 104px;
  padding: 15px;
  border-radius: 8px;
}

.metric-panel strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 30px;
  line-height: 1;
}

.metric-panel.metric-panel-danger {
  color: #fff;
  background: #7f1d1d;
  border-color: #7f1d1d;
}

.metric-panel.metric-panel-danger .metric-label,
.metric-panel.metric-panel-danger .metric-note,
.metric-panel.metric-panel-danger strong {
  color: #fff;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.control-panel,
.main-stack,
.split-panels {
  display: grid;
  gap: 16px;
}

.split-panels {
  grid-template-columns: 1fr;
}

.panel {
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.mode-filter select {
  width: auto;
  min-width: 128px;
  height: 34px;
  padding: 6px 30px 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

#symbolBadge {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #b6ddd6;
  border-radius: 999px;
  padding: 5px 9px;
}

.settings-form,
.profile-panel,
.token-form,
.account-form,
.connect-card {
  display: grid;
  gap: 12px;
}

.profile-panel {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-actions .icon-button {
  min-width: 0;
  padding-inline: 10px;
}

.form-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body[data-locked="true"] .shell {
  visibility: hidden;
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(238, 242, 243, 0.96), rgba(243, 245, 246, 0.98)),
    var(--bg);
}

.lock-screen[hidden] {
  display: none;
}

.lock-panel,
.logout-panel {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.lock-panel h1,
.logout-panel h1 {
  font-size: 34px;
}

.lock-panel p,
.logout-panel p {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
}

.lock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--panel-soft);
  outline: none;
}

input:focus,
select:focus {
  border-color: #7cbdb5;
  box-shadow: 0 0 0 3px rgba(0, 122, 112, 0.12);
}

.connect-card {
  margin-bottom: 12px;
}

.callback-box {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.callback-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.callback-box code {
  color: var(--ink);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.manual-token {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.manual-token summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.manual-token .token-form {
  margin-top: 12px;
}

.switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.live-account-panel {
  display: grid;
  gap: 14px;
}

.live-account-panel h3 {
  margin: 2px 0 0;
  font-size: 14px;
}

.live-account-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.live-account-note {
  color: var(--muted);
  font-weight: 700;
}

.live-gate-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e4b8b8;
  border-radius: 7px;
  background: #fff0f0;
  color: #8f1d24;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.live-gate-status[data-state="ready"] {
  border-color: #9ed2c7;
  background: #e6f5f1;
  color: #126c60;
}

.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.switch input {
  width: 16px;
  min-height: 16px;
}

.full-button {
  width: 100%;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(7, minmax(82px, 1fr));
  gap: 8px;
}

.time-chip {
  min-height: 76px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.time-chip strong,
.time-chip span {
  display: block;
}

.time-chip strong {
  font-size: 18px;
}

.time-chip span {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.time-chip[data-state="queued"] {
  border-color: #bdd0e8;
  background: var(--blue-soft);
}

.time-chip[data-state="now"] {
  border-color: #78bfb8;
  background: var(--accent-soft);
}

.time-chip[data-state="done"] {
  border-color: #89c7a6;
  background: #e3f4ea;
}

.time-chip[data-state="missed"] {
  color: var(--faint);
  background: #f1f3f3;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

.side-badge,
.mode-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 850;
}

.side-badge {
  color: var(--blue);
  background: var(--blue-soft);
}

.mode-dry {
  color: #4b5563;
  background: #edf0f3;
}

.mode-live {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-badge {
  color: var(--accent);
  background: var(--accent-soft);
}

.pnl-badge {
  color: var(--muted);
  font-weight: 850;
}

.pnl-positive {
  color: var(--accent);
}

.pnl-negative {
  color: var(--danger);
}

.pnl-source {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.order-id {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.bot-monitored-order {
  color: #9a6700;
  font-weight: 700;
}

.table-empty {
  color: var(--muted);
  text-align: center;
}

.trade-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: baseline;
  justify-content: flex-end;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.trade-summary-value {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.trade-summary-value strong {
  font-size: 20px;
}

.trade-summary small {
  width: 100%;
  color: var(--faint);
  text-align: right;
}

.pnl-visual {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%);
}

.pnl-visual-heading {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pnl-visual-heading h3 {
  margin: 0;
  font-size: 15px;
}

.pnl-visual-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pnl-visual-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.pnl-visual-tools select {
  min-height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 850;
}

.pnl-chart {
  display: grid;
  gap: 12px;
}

.pnl-period-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.pnl-period-card {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.pnl-period-card:hover,
.pnl-period-card.is-selected {
  border-color: rgba(25, 111, 166, 0.45);
  background: #eef7f9;
}

.pnl-period-card.is-selected {
  box-shadow: inset 0 0 0 2px rgba(25, 111, 166, 0.35);
}

.pnl-period-card-top {
  display: grid;
  gap: 5px;
}

.pnl-period-card-top span,
.pnl-period-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.pnl-period-card-top strong {
  font-size: 16px;
}

.pnl-period-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef1;
}

.pnl-mini-sparkline {
  display: block;
  width: 100%;
  height: 42px;
  border: 1px solid rgba(15, 23, 32, 0.06);
  border-radius: 7px;
  background: #ffffff;
}

.pnl-mini-sparkline.is-empty {
  background: repeating-linear-gradient(
    -45deg,
    #f3f6f7,
    #f3f6f7 6px,
    #edf2f4 6px,
    #edf2f4 12px
  );
}

.pnl-mini-zero {
  stroke: rgba(102, 117, 127, 0.28);
  stroke-width: 1;
}

.pnl-mini-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.pnl-mini-sparkline.is-positive .pnl-mini-line {
  stroke: var(--accent);
}

.pnl-mini-sparkline.is-negative .pnl-mini-line {
  stroke: var(--danger);
}

.pnl-selected-day-chart {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.85fr);
  gap: 12px;
  align-items: stretch;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pnl-selected-day-heading {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.pnl-selected-day-heading strong {
  font-size: 13px;
}

.pnl-selected-day-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pnl-chart-empty {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pnl-period-graph {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.pnl-period-graph-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: stretch;
  margin-top: 10px;
}

.pnl-period-line {
  min-height: 220px;
}

.pnl-period-line svg {
  height: 178px;
}

.pnl-period-bars {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.pnl-chart-bars {
  display: grid;
  gap: 7px;
}

.pnl-chart-bar-row {
  display: grid;
  grid-template-columns: 48px minmax(80px, 1fr) 92px 70px;
  gap: 8px;
  align-items: center;
}

.pnl-chart-label,
.pnl-chart-bar-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.pnl-chart-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef1;
}

.pnl-chart-bar {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
}

.pnl-chart-bar.is-positive {
  background: linear-gradient(90deg, rgba(13, 128, 116, 0.45), rgba(13, 128, 116, 0.95));
}

.pnl-chart-bar.is-negative {
  background: linear-gradient(90deg, rgba(174, 36, 48, 0.45), rgba(174, 36, 48, 0.95));
}

.pnl-chart-line {
  position: relative;
  min-height: 172px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f1720;
}

.pnl-chart-line svg {
  display: block;
  width: 100%;
  height: 132px;
}

.pnl-zero-line {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1;
}

.pnl-cumulative-line {
  fill: none;
  stroke: #72d6c7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.pnl-chart-line-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 12px 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 850;
}

.pnl-chart-line-meta .pnl-badge {
  color: rgba(255, 255, 255, 0.75);
}

.pnl-chart-line-meta .pnl-positive {
  color: #72d6c7;
}

.pnl-chart-line-meta .pnl-negative {
  color: #ff858d;
}

.trade-calendar {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.trade-calendar-heading {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.trade-calendar-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.trade-calendar-heading h3 {
  margin: 0;
  font-size: 16px;
}

.trade-calendar-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: left;
}

.calendar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.calendar-nav-button,
.calendar-nav-current,
.calendar-view-select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 850;
}

.calendar-nav-button,
.calendar-nav-current,
.calendar-view-select {
  cursor: pointer;
}

.calendar-nav-button {
  width: 34px;
  padding: 0;
}

.calendar-nav-current {
  padding: 0 12px;
}

.calendar-nav-current:disabled {
  color: var(--muted);
  cursor: default;
}

.calendar-view-select {
  padding: 0 28px 0 10px;
}

.calendar-nav-button:hover,
.calendar-nav-current:not(:disabled):hover,
.calendar-view-select:hover {
  border-color: rgba(13, 128, 116, 0.4);
  background: rgba(13, 128, 116, 0.1);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  margin-bottom: 6px;
}

.calendar-weekdays[hidden] {
  display: none;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  display: grid;
  align-content: start;
  width: 100%;
  min-height: 78px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: inherit;
  font-size: 12px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.calendar-day:hover {
  border-color: rgba(25, 111, 166, 0.4);
  background: #eef7f9;
}

.calendar-day-empty {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}

.calendar-day.has-trades {
  border-color: rgba(17, 137, 119, 0.38);
  background: var(--accent-soft);
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 2px rgba(25, 111, 166, 0.28);
}

.calendar-day.is-selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 2px rgba(25, 111, 166, 0.38);
}

.calendar-grid.is-year {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.calendar-month-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.calendar-month-card:hover {
  border-color: rgba(25, 111, 166, 0.4);
  background: #eef7f9;
}

.calendar-month-card.is-selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 2px rgba(25, 111, 166, 0.38);
}

.calendar-month-card strong {
  color: var(--ink);
  font-size: 14px;
}

.calendar-month-card span,
.calendar-month-card b {
  font-size: 12px;
  font-weight: 850;
}

.calendar-date {
  color: var(--muted);
  font-weight: 850;
}

.calendar-day strong {
  margin-top: 8px;
  color: var(--ink);
  font-size: 12px;
}

.calendar-muted {
  color: var(--faint);
  font-weight: 850;
}

.calendar-total {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.calendar-total strong {
  font-size: 20px;
}

.calendar-total small {
  width: 100%;
  color: var(--faint);
  text-align: right;
}

@media (max-width: 760px) {
  .pnl-period-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pnl-period-graph-body {
    grid-template-columns: 1fr;
  }

  .pnl-selected-day-chart {
    grid-template-columns: 1fr;
  }

  .pnl-chart-bar-row {
    grid-template-columns: 42px minmax(70px, 1fr) 84px;
  }

  .pnl-chart-bar-row small {
    grid-column: 3;
  }

  .calendar-grid.is-year {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.list,
.log-list {
  display: grid;
  gap: 9px;
  max-height: 330px;
  overflow: auto;
}

.item,
.empty {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--panel-soft);
}

.item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.item span,
.empty {
  color: var(--muted);
  font-size: 12px;
}

.event-list .item {
  border-left: 4px solid var(--accent);
}

.spread-item {
  border-left: 4px solid var(--blue);
}

.log-list {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111920;
  color: #d9efe9;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.log-list div {
  overflow-wrap: anywhere;
}

.full-log-list {
  max-height: 620px;
}

.diagnostics-heading {
  margin-bottom: 12px;
}

.diagnostics-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--line);
}

.diagnostics-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  cursor: pointer;
}

.diagnostics-tab:hover {
  color: var(--ink);
  background: var(--panel-soft);
}

.diagnostics-tab:focus-visible {
  outline: 3px solid rgba(0, 122, 112, 0.18);
  outline-offset: -3px;
}

.diagnostics-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.diagnostics-view {
  padding-top: 14px;
}

.diagnostics-view[hidden] {
  display: none;
}

.diagnostics-view-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.diagnostics-view-heading h3 {
  margin: 0;
  font-size: 14px;
}

.diagnostics-view-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.diagnostics-content {
  min-height: 300px;
  max-height: 540px;
}

pre {
  overflow: auto;
  max-height: 360px;
  min-height: 180px;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #111920;
  color: #d9efe9;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.auth-page {
  max-width: 760px;
  margin: 40px auto;
}

.auth-error {
  color: var(--danger);
  margin-top: 12px;
}

@media (max-width: 1120px) {
  .masthead,
  .layout,
  .split-panels {
    grid-template-columns: 1fr;
  }

  .status-grid,
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1440px);
    margin-top: 12px;
  }

  .status-grid,
  .overview-grid,
  .field-row,
  .switches,
  .timeline {
    grid-template-columns: 1fr;
  }

  .command-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 100%;
  }

  h1 {
    font-size: 34px;
  }
}
