/* TANGENTS war-room hub — dark theme per tangents-design-system.md hero palette */

:root {
  color-scheme: dark;
  /* Surfaces (dark variants of the system tokens) */
  --surface-low: rgba(255, 255, 255, .055);
  --surface-card: rgba(255, 255, 255, .085);
  --line: rgba(255, 255, 255, .11);

  /* Text */
  --ink: #eef3f4;
  --ink-soft: #b9c7ca;
  --muted: #9baeb3;

  /* Brand / structure */
  --accent: #7db2bf;
  --accent-light: #d6e8ed;
  --accent-deep: #344b51;

  /* Operating status */
  --success: #5ba67d;
  --warning: #e8a838;
  --danger: #d4544e;

  /* Geometry */
  --radius: 14px;
  --control-gap: 12px;

  /* Typography */
  --font: "Acumin Variable Concept", "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
  background:
    radial-gradient(circle at 93% 15%,
      rgba(125, 178, 191, .22) 0,
      rgba(125, 178, 191, 0) 25%),
    linear-gradient(126deg, #303033 0%, #344b51 74%, #42646c 100%);
  background-attachment: fixed;
}

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

.view { position: relative; z-index: 1; }

/* ---- Shared text roles ---- */

.kicker {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.form-error {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: #f0a09b;
}

/* ---- Sigma watermark ---- */

.sigma-watermark {
  position: fixed;
  right: -3%;
  bottom: -24%;
  z-index: 0;
  font-size: min(78vh, 720px);
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, .035);
  pointer-events: none;
  user-select: none;
}

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

.btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--ink);
  background: var(--surface-card);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1d2a2d;
}
.btn-primary:hover { background: #8fbfca; }

.btn-outline {
  background: transparent;
  border-color: rgba(125, 178, 191, .55);
  color: var(--accent-light);
}
.btn-outline:hover { background: rgba(125, 178, 191, .14); }

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--ink);
}
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-ghost:hover { color: var(--ink); border-color: rgba(255, 255, 255, .25); }

.btn[disabled] { opacity: .55; cursor: default; }

/* ---- Fields ---- */

.field { margin: 0 0 12px; }

.field > label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: rgba(0, 0, 0, .26);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  padding: 9px 11px;
}

.field input:focus-visible { outline-offset: 0; border-color: var(--accent); }

.field textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: rgba(0, 0, 0, .26);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  padding: 9px 11px;
}

.brief-intro { color: var(--ink-soft); font-size: 12px; margin: 16px 0 10px; }
.brief-group { border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 0; margin: 0 0 12px; }
.brief-group legend { padding: 0 6px; color: var(--accent-light); font-size: 12px; font-weight: 700; }
.brief-group legend span { margin-left: 6px; color: var(--muted); font-size: 10px; font-weight: 500; }
.brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }

/* ---- Sign-in view ---- */

#view-signin {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 18px;
}

.signin-wrap { width: min(380px, 100%); }

.wordmark {
  margin: 0 0 16px;
  text-align: center;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--ink);
}

.wordmark .sigma { color: var(--accent); margin-right: 6px; }

.signin-card {
  background: var(--surface-low);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 3px 18px rgba(0, 0, 0, .28);
}

.signin-title {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -.025em;
}

.signin-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--ink-soft);
}

.signin-card .btn-primary { width: 100%; margin-top: 10px; padding: 10px 15px; }
.security-alt-action { margin-block: var(--control-gap); }

/* ---- Deck ---- */

.page {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.deck-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.deck-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.04em;
}

.deck-sub { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.deck-project-visibility { margin-bottom: var(--control-gap); }

.deck-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }

.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

/* ---- Cards ---- */

.card {
  position: relative;
  background: var(--surface-low);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.card-top {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.card-tagline {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.card-launch-date {
  margin: -5px 0 0;
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 650;
}

/* Chips — rounded pill with 5px status dot */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip .dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  flex: none;
}

.chip-role {
  background: rgba(125, 178, 191, .16);
  border: 1px solid rgba(125, 178, 191, .38);
  color: var(--accent-light);
}

.chip-ok {
  background: rgba(91, 166, 125, .15);
  border: 1px solid rgba(91, 166, 125, .4);
  color: #93d2ae;
}

.chip-warn {
  background: rgba(232, 168, 56, .14);
  border: 1px solid rgba(232, 168, 56, .4);
  color: #efc273;
}

/* Completion ring + stats */

.card-mid {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ring { width: 64px; height: 64px; flex: none; }

.ring-track { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 5; }

.ring-bar {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset .9s ease;
}

.ring-pct {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.card-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.stat-line { margin: 0; font-size: 12px; color: var(--ink-soft); }
.stat-line strong { color: var(--ink); font-weight: 700; }

.stat-due {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--warning);
}

/* Milestone row */

.card-mile {
  border-top: 1px solid var(--line);
  padding-top: 9px;
  margin-top: auto;
}

.mile-label {
  margin: 0 0 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.mile-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }

.mile-meta { margin: 2px 0 0; font-size: 11px; color: var(--muted); }

.mile-meta .overdue { color: var(--danger); font-weight: 700; }

/* Launch: visible row whose ::after stretches across the card */

.card-launch {
  font: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.card-launch::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }

.card-launch:focus-visible { outline: none; }

.card-launch:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card:hover { border-color: rgba(125, 178, 191, .45); }

.card-rename {
  position: relative;
  z-index: 1;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.card-rename:hover { color: var(--accent-light); border-color: rgba(125, 178, 191, .5); }


/* ---- Gate overlay ---- */


.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 93% 15%,
      rgba(125, 178, 191, .22) 0,
      rgba(125, 178, 191, 0) 25%),
    linear-gradient(126deg, #303033 0%, #344b51 74%, #42646c 100%);
  opacity: 0;
  transition: opacity .22s ease;
}

.gate.on { opacity: 1; }

.gate-inner { text-align: center; }

.gate-sigma {
  display: block;
  font-size: 88px;
  font-weight: 700;
  line-height: 1;
  color: rgba(125, 178, 191, .8);
  margin-bottom: 14px;
}

.gate-text {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.025em;
}

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

.room-dialog {
  width: min(680px, calc(100vw - 36px));
  max-height: min(90vh, 920px);
  overflow: auto;
  background: #2e3c40;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 13px;
  padding: 20px;
  box-shadow: 0 3px 18px rgba(0, 0, 0, .35);
}

.room-dialog::backdrop { background: rgba(20, 24, 25, .62); }
.github-controls { border: 0; padding: 0; margin: 0; min-width: 0; }
#github-content { overflow-wrap: anywhere; }

.dlg-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.025em;
}

.dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  position: sticky;
  bottom: -20px;
  background: #2e3c40;
  padding: 12px 0 2px;
}

.card-brief { margin: 14px 0; border-top: 1px solid var(--line); padding-top: 12px; }
.card-brief summary { color: var(--accent-light); font-size: 12px; font-weight: 650; cursor: pointer; }
.card-brief dl { display: grid; grid-template-columns: minmax(100px, .35fr) minmax(0, 1fr); gap: 7px 12px; margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.card-brief dt { color: var(--muted); font-size: 11px; }
.card-brief dd { margin: 0; color: var(--ink-soft); font-size: 12px; }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

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

@media (max-width: 650px) {
  .page { width: calc(100% - 36px); padding-top: 24px; }
  .deck-grid { grid-template-columns: 1fr; gap: 10px; }
  .deck-actions { width: 100%; }
  body { font-size: 14px; }
  .card-tagline { font-size: 13px; }
  .brief-grid { grid-template-columns: 1fr; }
}

/* ---- Reduced motion ---- */

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

/* Keep select chevrons slightly inset from the field edge across all hub dialogs. */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
/* ---- Profile and project access ---- */

.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 12px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-low);
  color: var(--ink);
  text-align: left;
}
.profile-button:hover { border-color: rgba(125, 178, 191, .5); background: var(--surface-card); }
.profile-initial {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-deep);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.profile-button-copy { display: grid; gap: 2px; min-width: 0; }
.profile-button-copy strong { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.profile-button-copy small { color: var(--muted); font-size: 10px; }

.profile-dialog {
  color: var(--ink);
  background: #303033;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 18px;
  box-shadow: 0 16px 60px #0008;
  padding: 0;
}
.profile-dialog { width: min(450px, calc(100vw - 28px)); }
.profile-dialog::backdrop { background: #0a0c0d99; backdrop-filter: blur(5px); }
.profile-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.profile-dialog > header h2 { margin: 0; font-size: 19px; }
.profile-dialog > header .kicker { margin-bottom: 5px; }
.profile-details { padding: 22px; }
.profile-full-name { margin: 0; font-size: 20px; font-weight: 650; }
.profile-email { margin: 4px 0 16px; color: var(--ink-soft); overflow-wrap: anywhere; }
.profile-access { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.profile-role-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; margin: 0; border-top: 1px solid var(--line); }
.profile-role-row span { color: var(--accent-light); text-align: right; }
.profile-dialog > footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }

.admin-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-page-head .deck-sub { margin-bottom: 0; }
.team-content { padding: 0 0 40px; }
.team-intro { margin: 0 0 16px; color: var(--ink-soft); }
.team-toolbar,
.team-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.team-toolbar { min-height: 44px; margin-bottom: 16px; }
.team-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.team-toolbar p.is-error { color: #f0a09b; }
.team-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
.team-section-heading { margin: 20px 0 9px; }
.team-section-heading h3 { margin: 0; font-size: 15px; }
.team-count { color: var(--muted); font-size: 11px; }
.team-roster-toolbar { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.team-roster-toolbar .field { width: min(360px, 100%); margin: 0; }
.team-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-low); }
.team-table-scroll { overflow-x: auto; }
.team-roster-table { width: 100%; min-width: 760px; border-collapse: collapse; text-align: left; }
.team-roster-table th { padding: 10px 12px; background: rgba(255,255,255,.045); color: var(--muted); font-size: 10px; font-weight: 700; }
.team-roster-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 11px; }
.team-roster-table td:first-child { min-width: 190px; }
.team-access-tag { display: inline-flex; align-items: center; gap: 3px; margin: 2px 5px 2px 0; padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); color: var(--ink-soft); font-size: 10px; line-height: 1.3; }
.team-access-tag strong { color: var(--ink); font-weight: 600; }
.team-no-access { color: var(--muted); }
.team-status { display: inline-block; padding: 4px 7px; border-radius: 999px; font-size: 10px; white-space: nowrap; }
.team-status.is-active { background: rgba(91,166,125,.14); color: #9ad2b0; }
.team-status.is-disabled { background: rgba(212,84,78,.13); color: #f0a09b; }
.team-manage-person { padding: 6px 10px; font-size: 10px; }
.team-roster-empty { margin: 0; padding: 18px; }
.team-person-editor { margin-top: 16px; padding: 16px; border: 1px solid rgba(125,178,191,.3); border-radius: 12px; background: rgba(125,178,191,.045); }
.team-person-editor > .team-section-heading { margin: 0 0 10px; }
.team-person-editor h3 { margin: 0; font-size: 15px; }
.team-account-removal { margin-top: var(--control-gap); padding-top: var(--control-gap); border-top: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); }
.team-account-removal p { max-width: 760px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.team-account-removal .btn-danger { margin-top: 4px; }
.team-person-note { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.team-person-room-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,260px); align-items: center; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.team-person-room-row strong,
.team-person-room-row small { display: block; }
.team-person-room-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.team-bulk-editor { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.team-bulk-editor > summary { color: var(--accent-light); font-size: 13px; font-weight: 650; cursor: pointer; }
.team-bulk-editor > .help { margin: 9px 0 14px; }
.team-invite-table { width: 100%; border-collapse: collapse; text-align: left; }
.team-invite-table th { padding: 11px 12px; background: rgba(255,255,255,.045); color: var(--muted); font-size: 10px; font-weight: 700; }
.team-invite-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; font-size: 11px; }
.team-invite-table td span,
.team-invite-table td small { display: block; }
.team-invite-table td span { margin-top: 3px; color: var(--ink-soft); overflow-wrap: anywhere; }
.team-invite-table td small,
.team-access-summary { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); color: var(--ink-soft); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.team-role-select { display: block; width: 100%; min-width: 0; max-width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #252829; color: var(--ink); font: inherit; }
.team-role-select:disabled { opacity: .75; }
.team-access-controls { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr) minmax(0,.8fr); align-items: end; gap: 12px; margin-bottom: 12px; }
.team-access-controls .field { min-width: 0; }
.team-room-picker { position: relative; min-width: 0; }
.team-room-picker summary { position: relative; min-height: 36px; padding: 8px 38px 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #252829; color: var(--ink); font-size: 12px; cursor: pointer; list-style: none; }
.team-room-picker summary::-webkit-details-marker { display: none; }
.team-room-picker summary::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .15s ease; }
.team-room-picker[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.team-room-options { position: absolute; z-index: 10; top: calc(100% + 5px); left: 0; width: min(340px, 82vw); max-height: 250px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #202425; box-shadow: 0 12px 32px rgba(0,0,0,.4); }
.team-room-option { display: flex; flex-flow: row nowrap; align-items: center; gap: 10px; min-height: 34px; padding: 8px; border-radius: 7px; color: var(--ink-soft); font-size: 12px; line-height: 16px; cursor: pointer; }
.team-room-option:hover { background: rgba(255,255,255,.06); }
.team-room-option input { display: block; flex: 0 0 16px; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.team-room-option-all { font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); border-radius: 7px 7px 0 0; }
.team-room-option.is-done { opacity: .6; cursor: not-allowed; }
.team-access-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.team-access-actions button:disabled { opacity: .55; cursor: not-allowed; }
.team-invitations-section { margin-top: 23px; }
.team-murphy-section { margin-top: 28px; }
.team-murphy-section > .team-section-heading p { margin: 4px 0 0; max-width: 70ch; }
.murphy-connections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.murphy-connections > .team-person-editor { margin-top: 12px; }
.murphy-code { display: grid; gap: 8px; justify-items: start; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.murphy-code strong { font-size: 22px; letter-spacing: .12em; }
/* QR codes need a white quiet zone to scan in either theme. */
.murphy-qr { margin: 12px 0; width: 240px; max-width: 100%; aspect-ratio: 1; padding: 8px; background: #ffffff; border-radius: var(--radius); }
.murphy-qr img { display: block; width: 100%; height: auto; }
.murphy-test { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 14px; }
.murphy-test p { grid-column: 1 / -1; margin: 0; }
.murphy-automation { display: grid; gap: 10px; max-width: 520px; }
@media (max-width: 760px) {
  .murphy-connections { grid-template-columns: 1fr; }
  .murphy-test { grid-template-columns: 1fr; }
}
.team-invite-table { min-width: 680px; }
.team-revoke { padding: 6px 10px; font-size: 10px; }
.team-invite-panel { margin: 14px 0 20px; padding: 17px; border: 1px solid rgba(125,178,191,.32); border-radius: 14px; background: rgba(125,178,191,.07); }
.team-invite-panel h3 { margin: 0 0 5px; font-size: 15px; }
.team-invite-panel > .help { margin: 0 0 15px; }
.invite-identity { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.invite-projects { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 8px; margin: 8px 0 12px; }
.invite-project-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(125px,.8fr); align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.12); font-size: 11px; }
.invite-project-choice { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.invite-project-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.invite-project-row strong { overflow-wrap: anywhere; }
.invite-project-role { min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: #252829; color: var(--ink); font: inherit; }
.team-invite-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.invite-result { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; padding: 13px; border: 1px solid rgba(91,166,125,.4); border-radius: 10px; background: rgba(91,166,125,.08); }
.invite-result strong,
.invite-result p { flex: 1 1 100%; margin: 0; }
.invite-result p { color: var(--ink-soft); font-size: 11px; }
.invite-result input { flex: 1 1 300px; min-width: 0; color: var(--ink); }

@media (max-width: 650px) {
  .profile-button { margin-left: auto; }
  .profile-button-copy strong { max-width: min(46vw, 190px); }
  .team-content { padding-bottom: 28px; }
  .admin-page-head { align-items: flex-start; }
  .admin-page-head #team-close { width: 100%; }
  .team-toolbar { align-items: flex-start; flex-direction: column; }
  .team-toolbar #team-invite-open { width: 100%; }
  .team-roster-toolbar .field { width: 100%; }
  .team-person-room-row { grid-template-columns: minmax(0,1fr) minmax(120px,45%); gap: 8px; }
  .team-access-controls { grid-template-columns: 1fr; gap: 9px; }
  .team-access-actions button { width: 100%; }
  .invite-identity { grid-template-columns: 1fr; gap: 0; }
  .invite-projects { grid-template-columns: 1fr; }
  .invite-project-row { grid-template-columns: minmax(0,1fr) minmax(120px,.8fr); }
  .team-invite-actions { flex-direction: column-reverse; }
  .team-invite-actions button { width: 100%; }
  .profile-dialog > footer { padding: 14px 16px; }
}

:root[data-theme="light"] {
  color-scheme: light;
  --surface-low: #ffffff;
  --surface-card: #e1ebee;
  --line: #bacdd3;
  --ink: #20363e;
  --ink-soft: #405b65;
  --muted: #526b74;
  --accent: #2c6575;
  --accent-light: #245666;
  --accent-deep: #2f5660;
  --success: #276643;
  --warning: #805600;
  --danger: #a1342e;
  --page-surface: #edf3f4;
  --page-tint: #d6e4e8;
  --primary-ink: #ffffff;
  --primary-hover: #245565;
  --field-border: #78919a;
  --watermark-ink: #bacdd3;
}

:root[data-theme="light"] body,
:root[data-theme="light"] .gate { background: linear-gradient(126deg, var(--page-surface), var(--page-tint)); }
:root[data-theme="light"] .sigma-watermark { color: var(--watermark-ink); }
:root[data-theme="light"] .room-dialog,
:root[data-theme="light"] .profile-dialog,
:root[data-theme="light"] .dlg-actions,
:root[data-theme="light"] .team-room-options { background: var(--surface-low); border-color: var(--line); }
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field textarea,
:root[data-theme="light"] .team-role-select,
:root[data-theme="light"] .team-room-picker summary,
:root[data-theme="light"] .invite-project-role,
:root[data-theme="light"] .invite-result input { background-color: var(--surface-low); border-color: var(--field-border); color: var(--ink); }
:root[data-theme="light"] .btn-primary { background: var(--accent); color: var(--primary-ink); }
:root[data-theme="light"] .btn-primary:hover { background: var(--primary-hover); }
:root[data-theme="light"] .btn-outline { border-color: var(--accent); }
:root[data-theme="light"] .btn-ghost:hover,
:root[data-theme="light"] .team-room-option:hover { background: var(--surface-card); border-color: var(--accent); }
:root[data-theme="light"] .form-error,
:root[data-theme="light"] .team-toolbar p.is-error,
:root[data-theme="light"] .team-status.is-disabled { color: var(--danger); }
:root[data-theme="light"] .chip-ok,
:root[data-theme="light"] .team-status.is-active { color: var(--success); }
:root[data-theme="light"] .chip-warn { color: var(--warning); }
:root[data-theme="light"] .team-roster-table th,
:root[data-theme="light"] .team-invite-table th,
:root[data-theme="light"] .invite-project-row { background: var(--surface-card); }

.appearance-toggle { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.appearance-icon { display: inline-flex; width: 16px; height: 16px; }

@media (max-width: 650px) {
  .appearance-label { display: none; }
  .appearance-toggle { min-width: 42px; min-height: 42px; justify-content: center; padding: 8px; }
}

/* ---- v1: Done war rooms (design §7.3) ---- */

.deck-done { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 14px; }
.deck-done > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 6px 0;
  width: fit-content;
}
.deck-done > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.deck-done-grid { margin-top: 12px; }
.card-done { background: transparent; }
.card-done .card-name { font-size: 15px; color: var(--ink-soft); }
.card-done-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ---- v1: command center views and My work (design §7.5) ---- */

.deck-tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.deck-tabs [role="tab"] { flex: 0 0 auto; }
.deck-tabs [role="tab"] {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 10px 14px; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.deck-tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.deck-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }

.work-panel { display: flex; flex-direction: column; gap: 28px; }
.work-section { display: flex; flex-direction: column; gap: 12px; }
.work-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.work-heading { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.work-filters { display: flex; flex-wrap: wrap; gap: var(--control-gap); }
.work-filters .field { margin: 0; min-width: 180px; }
.work-scope { display: flex; flex-wrap: wrap; gap: 6px; }
.work-scope [aria-pressed="true"] { background: var(--surface-card); border-color: var(--accent); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

.work-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.work-table th, .work-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.work-table thead th { font-size: 11px; color: var(--muted); font-weight: 700; }
.work-table tbody th a { color: var(--ink); font-weight: 700; }
.work-progress { display: inline-flex; align-items: center; gap: 8px; }
.work-progress-track { width: 72px; height: 6px; border-radius: 3px; background: var(--surface-card); overflow: hidden; }
.work-progress-fill { display: block; height: 100%; background: var(--accent); }
.work-attention { color: var(--warning); font-weight: 700; }
.discovery-actions { margin-top: 6px; }
.idea-status { font-weight: 600; }
.work-references { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.work-reference { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.work-reference h3 { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.work-reference-detail, .work-reference-fresh { margin: 4px 0 0; font-size: 12px; color: var(--ink-soft); }
.work-reference a { display: inline-block; margin-top: 6px; color: var(--accent); font-size: 13px; }
.work-reference-form { margin-top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.work-subheading { margin: 20px 0 8px; font-size: 13px; color: var(--ink-soft); }
.operations-alerts { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.operations-alerts li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line);
  border-left: 3px solid var(--warning); border-radius: 8px; font-size: 13px; color: var(--ink); }
.operation-state { font-weight: 600; }
.operation-state.is-stopped { color: var(--danger); }
#panel-operations code { font-size: 12px; white-space: nowrap; }
#operations-queue .work-table { min-width: 680px; }
#migration-inventory .work-table { min-width: 720px; }
.migration-form { margin-top: 16px; display: grid; gap: 4px; max-width: 760px; }
.migration-form textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.migration-form small { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.migration-rooms { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.migration-rooms > li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.migration-rooms ul { margin: 6px 0 0; padding-left: 18px; }
.migration-command:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.migration-command { margin: 6px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font-size: 12px; }

.handoff-approval-details { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 6px 12px; margin: 12px 0; font-size: 13px; }
.handoff-approval-details dt { color: var(--muted); }
.handoff-approval-details dd { margin: 0; overflow-wrap: anywhere; }
.idea-selections { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.idea-selections li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#panel-ideas .work-table tbody th a { color: var(--accent); }
.discovery-flags { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
#panel-discovery .work-table tbody th a { color: var(--accent); }
.team-table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.work-group { display: flex; flex-direction: column; gap: 6px; }
.work-group-title { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.work-group-overdue .work-group-title { color: var(--danger); }
.work-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-low); }
.work-row {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto 44px 108px;
  gap: 12px; align-items: center; padding: 10px 14px; font-size: 13px;
}
.work-row + .work-row { border-top: 1px solid var(--line); }
.work-task { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.work-meta, .work-due { color: var(--muted); }
.work-due { text-align: right; }
.work-status { justify-self: start; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); white-space: nowrap; }
.work-status-blocked { color: var(--danger); border-color: var(--danger); }
.work-status-at-risk { color: var(--warning); border-color: var(--warning); }
.work-status-done { color: var(--success); border-color: var(--success); }

:root { --surface-pinned: #33464c; --timeline-label: 180px; }
:root[data-theme="light"] { --surface-pinned: #edf3f4; }
.timeline-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-low); }
.timeline { position: relative; min-width: max(100%, calc(var(--timeline-weeks) * 76px + var(--timeline-label))); padding-bottom: 10px; }
.timeline-track-head, .timeline-band { display: grid; grid-template-columns: var(--timeline-label) 1fr; }
.timeline-track-head { height: 34px; border-bottom: 1px solid var(--line); }
.timeline-corner, .timeline-room { position: sticky; left: 0; z-index: 2; background: var(--surface-pinned); }
.timeline-weeks { position: relative; height: 100%; }
.timeline-weeks span {
  position: absolute; top: 0; bottom: 0; padding: 10px 0 0 6px; font-size: 11px; color: var(--muted);
  border-left: 1px solid var(--line); white-space: nowrap;
}
.timeline-body { position: relative; }
.timeline-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); z-index: 1; }
.timeline-band { border-bottom: 1px solid var(--line); }
.timeline-band:last-child { border-bottom: 0; }
.timeline-room { margin: 0; padding: 12px; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; border-right: 1px solid var(--line); }
.timeline-lanes { display: flex; flex-direction: column; gap: 4px; min-height: 24px; padding: 10px 14px 10px 0; }
.timeline-lane { position: relative; height: 22px; }
.timeline-bar {
  position: absolute; top: 0; height: 22px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 24%, transparent);
  border: 1px solid var(--accent); color: var(--ink); font-size: 11px; line-height: 20px; padding: 0 6px; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; text-decoration: none; min-width: 6px;
}
.timeline-bar span { pointer-events: none; }
.timeline-blocked { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 28%, transparent); color: var(--ink); }
.timeline-at-risk { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 26%, transparent); color: var(--ink); }
.timeline-done { border-color: var(--success); background: color-mix(in srgb, var(--success) 24%, transparent); color: var(--ink); }
.timeline-flag {
  position: absolute; top: 3px; width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg);
  background: var(--warning); border: 1px solid var(--ink); border-radius: 2px;
}
.timeline-bar:focus-visible, .timeline-flag:focus-visible, .work-task:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 720px) {
  .work-row { grid-template-columns: 1fr auto; }
  .work-row .work-meta:first-of-type { grid-column: 1 / -1; }
  .work-due { text-align: left; }
  :root { --timeline-label: 112px; }
}

/* ---- Feedback after the v1 preview: a card says when other people's work waits on yours ---- */

.card-has-blocker { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.card-blocker {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--ink);
  font-size: 12px; font-weight: 700; line-height: 1.35;
}
.card-blocker-icon { flex: none; color: var(--danger); }

/* Feedback after the v1 preview: a save button that has saved shows a tick and Saved. */
.btn.is-saved,.btn.is-saved:disabled{opacity:1;cursor:default}
.btn.is-saved::before{content:"";display:inline-block;width:.55em;height:.28em;margin:0 .5em .18em 0;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg)}

.card-github { position: relative; z-index: 1; flex: none; }

.repository-request-status { position: relative; z-index: 1; overflow-wrap: anywhere; }
.repository-request-reason { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.repository-request-link { margin: 4px 0 0; font-size: 11px; }
.repository-request-link a { color: var(--accent); text-underline-offset: 2px; }
.repository-request-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.delivery-dialog { width: min(920px, calc(100vw - 32px)); }
.delivery-note, .delivery-freshness { color: var(--muted); font-size: 12px; line-height: 1.5; }
.delivery-project, .delivery-changes { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.delivery-project h3, .delivery-changes h3 { margin: 0 0 8px; font-size: 14px; }
.delivery-project-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.delivery-proposal fieldset, .delivery-link fieldset { display: grid; gap: 10px; margin: 12px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.delivery-proposal legend, .delivery-link legend { padding: 0 4px; font-weight: 600; }
.delivery-proposal button, .delivery-link button { justify-self: start; }
.delivery-change-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.delivery-change-list a, .delivery-project a { color: var(--accent); }
#delivery-status:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
