:root {
  --ink: #12233f;
  --muted: #66758e;
  --line: #dce4ef;
  --panel: #ffffff;
  --canvas: #f4f7fb;
  --blue: #1769e0;
  --blue-dark: #0d4eae;
  --green: #15805b;
  --green-soft: #e5f6ef;
  --navy: #0b1f3a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
a { color: var(--blue); text-decoration: none; font-weight: 700; }
.topbar { height: 72px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: white; }
.brand { display: flex; align-items: center; gap: 12px; color: white; font-size: 17px; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--navy); background: #7ce8c2; font-size: 12px; font-weight: 900; }
.site-nav { display: flex; align-items: center; }
.profile-menu { position: relative; }
.profile-trigger { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border-radius: 999px; cursor: pointer; list-style: none; transition: background .16s ease; }
.profile-trigger::-webkit-details-marker { display: none; }
.profile-trigger:hover, .profile-trigger:focus-visible, .profile-menu[open] .profile-trigger { background: rgba(255,255,255,.12); }
.profile-trigger:focus-visible { outline: 3px solid rgba(124,232,194,.45); outline-offset: 2px; }
.user-chip { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #25456d; font-size: 12px; font-weight: 800; }
.profile-chevron { width: 7px; height: 7px; border-right: 2px solid #c9d9eb; border-bottom: 2px solid #c9d9eb; transform: translateY(-2px) rotate(45deg); transition: transform .16s ease; }
.profile-menu[open] .profile-chevron { transform: translateY(2px) rotate(225deg); }
.profile-dropdown { position: absolute; z-index: 20; top: calc(100% + 10px); right: 0; display: grid; width: min(280px, calc(100vw - 32px)); padding: 8px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; box-shadow: 0 18px 48px rgba(7,24,47,.22); }
.profile-dropdown::before { content: ""; position: absolute; top: -6px; right: 22px; width: 10px; height: 10px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: white; transform: rotate(45deg); }
.profile-identity { display: grid; gap: 4px; min-width: 0; margin: 2px 4px 7px; padding: 11px 10px 14px; border-bottom: 1px solid var(--line); }
.profile-identity span { color: var(--muted); font-size: 11px; font-weight: 700; }
.profile-identity strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.profile-dropdown a, .profile-menu-button { display: flex; width: 100%; min-height: 42px; align-items: center; padding: 0 11px; border-radius: 8px; color: #34445d; background: transparent; font-size: 14px; font-weight: 750; text-align: left; }
.profile-dropdown a:hover, .profile-dropdown a:focus-visible, .profile-menu-button:hover, .profile-menu-button:focus-visible { outline: none; color: var(--blue); background: #f0f6ff; }
.profile-menu-button { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: #a12f3e; }
.auth-layout { min-height: calc(100vh - 72px); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, .85fr); }
.auth-layout.compact { grid-template-columns: minmax(0, 1fr) minmax(420px, .8fr); }
.auth-intro { display: flex; flex-direction: column; justify-content: center; padding: 8vw; color: white; background: radial-gradient(circle at 15% 20%, #1d4a78 0, transparent 34%), linear-gradient(135deg, #0b1f3a, #123865); }
.auth-intro h1 { max-width: 680px; margin: 12px 0 20px; font-size: clamp(42px, 5vw, 72px); line-height: .98; letter-spacing: -.05em; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .15em; font-size: 12px; font-weight: 900; color: #59d9ad; }
.lede { max-width: 630px; margin: 0; color: #c8d9ee; font-size: 19px; line-height: 1.65; }
.status-strip { display: flex; align-items: center; gap: 14px; margin-top: 42px; padding: 18px 20px; width: fit-content; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: rgba(255,255,255,.06); }
.status-strip strong, .status-strip small { display: block; }
.status-strip small { margin-top: 3px; color: #b8cbe2; }
.pulse { display: inline-block; width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 5px rgba(21,128,91,.12); }
.pulse.operational { background: #3ed59f; }
.pulse.unhealthy { background: #df4f5f; box-shadow: 0 0 0 5px rgba(223,79,95,.12); }
.auth-card { align-self: center; width: min(470px, 84%); margin: 48px auto; padding: 42px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 24px 70px rgba(16,37,67,.10); }
.auth-card .eyebrow { color: var(--blue); }
.auth-card h2 { margin: 10px 0 30px; font-size: 30px; letter-spacing: -.03em; }
form { display: grid; gap: 20px; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 800; color: #34445d; }
input, select { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #cbd6e5; border-radius: 10px; background: white; color: var(--ink); font: inherit; }
input:focus, select:focus { outline: 3px solid rgba(23,105,224,.16); border-color: var(--blue); }
button { border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.primary { min-height: 48px; padding: 0 20px; border-radius: 10px; color: white; background: var(--blue); box-shadow: 0 8px 18px rgba(23,105,224,.18); }
.primary:hover { background: var(--blue-dark); }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; }
.secondary { border: 1px solid #cbd6e5; border-radius: 10px; color: #34445d; background: white; }
.form-foot { margin: 24px 0 0; text-align: center; color: var(--muted); }
.field-note { margin: -12px 0 0; color: var(--muted); line-height: 1.45; }
.flash-stack { position: fixed; z-index: 10; top: 86px; right: 24px; display: grid; gap: 10px; width: min(440px, calc(100vw - 48px)); }
.flash { padding: 14px 16px; border: 1px solid; border-radius: 12px; background: white; box-shadow: 0 12px 32px rgba(12,31,57,.14); font-size: 14px; font-weight: 700; }
.flash.success { color: #12694d; border-color: #9ad9c2; background: #eefbf6; }
.flash.error { color: #982f3b; border-color: #f1b3bb; background: #fff3f4; }
.inline-form, .rule-actions form { display: block; margin: 0; }
.shell { width: min(1180px, 90vw); margin: 0 auto; padding: 64px 0 100px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.page-heading h1 { margin: 8px 0 8px; font-size: 42px; letter-spacing: -.04em; }
.page-heading p:last-child { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 38px 0 48px; }
.metric-grid article { display: grid; gap: 8px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.metric-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.metric-grid strong { display: flex; align-items: center; gap: 10px; font-size: 26px; }
.metric-grid small { color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; }
.section-title h2 { font-size: 24px; }
.section-title span { color: var(--muted); font-size: 13px; }
.rule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.rule-card { padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.rule-card h3 { margin: 18px 0 9px; font-size: 21px; }
.rule-card p { margin: 0; color: var(--muted); line-height: 1.6; }
.rule-top, .rule-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.region-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.region-tag, .enabled, .status-tags span { padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.region-tag { color: #154c8a; background: #e8f2ff; }
.enabled { color: var(--green); background: var(--green-soft); }
.disabled { padding: 6px 9px; border-radius: 999px; color: #6b7280; background: #eef1f5; font-size: 11px; font-weight: 900; }
.status-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.status-tags span { color: #5d4630; background: #fff2df; }
.rule-foot { padding-top: 18px; border-top: 1px solid var(--line); }
.rule-foot code { color: var(--muted); }
.rule-card.paused { opacity: .72; }
.live-statuses { display: flex; align-items: center; gap: 8px; margin: 17px 0 0; }
.live-statuses small { margin-left: 3px; color: var(--muted); }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: #8a96a8; }
.status-dot.operational { background: #28b987; }
.status-dot.degraded_performance { background: #e0a12b; }
.status-dot.major_outage { background: #d94a5a; }
.status-dot.under_maintenance { background: #3c83df; }
.status-dot.unavailable, .status-dot.unknown { background: #8a96a8; }
.status-tags span.operational { color: #12694d; background: #e5f6ef; }
.status-tags span.major_outage { color: #922a37; background: #fde9ec; }
.status-tags span.under_maintenance { color: #215c9f; background: #e8f2ff; }
.status-tags span.unavailable { color: #586174; background: #edf0f4; }
.rule-endpoint { display: grid; gap: 6px; margin: 20px 0; padding: 14px; border-radius: 10px; background: #f5f7fa; }
.rule-endpoint span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; font-weight: 900; }
.rule-endpoint code { overflow: hidden; color: #40506a; text-overflow: ellipsis; }
.rule-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 17px; padding-top: 18px; border-top: 1px solid var(--line); }
.rule-actions button { padding: 0; color: var(--blue); background: transparent; }
.rule-actions .danger-link { color: #ba3544; }
.add-card { display: grid; place-content: center; min-height: 250px; text-align: center; border-style: dashed; background: transparent; }
.add-card strong { font-size: 42px; color: var(--blue); }
.add-card h3 { margin: 8px 0; }
.empty-state { padding: 70px 30px; border: 1px dashed #bcc9da; border-radius: 18px; text-align: center; background: rgba(255,255,255,.45); }
.empty-state strong { font-size: 24px; }
.empty-state p { margin: 10px auto 24px; color: var(--muted); }
.delivery-heading { margin-top: 60px; }
.delivery-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
.delivery-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.delivery-table th, .delivery-table td { padding: 15px 17px; border-bottom: 1px solid #e7edf5; text-align: left; white-space: nowrap; }
.delivery-table th { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.delivery-table td:last-child { max-width: 330px; overflow: hidden; text-overflow: ellipsis; }
.delivery-result { padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.delivery-result.success { color: #12694d; background: #e5f6ef; }
.delivery-result.failed { color: #982f3b; background: #fde9ec; }
.quiet-copy { color: var(--muted); }
.form-shell { width: min(900px, 90vw); margin: 0 auto; padding: 64px 0 100px; }
.form-shell.narrow { width: min(650px, 90vw); }
.form-heading { margin-bottom: 34px; }
.form-heading h1 { margin: 10px 0 12px; font-size: 42px; line-height: 1.1; letter-spacing: -.04em; }
.form-heading > p:last-child { margin: 0; color: var(--muted); line-height: 1.6; }
.rule-form { gap: 22px; }
fieldset { display: grid; gap: 20px; margin: 0; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: white; }
legend { padding: 0 10px; font-size: 17px; font-weight: 900; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.region-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fieldset-copy { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.selection-actions { display: flex; gap: 8px; }
.selection-actions button { min-height: 34px; padding: 7px 11px; border: 1px solid #c8d5e5; border-radius: 8px; background: #f6f9fd; color: var(--blue); font-size: 12px; font-weight: 800; cursor: pointer; }
.selection-actions button:hover { background: #eaf3ff; }
.choice { display: flex; align-items: flex-start; gap: 11px; min-height: 76px; padding: 15px; border: 1px solid #d5deea; border-radius: 12px; cursor: pointer; }
.compact-choice { min-height: 68px; }
.choice:hover { border-color: #91b5e8; background: #f7faff; }
.choice input, .toggle input { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; accent-color: var(--blue); }
.choice span { display: grid; gap: 4px; }
.choice small { color: var(--muted); font-weight: 500; }
.toggle { display: flex; align-items: center; gap: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }
.error-page { width: min(760px, 90vw); margin: 0 auto; padding: 14vh 0; }
.error-page h1 { margin: 12px 0 28px; font-size: 42px; letter-spacing: -.04em; }
@media (max-width: 820px) {
  .auth-layout, .auth-layout.compact { grid-template-columns: 1fr; }
  .auth-intro { min-height: 45vh; padding: 54px 8vw; }
  .auth-intro h1 { font-size: 44px; }
  .auth-card { width: min(520px, 90%); }
  .metric-grid, .rule-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .choice-grid, .services-grid, .region-choice-grid { grid-template-columns: 1fr; }
  .fieldset-copy { align-items: flex-start; flex-direction: column; }
  .form-heading h1 { font-size: 34px; }
}
