@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --paper: #f2f5f0;
  --surface: #ffffff;
  --surface-sunk: #e6ece3;
  --line: #d3dccf;
  --line-strong: #7b8b7d;
  --ink: #1d2a22;
  --ink-2: #4d5e52;
  --leaf: #2f6b4b;
  --leaf-hover: #255839;
  --leaf-tint: #e3eee5;
  --leaf-ink: #245a3f;
  --water: #1f5f80;
  --water-tint: #e0edf4;
  --water-ink: #1a4f6b;
  --ocher: #e8b44a;
  --ocher-tint: #fbf0d6;
  --ocher-ink: #6b4a0e;
  --clay: #a9482a;
  --clay-hover: #8f3b22;
  --clay-tint: #f7e4dc;
  --clay-ink: #8a3a20;
  --focus: #1f5f80;
  --chart-grid: #dfe6da;
  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 8px;
  --font: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) var(--paper);
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  line-height: 1.25;
  font-weight: 700;
}

p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--leaf-ink);
  text-underline-offset: 3px;
}

::selection {
  background: var(--leaf-tint);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  fill: currentColor;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-back {
  transform: rotate(180deg);
}

.led {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--line-strong);
}

.micro {
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 600;
}

.empty {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-sunk);
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.msg {
  min-height: 1.5em;
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.msg[data-tone="ok"] {
  color: var(--leaf-ink);
}

.msg[data-tone="err"] {
  color: var(--clay-ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  background: var(--leaf);
  border-color: var(--leaf);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--leaf-hover);
  border-color: var(--leaf-hover);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--surface-sunk);
}

.btn-icon {
  gap: 8px;
}

.btn-sm {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.9375rem;
}

.btn-wide {
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--leaf);
  color: #ffffff;
}

.brand-mark .icon {
  width: 22px;
  height: 22px;
}

.brand-text {
  min-width: 0;
  line-height: 1.2;
}

.brand-text strong {
  display: block;
  font-size: 1.0625rem;
  font-weight: 700;
}

.brand-text small {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar .btn-ghost {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.9375rem;
}

.logout-form {
  margin: 0;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.conn.is-live {
  background: var(--leaf-tint);
  color: var(--leaf-ink);
}

.conn.is-live .led {
  background: var(--leaf);
}

.conn.is-down {
  background: var(--clay-tint);
  color: var(--clay-ink);
}

.conn.is-down .led {
  background: var(--clay);
}

.conn.is-wait {
  background: var(--ocher-tint);
  color: var(--ocher-ink);
}

.conn.is-wait .led {
  background: var(--ocher);
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

@media (max-width: 620px) {
  .brand {
    min-height: 44px;
  }
}
