/* The hub site's one stylesheet: the widget's neutral greys and blue accent (widget/styles.ts), light and dark. */
:root {
    --bg: #ffffff;
    --bg-subtle: #f6f8fa;
    --fg: #1f2328;
    --muted: #59636e;
    --border: #d1d9e0;
    --accent: #0969da;
    --accent-fg: #ffffff;
    --ok: #1a7f37;
    --ok-soft: rgba(26, 127, 55, 0.14);
    --busy: #0969da;
    --busy-soft: rgba(9, 105, 218, 0.12);
    --warn: #9a6700;
    --warn-soft: rgba(154, 103, 0, 0.14);
    --bad: #cf222e;
    --bad-soft: rgba(207, 34, 46, 0.12);
    --idle-soft: rgba(89, 99, 110, 0.12);
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1f2428;
        --bg-subtle: #2a3036;
        --fg: #e6edf3;
        --muted: #9198a1;
        --border: #3d444d;
        --accent: #4493f8;
        --accent-fg: #0d1117;
        --ok: #3fb950;
        --ok-soft: rgba(63, 185, 80, 0.18);
        --busy: #4493f8;
        --busy-soft: rgba(68, 147, 248, 0.18);
        --warn: #d29922;
        --warn-soft: rgba(210, 153, 34, 0.18);
        --bad: #f85149;
        --bad-soft: rgba(248, 81, 73, 0.18);
        --idle-soft: rgba(145, 152, 161, 0.18);
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg); color: var(--fg);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 4px; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.dot { color: var(--muted); margin: 0 6px; }

.site-header { border-bottom: 1px solid var(--border); background: var(--bg-subtle); }
.site-header:empty { display: none; }
.site-header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; max-width: 1400px; margin: 0 auto; padding: 10px 24px; }
.site-title { font-weight: 700; color: var(--fg); text-decoration: none; }
.site-nav { display: flex; gap: 16px; }
.site-nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a[aria-current="page"] { color: var(--fg); font-weight: 600; border-bottom-color: var(--accent); }
.site-account { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); }

#site-main { max-width: 1400px; margin: 0 auto; padding: 24px; }
.site-card { max-width: 520px; margin: 64px auto; text-align: center; }
.site-status { color: var(--muted); }
.site-error { color: var(--bad); }
.site-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg); color: var(--fg); border-radius: 6px;
    padding: 5px 12px; font: inherit; line-height: 20px; text-decoration: none;
}
.btn:hover { background: var(--bg-subtle); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-small { padding: 1px 8px; font-size: 12px; }
.btn-danger { color: var(--bad); }

/* The inbox: the widget's Threads fill the page below the header. */
body.full { display: flex; flex-direction: column; height: 100dvh; }
body.full #site-main.site-main-full { flex: 1; min-height: 0; max-width: none; width: 100%; padding: 0; display: flex; flex-direction: column; }
.site-main-full .site-status { margin: 16px 24px; }
.site-main-full .site-status[hidden] { display: none; }
.inbox { display: block; flex: 1; min-height: 0; }

/* Previews and tokens. */
.intro { max-width: 900px; margin: 0 0 16px; }
.hosts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border: 1px solid var(--border); background: var(--bg); color: var(--fg); border-radius: 16px; padding: 3px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.on { font-weight: 600; border-color: transparent; }
.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.field input, .field select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; min-width: 200px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.previews { table-layout: fixed; min-width: 900px; }
.col-preview { width: 38%; } .col-change { width: 22%; } .col-links { width: 24%; } .col-progress { width: 16%; }
th .sort { border: 0; background: none; color: inherit; font: inherit; padding: 0; cursor: pointer; }
tr.pinned td { background: var(--busy-soft); }
tr.stale { opacity: 0.5; }
td.empty { text-align: center; color: var(--muted); padding: 24px; }
.cell-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-line { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.cell-line .branch { overflow: hidden; text-overflow: ellipsis; }
.cell-links { display: flex; flex-wrap: wrap; align-items: baseline; }
.numbers { font-variant-numeric: tabular-nums; }
.badge { border-radius: 10px; padding: 0 8px; font-size: 12px; white-space: nowrap; }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-busy { background: var(--busy-soft); color: var(--busy); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-bad { background: var(--bad-soft); color: var(--bad); }
.tone-idle { background: var(--idle-soft); color: var(--muted); }

.revealed { border: 1px solid var(--accent); background: var(--busy-soft); border-radius: 8px; padding: 12px 16px; margin: 16px 0; }
.revealed p { margin: 4px 0; }
.copy-row { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
.token, .snippet { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; margin: 0; }
table.tokens td:last-child { width: 1%; white-space: nowrap; }
