/* UI kit shared shell */
@import url("../../colors_and_type.css");

html, body {
  background: #0F1216;
  min-height: 100vh;
}

/* Center stage with subtle device-ish wrapper */
.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 32px 16px 64px;
  gap: 24px;
}

.stage-header {
  width: 100%;
  max-width: 1180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.stage-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.stage-sub {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

.screen-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.phone {
  width: 380px;
  height: 780px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.phone-label {
  position: absolute;
  top: -22px;
  left: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* Phosphor-style icon container */
.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: currentColor;
}
.ico.sm { width: 16px; height: 16px; }
.ico svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Status bar - phone */
.statusbar {
  height: 36px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  flex-shrink: 0;
}
.statusbar .right { display: flex; gap: 6px; align-items: center; color: var(--text-secondary); }

/* Tab bar */
.tabbar {
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: stretch;
  background: var(--bg-base);
  flex-shrink: 0;
}
.tabbar button {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 14px 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.tabbar button.active { color: var(--text-primary); }
.tabbar button:hover { color: var(--text-secondary); }
.tabbar button.active:hover { color: var(--text-primary); }

/* Body scroll area */
.screen-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}
.screen-body::-webkit-scrollbar { width: 4px; }
.screen-body::-webkit-scrollbar-thumb { background: var(--border-default); }

.pad {
  padding: 0 20px;
}

/* Screen header */
.s-header {
  padding: 8px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.s-header .back {
  background: transparent; border: 0; cursor: pointer;
  color: var(--text-secondary); padding: 6px; margin-left: -6px;
  display: inline-flex; align-items: center;
}
.s-header .back:hover { color: var(--text-primary); }
.s-header .ctx {
  font-family: var(--font-body); font-weight: 500; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary);
}

/* Reusable caption */
.cap {
  font-family: var(--font-body); font-weight: 500; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary);
}

/* Bottom-anchored button container */
.cta-anchor {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-base);
  flex-shrink: 0;
}

/* Buttons */
.btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 24px;
  font-family: var(--font-body); font-weight: 500; font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--accent); border-radius: 0; cursor: pointer;
  transition: background-color 150ms var(--ease-default), color 150ms var(--ease-default);
}
.btn:hover { background: var(--accent); color: var(--text-inverse); }
.btn:active { background: var(--accent-hover); color: var(--text-inverse); }
.btn[disabled] { border-color: var(--border-default); color: var(--text-disabled);
  cursor: not-allowed; background: transparent; }
.btn.secondary { border-color: var(--border-default); }
.btn.secondary:hover { background: transparent; color: var(--text-primary);
  border-color: var(--border-strong); }
.btn.ghost { border-color: transparent; color: var(--text-secondary); }
.btn.ghost:hover { background: var(--bg-interactive); color: var(--text-primary); }

/* Pos / neg numerals */
.pos { color: var(--data-positive); }
.neg { color: var(--data-negative); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums;
       font-feature-settings: "tnum"; }

/* Accent rule */
.accent-rule { display:block; width: 40px; height: 1px; background: var(--accent); }

/* Chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-body); font-weight: 500;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--border-default); color: var(--text-secondary);
  border-radius: 0; background: transparent;
}
.chip.active { border-color: var(--accent); color: var(--accent);
  background: var(--accent-muted); }
.chip.s-live { color: var(--text-primary); }
.chip.s-live::before { content: ""; width:6px; height: 6px; background: var(--accent); }
.chip.s-ok { color: var(--data-positive); border-color: var(--data-positive); }
.chip.s-warn { color: var(--data-negative); border-color: var(--data-negative); }

/* Card */
.kard {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 16px 18px;
}
.kard.active { border-color: var(--accent); }
.kard.flat { background: transparent; border-left: 0; border-right: 0;
  border-radius: 0; padding-left: 0; padding-right: 0; }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field .input {
  display: block; width: 100%; padding: 8px 0; background: transparent;
  border: 0; border-bottom: 1px solid var(--border-default);
  color: var(--text-primary); font-family: var(--font-body); font-size: 15px;
  outline: 0; border-radius: 0;
}
.field .input.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.field .input:focus { border-bottom: 2px solid var(--accent); padding-bottom: 7px; }

/* Option tile (onboarding answers / large tap targets) */
.option-tile {
  width: 100%; text-align: left;
  background: transparent; cursor: pointer; padding: 18px 18px;
  border: 1px solid var(--border-default); border-radius: 0;
  color: var(--text-primary); font-family: var(--font-body); font-size: 15px;
  line-height: 22px; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  transition: border-color 150ms var(--ease-default),
              background-color 150ms var(--ease-default);
}
.option-tile:hover { border-color: var(--border-strong); background: var(--bg-elevated); }
.option-tile.selected { border-color: var(--accent); background: rgba(212,62,45,0.04); }
.option-tile .lead { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.option-tile .sub { font-size: 12px; color: var(--text-tertiary); }
.option-tile .marker {
  width: 16px; height: 16px; border: 1px solid var(--border-default);
  margin-top: 3px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.option-tile.selected .marker { border-color: var(--accent); background: var(--accent); }
.option-tile.selected .marker::after {
  content: ""; width: 6px; height: 6px; background: var(--bg-base);
}

/* Table */
.kt { width: 100%; border-collapse: collapse; }
.kt th {
  font-family: var(--font-body); font-weight: 500; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; text-align: left;
  color: var(--text-tertiary); padding: 10px 0 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.kt td {
  padding: 12px 0; border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-body); font-size: 14px; color: var(--text-primary);
  vertical-align: top;
}
.kt td.num, .kt th.num {
  text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.kt td.t { font-family: var(--font-mono); color: var(--text-tertiary);
  font-size: 12px; font-variant-numeric: tabular-nums; }
.kt tbody tr:hover { background: var(--bg-interactive); }

/* Big display number */
.big-mono { font-family: var(--font-display); font-weight: 300;
  font-size: 44px; line-height: 52px; letter-spacing: -0.02em; }
.med-mono { font-family: var(--font-display); font-weight: 300;
  font-size: 32px; line-height: 38px; letter-spacing: -0.02em; }

/* Question copy (onboarding) */
.question {
  font-family: var(--font-display); font-weight: 300; font-size: 28px;
  line-height: 36px; letter-spacing: -0.01em; color: var(--text-primary);
}

/* Sparkline / chart panel */
.chart {
  background: transparent; padding: 12px 0 4px;
}

/* List divider */
.row-div > * + * { border-top: 1px solid var(--border-subtle); }

/* Pilot row */
.pilot-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 0; cursor: pointer;
}
.pilot-row .name {
  font-family: var(--font-display); font-weight: 300; font-size: 19px;
  line-height: 24px; letter-spacing: -0.01em; color: var(--text-primary);
}
.pilot-row .meta {
  font-family: var(--font-body); font-size: 12px; color: var(--text-tertiary);
}

/* Disclosure / aside */
.disclosure {
  font-family: var(--font-body); font-size: 11px; line-height: 16px;
  color: var(--text-tertiary); padding: 12px 0;
}

/* Sparkline svg */
.spark { width: 100%; height: 90px; display: block; }

/* Modal scrim */
.modal-scrim {
  position: absolute; inset: 0; background: var(--bg-overlay);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 10;
}
.sheet {
  width: 100%; background: var(--bg-elevated);
  border-top: 1px solid var(--border-default);
  padding: 24px 20px 28px;
  display: flex; flex-direction: column; gap: 16px;
}
