:root {
  --text: #1c1e21;
  --muted: #5a6068;
  --bg: #fafaf8;
  --accent: #1d4ed8;
  --error: #b42318;
  --border: #c9ccd1;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #ececec;
    --muted: #a0a6ae;
    --bg: #16181b;
    --accent: #7ea6ff;
    --error: #ff8a80;
    --border: #3b4048;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 { font-size: 1.5rem; margin-top: 0; }
h2 { font-size: 1.1rem; margin-top: 2rem; }

form { display: grid; gap: 0.75rem; margin: 1rem 0; }
label { display: grid; gap: 0.25rem; font-weight: 600; }

input {
  font: inherit;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: transparent;
  color: inherit;
}

button {
  font: inherit;
  justify-self: start;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 0.375rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
}

a { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.message { padding: 0.75rem 1rem; border-left: 4px solid var(--accent); background: rgba(127, 127, 127, 0.1); }
.message.error { border-left-color: var(--error); }
.muted { color: var(--muted); }

textarea, select {
  font: inherit;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: transparent;
  color: inherit;
}

ol.stages { padding-left: 0; list-style: none; }
ol.stages > li { margin: 0.75rem 0; }
.stage-number { font-weight: 700; margin-right: 0.5rem; }
details { margin: 0.5rem 0; }
.shared-end { margin: 0.25rem 0; }

/* The org chart (/:slug/org-chart). Tokens, font and the view switcher come from /maps/map.css, loaded after this file. */
body.org-page { height: auto; min-height: 100%; overflow: auto; }
.org-page .corner { position: fixed; }
.org-page .views, .org-page .manage { background: var(--paper); }
.org-page #account-controls button { font-weight: 400; justify-self: auto; }
/* map.css brings Source Sans 3 at 400 and 500 only, so emphasis is 500: nothing here asks the browser to fake a bold. */
.org-page :is(h1, h2, h3, strong, b) { font-weight: 500; }
.org { padding: 84px 32px 140px; }
.org .org-title { font-size: 30px; font-weight: 500; margin: 0 0 20px; line-height: 1.2; }
.org-empty { color: var(--ink-soft); }
.org-empty a { color: var(--focus); }
.org-tree { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.fn { border: 1.5px solid var(--furniture-rule); border-top: 6px solid var(--ink); background: var(--paper); border-radius: 6px; padding: 14px 16px 16px; min-width: 240px; }
.fn.depth-1 { background: var(--chalk); border-top: 1.5px solid var(--furniture-rule); min-width: 220px; }
.fn h2, .fn h3 { margin: 0 0 10px; font-size: 19px; line-height: 1.25; }
.fn-kids { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; margin-top: 10px; }
.teams { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.team { display: grid; gap: 2px; padding: 8px 12px; border-radius: 4px; border: 1.5px solid var(--rule); background: var(--paper); color: var(--ink); text-decoration: none; }
.team span { font-size: 13px; color: var(--ink-soft); }
.team:hover { border-color: var(--ink); }
.team.on, .team.on:hover { background: var(--ink); color: var(--chalk); border-color: var(--ink); }
.team.on span { color: color-mix(in srgb, var(--chalk) 75%, transparent); }
.org-foot { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20; background: var(--paper); border: 1.5px solid var(--furniture-rule); border-radius: 6px; padding: 12px 16px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.org-foot p { margin: 0; }
.org-foot.empty { color: var(--ink-soft); }
.org-foot .primary { background: var(--ink); color: var(--chalk); border-radius: 4px; padding: 9px 16px; font-weight: 500; text-decoration: none; }
@media (max-width: 900px) {
  .org-page .corner { left: 16px; }
  .org { padding: 76px 16px 160px; }
  .fn, .fn.depth-1 { min-width: 0; width: 100%; }
}

/* Connect Claude (/:slug/claude): the one-time command sits in a box that reads as a message, not a card. */
.token-box { padding: 0.75rem 1rem; border-left: 4px solid var(--accent); background: rgba(127, 127, 127, 0.1); margin: 1rem 0; }
.token-box p { margin: 0 0 0.5rem; }
.token-box pre { margin: 0 0 0.75rem; padding: 0.625rem 0.75rem; border: 1px solid var(--border); border-radius: 0.375rem; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.token-box code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem; }

/* The quiet Help link at the foot of every page that uses the shared layout. */
.app-foot { max-width: 34rem; margin: 0 auto; padding: 0 1rem 2rem; font-size: 0.9rem; }
.app-foot a { color: var(--muted); }
