@font-face {
  font-family: "Open Sans";
  src: url("../brand/open-sans.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #00776f;
  --brand-strong: #005f58;
  --mint: #55d9b1;
  --ink: #111c1a;
  --ink-2: #3c4b48;
  --muted: #66746f;
  --line: #e2e8e6;
  --line-strong: #cdd6d3;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-2: #f0f4f3;
  --brand-soft: #e3f4f0;
  --ok: #10865a;
  --ok-soft: #e2f5ec;
  --warn: #a35a00;
  --warn-soft: #fdf0dc;
  --danger: #c0392b;
  --danger-soft: #fbe7e4;
  --info: #2563eb;
  --info-soft: #e5edfd;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(17 28 26 / 6%), 0 4px 16px rgb(17 28 26 / 6%);
  --shadow-lg: 0 10px 40px rgb(17 28 26 / 14%);
  --focus: 0 0 0 3px rgb(0 119 111 / 35%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #2fb39f;
    --brand-strong: #55d9b1;
    --ink: #e8efed;
    --ink-2: #c3cfcc;
    --muted: #8d9b97;
    --line: #22302d;
    --line-strong: #31423e;
    --bg: #0c1312;
    --surface: #131d1b;
    --surface-2: #192624;
    --brand-soft: #123430;
    --ok: #3ccf8e;
    --ok-soft: #12302a;
    --warn: #f0a640;
    --warn-soft: #33270f;
    --danger: #f2776a;
    --danger-soft: #3a1c19;
    --info: #7aa5ff;
    --info-soft: #18233d;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / 45%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: var(--mint); color: #062520; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s, opacity .15s;
  background: var(--surface-2); color: var(--ink);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: #04201c; }
}
.btn-ghost { background: transparent; border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input, select.input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.hint { font-size: 13px; color: var(--muted); }
.form-error {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 500;
}

/* Bits */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.muted { color: var(--muted); }
.chip.plain::before { display: none; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo img { height: 26px; width: auto; }
.logo .dark-only { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo .light-only { display: none; }
  :root:not([data-theme="light"]) .logo .dark-only { display: block; }
}

.toast-host {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: grid; gap: 8px; z-index: 100; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg);
  font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toast-in .2s ease-out;
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
