:root {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #183049;
  background: #eef3f8;
  font-synthesis: none;
  --blue: #2457ce;
  --line: #d3deea;
  --muted: #50657b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
summary {
  cursor: pointer;
}
button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: #183049;
  font-weight: 600;
}
button:hover {
  background: #e7eef9;
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.primary:hover {
  background: #1741a2;
}
.danger {
  background: #b42336;
  color: white;
  border-color: #b42336;
}
a {
  color: var(--blue);
}
:focus-visible {
  outline: 3px solid #2457ce;
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 8px;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.025em;
}
h3 {
  font-size: 17px;
}
p {
  line-height: 1.6;
}
.muted,
small {
  color: var(--muted);
}
small {
  line-height: 1.5;
}
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 12px;
}
.brand {
  display: block;
  text-decoration: none;
  color: #183049;
  font-size: 32px;
  letter-spacing: -0.06em;
  font-weight: 800;
}
.brand span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  padding: 32px 24px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
}
.sidebar nav a {
  text-decoration: none;
  color: #40566d;
  padding: 13px 14px;
  border-radius: 8px;
  font-weight: 600;
}
.sidebar nav a[aria-current='page'] {
  background: #e9f0ff;
  color: #194bb9;
}
.sidebar-note {
  margin-top: auto;
  font-size: 14px;
  color: var(--muted);
}
main {
  margin-left: 230px;
  padding: 40px clamp(20px, 4vw, 64px);
  max-width: 1600px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.card,
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 24px;
}
.card strong.metric {
  display: block;
  font-size: 36px;
  letter-spacing: -0.05em;
  margin-top: 14px;
  font-variant-numeric: tabular-nums;
}
.panel {
  margin-bottom: 20px;
}
.toolbar,
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar {
  margin-bottom: 20px;
}
.toolbar input {
  flex: 1;
  min-width: 160px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #93a9bf;
  border-radius: 7px;
  padding: 12px;
  background: #fff;
  color: #183049;
  min-height: 44px;
}
select {
  width: auto;
  max-width: 100%;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
label {
  display: block;
  font-weight: 600;
  margin: 20px 0 8px;
}
form > button {
  margin-top: 16px;
}
.site-list {
  display: grid;
  gap: 12px;
}
.site-row {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}
.site-row h3 {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
.site-row code {
  font:
    14px Consolas,
    monospace;
}
.site-row p {
  margin: 6px 0;
  font-size: 14px;
  color: var(--muted);
}
.life {
  height: 5px;
  width: 100%;
  max-width: 320px;
  border: 0;
  border-radius: 8px;
  accent-color: var(--blue);
  display: block;
  margin: 12px 0;
}
.badge {
  display: inline-block;
  border-radius: 5px;
  padding: 4px 8px;
  background: #edf2f7;
  font-size: 12px;
  font-weight: 650;
  color: #40566d;
}
.badge.warn {
  background: #fff0d8;
  color: #8a4b00;
}
.badge.good {
  background: #e0f3ed;
  color: #18634c;
}
.empty {
  padding: 40px 20px;
  text-align: center;
  background: white;
  border: 1px dashed #a8bbd0;
  border-radius: 12px;
}
.help {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  width: 28px;
  min-height: 28px;
  margin-left: 8px;
  font-size: 14px;
  color: var(--blue);
  vertical-align: middle;
}
.close {
  float: right;
  font-size: 24px;
  line-height: 1;
  padding: 7px 13px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 620px;
  width: calc(100% - 32px);
  max-height: 85vh;
  padding: 28px;
  color: #183049;
}
dialog::backdrop {
  background: #18304980;
}
#dialog-body {
  clear: both;
  padding-top: 12px;
}
.login {
  max-width: 480px;
  margin: 10vh auto;
  padding: 36px;
}
.login .brand {
  margin-bottom: 48px;
}
.login > button {
  width: 100%;
  margin: 20px 0;
}
details {
  margin: 24px 0;
}
summary {
  min-height: 44px;
  padding: 10px 0;
  color: var(--blue);
}
#notice {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: min(440px, calc(100% - 40px));
  padding: 18px 24px;
  background: #183049;
  color: white;
  border-radius: 10px;
  box-shadow: 0 6px 30px #18304933;
  z-index: 10;
}
#notice.error {
  background: #9e2131;
}
.skip {
  position: fixed;
  top: -100px;
  left: 12px;
  padding: 12px;
  background: white;
  z-index: 20;
}
.skip:focus {
  top: 10px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #eef3f8;
  padding: 16px;
  border-radius: 8px;
  font-size: 13px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  font-size: 14px;
}
th {
  color: var(--muted);
}
.field {
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
}
.notice {
  border-left: 4px solid #ca7f13;
  padding: 16px 20px;
  background: #fff5e6;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.preview-copy {
  background: #f4f7fc;
  padding: 20px;
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chart-row {
  display: grid;
  grid-template-columns: 110px 1fr 40px;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  font-size: 14px;
}
.chart-row meter {
  width: 100%;
  height: 18px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 20px;
    gap: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .brand {
    font-size: 26px;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    gap: 4px;
  }
  .sidebar nav a {
    white-space: nowrap;
    padding: 10px;
  }
  .sidebar-note {
    display: none;
  }
  .sidebar #logout {
    position: absolute;
    top: 20px;
    right: 20px;
  }
  main {
    margin: 0;
    padding: 28px 16px;
  }
  header {
    margin-bottom: 24px;
  }
  .card,
  .panel {
    padding: 18px;
  }
  .site-row {
    grid-template-columns: 1fr;
  }
  .site-row .actions button {
    flex: 1;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .card strong.metric {
    font-size: 28px;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .login {
    margin: 3vh auto;
    padding: 24px;
  }
  dialog {
    padding: 20px;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar select {
    width: 100%;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  a {
    transition: background-color 0.15s;
  }
  dialog[open] {
    animation: appear 0.15s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

.save-bar {
  position: sticky;
  bottom: 0;
  padding: 14px 0;
  background: #eef3f8;
  z-index: 2;
}
input[type='checkbox'] {
  width: 24px;
  min-height: 24px;
}
#view form > details {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 20px;
}
#view form > details > summary {
  font-weight: 650;
  font-size: 18px;
}
