:root {
  color-scheme: light;
  --bg: #f7f7f3;
  --paper: #fff;
  --ink: #202521;
  --muted: #626861;
  --line: #e1e4dc;
  --soft: #eef0ea;
  --accent: #284936;
  --accent-ink: #fff;
  --danger: #a7352a;
  --radius: 16px;
  --width: 850px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181b18;
  --paper: #222622;
  --ink: #eff1ec;
  --muted: #b2b9af;
  --line: #3a4239;
  --soft: #2b332b;
  --accent: #cee3bf;
  --accent-ink: #202c1e;
  --danger: #ffaca3;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.08; letter-spacing: -.055em; font-weight: 690; }
h2 { font-size: 1.33rem; letter-spacing: -.032em; line-height: 1.25; }
h3 { font-size: 1.06rem; line-height: 1.3; letter-spacing: -.015em; }
[hidden] { display: none !important; }
.muted, .lead, .hint { color: var(--muted); }
.lead { margin-top: .65rem; max-width: 60ch; }
.hint { font-size: .875rem; }
.error { color: var(--danger); margin: .65rem 0; }
.primary, .secondary, .quiet { display: inline-flex; justify-content: center; align-items: center; gap: .45rem; min-height: 44px; padding: .58rem 1rem; border: 1px solid transparent; border-radius: 10px; font-size: .9375rem; font-weight: 625; text-align: center; }
.primary { background: var(--accent); color: var(--accent-ink); }
.secondary { background: var(--paper); border-color: var(--line); }
.quiet { background: transparent; color: var(--muted); padding-inline: .55rem; }
.secondary:hover, .quiet:hover, .icon-button:hover { background: var(--soft); }
.primary:hover { filter: brightness(.94); }
.icon-button, .avatar { display: inline-grid; place-items: center; flex: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink); }
.icon-button { font-size: 1.3rem; }
.avatar { background: var(--soft); color: var(--accent); font-size: .875rem; font-weight: 700; }
.gate { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .95rem; padding: 70px 24px; text-align: center; }
.gate h1 { margin-top: .15rem; }
.gate p { color: var(--muted); max-width: 35ch; }
.gate .primary { margin-top: .8rem; min-width: min(250px, 100%); }
.gate-theme { position: absolute; top: max(20px, env(safe-area-inset-top)); right: max(20px, env(safe-area-inset-right)); }
.gate-status { font-size: .875rem; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: .9rem; font-weight: 750; letter-spacing: -.04em; }
.gate .brand-mark { width: 54px; height: 54px; font-size: 1.25rem; border-radius: 15px; }
.app-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.head-inner { max-width: var(--width); margin: auto; min-height: 72px; padding-inline: 22px; display: flex; align-items: center; gap: 20px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 730; white-space: nowrap; }
.head-actions { display: flex; gap: 8px; margin-left: auto; }
.navigation { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.navigation a { display: grid; align-items: center; min-height: 42px; padding: 0 13px; border-radius: 999px; color: var(--muted); font-size: .9rem; font-weight: 570; white-space: nowrap; text-align: center; }
.navigation a[aria-current="page"], .navigation a:hover { background: var(--soft); color: var(--ink); }
.content { max-width: var(--width); margin: 0 auto; padding: clamp(30px, 6vw, 64px) 22px 76px; }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stack { display: grid; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.profile-panel { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.profile-panel button { margin-left: auto; }
.back { display: inline-block; color: var(--muted); font-size: .9375rem; padding: .35rem 0; margin-bottom: 14px; text-decoration: underline; text-underline-offset: 3px; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label, .field > span { font-size: .925rem; font-weight: 625; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select { width: 100%; min-height: 44px; border-radius: 9px; padding: .6rem .7rem; border: 1px solid var(--line); background: var(--bg); }
textarea { resize: vertical; }
select { appearance: none; padding-right: 2rem; background-image: conic-gradient(from 45deg, transparent 0deg 90deg, var(--muted) 90deg 180deg, transparent 180deg 360deg); background-size: 10px 10px; background-repeat: no-repeat; background-position: right 12px center; }
code { font-size: .9em; }
@media (max-width: 640px) {
  .head-inner { min-height: 61px; padding-inline: 16px; }
  .content { padding-inline: 16px; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .navigation { position: fixed; z-index: 5; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 20px); padding: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 3px 18px #0001; }
  .navigation a { padding-inline: clamp(9px, 3vw, 15px); font-size: .875rem; }
  .panel { padding: 16px; }
}
