:root {
  --bg: #ffffff;
  --top-bg: #f4f4f6;
  --top-bg-image: none;
  --footer-bg: #efeff2;
  --row-alt: #f5f5f7;
  --head-bg: #ededf0;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #52525b;
  --faint: #71717a;
  --lijn-yellow: #ffd200;
  --lijn-ink: #18181b;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #121214;
  --top-bg: #18181c;
  --top-bg-image: none;
  --footer-bg: #0e0e10;
  --row-alt: #19191d;
  --head-bg: #1f1f24;
  --border: #2a2a30;
  --text: #ececef;
  --muted: #a1a1aa;
  --faint: #71717a;
  --lijn-yellow: #ffd200;
  --lijn-ink: #121214;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  max-width: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

button, a, input, li {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.y-tick {
  display: inline-block;
  width: 10px;
  height: 3px;
  background: var(--lijn-yellow);
  vertical-align: middle;
  margin-right: 0.35rem;
}

.site-header {
  position: sticky;
  position: -webkit-sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}

.logo-box {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--lijn-yellow);
  color: var(--lijn-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--row-alt);
}

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.top-zone {
  position: relative;
  background: var(--top-bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.top-zone-bg {
  position: absolute;
  inset: -16px;
  background-image: var(--top-bg-image);
  background-size: cover;
  background-position: center;
  filter: blur(10px) saturate(0.8);
  opacity: 0.22;
  pointer-events: none;
}

.top-zone-content {
  position: relative;
  z-index: 1;
}

.intro {
  padding: 1.5rem 0 1.1rem;
  border-bottom: 1px solid var(--border);
}

.intro h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 68ch;
}

.records-band {
  padding: 0.7rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.summary-item {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem;
}

.summary-item strong {
  color: var(--text);
  font-weight: 600;
}

.summary-item small {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.sep {
  color: var(--faint);
}

.compact-select {
  min-width: 120px;
}

.main-list {
  padding-top: 0.25rem;
}

.toolbar {
  padding: 1.1rem 0 0.8rem;
}

.toolbar-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 1.8rem 0 0.75rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.search-box input:focus {
  border-color: var(--text);
}

.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.clear-search {
  position: absolute;
  right: 0.4rem;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.3rem;
}

.custom-select {
  position: relative;
  min-width: 130px;
}

.custom-select-trigger {
  width: 100%;
  height: 36px;
  padding: 0 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.custom-select-trigger:hover {
  background: var(--row-alt);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 100%;
  max-width: calc(100vw - 2rem);
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  z-index: 30;
  display: none;
}

.custom-select.open .custom-select-options {
  display: block;
}

.custom-select-options li {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.custom-select-options li:hover {
  background: var(--row-alt);
}

.custom-select-options li.active {
  font-weight: 600;
  background: var(--row-alt);
}

.toolbar-sub {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.left-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--lijn-yellow);
  text-underline-offset: 3px;
}

.exports {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.mini-btn {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.18rem 0.48rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  cursor: pointer;
}

.mini-btn:hover {
  background: var(--row-alt);
  border-color: var(--lijn-yellow);
}

.hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--faint);
}

.hidden {
  display: none !important;
}

.strikes-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.75rem;
}

.strikes-table th {
  background: var(--head-bg);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

.strikes-table th + th {
  border-left: 1px solid var(--border);
}

.strikes-table td {
  padding: 0.85rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.strikes-table td + td {
  border-left: 1px solid var(--border);
}

.strikes-table tbody tr:nth-child(even) {
  background: var(--row-alt);
}

.strikes-table tbody tr:last-child td {
  border-bottom: none;
}

.col-when {
  width: 170px;
}

.col-prov {
  width: 150px;
}

.col-reason {
  width: auto;
}

.date-main {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.date-days {
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
}

.prov-label {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
}

.reason-text {
  margin: 0;
  white-space: pre-line;
}

.note-line {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.note-line strong {
  color: var(--text);
  font-weight: 600;
}

.row-actions {
  margin-top: 0.65rem;
  display: flex;
  justify-content: flex-end;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.24rem 0.58rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--row-alt);
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem !important;
}

.site-footer {
  margin-top: auto;
  background: var(--footer-bg);
  border-top: 2px solid var(--lijn-yellow);
  padding: 1.5rem 0 1.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.footer-col {
  max-width: 56ch;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 0.88rem;
}

.footer-copy {
  margin: 0.35rem 0 0;
  color: var(--faint);
  line-height: 1.5;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--faint);
}

.site-footer a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--lijn-yellow);
  text-underline-offset: 3px;
}

.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 60;
}

.toast.show {
  opacity: 1;
}

@media (max-width: 680px) {
  .toolbar-row {
    grid-template-columns: 1fr;
  }

  .custom-select {
    width: 100%;
  }

  .col-when {
    width: 96px;
  }

  .col-prov {
    width: 98px;
  }

  .strikes-table th,
  .strikes-table td {
    padding: 0.7rem 0.45rem;
  }

  .date-main {
    font-size: 0.76rem;
  }

  .prov-label {
    font-size: 0.78rem;
  }
}
