:root {
  color-scheme: light;
  --ink: #22201e;
  --muted: #655f5b;
  --line: #e9e5e0;
  --paper: #f7f6f3;
  --surface: #fff;
  --coral: #ff9b7e;
  --down: #a03b2b;
  --up: #246c51;
  --pending: #87631e;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  font-family: Geist, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; min-height: 100vh; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid #ad4d36; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linejoin: round; stroke-linecap: round; }
.shell { max-width: 1216px; margin-inline: auto; padding-inline: 28px; }

.topbar { border-bottom: 1px solid var(--line); background: #fffdfb; }
.topbar-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -.045em; text-decoration: none; }
.brand img, .login-panel > img, .alerts-top img { display: block; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.interval { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font: 500 11px var(--mono); }
.interval .icon { width: 15px; height: 15px; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.icon-button:hover { color: var(--ink); background: var(--paper); }

.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 230px; margin-block: 30px 18px; border-radius: 16px; color: #fff9f6; background: radial-gradient(ellipse at 93% 99%, #522a27, transparent 57%), #251d22; }
.hero-copy { position: relative; z-index: 1; padding: 30px 35px; }
.hero-label { color: #f0b6a6; font: 500 10px var(--mono); letter-spacing: .13em; display: flex; align-items: center; gap: 8px; }
.hero-label span { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px #ff9b7e1c; }
.hero h1 { font-size: clamp(33px, 5vw, 53px); line-height: 1.06; letter-spacing: -.066em; font-weight: 650; margin-top: 11px; }
.hero p { color: #d5c6c7; font-size: 14px; margin-top: 9px; line-height: 1.5; }
.hero .button { margin-top: 24px; }
.hero-visual { position: absolute; inset: 0 0 0 auto; width: 52%; pointer-events: none; }
.hero-visual svg { display: block; width: 100%; height: 100%; }
.button { min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 650; line-height: 1.25; white-space: nowrap; }
.button .icon { width: 16px; height: 16px; }
.button-accent { background: var(--coral); color: #291814; }
.button-accent:hover { background: #ffb39d; }
.button-outline { border-color: #e0dcd6; background: var(--surface); color: var(--ink); }
.button-outline:hover { background: #f8f5f2; }
.button-dark { background: #2d2427; color: #fffaf7; }
.button-dark:hover { background: #49363a; }
.button-danger { background: #9f3b2d; color: white; }
.button-danger:hover { background: #842e21; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 21px; }
.stat { display: flex; align-items: center; gap: 13px; padding: 15px; min-height: 83px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stat-icon { width: 39px; height: 39px; flex: none; display: grid; place-items: center; border-radius: 10px; }
.stat-icon.total { color: #574953; background: #f2eef1; }
.stat-icon.up { color: var(--up); background: #e7f3ea; }
.stat-icon.down { color: var(--down); background: #fceae3; }
.stat-icon.pending { color: var(--pending); background: #f8f0dd; }
.stat p { font-size: 12px; color: var(--muted); line-height: 1.35; }
.stat strong { display: block; margin-top: 3px; font: 500 23px/1 var(--mono); letter-spacing: -.07em; }

.dashboard-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 278px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.panel-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 19px 20px 16px; }
h2 { font-weight: 650; font-size: 18px; letter-spacing: -.04em; line-height: 1.25; }
.panel-heading p, .alerts p { font-size: 13px; color: var(--muted); line-height: 1.55; }
.panel-heading p { margin-top: 3px; }
.alerts { padding: 19px; }
.alerts-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 13px; }
.alerts h2 { margin-bottom: 6px; }
.alerts p { min-height: 60px; }
.alert-button { justify-content: flex-start; width: 100%; margin-top: 14px; }
.end-icon { margin-left: auto; }
.text-button { display: block; margin: 10px auto 0; padding: 7px 4px; font-size: 12px; font-weight: 550; color: var(--muted); border: 0; background: none; }
.text-button:hover { color: var(--ink); text-decoration: underline; }
.status { width: max-content; max-width: 100%; display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; padding: 5px 7px; background: #f2f0ed; color: #5d5752; font: 500 11px/1.15 Geist, system-ui, sans-serif; white-space: nowrap; }
.status i { width: 6px; height: 6px; flex: none; background: currentColor; border-radius: 50%; }
.status.up { background: #e8f4eb; color: var(--up); }
.status.down { background: #fbe9e2; color: var(--down); }
.status.pending, .status.stale { background: #faf1dd; color: var(--pending); }

.empty { display: grid; place-items: center; min-height: 211px; border-top: 1px solid #f1eeea; padding: 24px 16px 26px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #eee5de; border-radius: 11px; background: #faf6f1; color: #8d5446; margin-bottom: 11px; }
.empty h3 { font-weight: 650; font-size: 15px; letter-spacing: -.02em; }
.empty p { color: var(--muted); font-size: 13px; margin: 4px 0 13px; line-height: 1.4; }
.empty .button { min-height: 34px; font-size: 12px; }
.search { margin: 0 20px 14px; display: flex; align-items: center; gap: 8px; color: var(--muted); width: min(276px, calc(100% - 40px)); border: 1px solid var(--line); border-radius: 8px; padding-left: 10px; }
.search > .icon { width: 15px; height: 15px; }
.search input { min-width: 0; width: 100%; min-height: 35px; border: 0; border-radius: 8px; padding: 0 8px 0 0; font-size: 13px; background: transparent; color: var(--ink); }
.search input:focus-visible { outline: 0; }
.search:focus-within { outline: 2px solid #ad4d36; outline-offset: 2px; }

.monitor-head, .monitor { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(80px, .63fr) minmax(75px, .9fr) minmax(70px, .65fr) 34px; gap: 12px; align-items: center; padding: 12px 19px; }
.monitor-head { background: #faf9f7; border-block: 1px solid #f1eeea; color: var(--muted); font: 500 10px var(--mono); letter-spacing: .025em; }
.monitor { min-height: 68px; border-bottom: 1px solid #f1eeea; }
.monitor:last-child { border-bottom: 0; }
.monitor.highlighted { background: #fcf3ee; }
.site-link { display: block; min-width: 0; text-decoration: none; }
.site-link strong, .site-link small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-link strong { font-weight: 650; font-size: 13px; letter-spacing: -.015em; }
.site-link:hover strong { text-decoration: underline; }
.site-link small, .checked small, .monitor-state small { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-state, .checked { min-width: 0; }
.checked { font: 400 11px var(--mono); }
.checked small { font-family: Geist, system-ui, sans-serif; }
.history { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; min-width: 0; min-height: 20px; align-items: center; }
.history span { display: block; height: 17px; border-radius: 2px; background: #ece9e5; }
.history .up { background: #7eb99b; }
.history .down { background: #dc785f; }
.history span:hover { outline: 1px solid var(--ink); }
.monitor-menu { position: relative; justify-self: end; }
.monitor-menu summary { list-style: none; width: 34px; height: 34px; cursor: pointer; }
.monitor-menu summary::-webkit-details-marker { display: none; }
.menu-content { z-index: 2; position: absolute; top: calc(100% + 5px); right: 0; width: max-content; min-width: 145px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 8px 20px #2a181925; }
.menu-content button { min-height: 34px; width: 100%; display: flex; align-items: center; text-align: left; gap: 7px; border: 0; border-radius: 6px; background: transparent; padding: 5px 8px; color: var(--ink); font-size: 12px; }
.menu-content button:hover { background: var(--paper); }
.menu-content button.remove { color: var(--down); }
.menu-content .icon { width: 14px; height: 14px; }
.footer { margin: 21px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font: 400 11px var(--mono); }
.footer span:first-child { display: flex; align-items: center; gap: 6px; }
.footer .icon { width: 15px; height: 15px; }

dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 22px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 16px 70px #27161936; }
dialog::backdrop { background: #2b202767; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dialog-heading h2 { font-size: 23px; }
dialog p, .login-panel p { margin: 7px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
form label { display: block; margin: 15px 0 6px; font-size: 12px; font-weight: 650; }
form label span { font-weight: 400; color: var(--muted); margin-left: 4px; }
form input { width: 100%; min-height: 42px; background: var(--surface); color: var(--ink); border: 1px solid #ded9d3; border-radius: 8px; padding: 0 10px; font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 21px; }
.diagnostic { display: grid; gap: 12px; margin: 0; }
.diagnostic div { padding: 11px 12px; border-radius: 8px; background: var(--paper); }
.diagnostic dt { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.diagnostic dd { margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.rollback-state { padding: 10px 12px; border-radius: 8px; background: var(--paper); color: var(--ink); }
#rollback-site { margin-bottom: 5px; font-weight: 600; color: var(--ink); }
form .inline-error { margin: 10px 0 0; color: var(--down); font-size: 12px; }
.login-page { display: grid; place-items: center; min-height: calc(100svh - 69px); padding: 20px 16px 55px; background: radial-gradient(ellipse at 50% 48%, #efded5, transparent 62%); }
.login-panel { width: min(100%, 410px); padding: 26px; box-shadow: 0 12px 36px #67372012; }
.login-panel h1 { margin-top: 16px; font-size: 27px; font-weight: 650; letter-spacing: -.06em; }
.login-panel .button { width: 100%; margin-top: 15px; }
.toast { z-index: 3; position: fixed; right: 18px; bottom: 18px; max-width: min(370px, calc(100vw - 36px)); padding: 12px 15px; border: 1px solid #4f383d; border-radius: 9px; background: #2d2427; color: #fff9f5; font-size: 13px; line-height: 1.4; box-shadow: 0 8px 25px #2d242728; }
.toast.error { background: #8c3327; border-color: #9e4e41; }

@media (max-width: 910px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .alerts { width: 100%; }
  .alerts p { min-height: 0; }
  .alert-button { width: auto; }
  .text-button { display: inline-block; margin-left: 8px; }
}

@media (max-width: 650px) {
  .shell { padding-inline: 14px; }
  .topbar-inner { min-height: 58px; }
  .top-actions { gap: 8px; }
  .interval { font-size: 10px; }
  .hero { margin-top: 14px; min-height: 0; }
  .hero-copy { padding: 21px; }
  .hero p { max-width: 31ch; }
  .hero-visual { right: -75px; width: 80%; opacity: .42; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 13px; }
  .stat { padding: 9px; min-height: 62px; gap: 8px; }
  .stat-icon { width: 32px; height: 32px; }
  .stat-icon .icon { width: 15px; height: 15px; }
  .stat p { font-size: 11px; }
  .stat strong { font-size: 20px; }
  .dashboard-grid { gap: 12px; }
  .monitor-head, .monitor { grid-template-columns: minmax(0, 1fr) 80px 34px; padding-inline: 12px; gap: 9px; }
  .monitor-head .history-head, .monitor-head .checked-head, .monitor .checked { display: none; }
  .monitor .history { grid-row: 2; grid-column: 1 / -1; max-width: 250px; min-height: 8px; }
  .monitor .history span { height: 8px; }
  .panel-heading { padding-inline: 12px; }
  .search { margin-inline: 12px; }
  .login-page { min-height: calc(100svh - 59px); }
}
