/* Step 8a shell. Black iOS palette from the prompt. No chart series. */

:root {
  color-scheme: dark;
  --bg: #000;
  --text: #fff;
  --secondary: rgba(235, 235, 245, 0.6);
  --tertiary: rgba(235, 235, 245, 0.3);
  --separator: rgba(84, 84, 88, 0.55);
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --green: #00d35a;
  --red: #ff453a;
  --orange: #ff9f0a;
  --cyan: #64d2ff;
  --blue: #0a84ff;
  --yellow: #ffd60a;
  --pink: #ff6b9a;
  --text-font: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display-font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono-font: "SF Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--text-font);
  font-variant-numeric: tabular-nums;
}

body {
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 16px;
}

.brand {
  margin: 0;
  font-family: var(--display-font);
  font-size: 17px;
  font-weight: 600;
}

.paper-pill {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--orange);
  color: #000;
  font-family: var(--mono-font);
  font-size: 12px;
  line-height: 1;
}

.error-row {
  margin: 0;
  padding: 12px 16px;
  min-height: 44px;
  color: var(--red);
  font-size: 15px;
  line-height: 1.35;
}

.error-row[hidden] {
  display: none;
}

main {
  padding: 8px 16px calc(72px + env(safe-area-inset-bottom));
}

.screen[hidden] {
  display: none;
}

h1 {
  margin: 8px 0 16px;
  font-family: var(--text-font);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.block {
  height: 72px;
  margin: 0 0 12px;
  border-radius: 16px;
  background: var(--card);
  opacity: 0.5;
  animation: desk-pulse 1.2s ease-in-out infinite alternate;
}

.block.short {
  width: 46%;
  height: 44px;
}

@keyframes desk-pulse {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

.screen[data-state="empty"] .state-loading,
.screen[data-state="error"] .state-loading {
  display: none;
}

.screen[data-state="loading"] > .state-empty,
.screen[data-state="error"] > .state-empty {
  display: none;
}

.avatar,
.icon-btn,
#activity-see-all,
.ranges button {
  min-width: 44px;
  min-height: 44px;
}

.avatar {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--card-2);
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--tertiary);
  font: inherit;
}

.icon-btn[disabled] {
  opacity: 0.45;
}

.balance-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.odometer {
  min-height: 66px;
  font-family: var(--display-font);
  font-size: 66px;
  font-weight: 600;
  line-height: 1;
}

.odo-col {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  vertical-align: top;
}

.odo-strip {
  display: block;
  transition: transform 600ms ease-out;
}

.odo-digit {
  display: block;
  height: 1em;
}

.today {
  margin: 8px 0 0;
  color: var(--secondary);
  font-size: 16px;
}

.mult {
  display: inline-block;
  margin: 8px 0 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green);
  color: #000;
  font-family: var(--mono-font);
  font-size: 13px;
}

.ranges {
  display: flex;
  gap: 4px;
  margin: 16px 0;
}

.ranges button {
  flex: 1 1 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--secondary);
  font: inherit;
  font-size: 13px;
}

.ranges button[aria-current="true"] {
  background: var(--card-2);
  color: var(--text);
}

.chart-canvas {
  display: block;
  width: 100%;
  height: 180px;
  background: transparent;
}

.part-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.part-head h2,
.part-body h2 {
  margin: 16px 0;
  font-size: 22px;
  font-weight: 600;
  text-transform: none;
}

#activity-see-all {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
}

.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}

.agent-card {
  flex: 0 0 calc(100vw - 32px);
  aspect-ratio: 504 / 470;
  scroll-snap-align: start;
  border-radius: calc(42 * (100vw - 32px) / 504);
  background: var(--card);
  padding: 24px;
}

.agent-card[data-agent="Scanner"] { border-top: 3px solid #64d2ff; }
.agent-card[data-agent="Analyst"] { border-top: 3px solid #ffd60a; }
.agent-card[data-agent="Executor"] { border-top: 3px solid #00d35a; }
.agent-card[data-agent="Risk"] { border-top: 3px solid #ff6b9a; }

.agent-card p {
  margin: 0 0 8px;
  font-size: 22px;
}

.agent-card .status {
  color: var(--secondary);
  font-size: 16px;
}

.activity-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--separator);
}

.activity-row .sub {
  grid-column: 1;
  color: var(--secondary);
}

.agent-full {
  margin: 0 0 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--card);
}

.agent-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-top h2,
.agent-status {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  text-transform: none;
}

.agent-status {
  color: var(--secondary);
  font-size: 16px;
  font-weight: 400;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--tertiary);
}

.status-dot.is-running {
  background: var(--green);
}

.status-dot.is-paused {
  background: var(--secondary);
}

.agent-switch,
.settings-link {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.agent-switch {
  position: relative;
  width: 64px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border-radius: 999px;
  background: transparent;
}

.agent-switch::before,
.agent-switch::after {
  content: "";
  position: absolute;
  display: block;
}

.agent-switch::before {
  top: 14px;
  right: 8px;
  left: 8px;
  height: 16px;
  border-radius: 999px;
  background: rgba(235, 235, 245, 0.35);
}

.agent-switch::after {
  top: 10px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
}

.agent-switch[data-known="false"]::after {
  display: none;
}

.agent-switch[aria-checked="true"]::before {
  background: #00d35a;
}

.agent-switch[aria-checked="true"]::after {
  right: 8px;
  left: auto;
}

.agent-switch:disabled,
.agent-switch[aria-busy="true"] {
  opacity: 0.4;
}

.settings-link {
  color: var(--blue);
  padding: 0;
}

.card-note {
  margin: 8px 0 0;
  color: var(--red);
}

.decision {
  padding: 12px 0;
  border-top: 1px solid var(--separator);
}

.decision p {
  margin: 0;
}

.part-empty p {
  margin: 0;
  color: var(--secondary);
}

.part[data-state="loading"] .part-body,
.part[data-state="loading"] .part-empty,
.part[data-state="loading"] .chart-canvas {
  display: none;
}

.part[data-state="ready"] .part-loading,
.part[data-state="ready"] .part-empty {
  display: none;
}

.part[data-state="empty"] .part-loading,
.part[data-state="empty"] .part-body {
  display: none;
}

.part[data-state="empty"][data-has-start="false"] .chart-canvas {
  display: none;
}

.part[data-state="error"] .part-loading {
  display: none;
}

.part[data-state="error"][data-has-value="false"] .part-body,
.part[data-state="error"][data-has-value="false"] .part-empty,
.part[data-state="error"][data-has-value="false"] .chart-canvas {
  display: none;
}

.part[data-state="error"] .part-empty,
.part[data-state="error"][data-last="ready"] .part-empty {
  display: none;
}

.part[data-state="error"][data-last="empty"] .part-body {
  display: none;
}

.part[data-state="error"][data-last="empty"][data-has-start="false"] .chart-canvas {
  display: none;
}

.state-empty p {
  margin: 0;
  color: var(--secondary);
  font-size: 16px;
  line-height: 1.4;
}

.tabs {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  border-top: 1px solid var(--separator);
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.tabs button {
  flex: 1 1 0;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font: inherit;
  font-size: 13px;
  text-transform: none;
}

.tabs button[aria-current="page"] {
  color: var(--text);
}

button.activity-row {
  width: 100%;
  min-height: 44px;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.detail-back,
.fomo-link,
.fomo-idle {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.detail-back {
  color: var(--blue);
  padding: 0;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-price {
  margin: 8px 0;
  font-family: var(--display-font);
  font-size: 66px;
  font-weight: 600;
  line-height: 1;
}

.shield {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green);
  color: #000;
  font-family: var(--mono-font);
  font-size: 13px;
}

.change-line,
.stat-line,
.candle-line,
.layer-line {
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--separator);
}

.disc-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.disc {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--card-2);
  transition: background-color 150ms linear;
}

.disc.is-pass {
  background: var(--green);
}

.disc.is-fail {
  background: var(--red);
}

.disc.is-beam {
  background: var(--cyan);
}

.saved-audit {
  margin: 0 0 8px;
  color: var(--secondary);
  font-size: 13px;
}

.candle-canvas {
  display: block;
  width: 100%;
  height: 220px;
  margin-top: 12px;
  background: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: pre;
  border: 0;
}

.fomo-link,
.fomo-idle {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--card-2);
  text-align: center;
  text-decoration: none;
}

.fomo-idle {
  color: var(--tertiary);
}

.account-row,
.setting-row {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--separator);
}

.account-link,
.invite-btn {
  display: inline-block;
  min-height: 44px;
  min-width: 44px;
  margin: 8px 0 0;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.account-link.is-idle,
.invite-btn:disabled {
  color: var(--tertiary);
}

.setting-group {
  margin: 16px 0 0;
  font-size: 16px;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .block {
    animation: none;
    opacity: 1;
  }

  .odo-strip,
  .disc {
    transition: none;
  }
}
