/*
 * Dialed public pages. Flat by rule: surface fill + 1px hairline, no shadows,
 * no glass, no gradients, no glow. Tokens mirror lib/core/theme/dialed_tokens.dart.
 * Dark is the default; light follows prefers-color-scheme and inverts the
 * accent roles exactly as the app does (warm-black fills carrying bone text).
 */

:root {
  --bg: #0e0d0b;
  --surface: #171612;
  --surface-active: #201d18;
  --ink: #f3efe8;
  --ink-2: rgba(243, 239, 232, 0.68);
  --ink-3: rgba(243, 239, 232, 0.58);
  --accent: #efe6d2;
  --on-accent: #14120e;
  --accent-pressed: #d8cdb6;
  --gain: #a6e8c9;
  --loss: #e0705e;
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-strong: rgba(255, 255, 255, 0.18);
  --display: 'Saira Condensed', 'Arial Narrow', sans-serif;
  --body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, 'Roboto Mono', monospace;
  color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef1ee;
    --surface: #ffffff;
    --surface-active: #f3f6f3;
    --ink: #17211b;
    --ink-2: rgba(23, 33, 27, 0.7);
    --ink-3: rgba(23, 33, 27, 0.6);
    --accent: #3a3128;
    --on-accent: #efe6d2;
    --accent-pressed: #241e18;
    --gain: #0f7a52;
    --loss: #c9503e;
    --hairline: rgba(23, 33, 27, 0.09);
    --hairline-strong: rgba(23, 33, 27, 0.2);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.top {
  padding: 20px 0 12px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-decoration: none;
}

main > * + * {
  margin-top: 16px;
}

.display {
  font-family: var(--display);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

.lede {
  color: var(--ink-2);
  margin: 0;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--ink-3);
}

.small {
  font-size: 13px;
}

/* Identity row */
.ident {
  display: flex;
  gap: 16px;
  align-items: center;
}

.avatar {
  display: inline-block;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  object-fit: cover;
}

.av-lg {
  width: 56px;
  height: 56px;
}

.av-sm {
  width: 24px;
  height: 24px;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-active);
  color: var(--accent);
  font-family: var(--display);
  font-weight: 700;
}

.av-lg.avatar-fallback {
  font-size: 24px;
}

.av-sm.avatar-fallback {
  font-size: 13px;
}

.by {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
}

.tag {
  font-size: 12px;
  line-height: 1;
  padding: 4px 8px;
  border: 1px solid var(--hairline-strong);
  border-radius: 4px;
  color: var(--ink-2);
}

/* Cards and rows */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 16px;
}

.card > * + * {
  margin-top: 12px;
}

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

.card-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.15;
  margin: 0;
  overflow-wrap: anywhere;
}

.status {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  flex: none;
}

.big {
  font-family: var(--display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.gain {
  color: var(--gain);
}

.loss {
  color: var(--loss);
}

.facts {
  margin: 0;
  border-top: 1px solid var(--hairline);
}

.fact {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}

.fact dt {
  color: var(--ink-3);
}

.fact dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.thesis {
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid var(--hairline-strong);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.note-block {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.note-block .eyebrow {
  display: block;
  margin-bottom: 4px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 8px;
}

.stat {
  padding: 14px 12px;
  text-align: center;
}

.stat + .stat {
  border-left: 1px solid var(--hairline);
}

.stat-value {
  font-family: var(--display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-3);
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hairline);
}

.row {
  border-bottom: 1px solid var(--hairline);
}

.row-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  text-decoration: none;
}

.row-main {
  overflow-wrap: anywhere;
  min-width: 0;
}

.row-meta {
  display: flex;
  gap: 12px;
  flex: none;
  font-size: 14px;
  color: var(--ink-2);
}

/* Calls to action */
.cta {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.stores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: var(--body);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-pressed);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--hairline-strong);
}

.btn-disabled {
  color: var(--ink-3);
  cursor: default;
}

.btn .note {
  font-weight: 400;
  font-size: 12px;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.foot {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-3);
  font-size: 13px;
}

.foot p {
  margin: 0;
}
