:root {
  color-scheme: light;
  --bg: #f2f5f2;
  --panel: #fff;
  --ink: #142c25;
  --muted: #495f57;
  --line: #b9c9c0;
  --accent: #125c49;
  --button: #fff;
  --warn: #fff0c1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    18px/1.5 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px max(18px, calc((100% - 1000px) / 2));
  background: var(--accent);
  color: #fff;
  gap: 12px;
}
.brand {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
}
#connection {
  font-size: 18px;
}
main,
nav,
.sync {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
}
nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-bottom: 0;
}
nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 650;
}
nav a[aria-current] {
  background: var(--accent);
  color: #fff;
}
h1 {
  font-size: 30px;
  margin: 8px 0 20px;
}
h2 {
  font-size: 23px;
  margin: 0 0 12px;
}
p {
  margin: 8px 0 16px;
}
button,
input,
select,
textarea {
  font: inherit;
  min-height: 52px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  max-width: 100%;
}
button {
  background: var(--accent);
  color: var(--button);
  font-weight: 700;
  cursor: pointer;
}
button.secondary {
  background: var(--panel);
  color: var(--ink);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
input,
select,
textarea {
  width: 100%;
  background: var(--panel);
  color: var(--ink);
}
label {
  display: block;
  margin: 14px 0;
}
label input,
label select,
label textarea {
  display: block;
  margin-top: 6px;
}
form {
  margin: 12px 0;
}
form > button {
  width: 100%;
  margin-top: 14px;
}
.card,
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.metric {
  margin: 0;
}
.metric strong {
  display: block;
  font-size: 27px;
  line-height: 1.4;
}
.hero {
  background: var(--accent);
  color: #fff;
  margin-bottom: 12px;
}
.hero strong {
  font-size: 36px;
}
.muted,
small {
  color: var(--muted);
}
small {
  font-size: 18px;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.actions button {
  flex: 1;
}
.login {
  max-width: 440px;
  margin: 30px auto;
}
.sync {
  font-size: 18px;
  padding-bottom: 0;
  color: var(--muted);
}
aside {
  padding: 14px 18px;
  background: var(--warn);
  color: #392c00;
}
#message {
  position: sticky;
  bottom: 10px;
  max-width: 960px;
  margin: 0 auto;
  background: var(--ink);
  color: var(--panel);
  border-radius: 10px;
}
#message:not(:empty) {
  padding: 16px;
}
dialog {
  width: calc(100% - 24px);
  max-width: 600px;
  max-height: 90dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  padding: 20px;
}
dialog::backdrop {
  background: #0009;
}
#close-dialog {
  width: 100%;
  margin-top: 16px;
}
details {
  margin-top: 12px;
}
summary {
  min-height: 48px;
  cursor: pointer;
  padding: 10px 0;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #d68a00;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 550px) {
  nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid {
    gap: 8px;
  }
  .metric {
    padding: 12px;
  }
  .metric strong {
    font-size: 23px;
  }
  main {
    padding: 16px 12px;
  }
  header {
    padding: 16px 12px;
  }
  .hero strong {
    font-size: 32px;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101c18;
  --panel: #1b2e26;
  --ink: #f3faf6;
  --muted: #c0d3c7;
  --line: #607d6b;
  --accent: #12684e;
  --warn: #ffe5a0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101c18;
    --panel: #1b2e26;
    --ink: #f3faf6;
    --muted: #c0d3c7;
    --line: #607d6b;
    --accent: #12684e;
    --warn: #ffe5a0;
  }
}
