
:root {
  --bg: #f6f5f1; --surface: #ffffff; --text: #1d1d1b; --muted: #6b6a66;
  --border: #e3e1da; --accent: #b4532a; --accent-text: #ffffff;
  --ok: #2f7d4a; --warn: #a15c00; --err: #b3261e; --code: #f0eee8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161614; --surface: #1f1f1c; --text: #ebe9e3; --muted: #9c9a93;
    --border: #34332f; --accent: #e07a4a; --accent-text: #161614;
    --ok: #6cc28a; --warn: #e0a24a; --err: #f08a80; --code: #2a2a26;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px 48px; }
header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0; border-bottom: 1px solid var(--border); margin-bottom: 24px;
}
header.top .brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
header.top nav { display: flex; gap: 8px; align-items: center; }
button, .button {
  font: inherit; font-size: 14px; border-radius: 8px; padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; display: inline-block;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button:disabled { opacity: .55; cursor: not-allowed; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 16px;
}
.status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.status .state { font-weight: 600; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--err); }
.muted { color: var(--muted); font-size: 14px; }
ul.summaries { list-style: none; padding: 0; margin: 0; }
ul.summaries li { border-top: 1px solid var(--border); }
ul.summaries li:first-child { border-top: 0; }
ul.summaries a {
  display: flex; justify-content: space-between; gap: 12px; padding: 14px 4px;
  text-decoration: none; color: var(--text);
}
ul.summaries a:hover { color: var(--accent); }
ul.summaries .muted { white-space: nowrap; }
.badge {
  font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px;
  color: var(--muted); margin-left: 6px;
}
article h1 { font-size: 28px; line-height: 1.25; margin: 0 0 8px; }
article h2 {
  font-size: 22px; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--accent);
}
article h3 { font-size: 18px; line-height: 1.35; margin: 28px 0 8px; }
article h3 a { color: var(--text); text-decoration: none; }
article h3 a:hover { color: var(--accent); }
article blockquote { margin: 0 0 16px; padding: 4px 16px; border-left: 3px solid var(--border); color: var(--muted); }
article hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
article code { background: var(--code); border-radius: 4px; padding: 1px 6px; font-size: 13px; }
article details { margin: 8px 0 12px; font-size: 14px; }
article details summary { cursor: pointer; color: var(--muted); }
article ol li, article ul li { margin: 2px 0; }
pre.log {
  background: var(--code); border-radius: 8px; padding: 12px; overflow-x: auto;
  font-size: 12px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
form.login { max-width: 360px; margin: 12vh auto 0; }
form.login label { display: block; font-size: 14px; margin: 12px 0 4px; color: var(--muted); }
form.login input {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
form.login button { width: 100%; margin-top: 20px; padding: 10px; }
.error-box { color: var(--err); font-size: 14px; margin-top: 12px; }
.message { margin-top: 12vh; }
nav.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
nav.tabs a {
  padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); font-size: 14px;
}
nav.tabs a.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.flash { border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.flash.ok { border-color: var(--ok); }
.flash.err { border-color: var(--err); }
.flash.warn { border-color: var(--warn); }
.card h2 { margin-top: 0; font-size: 18px; }
.card h2 .muted { font-weight: 400; }
.src { border-top: 1px solid var(--border); padding: 10px 0; }
.src:first-of-type { border-top: 0; }
.src-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.src-title { font-weight: 600; word-break: break-all; }
.src-title.off { color: var(--muted); text-decoration: line-through; font-weight: 400; }
.src-actions { display: flex; gap: 6px; align-items: center; }
.src-actions form { margin: 0; }
.src details { margin-top: 6px; }
.src details summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.form-grid { display: grid; gap: 10px; margin-top: 10px; max-width: 560px; }
.form-grid label, .field-label { font-size: 14px; color: var(--muted); display: block; margin-bottom: 2px; }
input[type=text], input[type=number], input[type=time], input[type=url], input[type=password], select {
  font: inherit; font-size: 15px; padding: 7px 10px; border-radius: 8px; width: 100%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { color: var(--text); font-size: 14px; display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.row-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
table.sections { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sections th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 6px; border-bottom: 1px solid var(--border); }
table.sections td { padding: 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.sections input[type=number] { width: 80px; }
table.sections input.pos { width: 56px; }
table.sections input[type=text] { min-width: 190px; }
.table-scroll { overflow-x: auto; }
button.danger { color: var(--err); }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
details.add-source { margin-bottom: 8px; }
details.add-source > summary { list-style: none; margin-bottom: 12px; }
details.add-source > summary::-webkit-details-marker { display: none; }
.primary-outline { border-color: var(--accent); color: var(--accent); font-weight: 600; }
@media (max-width: 560px) {
  header.top { flex-wrap: wrap; }
  article h1 { font-size: 24px; }
}
