/* What a visitor's browser gets: the base of every page and what the
   ways in need. Mobile-first; colours follow the system's light or dark
   mode; the green is the logo's. Plain CSS features only, for older
   phones. The rest of the styles is app.css, behind the login. */
:root {
  color-scheme: light dark;
  --accent: #0f9d74;
  --accent-ink: #ffffff;
  --accent-soft: #0f9d7418;
  --danger: #c0392b;
  --warn: #b7791f;
  --ink: #1b1f24;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f7f9;
  --bg-glass: #f6f7f9e0;
  --card: #ffffff;
  --raised: #f0f2f5;
  --radius: 14px;
  --tabbar: 4rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eaed;
    --muted: #9aa0a6;
    --line: #2c3138;
    --bg: #111418;
    --bg-glass: #111418e0;
    --card: #1a1e24;
    --raised: #232830;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 0 1rem calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { margin: 0 0 .75rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
h2 svg, h3 svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: .25rem; }
p { margin: .5rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; overflow-wrap: anywhere; }
.ok { color: var(--accent); }
.bad { color: var(--danger); }
.hidden { display: none !important; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 0 -1rem 1rem; padding: .75rem 1rem;
  padding-top: calc(.75rem + env(safe-area-inset-top, 0px));
  background: var(--bg-glass); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; font-weight: 700; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.topnav { display: none; gap: .25rem; }
.topnav a { padding: .4rem .8rem; border-radius: 999px; color: var(--ink); font-weight: 500; display: inline-flex; align-items: center; gap: .4rem; }
.topnav a:hover { background: var(--raised); text-decoration: none; }
.topnav a.active { background: var(--accent-soft); color: var(--accent); }
.topnav svg { width: 18px; height: 18px; }

/* Layout */
main { display: grid; gap: 1rem; max-width: 52rem; margin: 0 auto; }
section, .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--accent); }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: .5rem; }
.spaced { margin-top: .75rem; }

/* Forms */
label { display: block; margin: .75rem 0 .25rem; font-size: .9rem; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: .7rem .85rem; font: inherit; color: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 4.5rem; resize: vertical; }
label.check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; }
label.check input { width: auto; margin-top: .3rem; }
button {
  padding: .65rem 1.1rem; font: inherit; font-weight: 600; color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
}
button:hover { filter: brightness(1.05); }
button:disabled { opacity: .5; cursor: default; filter: none; }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button.quiet { background: var(--raised); color: var(--ink); }
button.danger { background: var(--danger); }
button.danger.secondary { background: transparent; color: var(--danger); border-color: var(--danger); }
button.small { padding: .4rem .7rem; font-size: .85rem; border-radius: 8px; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 500; }
button svg { width: 18px; height: 18px; }
.bigcode { font-size: 1.6rem; letter-spacing: .12em; text-align: center; padding: .6rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Notices and results */
.notice { border-left: 4px solid var(--accent); padding: .6rem .9rem; background: var(--raised); border-radius: 8px; margin: .5rem 0; }
.notice.warn { border-color: var(--warn); }
.notice.error { border-color: var(--danger); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 1rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 9;
  background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 999px; font-size: .9rem; box-shadow: 0 8px 24px #0004; max-width: 90vw; }

footer { padding: 1.5rem 0 .5rem; }

/* Desktop: navigation in the header */
@media (min-width: 720px) {
  body { padding-bottom: 2rem; }
  .topnav { display: flex; }
  .toast { bottom: 1.5rem; }
  h1 { font-size: 1.75rem; }
}
