:root {
  color-scheme: light;
  --canvas: #f7f7f1;
  --surface: #fff;
  --text: #1c201e;
  --muted: #515a56;
  --line: #dcded6;
  --control: #7a7f75;
  --gold: #dbc442;
  --focus: #245aa5;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--canvas);
  color: var(--text);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }

main {
  max-width: 470px;
  margin-inline: auto;
  padding: max(28px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.mark { border-radius: 11px; display: block; flex: none; }
h1, h2 { margin: 0; line-height: 1.18; letter-spacing: -.025em; }
h1 { font-size: 25px; }
h2 { font-size: 23px; }
p { margin: 10px 0 0; color: var(--muted); }
.panel { padding: 18px; border: 1px solid var(--line); background: var(--surface); border-radius: 15px; }
.section-title { margin: 26px 0 14px; }
.install { margin: 16px 2px 0; }
#pair-form { margin-top: 21px; }
label { display: block; font-weight: 650; }
input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  margin-top: 5px;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--control);
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

button {
  background: var(--gold);
  color: #1b1b15;
  width: 100%;
  font: inherit;
  font-weight: 720;
  line-height: 1.25;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 9px;
  margin-top: 16px;
  padding: 11px 12px;
  cursor: pointer;
}
button:disabled { opacity: .7; cursor: default; }
button:not(:disabled):hover { filter: brightness(.97); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.text-button {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .15em;
  margin-top: 8px;
}
.preferences { padding-block: 0; }
.setting-row { padding-block: 10px 14px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 12px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 720;
  cursor: pointer;
}
input[role="switch"] {
  appearance: none;
  width: 44px;
  height: 27px;
  border: 1px solid var(--control);
  border-radius: 30px;
  background: #e8e9e4;
  margin: 0;
  flex: none;
  position: relative;
  cursor: pointer;
}
input[role="switch"]::after {
  content: "";
  position: absolute;
  width: 19px;
  height: 19px;
  inset: 3px auto auto 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 1px #50574338;
}
input[role="switch"]:checked { background: var(--gold); border-color: #8c7615; }
input[role="switch"]:checked::after { inset-inline-start: 20px; }
.thresholds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  margin-top: 10px;
}
.thresholds.currency { grid-template-columns: 35px repeat(2, minmax(0, 1fr)); }
.thresholds strong { align-self: end; padding-bottom: 11px; }
.thresholds label, .detail, .outcome { font-size: 14px; color: var(--muted); }
.detail { margin-top: 3px; }
.thresholds + .detail, #month-note { margin-top: 8px; }
#feedback {
  padding: 10px 12px;
  margin-top: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
#feedback[data-error] { color: #8b3432; }
@media (min-width: 600px) {
  main { padding-top: 58px; }
}
@media (forced-colors: active) {
  input[role="switch"] { appearance: auto; }
}
