:root {
  color-scheme: dark;
  --ink: #eaf8ff;
  --muted: #a9bdc9;
  --line: #294453;
  --surface: #071722;
  --surface-raised: #0b202d;
  --canvas: #030b12;
  --accent: #38d7eb;
  --accent-dark: #76e7f4;
  --accent-soft: #0b3542;
  --allowed: #38d7eb;
  --banned: #ff7c70;
  --unknown: #f1c75b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 280px;
  color: var(--ink);
  background: var(--canvas);
}

button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: #031019;
  background: var(--accent);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.site-header {
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 23, 34, 0.97);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 0;
  color: #031019;
  background: var(--accent);
  font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand small { margin-top: 1px; color: var(--muted); }

.timezone-button,
.month-controls button {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid #547181;
  border-radius: 0;
  background: var(--surface-raised);
  cursor: pointer;
}
.timezone-button:hover, .month-controls button:hover { background: var(--accent-soft); }

main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 38px);
}

.site-footer {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 0 clamp(18px, 3vw, 38px) 32px;
}
.site-footer a, .statement a { color: var(--accent-dark); }

.statement { width: min(760px, 100%); }
.statement h1 { margin-bottom: 24px; }
.statement h2 { margin: 32px 0 8px; }
.statement p, .statement li { color: var(--muted); line-height: 1.65; }
.statement strong { color: var(--ink); }

.calendar-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
}

.calendar-toolbar {
  padding: clamp(18px, 3vw, 30px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.scan-summary {
  display: grid;
  grid-template-columns: 1.45fr repeat(4, minmax(120px, .8fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #05141d;
}
.scan-item {
  min-height: 66px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}
.scan-item:last-child { border-right: 0; }
.scan-item span {
  color: var(--muted);
  font: 750 0.64rem/1.25 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scan-item strong { margin-top: 5px; font-size: 0.96rem; }
.scan-good strong { color: var(--accent-dark); }
.scan-warn strong { color: #ffe08c; }
.scan-refresh { position: relative; overflow: hidden; }
.scan-refresh::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 10px;
  left: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.65;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.5rem); letter-spacing: -0.035em; }
h2 { line-height: 1.15; }

.month-controls { display: flex; gap: 8px; }
.policy-note { margin: 0; padding: 0 30px 10px; color: var(--muted); }
.status { margin: 0; padding: 0 30px 18px; color: var(--muted); }
.status:empty { display: none; }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.calendar-row { display: contents; }

.weekday {
  padding: 10px;
  color: var(--muted);
  border-right: 1px solid var(--line);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}
.weekday:nth-child(7) { border-right: 0; }

.calendar-cell {
  min-width: 0;
  min-height: 126px;
  padding: 8px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell.outside { background: #09131b; color: #8297a5; }
.calendar-cell.selected { box-shadow: inset 0 0 0 3px var(--accent); }

.day-select {
  width: 34px;
  height: 34px;
  padding: 3px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}
.day-select:hover { background: var(--accent-soft); }
.day-select.today { color: #031019; background: var(--accent); }

.cell-events { margin-top: 4px; display: grid; gap: 4px; }
.event-chip, .more-events, .day-event {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
}
.event-chip {
  padding: 6px 7px;
  overflow: hidden;
  color: #dffbff;
  background: var(--accent-soft);
  font-size: 0.77rem;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-chip[data-verification="unverified"],
.day-event[data-verification="unverified"] { color: #fff2bf; border-left: 3px solid var(--unknown); background: #493d16; }
.event-chip[data-verification="verified"],
.day-event[data-verification="verified"] { border-left: 3px solid var(--allowed); }
.event-chip:hover, .day-event:hover { filter: brightness(0.96); }
.more-events { padding: 5px 7px; color: var(--accent-dark); background: transparent; font-size: 0.75rem; font-weight: 750; }

.selected-day {
  display: none;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}
.selected-day h2 { margin: 0 0 12px; font-size: 1.15rem; }
#selected-day-events { display: grid; gap: 8px; }
.day-event { padding: 11px; color: #dffbff; background: var(--accent-soft); font-weight: 750; }
.day-empty { margin: 0; color: var(--muted); }

dialog {
  width: min(700px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 90px rgba(7, 21, 40, 0.35);
}
dialog::backdrop { background: rgba(10, 22, 39, 0.66); }
.dialog-card { position: relative; padding: clamp(22px, 5vw, 38px); }
.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: var(--surface-raised);
  cursor: pointer;
  font-size: 1.45rem;
}
.event-details h2 { margin: 0 52px 18px 0; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.policy-verdict {
  position: relative;
  padding: clamp(18px, 4vw, 28px);
  overflow: hidden;
  border: 1px solid #2a9db1;
  border-left: 7px solid var(--allowed);
  background: linear-gradient(125deg, #082a36 0%, #071c27 72%);
}
.policy-verdict::after {
  content: "AI";
  position: absolute;
  right: -8px;
  bottom: -24px;
  color: rgba(95, 229, 242, 0.055);
  font: 900 clamp(5rem, 18vw, 9rem)/1 "Arial Narrow", Arial, sans-serif;
  letter-spacing: -0.09em;
  pointer-events: none;
}
.policy-verdict.banned { border-color: #f7838d; background: linear-gradient(125deg, #4a1f25 0%, #26151a 72%); }
.policy-verdict.unknown { border-color: #e9c35d; background: linear-gradient(125deg, #403716 0%, #241f12 72%); }
.policy-heading { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.policy-heading .eyebrow { margin: 0; color: #8eecf4; }
.policy-verdict.unknown .policy-heading .eyebrow { color: #ffe08c; }
.policy-verdict.banned .policy-heading .eyebrow { color: #ffb0b7; }
.policy-status {
  padding: 4px 8px;
  color: #dffcff;
  border: 1px solid currentColor;
  font: 800 0.7rem/1.2 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.policy-verdict.unknown .policy-status { color: #ffe08c; }
.policy-verdict.banned .policy-status { color: #ffb0b7; }
.policy-verdict h3 { position: relative; z-index: 1; margin: 12px 0 8px; font-size: clamp(1.35rem, 4vw, 2rem); }
.policy-reason { position: relative; z-index: 1; margin: 0; color: #d7e8ed; line-height: 1.55; }
.policy-verdict blockquote {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  padding: 11px 14px;
  color: #effdff;
  border-left: 3px solid var(--allowed);
  background: rgba(1, 11, 17, 0.38);
  font-weight: 700;
}
.policy-verdict.unknown blockquote { border-left-color: var(--unknown); }
.policy-verdict.banned blockquote { border-left-color: var(--banned); }
.policy-checked { position: relative; z-index: 1; margin: 13px 0 0; color: var(--muted); font: 700 0.76rem/1.35 "Cascadia Code", Consolas, monospace; }
.policy-actions { position: relative; z-index: 1; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.policy-actions strong { color: #bff8ff; }
.policy-verdict.unknown .policy-actions strong { color: #ffe08c; }
.policy-verdict.banned .policy-actions strong { color: #ffb0b7; }
.policy-source { min-height: 42px; padding: 9px 12px; display: inline-flex; align-items: center; color: #031019; background: var(--accent); font-weight: 850; text-decoration: none; }
.policy-source:hover { background: #9bf5fc; }
.policy-source:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.scan-ledger { margin-top: 18px; border: 1px solid var(--line); background: #06141d; }
.scan-ledger-heading { padding: 15px 16px 13px; border-bottom: 1px solid var(--line); }
.scan-ledger-heading h3 { margin: 0; font-size: 1.2rem; }
.scan-ledger ol { margin: 0; padding: 0; list-style: none; }
.scan-ledger li {
  padding: 11px 14px;
  display: grid;
  grid-template-columns: 26px minmax(120px, .55fr) 1.45fr;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  align-items: start;
  font-size: 0.88rem;
}
.scan-ledger li:last-child { border-bottom: 0; }
.scan-ledger li > span:last-child { color: var(--muted); line-height: 1.4; }
.scan-mark { color: var(--accent-dark); font: 850 0.75rem/1.5 "Cascadia Code", Consolas, monospace; }
.scan-mark.warn { color: var(--unknown); }
.alert-decision { padding: 12px 14px; color: #dffbff; border-left: 3px solid var(--allowed); background: var(--accent-soft); }
.alert-decision.warn { color: #fff2bf; border-left-color: var(--unknown); background: #3a3218; }
.detail-grid { margin: 22px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-item { padding: 12px; border: 1px solid var(--line); border-radius: 0; }
.detail-item dt { color: var(--muted); font-size: 0.75rem; font-weight: 750; text-transform: uppercase; }
.detail-item dd { margin: 4px 0 0; font-weight: 650; }
.event-links { display: flex; flex-wrap: wrap; gap: 9px; }
.event-links a { padding: 10px 12px; border: 1px solid #547181; border-radius: 0; color: var(--accent-dark); font-weight: 700; text-decoration: none; }
.event-links a:hover { background: var(--accent-soft); }

.timezone-card { width: min(100%, 520px); }
.timezone-card h2 { margin: 0 0 14px; }
.timezone-card label { display: block; margin: 18px 0 6px; font-weight: 750; }
.timezone-card select { width: 100%; min-height: 46px; padding: 8px; border: 1px solid #6c8797; border-radius: 0; color: var(--ink); background: var(--surface-raised); }
.dialog-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 9px; }
.dialog-actions button { min-height: 44px; padding: 9px 14px; border: 1px solid #6c8797; border-radius: 0; color: var(--ink); background: var(--surface-raised); cursor: pointer; }
.dialog-actions .primary { color: #031019; border-color: var(--accent); background: var(--accent); }
.noscript { margin: 20px; padding: 14px; border: 2px solid var(--banned); background: var(--surface); }

.event-chip .event-name,
.event-chip .event-time,
.day-event .event-name,
.day-event .event-time {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-chip .event-time,
.day-event .event-time {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
}
.mobile-markers { display: none; }

@media (max-width: 680px) {
  .site-header { min-height: 62px; padding: 10px 12px; }
  .brand small { display: none; }
  .timezone-button { max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 10px; }
  .site-footer { padding: 10px 10px 24px; }
  .calendar-shell { border-radius: 0; }
  .calendar-toolbar { padding: 16px 12px 12px; align-items: stretch; flex-direction: column; }
  .month-controls { justify-content: space-between; }
  .month-controls button { flex: 1; }
  .policy-note { padding: 0 12px 8px; }
  .status { padding: 0 12px 12px; }
  .weekday { padding: 8px 1px; font-size: 0.63rem; letter-spacing: 0; text-transform: none; }
  .calendar-cell { min-height: 58px; padding: 3px; }
  .day-select { width: 30px; height: 30px; font-size: 0.78rem; }
  .cell-events { display: none; }
  .mobile-markers {
    min-height: 12px;
    margin: 2px 1px 0;
    display: flex;
    justify-content: center;
    gap: 2px;
  }
  .mobile-markers span {
    width: 4px;
    height: 4px;
    background: var(--allowed);
  }
  .mobile-markers span[data-verification="unverified"] { background: var(--unknown); }
  .selected-day { display: block; }
  .detail-grid { grid-template-columns: 1fr; }
  .policy-actions { align-items: stretch; flex-direction: column; }
  .policy-source { justify-content: center; }
  .event-links { display: grid; }
  .dialog-actions { display: grid; }
  .scan-summary { grid-template-columns: 1fr 1fr; }
  .scan-refresh { grid-column: 1 / -1; }
  .scan-item { min-height: 58px; border-bottom: 1px solid var(--line); }
  .scan-ledger li { grid-template-columns: 24px 1fr; }
  .scan-ledger li > span:last-child { grid-column: 2; }
}

@media (max-width: 420px) {
  .scan-summary { grid-template-columns: 1fr; }
  .scan-refresh { grid-column: auto; }
  .scan-item { border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
