/* 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-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-actions { display: flex; 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;
  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:not(.card-locked) { 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); }

/* Locked card */

.card-locked { opacity: .55; }

.card-lock-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.card-lock-note svg { flex: none; color: var(--muted); }

/* ---- 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); }

.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-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-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-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-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; }
}

/* Follow the device theme while keeping the established dark palette intact. */
@media (prefers-color-scheme: light) {
  :root {
    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;
  }

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