:root {
  --bg: #f6f6f3; --surface: #ffffff; --text: #1d1d1b; --muted: #6b6b66;
  --line: #e2e2dc; --accent: #1f5f4a; --accent-text: #ffffff;
  --danger: #a33a2b; --warn-bg: #fbeee0; --warn-text: #7a4a12; --ok-bg: #e3f1ea; --ok-text: #1f5f4a;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --surface: #1e1e1c; --text: #ecece6; --muted: #a2a29a;
    --line: #33332f; --accent: #5fb592; --accent-text: #0f1f18;
    --danger: #e0806f; --warn-bg: #3a2c1a; --warn-text: #f0c48a; --ok-bg: #1d3329; --ok-text: #8fd3b4;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.45; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.6rem; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 24px 0 8px; }
a { color: var(--accent); }

.topbar { background: var(--surface); border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 0.95rem; }
.topbar nav form { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; }
.card h2 { margin-top: 0; }
.notice { border-color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input:not([type]), select {
  width: 100%; font-size: 17px; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); }
input:focus, button:focus-visible, .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button, .button, input[type=submit] {
  display: inline-block; font: inherit; font-weight: 600; padding: 11px 16px; min-height: 44px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  text-decoration: none; cursor: pointer; margin-top: 12px; }
.primary, input[type=submit] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.wide { width: 100%; text-align: center; }
button.link { background: none; border: 0; padding: 0; margin: 0; min-height: 0; color: var(--accent); font-weight: 400; text-decoration: underline; }

.flash { padding: 12px 14px; border-radius: 10px; background: var(--ok-bg); color: var(--ok-text); }
.flash-error, .error, .fs-error-msg { color: var(--danger); }
.flash-error { background: var(--warn-bg); }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--line); }
.tag.ok { background: var(--ok-bg); color: var(--ok-text); }
.tag.warn { background: var(--warn-bg); color: var(--warn-text); }

.list { list-style: none; padding: 0; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list > li { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list form, .actions form { margin: 0; }
.list button { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.links { padding-left: 18px; margin: 0; }
.links li { margin: 6px 0; }

.steps { padding: 0; list-style: none; counter-reset: s; }
.steps > li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 14px 52px; margin-bottom: 12px; position: relative; }
.steps > li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 24px; height: 24px; border-radius: 50%; background: var(--line); text-align: center; font-weight: 700; font-size: 0.9rem; line-height: 24px; }
.steps > li.done::before { content: "✓"; background: var(--ok-bg); color: var(--ok-text); }
.steps p { margin: 4px 0 0; }

.divider { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 4px 0 16px; }

/* Flask-Security page classes */
.fs-gap { margin-top: 16px; }
.fs-div { margin: 4px 0; }
.fs-center { text-align: center; }
.fs-important { font-weight: 700; }
img { max-width: 100%; height: auto; }
