
:root {
  color-scheme: light dark;
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f0f2f5; --text: #1b2130; --muted: #5d6676; --border: #dde1e8;
  --accent: #0a66c2; --accent-text: #ffffff; --focus: #2f80ed;
  --open: #17703a; --open-bg: #ddf4e4; --closed: #a3261b; --closed-bg: #fde3e0;
  --unknown: #8a5a00; --unknown-bg: #fff1cc; --pending: #2b5797; --pending-bg: #e1ebfa;
  --neutral: #4a5363; --neutral-bg: #e9ecf1;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --surface: #171b23; --surface-2: #1d222c; --text: #e5e8ee; --muted: #9aa3b2; --border: #2a313d;
    --accent: #4c9be8; --accent-text: #0b1220; --focus: #76b3ff;
    --open: #5fd38a; --open-bg: #13281b; --closed: #ff8f84; --closed-bg: #321715;
    --unknown: #f2c35b; --unknown-bg: #2d240f; --pending: #8db8ff; --pending-bg: #16233a;
    --neutral: #b4bcc9; --neutral-bg: #232934; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 1.75rem 0 .6rem; }
p { margin: .4rem 0 .8rem; }
.muted { color: var(--muted); }
.flush { margin-top: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; }
.narrow { max-width: 460px; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.signout { display: flex; align-items: center; gap: 10px; margin: 0; }

.flagbar { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 16px; font-size: .82rem; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.flag-off::before { content: "● "; color: var(--muted); }
.flag-on::before { content: "● "; color: var(--open); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.notice { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 16px; border: 1px solid var(--border); background: var(--surface); }
.notice-success { border-color: var(--open); }
.notice-warning { border-color: var(--unknown); }
.notice-error { border-color: var(--closed); }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs a { padding: 9px 12px; white-space: nowrap; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.count { display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--surface-2); font-size: .8rem; text-align: center; }

.filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(140px, 1fr)) auto; gap: 10px; align-items: end; padding: 12px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.filters .actions { display: flex; gap: 8px; align-items: center; }
label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-width: 0; width: 100%; }
input[type=checkbox] { width: auto; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: .95rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); cursor: pointer; text-decoration: none; }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--border); font-weight: 500; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.form-card { display: grid; gap: 12px; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.job-title { font-weight: 600; text-decoration: none; }
.job-title:hover { text-decoration: underline; }
.meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.wrap { overflow-wrap: anywhere; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-open { color: var(--open); background: var(--open-bg); }
.badge-closed { color: var(--closed); background: var(--closed-bg); }
.badge-unknown { color: var(--unknown); background: var(--unknown-bg); }
.badge-pending { color: var(--pending); background: var(--pending-bg); }
.badge-neutral { color: var(--neutral); background: var(--neutral-bg); }
.tag { display: inline-block; padding: 0 6px; margin-left: 4px; border: 1px solid var(--border); border-radius: 6px; font-size: .75rem; color: var(--muted); }

.empty { text-align: center; padding: 40px 20px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty h2 { margin-top: 0; }
.empty p { max-width: 560px; margin-left: auto; margin-right: auto; color: var(--muted); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: .9rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.description { white-space: pre-wrap; max-height: 320px; overflow: auto; }
.shot { display: inline-block; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.shot img { display: block; max-width: 240px; height: auto; }
.stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; min-width: 110px; }
.stat b { display: block; font-size: 1.25rem; }

@media (max-width: 900px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .search, .filters .actions { grid-column: 1 / -1; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .filters { grid-template-columns: 1fr; }
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .stack-table tr:last-child { border-bottom: 0; }
  .stack-table td { padding: 3px 0; border: 0; }
  .stack-table td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .stack-table td.primary::before { display: none; }
  .facts { grid-template-columns: 1fr; }
  .facts dd { margin-bottom: 6px; }
}
