/* I&E Bench design tokens - mirrored from DesignTokens.swift (IEColor). HTML mockups only. */
:root, .light {
  --bg: #FFFFFF;
  --surface: #F7F7F8;
  --surface-elevated: #FFFFFF;
  --border: #E4E4E7;
  --border-strong: #D4D4D8;
  --text-primary: #09090B;
  --text-secondary: #5A5A63;
  --text-tertiary: #6B7280;
  --accent: #2563EB;
  --accent-muted: #DBEAFE;
  --success: #16A34A;
  --success-muted: #DCFCE7;
  --warning: #CA8A04;
  --warning-muted: #FEF9C3;
  --danger: #DC2626;
  --danger-muted: #FEE2E2;
  --on-accent: #FFFFFF;
  --status-bar: #09090B;
  --tab-bg: rgba(255,255,255,0.92);
  --tab-border: #E4E4E7;
  --home-indicator: #09090B;
}
.dark {
  --bg: #09090B;
  --surface: #18181B;
  --surface-elevated: #27272A;
  --border: #27272A;
  --border-strong: #3F3F46;
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-tertiary: #A1A1AA;
  --accent: #3B82F6;
  --accent-muted: #1E3A8A;
  --success: #22C55E;
  --success-muted: #14532D;
  --warning: #EAB308;
  --warning-muted: #422006;
  --danger: #EF4444;
  --danger-muted: #7F1D1D;
  --on-accent: #FFFFFF;
  --status-bar: #FAFAFA;
  --tab-bg: rgba(9,9,11,0.92);
  --tab-border: #27272A;
  --home-indicator: #FAFAFA;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: #1a1a1a;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.phone {
  width: 393px;
  height: 852px;
  min-height: 852px;
  background: var(--bg);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone.fixed { height: 852px; min-height: 852px; }
.status-bar {
  height: 54px;
  padding: 14px 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--status-bar);
  flex-shrink: 0;
}
.status-bar .time { width: 54px; }
.status-bar .icons { display: flex; gap: 6px; align-items: center; }
.status-bar svg { display: block; }

.mock-banner {
  position: absolute;
  top: 58px;
  right: 10px;
  z-index: 20;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--warning-muted);
  color: var(--warning);
  border: 1px solid var(--warning);
  opacity: 0.95;
  pointer-events: none;
}

.nav-bar {
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.nav-bar .close {
  color: var(--accent);
  font-size: 17px;
  font-weight: 400;
  background: none;
  border: none;
}

.content {
  flex: 1;
  overflow: visible;
  padding: 8px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.content.scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.title-block { display: flex; flex-direction: column; gap: 4px; }
.title-block h1 {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.1;
  color: var(--text-primary);
}
.title-block .subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  width: 100%;
}
.card.vstack { display: flex; flex-direction: column; gap: 12px; }
.card.vstack-md { display: flex; flex-direction: column; gap: 16px; }
.card.vstack-sm { display: flex; flex-direction: column; gap: 12px; }

.section-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.field { display: flex; flex-direction: column; gap: 4px; }
.field .label { font-size: 12px; color: var(--text-secondary); }
.field .box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.field .box .value {
  flex: 1;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 17px;
  color: var(--text-primary);
}
.field .box .unit {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--text-secondary);
}
.field .box.plain .value { font-family: Inter, sans-serif; }
.field .box .unit:empty { display: none; }

.btn-primary {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; width: 100%;
  background: var(--accent); color: var(--on-accent);
  font-size: 17px; font-weight: 600; border: none; border-radius: 12px;
}
.btn-secondary {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; width: 100%;
  background: transparent; color: var(--text-primary);
  font-size: 17px; font-weight: 600;
  border: 1px solid var(--border-strong); border-radius: 12px;
}

.result { display: flex; flex-direction: column; gap: 4px; }
.result .rlabel {
  font-size: 12px; font-weight: 500; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-tertiary);
}
.result .rrow { display: flex; align-items: baseline; gap: 6px; }
.result .rvalue {
  font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums;
  color: var(--text-primary); letter-spacing: -0.3px;
}
.result .rvalue.sm {
  font-size: 17px; font-weight: 500;
  font-family: "Roboto Mono", ui-monospace, monospace;
}
.result .runit { font-size: 16px; font-variant-numeric: tabular-nums; color: var(--text-secondary); }

.chips { display: flex; gap: 8px; flex-wrap: nowrap; overflow: hidden; }
.chip {
  flex-shrink: 0; padding: 8px 14px; font-size: 15px; font-weight: 500;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
}
.chip.selected {
  background: var(--accent-muted); color: var(--accent);
  border-color: rgba(37, 99, 235, 0.35);
}
.dark .chip.selected { border-color: rgba(59, 130, 246, 0.35); }

.segmented {
  display: flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
.segmented .seg {
  flex: 1; text-align: center; padding: 10px 4px; font-size: 15px; font-weight: 500;
  color: var(--text-secondary); position: relative; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.segmented .seg.selected { color: var(--accent); }
.segmented .seg.selected::before {
  content: ""; position: absolute; inset: 3px;
  background: var(--accent-muted); border-radius: 8px; z-index: 0;
}
.segmented .seg span { position: relative; z-index: 1; }

.mono-caption {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 12px; color: var(--text-tertiary);
}
.caption { font-size: 12px; color: var(--text-tertiary); line-height: 1.4; }
.caption.warn { color: var(--warning); }
.body-text { font-size: 17px; color: var(--text-secondary); line-height: 1.4; }
.callout { font-size: 16px; color: var(--text-secondary); }

.hub-row { display: flex; align-items: center; gap: 16px; }
.hub-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-muted); color: var(--accent); flex-shrink: 0;
}
.hub-icon.locked { background: var(--surface-elevated); color: var(--text-tertiary); }
.hub-text { flex: 1; min-width: 0; }
.hub-text .htitle {
  font-size: 17px; font-weight: 600; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.hub-text .hdetail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.pro-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px;
  background: var(--accent-muted); color: var(--accent);
}
.chevron { color: var(--text-tertiary); flex-shrink: 0; }

.feature-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 17px; color: var(--text-primary);
}
.feature-row svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }

.links { display: flex; gap: 16px; }
.links a { font-size: 12px; color: var(--accent); text-decoration: none; }

.search {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text-tertiary); font-size: 17px;
}
.search .ph { color: var(--text-tertiary); }

.tab-bar {
  height: 83px; background: var(--tab-bg); border-top: 0.5px solid var(--tab-border);
  backdrop-filter: blur(20px); display: flex; padding: 6px 0 0;
  flex-shrink: 0; position: relative; margin-top: auto;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-tertiary); font-size: 10px; font-weight: 500;
}
.tab.selected { color: var(--accent); }
.tab svg { width: 24px; height: 24px; }
.home-indicator {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 134px; height: 5px; background: var(--home-indicator);
  border-radius: 3px; opacity: 0.2;
}

.picker-wheel {
  height: 120px; overflow: hidden; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
}
.picker-wheel .opt {
  font-size: 20px; color: var(--text-tertiary); height: 28px; line-height: 28px;
}
.picker-wheel .opt.sel { color: var(--text-primary); font-weight: 500; font-size: 22px; }
.picker-sel-bar {
  position: absolute; left: 8px; right: 8px; height: 32px; top: 50%;
  transform: translateY(-50%); background: var(--surface); border-radius: 8px;
  z-index: -1; border: 1px solid var(--border);
}

.stack-xs { display: flex; flex-direction: column; gap: 8px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.stack-md { display: flex; flex-direction: column; gap: 16px; }
.gap-section { display: flex; flex-direction: column; gap: 24px; }
