:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --bg-tint-a: rgba(0, 122, 255, .16);
  --bg-tint-b: rgba(175, 82, 222, .12);
  --bg-tint-c: rgba(52, 199, 89, .10);
  --ink: #1c1c1e;
  --soft: #6c6c70;
  --hairline: rgba(60, 60, 67, .16);
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, .08);
  --blue: #007aff;
  --on-blue: #ffffff;
  --red: #d70015;
  --red-tint: rgba(255, 59, 48, .14);
  --orange: #a05a00;
  --orange-tint: rgba(255, 149, 0, .16);
  --green: #1a7f37;
  --green-tint: rgba(52, 199, 89, .16);
  --field: rgba(118, 118, 128, .12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-tint-a: rgba(10, 132, 255, .28);
    --bg-tint-b: rgba(191, 90, 242, .20);
    --bg-tint-c: rgba(48, 209, 88, .14);
    --ink: #f5f5f7;
    --soft: #aeaeb2;
    --hairline: rgba(235, 235, 245, .16);
    --glass: rgba(44, 44, 46, .55);
    --glass-strong: rgba(44, 44, 46, .78);
    --glass-edge: rgba(255, 255, 255, .16);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, .45);
    --blue: #0a84ff;
    --red: #ff6961;
    --red-tint: rgba(255, 69, 58, .20);
    --orange: #ffb340;
    --orange-tint: rgba(255, 159, 10, .20);
    --green: #30d158;
    --green-tint: rgba(48, 209, 88, .18);
    --field: rgba(118, 118, 128, .24);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--bg);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vmax 45vmax at 8% -6%, var(--bg-tint-a), transparent 70%),
    radial-gradient(55vmax 45vmax at 104% 18%, var(--bg-tint-b), transparent 70%),
    radial-gradient(60vmax 45vmax at 40% 108%, var(--bg-tint-c), transparent 70%);
}
main { max-width: 600px; margin: 0 auto; padding: 16px 16px max(48px, env(safe-area-inset-bottom)); }

.bar {
  position: sticky; top: 8px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 8px auto 0; max-width: 568px; padding: 8px 8px 8px 16px;
  border-radius: 999px;
}
.bar strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.bar a { color: var(--blue); text-decoration: none; font-size: 15px; font-weight: 500; padding: 6px 10px; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: .5px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-edge), inset 0 -1px 0 rgba(255, 255, 255, .06);
}

h1 { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -.022em; margin: 24px 4px 6px; }
.lead { color: var(--soft); font-size: 17px; margin: 0 4px 20px; }
h2 { font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--soft); margin: 0 0 6px; }
p { margin: 0 0 10px; }
.card { border-radius: 22px; padding: 16px; margin-bottom: 12px; }
.card > :last-child { margin-bottom: 0; }

label.title { display: block; font-size: 13px; font-weight: 600; color: var(--soft); margin-bottom: 8px; }
select, input[type=password] {
  width: 100%; min-height: 44px; font: inherit; color: var(--ink);
  padding: 10px 12px; border: 0; border-radius: 12px; background: var(--field);
  -webkit-appearance: none; appearance: none;
}
button, .button {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px;
  padding: 12px 18px; margin-top: 8px; font: inherit; font-weight: 600; letter-spacing: -.01em;
  border: 0; border-radius: 999px; background: var(--field); color: var(--blue);
  cursor: pointer; text-decoration: none; transition: transform .15s ease, opacity .15s ease;
}
button:active, .button:active { transform: scale(.98); }
button.primary {
  background: var(--blue); color: var(--on-blue);
  box-shadow: 0 6px 18px rgba(0, 122, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .28);
}
button:disabled { opacity: .4; cursor: default; box-shadow: none; transform: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick-row button { margin-top: 0; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs:not(:empty) { margin-top: 12px; }
.thumbs figure { position: relative; margin: 0; }
.thumbs img, .thumbs .pdf {
  display: flex; align-items: center; justify-content: center;
  width: 72px; height: 96px; object-fit: cover; font-size: 13px; color: var(--soft);
  border-radius: 12px; background: var(--field);
}
.thumbs button {
  position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; min-height: 0;
  padding: 0; margin: 0; font-size: 15px; line-height: 1; color: var(--ink); background: var(--glass-strong);
}
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.consent input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--blue); }
.consent a, .note a { color: var(--blue); }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.today { background: var(--red-tint); color: var(--red); }
.soon { background: var(--orange-tint); color: var(--orange); }
.calm { background: var(--green-tint); color: var(--green); }
.alert { background: var(--red-tint); }
.caution { background: var(--orange-tint); }
ol, ul { margin: 0; padding-inline-start: 22px; }
li { margin-bottom: 6px; }
.quote { border-inline-start: 3px solid var(--hairline); padding-inline-start: 10px; color: var(--soft); margin: 8px 0; }
.draft { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--field); border-radius: 14px; padding: 12px; font-size: 16px; margin-bottom: 8px; }
.big { font-size: 22px; line-height: 1.22; font-weight: 700; letter-spacing: -.016em; margin-bottom: 8px; }
.note { font-size: 13px; color: var(--soft); margin-top: 8px; }
.error { color: var(--red); font-weight: 600; margin: 12px 4px 0; }
.foot { font-size: 13px; color: var(--soft); margin: 18px 4px 0; }
.foot a { color: var(--soft); }
.legal h2 { font-size: 20px; color: var(--ink); letter-spacing: -.01em; font-weight: 700; margin: 22px 0 6px; }
.legal a { color: var(--blue); }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: no-preference) {
  .busy { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .6; } }
}
@media (prefers-reduced-motion: reduce) {
  button, .button { transition: none; }
  button:active, .button:active { transform: none; }
}
@media (prefers-contrast: more) {
  .glass { background: var(--glass-strong); border: 1px solid var(--soft); }
}
@media (prefers-reduced-transparency: reduce) {
  body::before { display: none; }
  .glass { background: var(--glass-strong); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; border: 1px solid var(--hairline); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-strong); }
}
