/* REQ-126: System settings (people, teams, Claude setup, office location, house rules, access). The colour tokens (:root) and shared components are in ../styles.css; this file never defines :root variables. */

/* System settings */
.settings-block { display: flex; flex-direction: column; gap: 10px; }
.settings-block h2 { font-family: var(--font-display); font-weight: 800; font-size: 22px; margin: 0; }
.settings-block .sub { color: var(--mute); margin: 0; max-width: 70ch; }
.people { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.people-empty { padding: 16px; color: var(--mute); font-size: 14px; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.person:first-child { border-top: 0; }
.person.declined { opacity: 0.7; }
.person-av { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 800 16px/1 var(--font-display); overflow: hidden; flex: none; }
.person-av img { width: 100%; height: 100%; object-fit: cover; }
.person-who { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.person-who b { font-size: 15px; overflow-wrap: anywhere; }
.person-who span { font-family: var(--font-mono); font-size: 12px; color: var(--mute); overflow-wrap: anywhere; }
.person-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.person-act .btn { padding: 9px 14px; font-size: 13px; }
.role-select { font: 600 13px/1 var(--font-body); padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.role-tag { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
#settingsView .wrap { gap: 24px; }
.team { display: flex; flex-direction: column; gap: 12px; }
.team-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; padding-bottom: 8px; border-bottom: 2px solid color-mix(in srgb, var(--tc) 55%, transparent); }
.team-head i { width: 12px; height: 12px; border-radius: 4px; background: var(--tc); align-self: center; flex: none; }
.team-head h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.15; }
.team-focus { color: var(--mute); font-size: 14px; }
.team-n { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }
.team .empty { padding: 18px; font-size: 14px; }

/* System settings → Teams */
.settings-sub { margin: 8px 0 0; font: 700 11px/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.team-row { border-left: 4px solid var(--tc); }
.swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.swatch { width: 38px; height: 38px; padding: 2px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; flex: none; }

/* Claude setup page (#claude-setup, REQ-27). Tables become label/value cards on a phone. */
.cs .cs-tabs { margin: 4px 0 12px; flex-wrap: wrap; overflow-x: visible; }
.cs-body { display: flex; flex-direction: column; gap: 12px; }
.cs-body h2 { font-family: var(--font-display); font-weight: 800; font-size: 22px; margin: 18px 0 0; }
.cs-updated { margin: 0; color: var(--mute); font-size: 13.5px; }
.cs-sub { margin: 0; color: var(--mute); max-width: 75ch; }
.cs-mono { font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: break-word; }
.cs-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.cs-table col.w-event { width: 17%; } 
.cs-table col.w-script { width: 21%; } 
.cs-table col.w-does { width: 25%; } 
.cs-table col.w-blocks { width: 16%; } 
.cs-table col.w-escape { width: 11%; } 
.cs-table col.w-link { width: 10%; }
.cs-table col.w-target { width: 13%; } 
.cs-table col.w-paths { width: 20%; } 
.cs-table col.w-check { width: 11%; } 
.cs-table col.w-cmd { width: 34%; } 
.cs-table col.w-takes { width: 12%; }
.cs-table thead th:first-child { border-top-left-radius: 14px; } 
.cs-table thead th:last-child { border-top-right-radius: 14px; }
.cs-table caption { text-align: left; padding: 0 0 6px; color: var(--faint); font: 700 11px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; caption-side: top; }
.cs-table th, .cs-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.cs-table thead th { border-top: 0; background: var(--sunken); color: var(--mute); font: 700 11px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.cs-table tbody th { font-weight: 700; overflow-wrap: break-word; }
.cs-empty { color: var(--mute); }
.cs-block { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cs-when { color: var(--mute); font-size: 12.5px; }
.cs-chip { display: inline-flex; align-items: center; gap: 6px; font: 700 10.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
.cs-chip::before { content: ""; width: 7px; height: 7px; flex: none; }
.cs-chip.blocks { color: var(--blocked); background: var(--blocked-soft); }
.cs-chip.blocks::before { background: currentColor; border-radius: 1px; }
.cs-chip.never { color: var(--idle); background: var(--idle-soft); }
.cs-chip.never::before { border: 1.5px solid currentColor; border-radius: 50%; box-sizing: border-box; }
.cs-gh { font-weight: 700; color: var(--accent); }
.cs-gh:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.cs-nolink { color: var(--faint); }
.cs-agents { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cs-agent { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.cs-agent p { margin: 0; color: var(--mute); font-size: 13.5px; }
.cs-role { color: var(--mute); font-size: 13px; }
.cs-proposed { border: 1.5px dashed var(--faint); background: transparent; }
.cs-proposed-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
@media (max-width: 700px) {
  .cs-table, .cs-table tbody, .cs-table tr, .cs-table th, .cs-table td { display: block; width: 100%; box-sizing: border-box; }
  .cs-table colgroup { display: none; }
  .cs-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cs-table { border: 0; background: transparent; }
  .cs-table tbody { display: flex; flex-direction: column; gap: 10px; }
  .cs-table tr { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 0; }
  .cs-table th, .cs-table td { border-top: 0; padding: 6px 14px; white-space: normal; }
  .cs-table [data-label]::before { content: attr(data-label); display: block; color: var(--faint); font: 700 10.5px/1.6 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
}
.settings-block .sub, .cs-sub { max-width: 72ch; }

/* REQ-81.1: System settings → Office location. */
.loc-now { margin: 0; color: var(--ink); }
.loc-search { position: relative; display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.loc-search label, .loc-coords label { font: 600 13px/1.2 var(--font-body); color: var(--mute); display: flex; flex-direction: column; gap: 4px; }
.loc-search input, .loc-coords input { min-height: 44px; box-sizing: border-box; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 500 15px/1.2 var(--font-body); }
.loc-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); max-height: 320px; overflow: auto; }
.loc-opt { display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.loc-opt span { color: var(--faint); font-size: 12.5px; }
.loc-opt.on, .loc-opt:hover { background: var(--accent-soft); }
.loc-coords { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; max-width: 640px; }
.loc-coords .hint { font-weight: 500; color: var(--faint); font-size: 12px; }
.loc-coords .btn { min-height: 44px; }
.link-btn { align-self: flex-start; border: 0; background: none; padding: 10px 0; min-height: 44px; color: var(--accent); font: 700 14px/1.2 var(--font-body); cursor: pointer; text-decoration: underline; }
.link-btn:focus-visible, .loc-search input:focus-visible, .loc-coords input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* REQ-97: System settings in tabs (the .seg tab look, 44 px targets; the
   row scrolls sideways inside itself on a phone). */
.st-tabs { display: flex; width: max-content; max-width: 100%; margin: 0 0 18px; scroll-snap-type: x proximity; }
.st-tabs [role="tab"] { min-height: 44px; padding: 0 16px; white-space: nowrap; scroll-snap-align: start; }
.st-tabs [role="tab"][aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.st-count { color: var(--mute); font-weight: 600; }
.st-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
#lookAgents .btn, #teamAgents .btn { min-height: 44px; }

/* REQ-85.6: System settings → House rules. The readable panel is the one users
   see in the King's office: version and date on top, at most 70 characters a line. */
.hr-panel { max-width: 70ch; margin: 8px 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--card, var(--bg)); line-height: 1.55; }
.hr-panel p, .hr-panel ol, .hr-panel ul { margin: 0 0 10px; }
.hr-panel ol, .hr-panel ul { padding-left: 1.4em; }
.hr-panel li { margin: 4px 0; }
.hr-meta { color: var(--mute); font-size: 13px; }
.hr-draft-banner { display: inline-block; padding: 2px 10px; border: 1px dashed var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; }
.hr-group { margin: 18px 0; }
.hr-card { margin: 8px 0 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.hr-active { border: 2px solid var(--accent); }
.hr-draft { border: 2px dashed var(--line); }
.hr-chip { margin: 0 0 6px; font-weight: 700; }
.hr-tick { color: var(--accent); }
.hr-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.hr-actions .btn { min-height: 44px; }
.hr-same { color: var(--mute); font-size: 13px; }
.hr-same[hidden] { display: none; }
.hr-empty { color: var(--mute); }
.hr-older > summary, .hr-old > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.hr-old { margin-left: 12px; }
.hr-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.hr-col { min-width: 0; }
.hr-label { display: block; font-weight: 600; margin: 0 0 6px; }
.hr-text { width: 100%; box-sizing: border-box; min-height: 260px; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.hr-confirm { max-width: 460px; }
@media (max-width: 600px) { .hr-cols { grid-template-columns: 1fr; } .hr-panel { padding: 12px 14px; } }

/* REQ-114.1: System settings → Access → Invite a person */
.inv-form { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 8px 0 4px; }
.inv-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; flex: 1 1 180px; min-width: 0; }
.inv-field input, .inv-field select, .inv-rename { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; font-weight: 400; }
.inv-form .btn, .inv-act .btn, .inv-who .btn { min-height: 44px; }
.inv-note { margin: 6px 0; font-size: 14px; }
.inv-err { font-weight: 400; font-size: 13px; color: var(--needs); }
.inv-field input[aria-invalid="true"] { border-color: var(--needs); }
.inv-head { margin: 16px 0 0; font-size: 15px; }
.inv-list { margin-top: 6px; }
.inv-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; border: 2px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.inv-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 200px; }
.inv-who .sub { overflow-wrap: anywhere; }
.inv-tag { font-size: 13px; font-weight: 700; color: var(--mute); }
/* REQ-179.1 (Pablo's notes 5, 6): the e-mail language (a Segmented control,
   44 px targets) and the invite e-mail's state in words on the row; not sent
   on --needs-soft with the reason under it. */
.inv-lang button { min-height: 44px; }
.inv-mail { display: block; font-size: 13px; color: var(--mute); }
.inv-mail.failed { display: inline-block; margin-top: 2px; padding: 3px 10px; border-radius: 999px; background: var(--needs-soft); color: var(--needs); font-weight: 700; }
.inv-mail-why { display: block; font-size: 12.5px; color: var(--mute); overflow-wrap: anywhere; }
.inv-act { display: flex; gap: 8px; flex-wrap: wrap; }
.inv-items { margin: 4px 0 12px; padding-left: 20px; }
.person-who .si { display: flex; margin-top: 2px; }

/* System settings → Buildings (REQ-148.2): a card per building with its roof
   sign previewed on light and dark, the colour and the logo. */
.bl-list { display: flex; flex-direction: column; gap: 16px; }
.bl-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); max-width: 720px; }
.bl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.bl-name { margin: 0; font: 800 18px/1.2 var(--font-display); }
.bl-state { color: var(--mute); font-size: 13px; }
.bl-preview { display: flex; flex-wrap: wrap; gap: 12px; }
.bl-sign-wrap { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; min-width: 0; flex: 1 1 220px; }
/* The previews stand on a fixed light and a fixed dark ground, whatever the page's theme. */
.bl-sign-wrap.bl-light { background: var(--sign-ground-light); color: var(--sign-ink-light); }
.bl-sign-wrap.bl-dark { background: var(--sign-ground-dark); color: var(--sign-ink-dark); }
.bl-sign-theme { font: 600 12px/1.2 var(--font-body); }
.bl-sign { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 14px; border-radius: 10px; font: 800 20px/1.1 var(--font-display); overflow: hidden; }
.bl-sign-logo { width: 40px; height: 40px; object-fit: contain; flex: none; }
.bl-sign-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-field { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bl-field legend { font: 700 14px/1.2 var(--font-body); color: var(--ink); padding: 0; margin-bottom: 8px; }
.bl-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.bl-swatch { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: var(--sw); border: 2px solid var(--line-strong); }
.bl-swatch.on { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--accent); }
.bl-hex { display: flex; flex-direction: column; gap: 4px; font: 600 13px/1.2 var(--font-body); color: var(--mute); max-width: 200px; }
.bl-hex input { min-height: 44px; box-sizing: border-box; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font: 500 15px/1.2 var(--font-mono); text-transform: uppercase; }
.bl-hex input[aria-invalid="true"] { border-color: var(--blocked); }
.bl-ink, .bl-hint { margin: 0; color: var(--mute); font-size: 13.5px; max-width: 60ch; }
.bl-ink.bad, .bl-err { margin: 0; color: var(--blocked); font-size: 13.5px; }
.bl-warn { margin: 0; color: var(--needs); font-size: 13.5px; }
.bl-file { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; }
.bl-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.bl-field:has(.bl-file-input:focus-visible) .bl-file { outline: 2px solid var(--accent); outline-offset: 2px; }
.bl-file-note { display: flex; flex-direction: column; gap: 4px; }
/* REQ-159.1: the building's world */
.bl-world-label { font: 600 13px/1.2 var(--font-body); color: var(--mute); }
.bl-world select { min-height: 44px; max-width: 100%; box-sizing: border-box; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font: 500 15px/1.2 var(--font-body); }
.bl-world select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bl-actions, .bl-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bl-actions .btn, .bl-confirm .btn { min-height: 44px; }
.bl-confirm { padding: 12px; border-radius: 12px; background: var(--sunken); }
.bl-confirm p { margin: 0; flex: 1 1 100%; }
.bl-note { margin: 0; }
.bl-history summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--mute); }
.bl-history ul { margin: 0; padding-left: 18px; color: var(--mute); font-size: 13.5px; }
.bl-swatch:focus-visible, .bl-hex input:focus-visible, .bl-history summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* REQ-179.2 (Pablo 6): Send again waits a minute after a click; aria-disabled keeps it focusable. */
.inv-act .btn.ghost[aria-disabled="true"] { opacity: .55; cursor: default; }

/* REQ-184.2: removing a person: one row per agent that works with them
   (Pablo's note): avatar and name, Release / Reassign to… and a person
   picker, then what moves. On a phone the picker stacks under the choice. */
.rm-row { border: 0; margin: 0 0 12px; padding: 8px 6px; border-radius: 10px; min-width: 0; }
.rm-row:focus-within { background: var(--sunken); }
.rm-who { display: flex; align-items: center; gap: 8px; padding: 0; font-size: 15px; }
.rm-av { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--sunken); }
.rm-opts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0; }
.rm-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.rm-opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.rm-pick { width: 100%; min-height: 44px; box-sizing: border-box; }
.rm-moves { margin: 6px 0 0; color: var(--mute); font-size: 13px; }
.rm-moves:empty { display: none; }
.rm-need { margin: 6px 16px 0; color: var(--mute); font-size: 13px; }
.rm-need:empty { display: none; }
.rm-dlg .rq-assign-foot { justify-content: flex-end; flex-wrap: wrap; }
