/* ── Sky flavor tokens (local shorthand) ───────────────────────── */
:root {
  --fl-bg:     var(--c-sky-bg);
  --fl-border: var(--c-sky-border);
  --fl-text:   var(--c-sky-text);
  --fl-dark:   #0b3a52;
}

/* ── Hero ──────────────────────────────────────────────────────── */
.app-hero {
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 1.5rem 1.1rem;
}
.app-hero--sky {
  background: var(--fl-bg);
  border-bottom-color: var(--fl-border);
}
.app-hero__inner { margin: 0 auto; }
.app-hero__title {
  font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800;
  color: var(--fl-text); letter-spacing: -.02em;
  margin: 0 0 .5rem; line-height: 1.2;
}
.app-hero__desc {
  font-size: .9rem; color: var(--color-text-secondary);
  max-width: 660px; line-height: 1.6; margin: 0 0 .85rem;
}
.app-hero__chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.hero-chip {
  display: inline-flex; align-items: center; gap: .2rem;
  padding: .22rem .65rem; font-size: .72rem; font-weight: 700;
  background: var(--color-surface); border: 1.5px solid var(--fl-border);
  border-radius: var(--radius-full); color: var(--fl-text); white-space: nowrap;
}

/* ── Layout ────────────────────────────────────────────────────── */
.app-wrap {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem 0 1rem;
}
.pane-in {
  width: 300px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 1rem;
}
.pane-out {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1rem;
}

/* ── Cards and fields ──────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--fl-border);
  border-radius: var(--radius-xl);
  padding: 1rem 1.125rem;
}
.card-title {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fl-text); margin: 0 0 .75rem;
}
.field { margin-bottom: .8rem; }
.field:last-child { margin-bottom: 0; }

label.lbl {
  display: block; font-size: .72rem; font-weight: 600;
  color: var(--color-text-muted); margin-bottom: .28rem;
}
input.num-in, select.sel-in {
  width: 100%; box-sizing: border-box;
  padding: .4rem .6rem; font-size: .8rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg); color: var(--color-text-primary);
  transition: border-color .15s;
}
input.num-in:focus, select.sel-in:focus { outline: none; border-color: var(--fl-text); }

.hint {
  font-size: .68rem; line-height: 1.45;
  color: var(--color-text-muted); margin: .35rem 0 0;
}
.hint a { color: var(--fl-text); }

/* ── Disclosures ───────────────────────────────────────────────── */
.card--adv { padding: .75rem 1.125rem; }
.adv-toggle {
  width: 100%; text-align: left; background: none; border: none;
  padding: 0; cursor: pointer;
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fl-text);
}
#adv-panel { margin-top: .8rem; }

/* ── Result hero ───────────────────────────────────────────────── */
.result-hero {
  display: flex; gap: 1.5rem; align-items: stretch;
  background: var(--fl-bg); border: 1px solid var(--fl-border);
  border-radius: var(--radius-xl); padding: 1.25rem 1.5rem;
}
.big-block { flex: 1; min-width: 0; }
.big-lbl {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--fl-text); margin-bottom: .2rem;
}
.big-val {
  font-size: clamp(1.6rem, 4.4vw, 2.6rem); font-weight: 900;
  color: var(--fl-dark); line-height: 1.05; letter-spacing: -.02em;
}
.big-note {
  font-size: .7rem; line-height: 1.5;
  color: var(--color-text-secondary); margin-top: .45rem; max-width: 42ch;
}
.stats-col {
  width: 210px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: .45rem;
}
.stat-cell {
  background: var(--color-surface); border: 1px solid var(--fl-border);
  border-radius: var(--radius-md); padding: .45rem .6rem;
}
.stat-lbl {
  font-size: .6rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--color-text-muted); margin-bottom: .12rem;
}
.stat-val { font-size: 1.05rem; font-weight: 800; color: var(--fl-dark); line-height: 1.1; }

/* ── Correction chain ──────────────────────────────────────────── */
.bd-row {
  display: grid;
  grid-template-columns: 1fr 92px 96px;
  align-items: baseline; gap: .5rem;
  padding: .32rem .45rem; margin-bottom: .25rem;
  background: var(--fl-bg); border-radius: var(--radius-sm);
  font-size: .78rem;
}
.bd-row--head {
  background: none; padding-bottom: 0; margin-bottom: .1rem;
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--color-text-muted);
}
.bd-row--total { background: var(--fl-border); }
.bd-lbl { font-weight: 700; color: var(--color-text-secondary); }
.bd-fac { font-weight: 600; color: var(--color-text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.bd-val { font-weight: 800; color: var(--fl-dark); text-align: right; font-variant-numeric: tabular-nums; }

/* ── Tables ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.xref { width: 100%; border-collapse: collapse; font-size: .8rem; }
table.xref th, table.xref td {
  padding: .4rem .55rem; text-align: left;
  border-bottom: 1px solid var(--color-border);
}
table.xref thead th {
  font-size: .66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--color-text-muted); white-space: nowrap;
}
table.xref tbody th { font-weight: 800; color: var(--fl-dark); white-space: nowrap; }
table.xref tbody td { font-weight: 800; color: var(--fl-dark); font-variant-numeric: tabular-nums; }
table.xref tbody td.soft { font-weight: 500; color: var(--color-text-secondary); }
table.xref tbody tr.is-active { background: var(--fl-bg); }
table.xref tbody tr.is-twilight td, table.xref tbody tr.is-twilight th { opacity: .55; }

/* ── Moon panel ────────────────────────────────────────────────── */
.moon-line {
  display: flex; flex-wrap: wrap; gap: .4rem .9rem;
  padding: .45rem .55rem; margin-bottom: .45rem;
  background: var(--fl-bg); border-radius: var(--radius-sm);
  font-size: .78rem; font-weight: 700; color: var(--fl-dark);
}
.moon-line span { font-variant-numeric: tabular-nums; }
.moon-verdict { font-size: .78rem; line-height: 1.55; color: var(--color-text-secondary); margin: 0; }
.empty { font-size: .78rem; line-height: 1.55; color: var(--color-text-muted); margin: .6rem 0 0; }

/* ── Copy button ───────────────────────────────────────────────── */
.copy-btn {
  padding: .45rem .9rem; font-size: .76rem; font-weight: 700;
  background: var(--fl-text); color: #fff; cursor: pointer;
  border: none; border-radius: var(--radius-md);
}
.copy-btn:hover { opacity: .9; }

@media (max-width: 820px) {
  .app-wrap { flex-direction: column; padding-top: 1.1rem; }
  .pane-in { width: 100%; }
  .result-hero { flex-direction: column; gap: 1rem; }
  .stats-col { width: 100%; flex-direction: row; }
  .stats-col .stat-cell { flex: 1; }
  .big-note { max-width: none; }
  .bd-row { grid-template-columns: 1fr 70px 80px; font-size: .74rem; }
}

/* ── Learn more ────────────────────────────────────────────────── */
.learn-more{max-width:820px;margin:1.25rem auto 0;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-xl);padding:1.1rem 1.5rem}
.learn-more-title{font-size:1.1rem;font-weight:800;color:var(--fl-text);margin:0 0 .75rem}
.learn-more h3{font-size:1rem;font-weight:800;color:var(--color-text-primary);margin:1.1rem 0 .5rem}
.learn-more p{font-size:.88rem;line-height:1.65;color:var(--color-text-secondary);margin:0 0 .75rem}
.learn-more a{color:var(--fl-text)}
.learn-more .faq-item{margin-bottom:.75rem}
.learn-more .faq-q{font-size:.88rem;font-weight:700;color:var(--color-text-primary);margin:0 0 .25rem}
.learn-more-meta{font-size:.72rem;color:var(--color-text-muted);margin-top:1rem}
