:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-size: 16px;
  --ink: #1a222c;
  --subtle: #515965;
  --page: #f4f5f6;
  --accent: #e1251b;
  --accent-dark: #b9231b;
  --line: #d0d4d9;
  --field-line: #8d8e91;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent-dark); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -4rem; padding: .8rem; background: white; z-index: 2; }
.skip:focus { top: 1rem; }

.top { background: var(--ink); color: white; }
.bar {
  width: min(1120px, calc(100% - 3rem));
  min-height: 4.5rem;
  margin: auto;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  gap: .55rem;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  color: white;
}
.brand-mark { background: var(--accent); color: white; padding: .24rem .45rem; border-radius: .3rem; }
nav, .account { display: flex; align-items: center; gap: .85rem; }
nav { flex-wrap: wrap; justify-content: center; }
nav a { color: var(--line); padding: .48rem .65rem; text-decoration: none; border-radius: .35rem; }
nav a[aria-current], nav a:hover { background: #343f4c; color: white; }
.account { margin: 0; font-size: .9rem; }
.account span { max-width: 10ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .quiet { color: var(--line); }
.top :focus-visible { outline-color: white; }

.page { width: min(1040px, calc(100% - 3rem)); margin: clamp(2rem, 6vw, 4.5rem) auto; }
.page.narrow { width: min(460px, calc(100% - 2rem)); }
.page.form-page { width: min(690px, calc(100% - 3rem)); }
.intro { margin-bottom: 1.75rem; }
h1, h2 { margin: 0; color: var(--ink); line-height: 1.12; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 750; }
h2 { font-size: clamp(1.2rem, 2.2vw, 1.55rem); }
p { line-height: 1.55; }
.intro p { margin: .6rem 0 0; color: var(--subtle); font-size: 1.08rem; }
.back { display: inline-block; margin-bottom: 1rem; font-weight: 600; }
.panel {
  min-width: 0;
  padding: clamp(1.15rem, 3.5vw, 2rem);
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: white;
  box-shadow: 0 5px 18px #1a222c08;
}
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.action-card { display: flex; flex-direction: column; align-items: flex-start; }
.action-card p { margin: .65rem 0 1.15rem; color: var(--subtle); }
.action-card .button { margin-top: auto; }
.history, .offers, .status-panel { margin-top: 1rem; }
.history-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.history-list li { display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between; padding: .75rem 0; border-top: 1px solid var(--line); }
.muted, .hint { color: var(--subtle); }
.hint, small { font-size: .875rem; }
.hint { margin-top: .35rem; line-height: 1.45; }
.hint ul { padding-left: 1.1rem; margin: .4rem 0; }
.badge { display: inline-block; padding: .28rem .56rem; border-radius: .35rem; background: var(--page); color: var(--subtle); font-size: .875rem; font-weight: 650; }
.badge.active { background: var(--line); color: var(--ink); }
.auth-panel h1 { font-size: clamp(1.9rem, 6vw, 2.55rem); }
.auth-panel form > button { width: 100%; }
.auth-link { margin-top: 1.1rem; }

label, legend { color: var(--ink); font-weight: 650; }
label { display: block; font-size: .94rem; margin-bottom: .35rem; }
input:not([type=checkbox]), select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--field-line);
  border-radius: .4rem;
  padding: .62rem .7rem;
  font: inherit;
  color: var(--ink);
  background: white;
}
select {
  appearance: none;
  padding-right: 2.1rem;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23515965' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right .65rem center;
}
input::placeholder { color: var(--subtle); }
.field { min-width: 0; margin-bottom: 1rem; }
.check-field { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: .35rem .55rem; }
.check-field input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: var(--accent); }
.check-field .errorlist { grid-column: 1/-1; }
fieldset { margin: 0 0 1.1rem; padding: 0; border: 0; min-width: 0; border-bottom: 1px solid var(--line); }
legend { margin-bottom: .85rem; padding: 0; font-size: 1.17rem; }
.grid { display: grid; gap: 0 1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.errorlist { margin: .35rem 0 .65rem; padding-left: 1.2rem; color: var(--accent-dark); }
button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  border: 1px solid transparent;
  border-radius: .42rem;
  padding: .65rem .95rem;
  font: inherit;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  color: white;
  background: var(--accent);
  cursor: pointer;
}
button:hover, .button:hover { background: var(--accent-dark); }
.secondary { background: var(--page); border-color: var(--field-line); color: var(--ink); }
.secondary:hover { background: var(--line); }
.quiet { background: transparent; color: var(--accent-dark); padding: .3rem; text-decoration: underline; }
.quiet:hover { background: transparent; text-decoration-thickness: 2px; }
.form-actions, .recommendation, .inline { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1rem; }
.method-picker { margin-bottom: 1rem; }
.detach { border-top: 1px solid var(--line); margin-top: 1.4rem; padding-top: .75rem; }
.recommendation { justify-content: space-between; background: #fff; border-inline-start: .25rem solid var(--accent); }
.recommendation p { margin: .45rem 0 0; color: var(--subtle); }
.notice { background: #fff; border: 1px solid var(--line); border-radius: .45rem; padding: .65rem .8rem; color: var(--ink); }
.notice.error { background: #fff1f0; border-color: #edcbc9; color: var(--accent-dark); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin-top: .65rem; text-align: left; }
th, td { padding: .85rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--subtle); font-size: .9rem; }
.offers small { display: block; color: var(--subtle); font-weight: 400; margin-top: .3rem; }
.amount { white-space: nowrap; font-weight: 650; font-variant-numeric: tabular-nums; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: .45rem .85rem; margin: 1rem 0 1.35rem; }
.summary dt { color: var(--subtle); }
.summary dd { margin: 0; overflow-wrap: anywhere; }
.catalog { border-block: 1px solid var(--line); padding-block: .9rem; margin-bottom: 1.1rem; }
.inline input { flex: 1 1 12rem; }
code { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .bar { width: calc(100% - 2rem); flex-wrap: wrap; gap: .2rem .7rem; padding: .6rem 0; }
  nav { order: 3; width: 100%; justify-content: flex-start; }
  nav a { padding-inline: 0; margin-right: .4rem; }
  nav a[aria-current], nav a:hover { background: transparent; text-decoration: underline; }
  .page, .page.form-page { width: calc(100% - 2rem); }
}
@media (max-width: 540px) {
  .tiles, .grid.two { grid-template-columns: 1fr; }
  .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three > :first-child { grid-column: 1/-1; }
  .account span { display: none; }
  th, td { padding-inline: .45rem; }
}
