/* Antigravity control plane - embedded stylesheet.
   No external assets; light and dark via color-scheme. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5b6774;
  --line: #d7dce3;
  --accent: #0f62d6;
  --accent-ink: #ffffff;
  --ok: #0d7a3f;
  --ok-bg: #e4f5ea;
  --err: #b02a2a;
  --err-bg: #fbe9e9;
  --focus: #0b57d0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161c;
    --surface: #1a2029;
    --text: #e8ecf1;
    --muted: #9aa7b4;
    --line: #303a46;
    --accent: #6ea8ff;
    --accent-ink: #0d1522;
    --ok: #58c98b;
    --ok-bg: #14261c;
    --err: #ff8f8f;
    --err-bg: #2c1717;
    --focus: #8ab4f8;
  }
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.55;
}

.wrap {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1rem;
}

main.wrap { flex: 1 0 auto; padding-top: 1.25rem; padding-bottom: 2rem; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 1rem;
  z-index: 10;
}

.skip:focus { left: 0.5rem; top: 0.5rem; outline: 2px solid var(--focus); }

/* Header and navigation */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.bar-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.nav a, .nav .linklike {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

.nav a:hover { background: var(--bg); }

.nav a[aria-current="page"] {
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.who { margin-left: auto; color: var(--muted); font-size: 0.9rem; }

/* Cards and layout blocks */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.1rem;
}

.card.narrow { max-width: 26rem; margin-left: auto; margin-right: auto; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
}

.stat { display: flex; flex-direction: column; align-items: flex-start; }

.stat-num { font-size: 1.9rem; font-weight: 700; }

.stat-label { color: var(--muted); }

h1 { font-size: 1.45rem; margin: 0.2rem 0 1rem; }

h2 { font-size: 1.05rem; margin: 0.2rem 0 0.8rem; }

.links { margin: 0; padding-left: 1.2rem; }

.links li { margin-bottom: 0.4rem; }

/* Forms */

label { display: block; margin: 0.7rem 0 0.2rem; font-weight: 600; font-size: 0.9rem; }

input, select {
  display: block;
  width: 100%;
  max-width: 24rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.row input, .row select, .row label { display: inline-block; width: auto; }

.row label { margin: 0 0.4rem 0 0.8rem; }

button {
  font: inherit;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

button.danger { color: var(--err); border-color: var(--err); }

form.stack button { margin-top: 1rem; }

form.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.6rem; }

form.inline { display: inline; }

form.assign select { display: inline-block; width: auto; max-width: 10rem; padding: 0.3rem 0.4rem; }

form.note input { display: inline-block; width: auto; max-width: 12rem; padding: 0.3rem 0.4rem; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.form-error { color: var(--err); font-weight: 600; }

.hint { color: var(--muted); font-size: 0.88rem; }

/* Status results */

.result { border-radius: 10px; padding: 0.8rem 1.1rem; margin-bottom: 1.1rem; border: 1px solid; }

.result p { margin: 0.2rem 0; }

.result-ok { background: var(--ok-bg); border-color: var(--ok); }

.result-err { background: var(--err-bg); border-color: var(--err); }

.secret-line { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border: 1px dashed var(--line);
  border-radius: 6px;
  user-select: all;
}

/* Tables */

.table-wrap { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; min-width: 34rem; }

th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }

th { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

td.actions > form { margin: 0.15rem 0; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-on { background: var(--ok-bg); color: var(--ok); }

.badge-off { background: var(--err-bg); color: var(--err); }

/* Misc */

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1.2rem; margin: 0; }

.kv dt { color: var(--muted); font-weight: 600; }

.kv dd { margin: 0; overflow-wrap: anywhere; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.foot { color: var(--muted); font-size: 0.85rem; padding-top: 1rem; padding-bottom: 1.5rem; }

@media (max-width: 40rem) {
  .kv { grid-template-columns: 1fr; }
  .who { margin-left: 0; }
  table { min-width: 30rem; }
}
