:root {
  font: 16px/1.5 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  --page-background: #edf1f7;
  --surface: #fff;
  --surface-muted: #f4f7fb;
  --border: #dbe2eb;
  --control-border: #adbacc;
  --text: #172334;
  --text-muted: #536276;
  --accent: #1762c4;
  --accent-hover: #104fa5;
  --accent-tint: #e8f1fd;
  color: var(--text);
  background: var(--page-background);
}
* { box-sizing: border-box; }
body { margin: 0; }
main {
  width: min(calc(100% - 24px), 960px);
  margin: 12px auto;
  display: grid;
  gap: 16px;
}
.screen {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: max(340px, 78dvh);
  padding: clamp(16px, 4vw, 36px);
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.overview {
  aspect-ratio: auto;
  max-height: none;
  padding: clamp(12px, 3vw, 20px);
}
.overview h1 { font-size: clamp(22px, 4vw, 30px); }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header a { color: var(--accent); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 6vw, 46px); }
h2 { font-size: clamp(22px, 4vw, 32px); }
#boardStatus, .queue-group .table-status { color: var(--text-muted); font-size: .875rem; }
button, input { font: inherit; }
button {
  cursor: pointer;
  color: inherit;
  border: 1px solid var(--control-border);
  border-radius: 4px;
  background: #fff;
  padding: 5px 12px;
}
button:not(:disabled):hover { border-color: var(--accent); }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 10px);
  margin-top: 10px;
}
.metric {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 6px 2px;
  text-align: center;
  background: var(--surface-muted);
  border-color: var(--border);
}
.metric span { font-size: clamp(9px, 2.5vw, 13px); line-height: 1.2; }
.metric:hover, .copy-cell:hover { background: var(--accent-tint); }
.metric:first-child { background: var(--accent); border-color: var(--accent); color: #fff; }
.metric:first-child:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.metric strong {
  font-size: clamp(17px, 4vw, 26px);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.queue-screen { aspect-ratio: auto; max-height: none; gap: 20px; }
.queue-group h2 { font-size: clamp(18px, 4vw, 24px); }
.queue-group .table-scroll { max-height: 45dvh; margin-top: 8px; }
.queue-group th:nth-child(2) { width: 15%; }
.table-scroll { overflow: auto; min-height: 0; margin-top: 14px; }
table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
th, td { padding: 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
th { position: sticky; top: 0; background: var(--surface-muted); }
th[aria-sort="ascending"] button, th[aria-sort="descending"] button { color: var(--accent); }
th button { max-width: 100%; overflow-wrap: anywhere; text-align: left; border: 0; background: transparent; padding: 0; }
th input { display: block; width: 100%; min-width: 0; margin-top: 5px; border: 1px solid var(--control-border); border-radius: 5px; padding: 4px; }
.cell-content { display: flex; align-items: center; gap: 2px; min-width: 0; }
.cell-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-cell { flex: none; border: 0; background: transparent; padding: 0 2px; color: var(--accent); }
.table-status { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
[data-copy-status] { font-size: .8rem; color: var(--accent); }
.clipboard-field { position: fixed; top: 0; left: 0; opacity: 0; }
@media (max-width: 480px) {
  .screen { padding-inline: 10px; }
  th, td { padding-inline: 4px; }
  table { font-size: .75rem; }
}
.empty { text-align: center; color: var(--text-muted); }
dialog { width: min(94vw, 760px); max-height: 85dvh; border: 1px solid var(--control-border); border-radius: 5px; padding: 20px; color: inherit; }
dialog .table-scroll { max-height: 65dvh; }
dialog::backdrop { background: rgb(23 35 52 / 45%); }
