*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── LIGHT MODE (default) ── */
:root {
  --navy:      #1a2744;
  --navy-mid:  #223058;
  --navy-card: #1a2744;
  --gold:      #f0b400;
  --gold-dim:  #f0b40018;
  --gold-dark: #c49200;
  --red:       #c0392b;
  --white:     #ffffff;
  --off-white: #f4f5f7;
  --text:      #1a2744;
  --text-mid:  #3d4f6e;
  --text-dim:  #6b7f9e;
  --border:    #d0d9e8;
  --row-alt:   #edf1f7;
  --row-hover: #dce6f5;
  --toolbar-bg:  #ffffff;
  --table-bg:    #ffffff;
  --search-bg:   #f4f5f7;
  --link-color:  #1a2744;
  --font-head: 'Oswald', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --font-body: 'Source Sans 3', sans-serif;
}

/* ── DARK MODE ── */
html.dark {
  --gold-dim:  #f0b40025;
  --red:       #e05c5c;
  --off-white: #0f1623;
  --text:      #d4e2ef;
  --text-mid:  #93aec8;
  --text-dim:  #6b859e;
  --border:    #243447;
  --row-alt:   #162032;
  --row-hover: #1d3045;
  --toolbar-bg:  #162032;
  --table-bg:    #1c2b3a;
  --search-bg:   #0f1623;
  --link-color:  #7ec8e3;
}

/* ── DARK MODE TOGGLE BUTTON ── */
.btn-theme {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-mid);
  font-size: 1rem;
  padding: .45rem .65rem;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.btn-theme:hover { border-color: var(--gold); color: var(--gold); }
.btn-theme:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.icon-moon { display: inline; }
.icon-sun  { display: none;   }
html.dark .icon-moon { display: none;   }
html.dark .icon-sun  { display: inline; }

/* ── SMOOTH TRANSITIONS ── */
body, .toolbar, .table-wrap, #highlight-search, tbody tr {
  transition: background .2s, color .2s, border-color .2s;
}

.skip-link {
  position: absolute; top: -999px; left: -999px;
  background: var(--gold); color: var(--navy);
  padding: .5rem 1rem; font-weight: 700;
  border-radius: 4px; z-index: 9999;
}
.skip-link:focus { top: 1rem; left: 1rem; }

body {
  background: var(--off-white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  min-height: 100vh;
}

/* ── HEADER ── */
header {
  background: var(--navy);
  border-bottom: 4px solid var(--gold);
  padding: 1.5rem 2rem;
  position: relative;
  overflow: hidden;
}
header::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, var(--gold) 0%, transparent 65%);
  opacity: .06;
  pointer-events: none;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 1.25rem;
}
.header-text h1 {
  font-family: var(--font-head); font-size: 1.6rem;
  font-weight: 700; color: var(--gold); letter-spacing: .04em;
  text-transform: uppercase;
}
.header-text p { font-size: .82rem; color: rgba(255,255,255,.65); margin-top: .2rem; letter-spacing: .02em; }

/* ── TOOLBAR ── */
.toolbar {
  background: var(--toolbar-bg);
  border-bottom: 1px solid var(--border);
  padding: .9rem 2rem;
  box-shadow: 0 1px 4px rgba(26,39,68,.07);
}
.toolbar-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; gap: .75rem; align-items: center; flex-wrap: wrap;
}
.search-wrap { flex: 1; min-width: 220px; position: relative; }
.search-icon {
  position: absolute; left: .8rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim); pointer-events: none;
}
#highlight-search {
  width: 100%;
  background: var(--search-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: .92rem;
  padding: .6rem .9rem .6rem 2.4rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#highlight-search::placeholder { color: var(--text-dim); }
#highlight-search:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,39,68,.12); }

.btn {
  font-family: var(--font-body); font-size: .88rem; font-weight: 600;
  padding: .6rem 1.2rem; border-radius: 5px; border: none;
  cursor: pointer; transition: opacity .15s, background .15s;
  white-space: nowrap; text-decoration: none; display: inline-block;
}
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: #223058; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-mid); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-archive {
  background: var(--gold); color: var(--navy);
  font-family: var(--font-body); font-size: .82rem;
  letter-spacing: .03em; text-transform: uppercase;
  border: none;
}
.btn-archive:hover { background: var(--gold-dark); color: var(--white); }

/* ── NOTICE ── */
.notice { max-width: 1100px; margin: 1.25rem auto 0; padding: 0 2rem; }
.notice p {
  font-size: .82rem; color: var(--text-mid);
  padding: .6rem .9rem;
  border-left: 3px solid var(--gold);
  background: var(--gold-dim);
  border-radius: 0 4px 4px 0;
}

/* ── DESCRIPTION ── */
.description { max-width: 1100px; margin: 1rem auto 0; padding: 0 2rem; }
.description p {
  font-size: .92rem;
  color: var(--text-mid);
  line-height: 1.65;
}

/* ── LIVE STATUS ── */
#search-status {
  max-width: 1100px; margin: .75rem auto 0; padding: 0 2rem;
  font-size: .85rem; color: var(--text-mid);
  font-family: var(--font-body); min-height: 1.2em;
}

/* ── MAIN ── */
main { max-width: 1100px; margin: 1.25rem auto 3rem; padding: 0 2rem; }

/* ── TABLE ── */
.table-wrap {
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; background: var(--table-bg);
  box-shadow: 0 2px 8px rgba(26,39,68,.08);
}
table { width: 100%; border-collapse: collapse; }
caption { display: none; }

thead tr { background: var(--navy); border-bottom: 3px solid var(--gold); }
th {
  font-family: var(--font-head); font-size: .78rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold); padding: .9rem 1rem;
  text-align: left; white-space: nowrap; user-select: none;
}

tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
tbody tr:nth-child(odd)  { background: var(--table-bg); }
tbody tr:nth-child(even) { background: var(--row-alt); }
tbody tr:hover { background: var(--row-hover); }
tbody tr:last-child { border-bottom: none; }
tbody tr.hidden { display: none; }

td { padding: .72rem 1rem; vertical-align: middle; }

td a {
  font-family: var(--font-body); font-size: .9rem;
  color: var(--link-color); text-decoration: underline;
  font-weight: 600; letter-spacing: 0;
}
td a:hover { color: var(--gold-dark); text-decoration: underline; }
td a:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 2px; }

.status {
  display: inline-block; font-family: var(--font-body);
  font-size: .75rem; letter-spacing: .03em;
  padding: .2rem .55rem; border-radius: 4px; font-weight: 600;
}
.status-initial { background: rgba(26,39,68,.08);  color: var(--navy); border: 1px solid rgba(26,39,68,.2); }
.status-update  { background: rgba(240,180,0,.15); color: #7a5800;     border: 1px solid rgba(240,180,0,.4); }

html.dark .status-initial { background: rgba(126,200,227,.12); color: #7ec8e3; border-color: rgba(126,200,227,.3); }
html.dark .status-update  { background: rgba(240,180,0,.15);   color: #f0c040; border-color: rgba(240,180,0,.4); }

.offense        { color: var(--text);     font-size: .9rem; }
.offense.severe { color: var(--red);      font-weight: 600; }
.location       { color: var(--text-mid); font-size: .9rem; }
.date           { font-family: var(--font-body); font-size: .9rem; color: var(--text-mid); white-space: nowrap; }

.no-results {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-dim); font-family: var(--font-body);
  font-size: .9rem; display: none;
}

@media (max-width: 640px) {
  header, .toolbar, .notice, main { padding-left: 1rem; padding-right: 1rem; }
  th:nth-child(4), td:nth-child(4) { display: none; }
}
