:root {
  color-scheme: dark;
  font:
    15px/1.6 system-ui,
    sans-serif;
  background: #0b1011;
  color: #e2e9e4;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header,
main {
  padding: 20px clamp(14px, 2vw, 32px);
}
header {
  border-bottom: 1px solid #324039;
  display: flex;
  align-items: center;
  gap: 15px;
}
header span,
small {
  color: #9eaea4;
}
header button {
  margin-left: auto;
}
#login,
dialog {
  background: #17201d;
  padding: 30px;
  border: 1px solid #34463d;
  border-radius: 16px;
}
#login {
  max-width: 370px;
  margin: 10vh auto 0;
}
label,
label span,
small {
  display: block;
}
label {
  margin-bottom: 14px;
}
input,
button {
  font: inherit;
  color: inherit;
  border: 1px solid #3c4b43;
  border-radius: 8px;
  background: #15201b;
  padding: 8px 12px;
}
input {
  min-width: 0;
}
label input {
  width: 100%;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.4;
}
button:hover:enabled {
  border-color: #acc994;
}
.primary {
  background: #bdd4a9;
  color: #182016;
}
.danger {
  color: #ffb9a5;
}
h1,
h2 {
  font-weight: 550;
}
h1 {
  margin-top: 0;
}
#rooms {
  padding-top: 26px;
}
#search {
  display: flex;
  gap: 9px;
  margin: 18px 0;
}
.scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
td,
th {
  padding: 13px 8px;
  border-bottom: 1px solid #29352f;
  white-space: normal;
  overflow-wrap: anywhere;
}
td:first-child {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}
td button {
  margin: 2px;
  font-size: 13px;
}
th {
  color: #94a69b;
  font-size: 13px;
}
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}
dialog {
  max-width: min(400px, 90vw);
}
dialog::backdrop {
  background: #000a;
}
#status {
  text-align: center;
  color: #f1c6ab;
}
#sections:not([hidden]) { display:flex; gap:6px; border-bottom:1px solid #324039; padding-bottom:14px; }
#sections button[aria-pressed="true"] { color:#cfe8bb; background:#283625; border-color:#75966a; }
#visitors { padding-top:26px; }
.note { color:#a8b7ad; }
#refresh-visits { margin-bottom:12px; }
#visit-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:end; margin-bottom:14px; }
#visit-filters label { margin:0; color:#b3c3b8; font-size:13px; }
#visit-filters label span { margin-bottom:4px; }
#visitors a {color:#b7d6a4;}

#visit-presets { display:flex; flex-wrap:wrap; gap:6px; margin:12px 0; }
#visit-presets button[aria-pressed="true"] { color:#cfe8bb; background:#283625; border-color:#75966a; }

.visit-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:0 0 16px; }
.visit-summary > div { background:#15201c; border:1px solid #34463d; border-radius:12px; padding:14px 18px; }
.visit-summary dt { color:#acbdb2; font-size:13px; }
.visit-summary dd { margin:4px 0 0; font-size:clamp(24px,2vw,32px); line-height:1.2; font-variant-numeric:tabular-nums; }
@media (max-width: 760px) {
  .scroll { overflow:visible; }
  .scroll table, .scroll tbody { display:block; }
  .scroll thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .scroll tbody tr { display:block; margin:10px 0; padding:8px 12px; border:1px solid #324039; border-radius:10px; }
  .scroll td { display:block; padding:5px 0 5px 34%; position:relative; min-height:1.8em; }
  .scroll td::before { content:attr(data-label); position:absolute; left:0; width:32%; color:#9eaea4; font-size:12px; }
  .scroll td:last-child { border:0; }
}
.visit-trend {margin:0 0 16px;padding:16px;border:1px solid #34463d;background:#121a17;border-radius:12px}
.visit-trend figcaption,.trend-legend {display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.visit-trend figcaption {justify-content:space-between}
.trend-legend,.visit-trend details {font-size:12px;color:#aebfb4}
.trend-legend i {width:14px;display:inline-block}
.bar-key {height:8px;background:#90bc80;border-radius:2px}
.line-key {border-top:2px solid #8bd9e0;margin-left:6px}
#trend-plot {display:block;width:100%;height:174px;margin:10px 0}
#trend-plot text {fill:#aebfb4;font:11px system-ui}
.trend-grid {stroke:#35413d;stroke-dasharray:3 4}
.trend-bar {fill:#90bc80}
.trend-line {fill:none;stroke:#8bd9e0;stroke-width:2}
.trend-point {fill:#8bd9e0;stroke:#15211d}
.visit-trend summary {cursor:pointer}
#trend-values {padding-top:6px;font-variant-numeric:tabular-nums}
.country-ranking {margin:0 0 16px;padding:16px;border:1px solid #34463d;background:#121a17;border-radius:12px}
.country-ranking h2 {margin:0 0 12px;font-size:1rem;font-weight:650}
.country-ranking th:not(:first-child),.country-ranking td:not(:first-child) {text-align:right;font-variant-numeric:tabular-nums}
.country-ranking td,.country-ranking th {padding:8px 4px}
.country-label {display:flex;align-items:center;gap:8px}
.country-label small {min-width:2ch;font-variant-numeric:tabular-nums}
.country-label img,.country-placeholder {flex:none;width:24px;border-radius:2px;text-align:center}
#country-empty {color:#aebfb4}
