@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-normal-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-italic-latin.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --bg: #f4f1e9;
  --fg: #17201c;
  --muted: #5e665f;
  --quiet: #818780;
  --surface: #fffdf8;
  --hairline: #ded9cd;
  --border: #c9c4b8;
  --accent: #2f5eef;
  --accent-hover: #244dcc;
  --accent-text: #2f5eef;
  --accent-soft: #dfe6ff;
  --on-accent: #ffffff;
  --green: #26705a;
  --green-soft: #dcefe6;
  --orange: #a4522b;
  --orange-soft: #f6e4d8;
  --red: #a4382f;
  --red-soft: #f6dddb;
  --font-sans: 'Plus Jakarta Sans', 'Avenir Next', 'Segoe UI', ui-sans-serif, system-ui, sans-serif;
  --font-serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 4px;
  --gutter: 1rem;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #08090a;
    --fg: #f5f5f5;
    --muted: #b9bfca;
    --quiet: #8b919c;
    --surface: #111318;
    --hairline: #1f222a;
    --border: #2a2e38;
    --accent: #2f5eef;
    --accent-hover: #4a73f2;
    --accent-text: #7ea1ff;
    --accent-soft: #18224a;
    --green: #3cc48f;
    --green-soft: #10261d;
    --orange: #f59e0b;
    --orange-soft: #2a1d08;
    --red: #f06a6a;
    --red-soft: #2c1213;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
code, .mono { font-family: var(--font-mono); font-size: 0.86em; }
[hidden] { display: none !important; }
a { color: var(--accent-text); }

/* Top bar */
.bar { border-bottom: 1px solid var(--hairline); background: var(--bg); position: sticky; top: 0; z-index: 2; }
.bar-inner, main { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; }
.brand { display: flex; align-items: baseline; gap: 0.6rem; color: inherit; text-decoration: none; }
.wordmark { font-weight: 800; letter-spacing: -0.05em; font-size: 1.15rem; }
.product { font-family: var(--font-serif); font-size: 1.35rem; font-style: italic; color: var(--accent-text); }
.bar-meta { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: 0.85rem; }

/* Buttons */
button { cursor: pointer; }
.primary, .secondary {
  border-radius: var(--radius); padding: 0.5rem 0.9rem; font-weight: 600; font-size: 0.88rem;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
  min-height: 38px;
}
.primary { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.secondary { background: var(--surface); border: 1px solid var(--border); }
.secondary:hover { border-color: var(--fg); }
.primary:disabled, .secondary:disabled { opacity: 0.55; cursor: progress; }
.link { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; font-size: 0.85rem; }
.link:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Login */
.login { max-width: 640px; padding: 12vh 0 4rem; }
.eyebrow {
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.72rem; color: var(--muted); margin: 0 0 1rem;
}
.login h1 {
  font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.02; margin: 0 0 1rem; letter-spacing: -0.01em;
}
.lede { color: var(--muted); font-size: 1.05rem; max-width: 52ch; margin: 0 0 2rem; }
a.button { display: inline-flex; align-items: center; text-decoration: none; }
.token-login { margin-top: 1.5rem; }
.token-login summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; font-weight: 600; width: fit-content; }
.token-login[open] summary { margin-bottom: 0.75rem; }
.token-login:not(.alone) .login-form { max-width: 420px; }
.token-login.alone summary { display: none; }
.login-form label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.4rem; }
.login-row { display: flex; gap: 0.5rem; }
.login-row input { flex: 1; min-width: 0; }
input[type=password], input[type=search] {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.5rem 0.7rem; min-height: 38px;
}
input:focus { border-color: var(--fg); outline: none; }
.error { color: var(--red); min-height: 1.5em; font-size: 0.88rem; margin: 0.5rem 0 0; }

/* Blocks */
.block { padding: 2rem 0 1rem; border-bottom: 1px solid var(--hairline); }
.block:last-child { border-bottom: 0; padding-bottom: 4rem; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 1rem; }
h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.9rem; line-height: 1.1; margin: 0; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0; }
.empty { color: var(--muted); padding: 1.25rem; border: 1px dashed var(--border); border-radius: var(--radius); margin: 0; }

/* Device cards */
.devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.1rem 1.1rem 1rem; display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.card h3 { margin: 0; font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; word-break: break-word; }
.sub { color: var(--muted); font-size: 0.82rem; margin: 0.15rem 0 0; }
.presence { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--quiet); flex: none; }
.presence.on { color: var(--green); }
.presence.on .dot { background: var(--green); }
.presence.off { color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0; }
.facts div { border-top: 1px solid var(--hairline); padding-top: 0.45rem; min-width: 0; }
.facts dt { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0.1rem 0 0; font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line { font-size: 0.86rem; margin: 0; }
.line .label { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.chip { font-size: 0.74rem; font-weight: 600; padding: 0.15rem 0.45rem; border-radius: 3px; border: 1px solid var(--hairline); color: var(--muted); white-space: nowrap; }
.chip.ok { color: var(--green); background: var(--green-soft); border-color: transparent; }
.chip.warn { color: var(--orange); background: var(--orange-soft); border-color: transparent; }
.chip.bad { color: var(--red); background: var(--red-soft); border-color: transparent; }
.chip.info { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.tools-line { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 0.25rem; }

/* Ongoing work */
.work { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1rem; }
.work-col { min-width: 0; }
.work-col h3 { font-size: 0.95rem; margin: 0 0 0.5rem; }
.list { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--hairline); }
.list > li { padding: 0.55rem 0; border-bottom: 1px solid var(--hairline); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; min-width: 0; }
.list .path { font-family: var(--font-mono); font-size: 0.8rem; overflow-wrap: anywhere; min-width: 0; flex: 1 1 260px; }
.list .meta { color: var(--muted); font-size: 0.8rem; }
.list .title { font-weight: 600; font-size: 0.88rem; flex: 1 1 100%; overflow-wrap: anywhere; }
.subhead { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.66rem; color: var(--muted); margin: 0.75rem 0 0.35rem; }

/* Repo matrix */
.tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.segmented button { background: var(--surface); border: 0; padding: 0.4rem 0.7rem; font-size: 0.82rem; font-weight: 600; color: var(--muted); min-height: 36px; }
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button[aria-pressed=true] { background: var(--fg); color: var(--bg); }
#repo-search { min-width: 0; width: 240px; max-width: 100%; }
.matrix { width: 100%; border-collapse: collapse; font-size: 0.84rem; table-layout: fixed; }
.matrix th { text-align: left; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 0.4rem 0.6rem 0.4rem 0; border-bottom: 1px solid var(--border); }
.matrix td { padding: 0.6rem 0.6rem 0.6rem 0; border-bottom: 1px solid var(--hairline); vertical-align: top; min-width: 0; overflow-wrap: anywhere; }
.matrix .repo-path { font-family: var(--font-mono); font-size: 0.8rem; }
.cell-branch { font-weight: 600; }
.cell-sha { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }
.cell .chips { margin-top: 0.25rem; }
.missing { color: var(--quiet); font-style: italic; }
.more { margin-top: 0.75rem; }

/* Activity */
.activity { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.activity > li { border-bottom: 1px solid var(--hairline); padding: 0.6rem 0; }
.activity summary { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; cursor: pointer; list-style: none; }
.activity summary::-webkit-details-marker { display: none; }
.activity .what { font-weight: 600; font-size: 0.9rem; flex: 1 1 240px; }
.activity pre { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 0.75rem; font-size: 0.74rem; line-height: 1.5; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; margin: 0.6rem 0 0; }

.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 0.6rem 1rem; border-radius: var(--radius); font-size: 0.88rem; font-weight: 600; max-width: calc(100% - 2rem); z-index: 5; }

@media (min-width: 720px) {
  :root { --gutter: 1.5rem; }
  .bar-inner, main { padding: 0 var(--gutter); }
}

@media (max-width: 719px) {
  .matrix thead { display: none; }
  .matrix, .matrix tbody, .matrix tr, .matrix td { display: block; width: 100%; }
  .matrix tr { border-bottom: 1px solid var(--border); padding: 0.5rem 0; }
  .matrix td { border: 0; padding: 0.3rem 0; }
  .matrix td[data-device]::before { content: attr(data-device); display: block; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login { padding-top: 8vh; }
  .login-row { flex-direction: column; }
  .bar-meta .updated, .bar-meta .who { display: none; }
  #repo-search { width: 100%; }
  .tools { width: 100%; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
