:root {
  color-scheme: light;
  --ink: #182629;
  --muted: #526365;
  --accent: #146054;
  --line: #dbe3e0;
  --wash: #f4f7f5;
  --paper: #fff;
  font: 15px/1.55 system-ui, "Leelawadee UI", "Tahoma", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
.layout { max-width: 1320px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 48px); }
header { border-bottom: 1px solid var(--line); }
.bar, .heading, .controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bar, .heading { justify-content: space-between; }
.bar { min-height: 64px; padding-block: 10px; }
.bar nav { display: flex; gap: clamp(14px, 3vw, 30px); }
.bar a { color: var(--muted); text-decoration: none; }
.bar a:hover { text-decoration: underline; }
.bar .brand { color: var(--ink); font-weight: 720; }
.intro { padding-block: clamp(28px, 5vw, 58px) 22px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; letter-spacing: -.045em; }
h2 { font-size: 21px; letter-spacing: -.025em; }
h3 { font-size: 15px; }
p { color: var(--muted); }
a { color: var(--accent); text-underline-offset: 3px; }
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-block: 1px solid var(--line);
  background: var(--wash);
  margin-bottom: clamp(26px, 4vw, 42px);
}
.metric { padding: 13px clamp(12px, 2vw, 23px); }
.metric + .metric { border-inline-start: 1px solid var(--line); }
.metric strong { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 13px; }
.panel { padding-bottom: 30px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.heading { margin-bottom: 16px; }
form, .advanced { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#filters { grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(140px, 1fr)); }
.filter-search { min-width: 0; }
.wide { grid-column: 1 / -1; }
label { display: grid; align-content: start; gap: 5px; min-width: 0; color: var(--muted); font-size: 13px; font-weight: 640; }
button, .button, input, select {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #aebdb8;
  border-radius: 7px;
  padding: 8px 11px;
  min-height: 40px;
}
input, select { width: 100%; min-width: 0; font-size: 15px; font-weight: 400; }
button, .button { cursor: pointer; font-weight: 650; text-decoration: none; }
button:hover, .button:hover { background: var(--wash); }
.primary { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.primary:hover { background: #104c43; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid #31877a; outline-offset: 2px; }
summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.advanced { padding: 12px; margin-top: 10px; background: var(--wash); }
#result:not(:empty), #sync-message:not(:empty), #keyword-message:not(:empty) { margin-block: 12px; }
.scroll { overflow-x: auto; margin-top: 16px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; text-align: left; min-width: 900px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--wash); color: var(--muted); font-size: 12px; font-weight: 650; }
td { color: var(--muted); font-size: 13px; }
td:nth-child(2) { width: 36%; min-width: 255px; }
td:nth-child(3) { min-width: 140px; }
th:nth-child(4), td:nth-child(4) { text-align: end; font-variant-numeric: tabular-nums; }
td:nth-child(8) { white-space: nowrap; }
tbody tr:hover { background: #f8faf9; }
.title { min-height: auto; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: 14px; text-align: left; }
.title:hover { background: transparent; color: var(--accent); text-decoration: underline; }
td p:not(:empty) { margin-top: 4px; }
.badge { display: inline-block; background: #eef1ef; color: #405251; border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.badge.new { background: #dceee6; color: #185242; }
.badge.closed { background: #f6ebe8; color: #79372b; }
.pagination { margin-top: 13px; justify-content: flex-end; color: var(--muted); font-size: 13px; }
#health { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.source { border-inline-start: 2px solid var(--line); padding-inline-start: 12px; overflow-wrap: anywhere; }
.source p { font-size: 13px; margin-top: 4px; }
.source .source-error { color: #79372b; }
#runs p { border-bottom: 1px solid var(--line); padding-block: 8px; }
#keyword-form { margin-top: 12px; align-items: end; }
#keyword-list { columns: 3; list-style: none; padding: 0; }
#keyword-list li { padding-block: 3px; break-inside: avoid; }
dialog { width: min(660px, calc(100% - 32px)); max-height: calc(100% - 32px); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); padding: 22px; }
dialog::backdrop { background: rgb(18 37 33 / .56); }
dialog form { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
#admin { max-width: 420px; }
#admin form > * { width: 100%; }
#detail-content h2 { margin-bottom: 12px; }
dl { display: grid; grid-template-columns: minmax(92px, 1fr) 2fr; gap: 8px; overflow-wrap: anywhere; }
dd { margin: 0; }
dt { color: var(--muted); font-weight: 650; }
@media (max-width: 720px) {
  #filters, form, .advanced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { grid-column: 1 / -1; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .metric:nth-child(4) { border-inline-start: 0; }
  #keyword-list { columns: 2; }
}
@media (max-width: 420px) {
  .bar nav { font-size: 13px; }
  .metric strong { font-size: 21px; }
  #keyword-list { columns: 1; }
}

