:root {
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
body {
  margin: 0;
}
img {
  max-width: 100%;
}

:root {
  --bg: #f3f6f6;
  --surface: #ffffff;
  --ink: #12292e;
  --muted: #5a6f73;
  --line: #d6e0e1;
  --accent: #f2c230;
  --accent-ink: #3a2c00;
  --petrol: #0f5560;
  --petrol-soft: #e0eef0;
  --warn-bg: #fff4d6;
  --warn-ink: #5c4300;
  --ok: #1c7a52;
  --ok-bg: #dff3ea;
  --late: #a8431f;
  --late-bg: #fbe6de;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1719;
    --surface: #14262a;
    --ink: #e6f0f1;
    --muted: #9bb1b5;
    --line: #274047;
    --accent: #f2c230;
    --accent-ink: #2b2100;
    --petrol: #7fd0dc;
    --petrol-soft: #1b3a40;
    --warn-bg: #3a3010;
    --warn-ink: #f6dc8a;
    --ok: #7fdcae;
    --ok-bg: #153a2b;
    --late: #f3a585;
    --late-bg: #44221a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1719;
  --surface: #14262a;
  --ink: #e6f0f1;
  --muted: #9bb1b5;
  --line: #274047;
  --accent: #f2c230;
  --accent-ink: #2b2100;
  --petrol: #7fd0dc;
  --petrol-soft: #1b3a40;
  --warn-bg: #3a3010;
  --warn-ink: #f6dc8a;
  --ok: #7fdcae;
  --ok-bg: #153a2b;
  --late: #f3a585;
  --late-bg: #44221a;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 48px;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}
.wrap {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
header.bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: var(--bg);
  padding-block: 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
header.bar h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
  min-width: 0;
  text-wrap: balance;
}
.back {
  font: inherit;
  font-weight: 600;
  color: var(--petrol);
  background: var(--petrol-soft);
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.mark {
  width: 14px;
  height: 22px;
  background: var(--accent);
  border-radius: 3px;
  flex: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}
input[type="search"],
input[type="date"],
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tile {
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 104px;
}
.tile b {
  font-size: 1.08rem;
}
.tile span {
  font-size: 0.85rem;
  color: var(--muted);
}
.tile.on {
  border-color: var(--petrol);
  box-shadow: inset 0 -5px 0 var(--accent);
}
.tile.soon {
  cursor: default;
  opacity: 0.6;
  border-style: dashed;
}
h2 {
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 6px 0 0;
  font-weight: 600;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row {
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
}
.row .txt {
  flex: 1;
  min-width: 0;
}
.row .txt b {
  display: block;
}
.row .txt span {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
}
.row .ref {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--petrol);
  font-size: 0.95rem;
  flex: none;
}
.chev {
  color: var(--muted);
  flex: none;
}
.pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--petrol-soft);
  color: var(--petrol);
}
.pill.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.pill.late {
  background: var(--late-bg);
  color: var(--late);
}
.pill.tol {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card h3 {
  margin: 0;
  font-size: 1rem;
}
.card p {
  margin: 0;
}
.card b {
  font-size: 0.92rem;
}
.card ul {
  margin: 0;
  padding-left: 1.15em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kv {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 0;
}
@media (min-width: 600px) {
  .kv {
    grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
    gap: 8px 16px;
  }
  .kv dd {
    padding-bottom: 0;
  }
}
.kv dt {
  color: var(--muted);
  font-size: 0.86rem;
}
.kv dd {
  margin: 0;
  font-weight: 500;
  padding-bottom: 10px;
  overflow-wrap: anywhere;
}
.kv dd:last-child {
  padding-bottom: 0;
}
.card p,
.card li,
.warn {
  overflow-wrap: anywhere;
}
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.step {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.step:first-child {
  border-top: 0;
  padding-top: 0;
}
.step .d {
  font-family: var(--mono);
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 10px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.step b {
  display: block;
}
.step span {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
}
.nums {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.num {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}
.num code {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--petrol);
  font-size: 0.98rem;
}
.num span {
  font-size: 0.92rem;
}
.warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.92rem;
}
.warn b {
  display: block;
  margin-bottom: 2px;
}
.warn ul {
  margin: 4px 0 0;
  padding-left: 1.15em;
}
.src {
  font-size: 0.82rem;
  color: var(--muted);
}
.src a {
  color: var(--petrol);
}
.cal {
  display: flex;
  flex-direction: column;
}
.cal div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 0.93rem;
}
.cal div:first-child {
  border-top: 0;
}
.cal b {
  font-weight: 600;
}
.dates {
  font-variant-numeric: tabular-nums;
  font-size: 0.86rem;
  color: var(--muted);
}
label {
  font-weight: 600;
  font-size: 0.92rem;
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 18px;
}
@media (prefers-reduced-motion: no-preference) {
  .row,
  .tile {
    transition: border-color 0.12s;
  }
}
.row:hover,
.tile.on:hover {
  border-color: var(--petrol);
}
.view {
  gap: 14px;
}
.fav {
  align-self: flex-start;
}
.lead {
  margin: 0;
  font-size: 1.05rem;
}
.kv dd.normal {
  font-weight: 400;
}
.pair {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.code {
  font-family: var(--mono);
  color: var(--petrol);
}
.code.bold {
  font-weight: 600;
}
.code.small {
  font-size: 0.92rem;
}
.cal.rates div {
  grid-template-columns: minmax(0, 1fr) auto;
}
.row.static {
  cursor: default;
}
.steps.durations .step {
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
}
.update {
  font: inherit;
  font-weight: 600;
  text-align: left;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}
