:root {
  --ink: #17201d;
  --muted: #65706b;
  --line: #dce2de;
  --paper: #ffffff;
  --wash: #f3f5f2;
  --deep: #102b25;
  --accent: #153f35;
  --green: #16814d;
  --green-bg: #e8f5ed;
  --yellow: #a65b00;
  --yellow-bg: #fff2d8;
  --orange: #b94709;
  --orange-bg: #fff0e7;
  --red: #b3262d;
  --red-bg: #fdebec;
  --blue: #2466aa;
  --blue-bg: #eaf2fb;
  --shadow: 0 18px 50px rgba(18, 43, 37, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 5vw, 4.3rem); line-height: 1.02; }
h2 { font-size: clamp(1.55rem, 3vw, 2.2rem); margin-bottom: .55rem; }
h3 { font-size: 1.05rem; margin-bottom: .3rem; }
p { line-height: 1.65; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: -80px; padding: 10px 16px; background: var(--deep); color: white; z-index: 100; }
.skip-link:focus { top: 12px; }

.site-header { height: 82px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(16px); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; margin-right: auto; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--accent); color: white; font-size: .76rem; font-weight: 800; letter-spacing: .02em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .97rem; }
.brand small { color: var(--muted); font-size: .73rem; margin-top: 2px; }
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { text-decoration: none; font-weight: 650; color: var(--muted); font-size: .89rem; }
.main-nav a:hover, .main-nav a.active { color: var(--ink); }
.nav-toggle { display: none; border: 0; background: transparent; font-weight: 700; }
.button { min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; font-size: .88rem; text-decoration: none; cursor: pointer; transition: transform .16s ease, background .16s ease, border .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-dark { background: var(--deep); color: white; }
.button-primary { background: var(--accent); color: white; }
.button-light { background: white; border-color: var(--line); color: var(--ink); }
.button-light:hover { border-color: #aeb9b4; }
.button-danger { background: white; border-color: #efc5c8; color: var(--red); }
.button-danger:hover { background: var(--red-bg); border-color: #e4a6ab; }
.button-wide { width: 100%; }

.loading { min-height: 65vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.loading span { width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero { padding-top: 72px; padding-bottom: 54px; }
.eyebrow-row, .section-heading, .hero-meta, .form-footer, .panel-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: .72rem; line-height: 1.2; font-weight: 850; color: var(--accent); margin-bottom: 13px; }
.live-dot { display: inline-block; width: 7px; height: 7px; background: var(--green); border-radius: 50%; margin-right: 7px; box-shadow: 0 0 0 5px var(--green-bg); }
.last-updated, .section-note { color: var(--muted); font-size: .84rem; }
.overall-banner { margin-top: 18px; min-height: 156px; padding: 34px 38px; border: 1px solid; border-radius: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.overall-banner h1 { font-size: clamp(2rem, 5vw, 3.7rem); margin: 0; max-width: 820px; }
.overall-banner .status-orb { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-size: 1.7rem; font-weight: 900; }
.overall-banner.operational { background: var(--green-bg); border-color: #b8dcc5; color: #0f633b; }
.overall-banner.degraded { background: var(--yellow-bg); border-color: #f0d398; color: #7c4603; }
.overall-banner.partial { background: var(--orange-bg); border-color: #efc6ae; color: #913d11; }
.overall-banner.major { background: var(--red-bg); border-color: #ecb8bc; color: #941f28; }
.overall-banner.maintenance { background: var(--blue-bg); border-color: #bed4eb; color: #1f568c; }
.overall-banner .status-orb { background: rgba(255,255,255,.66); }
.hero-meta { padding: 18px 8px 0; color: var(--muted); font-size: .84rem; align-items: center; }
.hero-meta p { margin: 0; }
.hero-meta div { display: flex; gap: 8px; }
.hero-meta a { font-weight: 700; }

.content-section { padding-block: 48px; }
.section-heading { margin-bottom: 24px; }
.section-heading h2 { margin: 0; }
.section-heading .eyebrow { margin-bottom: 9px; }
.incident-list, .admin-stack { display: grid; gap: 14px; }
.incident-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: white; }
.incident-card.pinned { border-color: #edc29e; }
.incident-summary { padding: 22px 24px; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 16px; cursor: pointer; }
.incident-card[open] .incident-summary { border-bottom: 1px solid var(--line); }
.incident-summary::-webkit-details-marker { display: none; }
.incident-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; }
.incident-summary h3 { margin: 0 0 6px; }
.incident-summary p { margin: 0; color: var(--muted); font-size: .87rem; }
.chevron { color: var(--muted); font-size: 1.25rem; transition: transform .2s; }
details[open] .chevron { transform: rotate(45deg); }
.incident-thread { padding: 24px 24px 12px 77px; }
.thread-item { position: relative; padding: 0 0 26px 21px; border-left: 1px solid var(--line); }
.thread-item:last-child { border-left-color: transparent; }
.thread-item::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 4px solid white; position: absolute; left: -5px; top: 2px; box-shadow: 0 0 0 1px var(--line); }
.thread-item header { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.thread-item strong { font-size: .9rem; }
.thread-item time { color: var(--muted); font-size: .78rem; }
.thread-item p { color: #414c47; margin: 0; max-width: 760px; }

.service-group { margin-top: 20px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: white; }
.service-group-header { padding: 19px 22px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: var(--wash); }
.service-group-header h3 { margin: 0 0 3px; font-size: 1.05rem; }
.service-group-header p { margin: 0; color: var(--muted); font-size: .78rem; }
.service-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: white; padding: 16px 22px; display: grid; grid-template-columns: minmax(190px, 1.4fr) minmax(180px, 1fr) auto; gap: 18px; text-align: left; align-items: center; cursor: pointer; }
.service-row:last-child { border-bottom: 0; }
.service-row:hover { background: #fbfcfb; }
.service-name strong, .service-name small { display: block; }
.service-name small { color: var(--muted); margin-top: 4px; font-size: .77rem; }
.uptime { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; height: 24px; }
.uptime span { min-width: 3px; border-radius: 2px; background: var(--green); }
.uptime span.degraded { background: #efa52b; }
.uptime span.partial { background: #dc630b; }
.uptime span.major { background: var(--red); }
.uptime span.maintenance { background: var(--blue); }
.status-badge { display: inline-flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 800; padding: 7px 10px; border-radius: 999px; white-space: nowrap; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.operational .status-badge, .status-badge.operational { background: var(--green-bg); color: #12673e; }
.degraded .status-badge, .status-badge.degraded { background: var(--yellow-bg); color: #8d4e00; }
.partial .status-badge, .status-badge.partial { background: var(--orange-bg); color: #a04412; }
.major .status-badge, .status-badge.major { background: var(--red-bg); color: #a12029; }
.maintenance .status-badge, .status-badge.maintenance { background: var(--blue-bg); color: #205b98; }

.history-wrap { background: var(--wash); border-top: 1px solid var(--line); }
.history-list { background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 16px; }
.history-day { padding: 17px 20px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 145px 1fr auto; gap: 20px; align-items: center; }
.history-day:last-child { border-bottom: 0; }
.history-day time { font-weight: 800; font-size: .87rem; }
.history-day p { color: var(--muted); margin: 0; font-size: .86rem; }
.history-day a { font-weight: 750; font-size: .83rem; }

.site-footer { background: var(--deep); color: white; padding: 54px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; }
.footer-inner p { color: #b8c7c2; font-size: .87rem; }
.footer-inner div:last-child { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.footer-inner a { color: #dfe8e5; font-size: .83rem; }

dialog { width: min(600px, calc(100% - 28px)); border: 0; border-radius: 20px; padding: 34px; box-shadow: 0 30px 90px rgba(10, 30, 25, .3); }
dialog::backdrop { background: rgba(9, 24, 20, .58); backdrop-filter: blur(4px); }
dialog h2 { margin-bottom: 8px; }
dialog > p:not(.eyebrow) { color: var(--muted); }
.dialog-close { position: absolute; right: 18px; top: 16px; border: 0; background: transparent; font-size: 1.8rem; color: var(--muted); cursor: pointer; }
label { display: grid; gap: 7px; color: #36413c; font-size: .81rem; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #cdd5d1; border-radius: 9px; padding: 11px 12px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21,63,53,.12); }
textarea { resize: vertical; line-height: 1.5; }
fieldset { border: 0; padding: 0; margin: 20px 0; }
legend { font-weight: 800; font-size: .82rem; margin-bottom: 10px; }
.check-row { display: flex; align-items: center; gap: 9px; font-weight: 650; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.subscribe-services { max-height: 210px; overflow: auto; margin: 10px 0 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dialog-incident-list { margin-top: 24px; }
.form-help { margin: 14px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--deep); color: white; padding: 13px 17px; border-radius: 10px; box-shadow: var(--shadow); transform: translateY(100px); opacity: 0; transition: .25s; z-index: 100; max-width: 360px; }
.toast.show { transform: translateY(0); opacity: 1; }

.login-wrap { min-height: 720px; padding-block: 80px; display: grid; grid-template-columns: 1.1fr .78fr; gap: 90px; align-items: center; }
.login-copy h1 { max-width: 660px; }
.login-copy > p:not(.eyebrow) { color: var(--muted); max-width: 600px; font-size: 1.08rem; }
.login-proof { display: flex; align-items: flex-start; gap: 12px; margin-top: 24px; }
.login-proof > span { width: 26px; height: 26px; display: grid; place-items: center; background: var(--green-bg); color: var(--green); border-radius: 50%; font-weight: 900; }
.login-proof strong, .login-proof small { display: block; }
.login-proof small { color: var(--muted); margin-top: 4px; }
.card { background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.login-card { padding: 30px; display: grid; gap: 20px; }
.login-card h2 { margin-bottom: 5px; }
.login-card p { margin: 0; color: var(--muted); }

.console { background: #f5f6f4; min-height: 800px; }
.console-topbar { background: white; border-bottom: 1px solid var(--line); }
.console-topbar-inner { min-height: 86px; display: flex; justify-content: space-between; align-items: center; }
.console-topbar .eyebrow { margin: 0 0 4px; }
.console-actions { display: flex; gap: 8px; }
.console-layout { display: grid; grid-template-columns: 220px 1fr; gap: 44px; padding-block: 42px 80px; }
.console-nav { display: grid; align-content: start; gap: 4px; position: sticky; top: 124px; height: fit-content; }
.console-nav button { border: 0; background: transparent; border-radius: 9px; padding: 12px; color: var(--muted); text-align: left; font-weight: 750; cursor: pointer; }
.console-nav button span { font-size: .68rem; color: #9ca6a1; margin-right: 11px; }
.console-nav button:hover, .console-nav button.active { color: var(--ink); background: white; box-shadow: 0 5px 20px rgba(20,45,38,.05); }
.console-main { min-width: 0; }
.panel-heading { align-items: flex-start; margin-bottom: 24px; }
.panel-heading h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); margin-bottom: 8px; }
.panel-heading p:not(.eyebrow) { color: var(--muted); margin: 0; }
.time-target { background: var(--green-bg); color: #1d7049; font-size: .73rem; font-weight: 800; padding: 8px 10px; border-radius: 999px; white-space: nowrap; }
.form-card { padding: 26px; display: grid; gap: 22px; }
.form-step { display: flex; gap: 12px; align-items: center; }
.form-step > span { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--deep); color: white; font-weight: 800; font-size: .78rem; }
.form-step h3, .form-step p { margin: 0; }
.form-step p { color: var(--muted); font-size: .78rem; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 280px; overflow: auto; }
.choice-grid label { display: flex; gap: 9px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 9px; font-weight: 650; background: #fcfdfc; }
.choice-grid input { width: 16px; accent-color: var(--accent); }
.maintenance-service-fieldset { margin: 0; padding: 0; }
.maintenance-service-fieldset > legend { margin-bottom: 4px; }
.maintenance-service-fieldset > p { color: var(--muted); font-size: .78rem; margin: 0 0 10px; }
.maintenance-service-grid { max-height: 240px; }
.maintenance-service-grid label { align-items: flex-start; }
.maintenance-service-grid label span { display: grid; gap: 2px; }
.maintenance-service-grid label small { color: var(--muted); font-weight: 600; }
.empty-choice { color: var(--muted); font-size: .81rem; grid-column: 1 / -1; padding: 12px; margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-footer { border-top: 1px solid var(--line); padding-top: 18px; align-items: center; }
.form-footer p { margin: 0; color: var(--muted); font-size: .78rem; }
.admin-incident { padding: 22px; }
.admin-incident header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.admin-incident h3 { font-size: 1.05rem; margin-bottom: 5px; }
.admin-incident p { color: var(--muted); font-size: .84rem; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-actions .button { min-height: 36px; padding-inline: 13px; font-size: .76rem; }
.maintenance-heading { margin-top: 36px; }
.subsection-heading { display: flex; justify-content: space-between; align-items: end; margin: 30px 0 14px; }
.subsection-heading h2 { font-size: 1.25rem; margin: 0 0 3px; }
.subsection-heading p { color: var(--muted); font-size: .81rem; margin: 0; }
.history-entry-card { margin-bottom: 14px; box-shadow: none; }
.history-entry-card > summary { list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.history-entry-card > summary::-webkit-details-marker { display: none; }
.history-entry-card > summary::after { content: "+"; color: var(--muted); font-size: 1.25rem; }
.history-entry-card[open] > summary::after { content: "−"; }
.history-entry-card > summary span { color: var(--muted); font-size: .77rem; font-weight: 500; margin-left: auto; }
.history-entry-card .form-card { border-top: 1px solid var(--line); border-radius: 0; }
.past-events { margin-bottom: 28px; }
.past-event-row { padding: 18px 20px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.past-event-row h3 { margin: 7px 0 4px; }
.past-event-row p { color: var(--muted); font-size: .81rem; margin: 0; }
.event-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.event-location { color: var(--muted); font-size: .74rem; font-weight: 800; }
.service-edit-actions { display: flex; gap: 8px; }
#service-edit-form { display: grid; gap: 18px; margin-top: 20px; }
#maintenance-edit-form { display: grid; gap: 18px; margin-top: 20px; }
.update-form { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.inline-form { padding: 18px; display: grid; grid-template-columns: 1fr 180px 1.4fr auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.service-admin-list { display: grid; gap: 8px; }
.service-admin-row { background: white; border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; display: grid; grid-template-columns: 1fr 180px auto; gap: 12px; align-items: center; }
.service-admin-row small { display: block; color: var(--muted); margin-top: 3px; }
.table-wrap { overflow: auto; box-shadow: none; }
table { width: 100%; border-collapse: collapse; font-size: .81rem; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .69rem; text-transform: uppercase; letter-spacing: .09em; background: var(--wash); }
tr:last-child td { border-bottom: 0; }

@media (max-width: 820px) {
  .main-nav { display: none; position: absolute; inset: 82px 0 auto; padding: 20px; background: white; border-bottom: 1px solid var(--line); flex-direction: column; align-items: flex-start; }
  .main-nav.open { display: flex; }
  .header-subscribe { display: none; }
  .nav-toggle { display: block; }
  .hero { padding-top: 44px; }
  .overall-banner { min-height: 130px; padding: 25px; }
  .overall-banner .status-orb { width: 54px; height: 54px; }
  .service-row { grid-template-columns: 1fr auto; }
  .service-row .uptime { grid-column: 1 / -1; grid-row: 2; }
  .login-wrap { grid-template-columns: 1fr; gap: 36px; padding-block: 50px; }
  .login-copy h1 { font-size: 3rem; }
  .console-layout { grid-template-columns: 1fr; gap: 24px; }
  .console-nav { position: static; display: flex; overflow-x: auto; }
  .console-nav button { white-space: nowrap; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .inline-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 1120px); }
  .site-header { height: 70px; }
  .main-nav { top: 70px; }
  .eyebrow-row, .section-heading, .hero-meta, .form-footer, .panel-heading, .footer-inner { align-items: flex-start; flex-direction: column; }
  .last-updated { margin: -5px 0 2px 18px; }
  .overall-banner { align-items: flex-start; }
  .overall-banner h1 { font-size: 2rem; }
  .overall-banner .status-orb { display: none; }
  .hero-meta { gap: 7px; }
  .service-row { padding: 15px; grid-template-columns: 1fr; gap: 11px; }
  .service-row .uptime { grid-column: auto; grid-row: auto; }
  .status-badge { width: fit-content; }
  .service-group-header { padding: 16px; }
  .incident-summary { padding: 18px; grid-template-columns: auto 1fr; }
  .incident-summary .chevron { display: none; }
  .incident-thread { padding: 20px 18px 4px 30px; }
  .history-day { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .history-day p { grid-row: 2; grid-column: 1 / -1; }
  .subscribe-services, .form-grid, .choice-grid { grid-template-columns: 1fr; }
  dialog { padding: 28px 22px; }
  .login-copy h1 { font-size: 2.45rem; }
  .console-topbar-inner { padding-block: 14px; align-items: flex-start; gap: 12px; flex-direction: column; }
  .console-actions { width: 100%; }
  .console-actions .button { flex: 1; }
  .console-layout { padding-top: 24px; }
  .update-form { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .service-admin-row { grid-template-columns: 1fr auto; }
  .service-admin-row > :nth-child(2) { grid-row: 2; grid-column: 1 / -1; }
  .form-card { padding: 20px; }
  .past-event-row { grid-template-columns: 1fr; }
  .history-entry-card > summary { align-items: flex-start; flex-direction: column; }
  .history-entry-card > summary span { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
