:root {
  --green: #21ad3d;
  --orange: #ed8b24;
  --red: #db2c2c;
  --ink: #102019;
  --muted: #66756c;
  --line: #dce5df;
  --surface: #ffffff;
  --wash: #f3f8f4;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 0, #e1f7e6, transparent 30rem), var(--wash); }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1260px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 60px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 5px; color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(32px, 5vw, 54px); letter-spacing: -.045em; }
.subtitle { max-width: 680px; color: var(--muted); }
.topActions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.lastUpdated { color: var(--muted); font-size: 13px; }
button { border: 0; border-radius: 12px; padding: 11px 16px; background: var(--green); color: white; font-weight: 800; }
button.secondary { background: #e9efeb; color: var(--ink); }
.overall { display: flex; align-items: center; gap: 17px; padding: 20px 22px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: 0 10px 35px rgba(18,63,32,.07); }
.overall p { margin: 0 0 3px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.overall strong { font-size: 20px; letter-spacing: .02em; }
.trafficLight { display: inline-block; flex: 0 0 auto; width: 30px; height: 30px; border: 5px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #cad6ce, 0 0 18px currentColor; }
.trafficLight.green { color: var(--green); background: var(--green); }
.trafficLight.orange { color: var(--orange); background: var(--orange); }
.trafficLight.red { color: var(--red); background: var(--red); }
.statusGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.statusCard, .securityPanel, .panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 30px rgba(18,63,32,.06); }
.statusCard { padding: 21px; min-height: 260px; }
.localBackupPanel { display: grid; grid-template-columns: 1.1fr 1fr; gap: 30px; margin-top: 16px; }
.localBackupPanel .message { min-height: 0; margin: 20px 0 0 44px; }
.localBackupPanel dl { align-self: stretch; padding: 0 0 0 24px; border-top: 0; border-left: 1px solid var(--line); }
.cardHeading { display: flex; align-items: center; gap: 14px; }
.cardHeading p { margin: 0 0 2px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cardHeading h2 { margin: 0; font-size: 24px; }
.message { min-height: 44px; margin: 22px 0; color: var(--muted); line-height: 1.45; }
dl { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 850; text-align: right; }
.securityPanel { display: grid; grid-template-columns: 1.2fr 2fr; gap: 30px; padding: 24px; margin-top: 16px; }
.panelHeading > p { margin: 20px 0 0 44px; color: var(--muted); line-height: 1.45; }
.statGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { padding: 15px; border-radius: 14px; background: var(--wash); }
.stat span { display: block; min-height: 32px; color: var(--muted); font-size: 12px; }
.stat strong { display: block; margin-top: 7px; font-size: 25px; }
.lowerGrid { display: grid; grid-template-columns: .9fr 1.5fr; gap: 16px; margin-top: 16px; }
.activityPanel { margin-top: 16px; }
.activityGrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.activityStat { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--wash); }
.activityStat strong { display: block; color: var(--green); font-size: 30px; }
.activityStat span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.activityStat.clickable { width: 100%; color: inherit; text-align: left; cursor: pointer; }
.activityStat.clickable:hover, .activityStat.clickable:focus-visible { border-color: var(--green); background: #e8f6eb; outline: none; }
.activityNote { margin: 5px 0 14px; color: var(--muted); font-size: 13px; }
.panel { padding: 22px; }
.panelTitle { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.panelTitle h2 { margin-bottom: 14px; }
.countBadge { min-width: 34px; padding: 6px 9px; border-radius: 999px; background: #e8f6eb; color: var(--green); font-weight: 900; text-align: center; }
.panelControls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
button.compact { padding: 8px 11px; border-radius: 9px; font-size: 12px; }
button.clearButton { border: 1px solid #efb2b2; background: #fff5f5; color: #a31e1e; }
button.clearButton:hover, button.clearButton:focus-visible { border-color: var(--red); background: #ffe8e8; outline: none; }
button:disabled { cursor: not-allowed; opacity: .45; }
.blockedSourcesNote { margin: -2px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.blockedSourceList { display: grid; gap: 8px; max-height: 390px; overflow: auto; }
.blockedSourceRow { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 12px; border: 1px solid #f1d0d0; border-radius: 11px; background: #fffafa; color: var(--ink); text-align: left; }
.blockedSourceRow:hover, .blockedSourceRow:focus-visible { border-color: var(--red); background: #fff2f2; outline: none; }
.blockedSourceIdentity { display: grid; gap: 4px; min-width: 0; }
.blockedSourceIdentity strong { color: #8f1c1c; font: 800 13px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.blockedSourceIdentity small { color: var(--muted); font-size: 11px; }
.blockedSourceBadges { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.attemptBadge, .activeBanBadge { display: inline-block; white-space: nowrap; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.attemptBadge { background: #fee8e8; color: #9b2020; }
.activeBanBadge { background: #a31e1e; color: white; }
.ipDialog { width: min(620px, calc(100% - 30px)); }
.ipLookup { padding: 26px; }
.ipLookup dl { margin-top: 18px; }
.ipNotice { margin: 18px 0 0; padding: 12px; border-radius: 10px; background: #fff7e9; color: #765019; font-size: 13px; line-height: 1.45; }
.locationList { display: grid; gap: 9px; margin-top: 20px; }
.locationRow { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 14px; border-radius: 11px; background: var(--wash); }
.locationRow span { color: var(--green); font-weight: 850; }
.eventList { display: grid; gap: 8px; }
.event { display: grid; grid-template-columns: 88px 1fr auto; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 11px; background: var(--wash); }
.event time { color: var(--muted); font-size: 11px; }
.event strong { font-size: 13px; }
.event small { color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; }
dialog { width: min(440px, calc(100% - 30px)); border: 0; border-radius: 22px; padding: 0; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(9,25,15,.68); backdrop-filter: blur(8px); }
#loginForm { padding: 30px; }
.loginMark { margin-bottom: 28px; }
.loginMark img { display: block; width: min(300px, 100%); height: auto; border-radius: 10px; }
#loginForm > p:not(.eyebrow):not(.loginError) { color: var(--muted); line-height: 1.45; }
label { display: grid; gap: 7px; margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 700; }
input { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 13px; color: var(--ink); background: white; }
#loginForm button { width: 100%; margin-top: 20px; }
.loginError { min-height: 18px; margin: 12px 0 0; color: var(--red); font-size: 13px; font-weight: 700; }
@media (max-width: 900px) {
  .statusGrid, .securityPanel, .lowerGrid, .localBackupPanel { grid-template-columns: 1fr; }
  .localBackupPanel dl { padding: 16px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .statGrid { grid-template-columns: repeat(2, 1fr); }
  .activityGrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1260px); padding-top: 20px; }
  .topbar { display: block; }
  .topActions { justify-content: flex-start; }
  .statusCard { min-height: 0; }
  .event { grid-template-columns: 1fr; gap: 4px; }
  .blockedSourcesHeading, .blockedSourceRow { align-items: flex-start; }
  .blockedSourcesHeading, .blockedSourceRow { flex-direction: column; }
  .panelControls, .blockedSourceBadges { justify-content: flex-start; }
}
