:root { --gap: 12px; --muted:#000; --border:#ddd; }
* { box-sizing: border-box; }

/* match index/support pages so the header spans edge-to-edge */
html, body { height: 100%; }
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: #000;
  background-image: url("../assets/EdelgardSpeech.f64ec1cf1f86.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* center the top-site title inside the first header */
  header { display:flex; flex-wrap:wrap; gap:var(--gap); align-items:center; }
  header:first-of-type { justify-content: center; }
  /* style the main site header (first one) differently from the table header */
  header:first-of-type h1 { margin: 0; font-size: 2rem; width: 100%; text-align: center; }
    /* table header needs bottom margin and smaller text */
    header:not(:first-of-type) { margin-bottom: 14px; justify-content: center; }
    header:not(:first-of-type) h1 { margin: 0; font-size: 1.25rem; width: 100%; text-align: center; }
    
    /* push footer to bottom when content is short */
    main {
      flex: 1;
      padding: 2rem;
    }

    .toolbar { display:flex; gap:var(--gap); flex-wrap:wrap; align-items:center;}
  .sort-controls { display:flex; gap:8px; align-items:center; margin-left:8px; }
  .sort-btn.active { background:#111827; color:#fff; }
  /* show a small arrow for the active sort direction */
  .sort-btn[data-dir="desc"]::after { content: " ↓"; font-size: 0.85rem; }
  .sort-btn[data-dir="asc"]::after { content: " ↑"; font-size: 0.85rem; }
    input, select, button { padding: 10px 12px; font-size: 1rem; border:1px solid var(--border); border-radius: 8px; background:#fff; }
    button { cursor: pointer; }
    .btn { border-color:#bbb; }
    .btn:disabled { opacity: .6; cursor:not-allowed; }
    .muted { color: #000; font-size: .95rem; }
    .status { min-height: 1.3rem; margin: 8px 0; color: #000; }
    #liveStatus { color: #000 !important; }
    .sort-controls,
    .sort-controls label,
    .sort-controls span { color: #000; }
    .sort-controls .muted { color: #000 !important; }
    .table-wrap { overflow:auto; border:1px solid var(--border); border-radius: 10px; }
    table { width:100%; border-collapse: collapse; background:#fff; }
    th, td { text-align:left; padding: 10px 12px; border-bottom:1px solid var(--border); white-space: nowrap; }
    /* Ensure table cells are readable over the page background image */
    .table-wrap table th,
    .table-wrap table td {
      background-color: rgba(255,255,255,0.95);
      color: #000;
    }
    th { background: #fafafa; position: sticky; top: 0; z-index: 1; }
    tr:hover td { background: #fcfcff; }
    .sortable { cursor: pointer; user-select: none; }
    .controls { display:flex; align-items:center; gap: var(--gap); margin-top: 10px; flex-wrap: wrap; }
    .pill { padding: 6px 10px; border:1px solid var(--border); border-radius: 999px; }
    .right { margin-left:auto; }
    .spinner { display:inline-block; width:1em; height:1em; border:2px solid #ccc; border-top-color:#333; border-radius:50%; animation:spin 0.7s linear infinite; vertical-align: middle; }
    @keyframes spin { to { transform: rotate(360deg); } }
    .drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.3); display:none; z-index: 10; }
    .drawer { position: fixed; right: 0; top: 0; height: 100%; width: 480px; max-width: 100%; background: #fff; box-shadow: -10px 0 30px rgba(0,0,0,.15); transform: translateX(100%); transition: transform .25s ease; display:flex; flex-direction:column; z-index: 11; }
    .drawer.open { transform: translateX(0); }
    .drawer-backdrop.open { display:block; }
    .drawer header { padding: 16px; border-bottom:1px solid var(--border); justify-content: space-between; }
    .drawer .content { padding: 16px; overflow:auto; color: #000; }
    .drawer .content * { color: #000; }
    .kv { display:grid; grid-template-columns: 160px 1fr; gap: 10px 14px; }
    .drawer .kv div:nth-child(odd) { color: #000 !important; }
    .close-x { background:none; border:none; font-size: 1.4rem; line-height:1; cursor:pointer; }
    .row-actions button { padding:6px 10px; font-size:.9rem; }
    .sr-only { position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden; }


    .site-nav {
      background: #7c8085;          /* optional bg */
      padding: 0.75rem 1rem;
      justify-content: center;
    }

    /* horizontal, evenly spaced, wraps on small screens */
    .nav-list {
      --gap-x: 1rem;                 /* tweak spacing here */
      --gap-y: 0.5rem;

      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: var(--gap-y) var(--gap-x);
      list-style: none;
      margin: 0;
      padding: 0;
    }

    /* link styling */
    .nav-list a {
      display: block;
      padding: 0.5rem 0.9rem;
      text-decoration: none;
      border-radius: 0.5rem;
      color: #000;
    }

    /* hover / focus */
    .nav-list a:hover,
    .nav-list a:focus-visible {
      background: #e5e7eb;
      outline: none;
    }

    /* optional active state */
    .nav-list a.active {
      font-weight: 600;
      border-bottom: 2px solid currentColor;
    }

    nav {
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      background: #7c8085;
      padding: 2rem;
      text-align: center;
    }

    header, footer {
      background-color: #ef0606;
      padding: 1rem;
      text-align: center;
    }

    