/* Preflight web styles. Bump the ?v= query in layouts when this file changes. */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #fafafa;
  --surface: #ffffff;
  --surface-muted: #f4f4f5;
  --surface-hover: #f8f8f9;
  --border: #e7e7ea;
  --border-strong: #d4d4d8;
  --text: #09090b;
  --text-muted: #6b6b75;
  --text-subtle: #a1a1aa;
  --primary: #18181b;
  --primary-hover: #2e2e33;
  --on-primary: #fafafa;
  --accent: #2563eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #2563eb;

  --ring: color-mix(in srgb, var(--accent) 32%, transparent);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .04);
  --shadow-md: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px -12px rgb(0 0 0 / .12);
  --shadow-lg: 0 24px 64px -16px rgb(0 0 0 / .3);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --container: 1040px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --surface: #111113;
    --surface-muted: #1c1c1f;
    --surface-hover: #161618;
    --border: #232327;
    --border-strong: #34343a;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --text-subtle: #6b6b75;
    --primary: #fafafa;
    --primary-hover: #e4e4e7;
    --on-primary: #09090b;
    --accent: #3b82f6;
    --green: #22c55e;
    --amber: #f59e0b;
    --red: #f05252;
    --blue: #60a5fa;
    --shadow-sm: none;
    --shadow-md: 0 16px 40px -12px rgb(0 0 0 / .7);
    --shadow-lg: 0 24px 64px -16px rgb(0 0 0 / .8);
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 24px; font-weight: 650; letter-spacing: -.022em; }
h2 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
code, .mono { font-family: var(--font-mono); font-size: .88em; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.icon { width: 16px; height: 16px; flex: none; }
.icon.lg { width: 20px; height: 20px; }
.muted { color: var(--text-muted); }
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.link .icon { display: inline; width: 14px; height: 14px; vertical-align: -2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: var(--container);
  height: 56px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -.01em;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
}
.brand-mark .icon { width: 15px; height: 15px; margin: 1px 1px 0 0; }

.tabs { display: flex; gap: 2px; margin-right: auto; }
.tabs a {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s, background-color .15s;
}
.tabs a:hover { color: var(--text); background: var(--surface-muted); }
.tabs a[aria-current="page"] { color: var(--text); background: var(--surface-muted); }

/* Account menu */
.menu { position: relative; }
.menu > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 3px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  transition: background-color .15s, color .15s;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--surface-muted); color: var(--text); }
.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 232px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: pop-in .14s ease-out;
}
.menu-head { display: grid; gap: 1px; padding: 8px 10px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.menu-head span { color: var(--text-muted); font-size: 13px; text-transform: capitalize; }
.menu-panel form { margin: 0; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover { background: var(--surface-muted); }
.menu-item .icon { color: var(--text-muted); }

/* ---------- Layout ---------- */

.container { max-width: var(--container); margin: 0 auto; padding: 36px var(--gutter) 80px; }
.narrow { max-width: 800px; margin: 0 auto; }
.flow > * + * { margin-top: 16px; }
.flow > .back-link + * { margin-top: 0; }
.flow > .alert { margin-bottom: 0; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.subtitle { margin-top: 4px; color: var(--text-muted); }

.section { margin-top: 40px; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.count { margin-left: 6px; color: var(--text-subtle); font-weight: 500; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
  transition: color .15s;
}
.back-link:hover { color: var(--text); }

/* ---------- Surfaces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header p { margin-top: 2px; color: var(--text-muted); font-size: 14px; }
.card-body { padding: 20px; }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-muted) 50%, var(--surface));
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.card-footer .hint { margin-right: auto; }

.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.danger-zone .hint { margin-top: 4px; font-size: 14px; }
.danger-zone form { margin: 0; flex: none; }

.profile { display: flex; align-items: center; gap: 16px; }
.profile h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font: 500 14px/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.button:hover { background: var(--surface-muted); }
.button:active { transform: translateY(1px); }
.button.primary { border-color: transparent; background: var(--primary); color: var(--on-primary); }
.button.primary:hover { background: var(--primary-hover); }
.button.danger { border-color: transparent; background: var(--red); color: #fff; }
.button.danger:hover { background: color-mix(in oklab, var(--red) 88%, #000); }
.button.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-muted); }
.button.ghost:hover { background: var(--surface-muted); color: var(--text); }
.button.ghost.destructive:hover { background: color-mix(in oklab, var(--red) 10%, transparent); color: var(--red); }
.button.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--radius-sm); }
.button.lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.button.block { width: 100%; }
.button[aria-disabled="true"] { opacity: .55; pointer-events: none; box-shadow: none; }
.button.copied { color: var(--green); }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.icon-button:hover { background: var(--surface-muted); color: var(--text); }

/* ---------- Pills, chips, avatars ---------- */

.pill {
  --tone: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--tone) 11%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--tone) 20%, transparent);
  color: color-mix(in oklab, var(--tone) 72%, var(--text));
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.pill .icon { width: 12px; height: 12px; }
.pill.success { --tone: var(--green); }
.pill.warning { --tone: var(--amber); }
.pill.danger { --tone: var(--red); }
.pill.info, .pill.Admin { --tone: var(--blue); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
.chip .icon { width: 12px; height: 12px; }
.chip > span { overflow: hidden; text-overflow: ellipsis; }

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-muted), color-mix(in srgb, var(--border-strong) 70%, var(--surface-muted)));
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  object-fit: cover;
  outline: 1px solid rgb(0 0 0 / .06);
  outline-offset: -1px;
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }

.app-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 22.5%;
  object-fit: cover;
  outline: 1px solid rgb(0 0 0 / .08);
  outline-offset: -1px;
}
.app-icon.placeholder { background: var(--surface-muted); color: var(--text-subtle); outline-color: var(--border); }
.app-icon.lg { width: 76px; height: 76px; }
.app-icon.lg .icon { width: 28px; height: 28px; }

/* ---------- Alerts ---------- */

.alert {
  --tone: var(--green);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid color-mix(in oklab, var(--tone) 28%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--tone) 7%, var(--surface));
  font-size: 14px;
}
.alert > .icon { margin-top: 2px; color: var(--tone); }
.alert strong { font-weight: 600; }
.alert p { color: var(--text-muted); }
.alert.error { --tone: var(--red); }
.alert.warning { --tone: var(--amber); }
.alert.info { --tone: var(--blue); }

/* ---------- Build list ---------- */

.list { margin: 0; padding: 0; list-style: none; overflow: hidden; }
.list > li + li { border-top: 1px solid var(--border); }

.build-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  text-decoration: none;
  transition: background-color .12s;
}
.build-row:hover { background: var(--surface-hover); }
.build-main { display: grid; gap: 3px; min-width: 0; }
.build-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.build-title strong { font-weight: 600; }
.version { color: var(--text-muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.build-summary { overflow: hidden; color: var(--text-muted); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.build-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.build-aside { display: grid; justify-items: end; gap: 6px; color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.row-chevron { color: var(--text-subtle); transition: transform .15s, color .15s; }
.build-row:hover .row-chevron { color: var(--text-muted); transform: translateX(2px); }

.empty { display: grid; justify-items: center; gap: 6px; padding: 64px 24px; text-align: center; }
.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--text-muted);
}
.empty p { max-width: 380px; color: var(--text-muted); }

/* ---------- Build detail ---------- */

.build-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 24px;
}
.build-hero h1 { font-size: 26px; }
.build-hero .subtitle { font-variant-numeric: tabular-nums; }
.build-hero .pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.build-action { display: grid; justify-items: center; gap: 6px; }
.build-action .hint { font-size: 12.5px; }

.details { margin: 0; }
.details > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 20px;
}
.details > div + div { border-top: 1px solid var(--border); }
.details dt { color: var(--text-muted); font-size: 14px; }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.details dd code { color: var(--text-muted); font-size: 12.5px; }
.details .stack { display: grid; gap: 4px; justify-items: start; }

/* ---------- Tables ---------- */

.table-card { overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-muted) 55%, var(--surface));
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}
.table td { padding: 12px 16px; vertical-align: middle; }
.table tbody tr + tr td { border-top: 1px solid var(--border); }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover { background: var(--surface-hover); }
.table .actions { width: 1%; text-align: right; white-space: nowrap; }
.table .actions form { margin: 0; }
.table .secondary { color: var(--text-muted); }

.member { display: flex; align-items: center; gap: 12px; min-width: 0; }
.member-text { display: grid; min-width: 0; }
.member-text strong { font-weight: 550; }
.member-text strong .pill { margin-left: 6px; vertical-align: 1px; }
.member-text > span { color: var(--text-muted); font-size: 13px; }

/* ---------- Activity ---------- */

.timeline { margin: 0; padding: 8px 20px; list-style: none; }
.timeline li {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 10px 24px;
  font-size: 14px;
}
.timeline li::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 17px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  box-shadow: 0 0 0 3px var(--surface);
}
.timeline li::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: var(--border-strong);
}
.timeline li:first-child::after { top: 21px; }
.timeline li:last-child::after { bottom: calc(100% - 21px); }
.timeline li:first-child::before { background: var(--accent); }
.timeline .when { flex: none; color: var(--text-subtle); font-size: 13px; }

/* ---------- Forms ---------- */

.form { display: grid; gap: 22px; }
.field { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend { padding: 0; font-size: 14px; font-weight: 550; }
.field legend { margin-bottom: 8px; }
.optional { color: var(--text-subtle); font-weight: 400; }
.hint { color: var(--text-muted); font-size: 13px; }

.input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-subtle); }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--ring); }
.input.mono { font-family: var(--font-mono); font-size: 13px; }

.input-prefix { position: relative; }
.input-prefix > span { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }
.input-prefix .input { padding-left: 28px; }

input[type="radio"], input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }

.choice-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.choice-card:hover { border-color: var(--text-subtle); }
.choice-card:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 5%, var(--surface));
  box-shadow: 0 0 0 1px var(--accent);
}
.choice-card:has(input:focus-visible) { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--ring); }
.choice-card input { margin-top: 2px; }
.choice-card strong { display: block; font-size: 14px; font-weight: 550; }
.choice-card small { display: block; margin-top: 1px; color: var(--text-muted); font-size: 13px; line-height: 1.4; }

.options { display: grid; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; width: fit-content; font-size: 14px; cursor: pointer; }
.app-options { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 26px; transition: opacity .15s; }
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.toggle:hover { border-color: var(--text-subtle); }
.toggle:has(input:checked) { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 8%, var(--surface)); }
.toggle input { width: 14px; height: 14px; }

/* App choices only matter for viewers who are limited to some apps. */
.apps-field { transition: opacity .15s; }
.apps-field:has(input[name="scope"][value="all"]:checked) .app-options { opacity: .5; }
.form:has(input[name="role"][value="admin"]:checked) .apps-field { opacity: .45; pointer-events: none; }

.copy-field { display: flex; gap: 8px; }
.copy-field .input { flex: 1; min-width: 0; }

/* ---------- Invite link ---------- */

.invite-callout {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border-color: color-mix(in oklab, var(--accent) 35%, var(--border));
  background: color-mix(in oklab, var(--accent) 4%, var(--surface));
}
.invite-callout-head { display: flex; gap: 12px; align-items: flex-start; }
.invite-callout-head p { color: var(--text-muted); font-size: 14px; }
.feature-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent) 12%, var(--surface));
  color: var(--accent);
}

/* ---------- Dialog ---------- */

.dialog {
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.dialog[open] { animation: dialog-in .18s cubic-bezier(.2, .9, .3, 1); }
.dialog::backdrop { background: rgb(9 9 11 / .5); backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 20px 0; }
.dialog-header p { margin-top: 4px; color: var(--text-muted); font-size: 14px; }
.dialog-header .icon-button { margin: -6px -6px 0 0; }
.dialog .card-body { padding-top: 20px; }
.dialog .card-footer { border-radius: 0 0 14px 14px; }

@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ---------- Auth pages ---------- */

.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px 16px;
  background:
    radial-gradient(ellipse 70% 45% at 50% -8%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.auth-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 6px 16px -6px rgb(0 0 0 / .35);
}
.auth-mark .icon { width: 22px; height: 22px; }
.auth-mark.success { background: var(--green); color: #fff; }
.auth-mark.muted { background: var(--surface-muted); color: var(--text-muted); box-shadow: none; }
.auth-card h1 { margin-top: 20px; font-size: 22px; }
.auth-card > p { margin-top: 8px; color: var(--text-muted); }
.auth-card > p strong { color: var(--text); font-weight: 600; }
.auth-card form { margin: 0; }
.auth-card .button.block { margin-top: 24px; }
.auth-card .auth-note {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}
.auth-footer { margin-top: 20px; color: var(--text-subtle); font-size: 13px; text-align: center; }

.auth-card .device-code {
  margin-top: 24px;
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  font-family: var(--font-mono);
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .14em;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .container { padding-top: 24px; }
  .topbar-inner { gap: 12px; }
  .brand-name, .menu-login { display: none; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header .button { width: 100%; }

  .build-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 4px 14px; padding: 14px 16px; }
  .build-row .app-icon { grid-row: span 2; }
  .build-aside { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; grid-column: 2; }
  .row-chevron { display: none; }

  .build-hero { grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 20px; }
  .build-hero .app-icon.lg { width: 64px; height: 64px; }
  .build-hero h1 { font-size: 22px; }
  .build-action { grid-column: 1 / -1; justify-items: stretch; text-align: center; }
  .details > div { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 16px; }
  .details dt { font-size: 13px; }

  /* Tables become stacked rows. */
  .table thead { display: none; }
  .table, .table tbody { display: block; }
  .table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; }
  .table tbody tr + tr { border-top: 1px solid var(--border); }
  .table td, .table tbody tr + tr td { padding: 0; border: 0; }
  .table td:not(.primary, .actions) { grid-column: 1; color: var(--text-muted); font-size: 13px; }
  .table td[data-label]:not(.primary, .actions)::before { content: attr(data-label) " · "; color: var(--text-subtle); }
  .table td.primary { grid-column: 1; }
  .table td.actions { grid-column: 2; grid-row: 1; align-self: center; }
  .table .hide-sm { display: none; }
  .members-table td:not(.primary, .actions) { padding-left: 44px; }

  .card-header, .card-body { padding-left: 16px; padding-right: 16px; }
  .card-footer { padding-left: 16px; padding-right: 16px; }
  .timeline { padding: 8px 16px; }
  .timeline li { flex-direction: column; gap: 0; }
  .choice-cards { grid-template-columns: minmax(0, 1fr); }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .input { height: 42px; font-size: 16px; }

  .dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-width: 1px 0 0; border-radius: 16px 16px 0 0; }
  .dialog .card-footer { border-radius: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .dialog .card-footer .button { flex: 1; }
  @keyframes dialog-in { from { transform: translateY(40px); opacity: 0; } }
}

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