:root {
  --bg: #f5f3ee; --surface: #fbfaf6; --ink: #14302f; --muted: #5d6f6e; --line: #dcd8cd;
  --accent: #1d8582; --accent-ink: #fff; --accent-soft: #d9ecea; --danger: #b3412e;
  --radius: 14px; --shadow: 0 20px 60px -24px rgba(20, 48, 47, .35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1a1a; --surface: #162424; --ink: #e8efee; --muted: #93a7a5; --line: #26393a;
    --accent: #2fa7a3; --accent-ink: #06201f; --accent-soft: #173a39; --danger: #f08a75;
    --shadow: 0 20px 60px -24px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  display: grid; grid-template-rows: auto 1fr; height: 100dvh; overflow: hidden;
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg);
  color: var(--ink); font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.top { display: flex; align-items: center; justify-content: space-between; padding: clamp(14px, 3vh, 28px) clamp(18px, 4vw, 48px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; letter-spacing: -.01em; }
.brand img { border-radius: 8px; }
.account { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.account .who { color: var(--muted); max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 0 20px clamp(24px, 6vh, 64px); gap: clamp(10px, 2.2vh, 22px); min-height: 0;
}
h1 { font-size: clamp(34px, 7vmin, 72px); line-height: 1.04; letter-spacing: -.035em; margin: 0; font-weight: 720; }
h1 em { font-style: normal; color: var(--accent); }
.lead { margin: 0; color: var(--muted); font-size: clamp(16px, 2.2vmin, 20px); max-width: 34ch; }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 560; padding: 9px 16px; border-radius: 999px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .dl:focus-visible, .tabs button:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 10px 30px -12px var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.big { padding: 13px 24px; font-size: 17px; }
.btn.wide { width: 100%; padding: 12px; margin-top: 6px; }
.btn[disabled] { opacity: .6; cursor: progress; }

.cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: clamp(4px, 1vh, 10px); }
.hint { margin: 0; font-size: 14px; color: var(--muted); max-width: 40ch; }

.downloads { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: clamp(8px, 3vh, 30px); }
.dl {
  width: 104px; padding: 14px 8px 12px; border-radius: var(--radius); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent); text-decoration: none; display: grid; justify-items: center; gap: 6px;
  font-size: 14px; font-weight: 560; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.dl svg { width: 26px; height: 26px; fill: currentColor; }
.dl:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.dl.mine { border-color: var(--accent); background: var(--accent-soft); }
.meta { margin: 0; font-size: 13px; color: var(--muted); }
.meta a { text-decoration: none; border-bottom: 1px solid var(--line); }
.meta a:hover { border-color: var(--accent); }

dialog {
  border: 1px solid var(--line); border-radius: 20px; padding: 0; width: min(400px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(10, 22, 22, .45); backdrop-filter: blur(4px); }
dialog form { padding: 28px; display: grid; gap: 12px; position: relative; }
dialog h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.sub { margin: -6px 0 2px; color: var(--muted); font-size: 14px; }
.close { position: absolute; top: 12px; right: 14px; border: 0; background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; padding: 6px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 999px; padding: 4px; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 560; color: var(--muted); padding: 7px; border-radius: 999px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.field { display: grid; gap: 5px; font-size: 13px; font-weight: 560; color: var(--muted); text-align: left; }
.field input {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
}
.field input:focus { border-color: var(--accent); }
.error { margin: 0; color: var(--danger); font-size: 14px; }

@media (max-height: 560px) { .downloads { margin-top: 4px; } .dl { padding: 8px; width: 88px; } .lead { display: none; } }
@media (max-width: 420px) { .dl { width: calc(50% - 6px); } .brand span { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
