/* The light theme: the colour tokens and base element rules shared by the studio editor and the
   sign-in, setup and set-password pages. One source of colours, from the v6 mockup
   (docs/superpowers/specs/2026-11-06-editor-ui-design.md). The editor loads this
   before editor.css; the sign-in pages load it alone, on <body class="light account">. */
:root, body.editor {
  --bg: #e6e6e3; --panel: #f4f4f2; --panel2: #ececea; --open: #ebe6da; --open-line: #d9d2c2; --line: #d2d2cd; --line2: #c3c3be;
  --text: #1d1d1f; --muted: #6e6e74; --accent: #1d1d1f; --accent2: #b4912f; --tick: #b9b9b4; --tick-on: #1d1d1f; --chip: #ffffff;
  --own: #e08a00; /* the mark of a SKU's own changes, the editor's orange */
  --select: #34d27a; --error: #9b2c2c; --ok: #2f6b3a; --font: -apple-system, "SF Pro Text", Inter, "Segoe UI", Helvetica, Arial, sans-serif;
  --rail: 48px; --panel-w: 324px;
  color-scheme: light;
}

/* ------------------------------------------------------------------ base elements (editor and light pages) */
body.editor .brand, body.light .brand { color: var(--text); }
body.editor button.link, body.light button.link { color: var(--muted); }
body.editor [hidden], body.light [hidden] { display: none !important; } /* the hidden attribute wins over any display rule below */
body.editor a, body.light a { color: var(--accent2); }
body.editor input, body.editor select, body.editor textarea, body.editor button, body.light input, body.light select, body.light textarea, body.light button { color: var(--text); background: var(--chip); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; font: inherit; }
body.editor input[type="checkbox"], body.editor input[type="radio"], body.light input[type="checkbox"], body.light input[type="radio"] { width: auto; display: inline-block; margin: 0 6px 0 0; accent-color: var(--accent2); }
/* no display on the generic label: the switch, chip, choice, variant and colour field classes set their own */
body.editor label, body.light label { margin: 0; color: var(--text); }
body.editor pre, body.light pre { white-space: pre-wrap; background: var(--panel2); color: var(--text); padding: 10px; border-radius: 8px; font-size: 12px; }
body.editor details summary, body.light details summary { cursor: pointer; }
body.editor .error, body.light .error { color: var(--error); }
body.editor .ok, body.light .ok { color: var(--ok); }
body.editor .muted, body.light .muted { color: var(--muted); }

/* ------------------------------------------------------------------ light pages only (the editor gets these from editor.css) */
body.light, body.light *, body.light *::before, body.light *::after { box-sizing: border-box; }
body.light { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 13.5px/1.45 var(--font); }
body.light header.top { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); }
body.light .brand { text-decoration: none; font-weight: 600; letter-spacing: .02em; }
body.light button.link { background: none; border: 0; padding: 0; cursor: pointer; }
body.light .btn { background: var(--chip); color: var(--text); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 12.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
body.light .btn.primary { background: var(--accent); color: var(--panel); border-color: var(--accent); font-weight: 600; }
body.light .btn:disabled { opacity: .45; cursor: not-allowed; }

/* the sign-in, setup and set-password card */
body.account main { padding: 64px 16px; }
body.account .account-card { max-width: 380px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px 24px 20px; }
body.account h1 { font-size: 18px; font-weight: 600; margin: 0 0 16px; }
body.account form { display: grid; gap: 14px; }
body.account label { display: grid; gap: 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
body.account label input { width: 100%; min-height: 36px; font-size: 13.5px; letter-spacing: normal; text-transform: none; font-weight: 400; }
body.account input:focus-visible, body.account .btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 1px; }
body.account label.show-password { display: flex; align-items: center; gap: 8px; margin-top: -6px; font-size: 12.5px; letter-spacing: normal; text-transform: none; font-weight: 400; }
body.account label.show-password input { width: auto; min-height: 0; margin: 0; }
body.account .btn.primary { justify-content: center; padding: 9px 12px; font-size: 13.5px; margin-top: 4px; }
body.account .error { margin: 0 0 14px; }
body.account .note { margin: 14px 0 0; font-size: 12.5px; }

/* the not-found and not-available notice (body.light.notice) */
body.notice main { padding: 64px 16px; }
body.notice .card { max-width: 420px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
body.notice .card p { margin: 0; }

/* ------------------------------------------------------------------ the header: switcher, name menu, banner, notice (editor and light pages) */
body.editor header.top, body.light header.top { gap: 12px; }
body.editor .top-tools, body.light .top-tools { display: flex; align-items: center; gap: 10px; }
body.editor label.switcher, body.light label.switcher { display: inline-flex; margin: 0; }
body.editor #acting-account, body.light #acting-account { display: inline-block; width: auto; max-width: 220px; margin: 0; padding: 3px 8px; font-size: 12.5px; }
body.editor details.who, body.light details.who { position: relative; }
.who-initials { display: none; } /* the editor's header shows initials in a circle instead of the name (editor.css) */
body.editor details.who summary, body.light details.who summary { list-style: none; color: var(--text); font-size: 12.5px; padding: 4px 8px; border-radius: 8px; }
body.editor details.who summary::-webkit-details-marker, body.light details.who summary::-webkit-details-marker { display: none; }
body.editor details.who[open] summary, body.editor details.who summary:hover, body.light details.who[open] summary, body.light details.who summary:hover { background: var(--panel2); }
body.editor .who-menu, body.light .who-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; min-width: 160px; display: grid; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
body.editor .who-menu form, body.light .who-menu form { margin: 0; }
body.editor .who-menu a, body.editor .who-menu button.link, body.light .who-menu a, body.light .who-menu button.link { display: block; width: 100%; text-align: left; padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); text-decoration: none; font-size: 12.5px; cursor: pointer; }
body.editor .who-menu a:hover, body.editor .who-menu button.link:hover, body.light .who-menu a:hover, body.light .who-menu button.link:hover { background: var(--panel2); }
body.editor .acting-banner, body.light .acting-banner { margin: 0; padding: 6px 16px; background: var(--open); border-bottom: 1px solid var(--open-line); font-size: 12.5px; }
body.editor .acting-banner a, body.light .acting-banner a { margin-left: 8px; }
body.editor .acting-notice, body.light .acting-notice { margin: 0; padding: 6px 16px; background: var(--panel2); border-bottom: 1px solid var(--line); font-size: 12.5px; }
body.editor .sr-only, body.light .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ the studio pages: clients, a client, environments (body.light.studio) */
body.studio main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
body.studio .card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
body.studio h1 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
body.studio h2 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 10px; }
body.studio .crumb { margin: 0 0 10px; font-size: 12.5px; }
body.studio table { width: 100%; border-collapse: collapse; }
body.studio th, body.studio td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
body.studio th { color: var(--muted); font-weight: 600; font-size: 12px; }
body.studio tr.archived td { color: var(--muted); }
body.studio td.actions { white-space: nowrap; text-align: right; }
body.studio td.actions button.link + button.link { margin-left: 12px; }
body.studio .stack { margin-top: 14px; }
body.studio .row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
body.studio .row + .row { margin-top: 10px; }
body.studio .row label { display: grid; gap: 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
body.studio .row label input, body.studio .row label select { min-width: 200px; min-height: 34px; font-size: 13.5px; letter-spacing: normal; text-transform: none; font-weight: 400; }
body.studio .row label input[type="file"] { padding: 5px 8px; }
body.studio .btn { min-height: 34px; }
body.studio .btn.danger { color: var(--error); border-color: var(--error); }
body.studio .pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 400; letter-spacing: normal; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
body.studio .pill[data-status="active"] { color: var(--ok); }
body.studio .pill[data-status="disabled"], body.studio .pill[data-status="archived"] { color: var(--error); }
body.studio .link-box { margin-top: 14px; padding: 12px; background: var(--open); border: 1px solid var(--open-line); border-radius: 10px; }
body.studio .link-box p { margin: 0 0 8px; }
body.studio .link-box input { flex: 1; min-width: 260px; font: 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace; }
