:root {
  color-scheme: light;
  --bg-top: #eef4fb;
  --bg-bottom: #f8fbff;
  --panel: rgba(246, 250, 255, 0.94);
  --surface: #ffffff;
  --surface-soft: #f3f7fc;
  --surface-muted: #ecf2f9;
  --border: rgba(29, 82, 131, 0.14);
  --border-strong: rgba(29, 82, 131, 0.22);
  --text: #14263d;
  --muted: #5d7088;
  --accent: #1f63c8;
  --accent-strong: #184f9d;
  --accent-soft: rgba(31, 99, 200, 0.1);
  --accent-2: #7e97b6;
  --success: #2e7a4b;
  --success-soft: rgba(46, 122, 75, 0.1);
  --danger: #b34b4b;
  --danger-soft: rgba(179, 75, 75, 0.09);
  --shadow: 0 20px 48px rgba(20, 38, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(112, 155, 205, 0.18), transparent 34%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

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

code {
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.page-shell {
  width: min(1760px, calc(100% - 2.5rem));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2.5rem 0;
}

.panel {
  width: min(1680px, 100%);
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.site-header {
  display: grid;
  gap: 1.2rem;
  margin: 0 0 2rem;
  padding: 0 0 1.85rem;
  border-bottom: 1px solid var(--border);
}

.site-header-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem 2rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.95rem;
  color: var(--text);
  text-decoration: none;
}

.brand-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(20, 38, 61, 0.08);
}

.brand-wordmark {
  display: grid;
  gap: 0.05rem;
  line-height: 1;
}

.brand-wordmark-line {
  display: block;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-wordmark-line:last-child {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.brand-product-line {
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
}

.site-nav a,
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.82rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  text-decoration: none;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.site-nav a.is-active,
.nav-button.is-active {
  background: var(--accent-soft);
  border-color: rgba(31, 99, 200, 0.24);
  color: var(--accent-strong);
}

.site-nav a:hover,
.nav-button:hover {
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.nav-logout-form {
  margin: 0;
}

.admin-header {
  display: grid;
  gap: 1.2rem;
  margin: 0 0 2rem;
  padding: 0 0 1.85rem;
  border-bottom: 1px solid var(--border);
}

.admin-header-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.2rem 2rem;
  align-items: flex-start;
}

.admin-header-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 750;
}

.admin-header-copy {
  margin: 0.35rem 0 0;
}

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: flex-end;
}

.workspace-header-copy {
  display: grid;
  gap: 0.7rem;
}

.workspace-header .brand-mark {
  margin-bottom: 0.1rem;
}

.session-meta {
  display: grid;
  gap: 0.28rem;
  min-width: 220px;
  padding: 0.95rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
}

.session-meta span,
.session-meta small {
  color: var(--muted);
}

.session-meta span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.session-meta strong {
  font-size: 1.06rem;
  line-height: 1.2;
}

.session-meta small {
  font-size: 0.9rem;
}

.org-switcher-form,
.org-switcher-static {
  display: grid;
  gap: 0.45rem;
  min-width: 280px;
}

.org-switcher-form label,
.org-switcher-static span {
  color: var(--muted);
  font-size: 0.9rem;
}

.org-switcher-form select {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.eyebrow {
  margin: 0 0 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--accent-2);
}

h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.4rem, 4.2vw, 3.45rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 1.1rem;
  font-size: 1.6rem;
  line-height: 1.15;
}

h3 {
  margin: 0 0 1rem;
  font-size: 1.22rem;
  line-height: 1.2;
}

p {
  margin: 0 0 1.1rem;
  line-height: 1.65;
}

.landing-grid,
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(420px, 0.92fr);
  gap: 2rem;
  align-items: stretch;
}

.landing-hero,
.auth-copy,
.landing-card,
.auth-panel {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(20, 38, 61, 0.05);
}

.landing-hero,
.auth-copy {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  min-height: 100%;
}

.auth-layout {
  align-items: center;
}

.auth-copy {
  min-height: 100%;
  padding: 2.25rem;
}

.auth-panel {
  align-self: center;
  padding: 2.25rem;
}

.hero-brand {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1.25rem;
}

.hero-brand-company {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-brand-product {
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
}

.landing-lead {
  font-size: 1.16rem;
  color: var(--muted);
  max-width: 44rem;
}

.landing-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.landing-list {
  margin-top: 1.25rem;
}

.notice {
  padding: 1rem 1.15rem;
  border: 1px solid rgba(46, 122, 75, 0.2);
  border-radius: 14px;
  background: var(--success-soft);
  color: var(--success);
}

.alert {
  padding: 1rem 1.15rem;
  border: 1px solid rgba(179, 75, 75, 0.2);
  border-radius: 14px;
  background: var(--danger-soft);
  color: var(--danger);
}

.compact-alert {
  margin: 0;
  padding: 0.85rem 0.95rem;
  font-size: 0.95rem;
}

.muted {
  color: var(--muted);
}

.compact-note,
.permission-note,
.action-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.98rem;
}

.action-note {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.75rem 1.05rem;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-muted);
}

.role-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.75rem;
}

.link-grid a {
  display: inline-flex;
  align-items: center;
  min-height: 3.25rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  background: var(--surface);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
}

.action-link {
  display: inline-flex;
  align-items: center;
  min-height: 3.25rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  background: var(--surface);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
}

.clipboard-button {
  width: auto;
}

.stack-form {
  display: grid;
  gap: 1.15rem;
  margin-top: 1.75rem;
}

.stack-form label {
  display: grid;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.98rem;
}

.stack-form input {
  width: 100%;
  min-height: 3.35rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.stack-form input[type="file"] {
  min-height: auto;
  padding: 0.85rem;
}

.stack-form select {
  width: 100%;
  min-height: 3.35rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.upload-progress {
  display: grid;
  gap: 0.55rem;
}

.upload-progress-bar {
  position: relative;
  width: 100%;
  height: 0.9rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(127, 151, 182, 0.16);
}

.upload-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #3b82da 100%);
  transition: width 140ms ease-out;
}

button {
  width: fit-content;
  min-height: 3.2rem;
  padding: 0.9rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(31, 99, 200, 0.16);
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:hover {
  background: var(--accent-strong);
  box-shadow: 0 12px 24px rgba(31, 99, 200, 0.2);
}

button:disabled {
  transform: none;
  box-shadow: none;
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: none;
}

.button-secondary:hover {
  background: var(--surface-soft);
}

.section-block {
  margin-top: 2.6rem;
}

.role-guard-card {
  padding: 1.55rem;
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  background: rgba(236, 242, 249, 0.72);
}

.organization-card-list {
  display: grid;
  gap: 1.25rem;
}

.organization-card {
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(20, 38, 61, 0.05);
}

.organization-card-header,
.organization-card-body {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.organization-card-body {
  margin-top: 1.25rem;
}

.table-wrap {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(20, 38, 61, 0.04);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 1.1rem 1.2rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 0.98rem;
}

.data-table thead th {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  background: rgba(236, 242, 249, 0.82);
  font-weight: 700;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-start;
}

.action-group form {
  margin: 0;
}

.action-group .button-secondary {
  margin-left: auto;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.inline-form-wrap {
  flex-wrap: wrap;
}

.text-input {
  width: min(20rem, 100%);
  min-height: 3.15rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.compact-form {
  margin-top: 1.2rem;
}

.action-row {
  margin-top: 1rem;
}

.sort-input {
  width: 6rem;
  max-width: 100%;
  min-height: 3rem;
  padding: 0.78rem 0.92rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
}

.code-block {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.detail-grid {
  display: grid;
  gap: 0.75rem;
}

.detail-grid-inline {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.detail-grid p {
  margin: 0;
}

.dashboard-intro {
  margin-bottom: 2.6rem;
}

.dashboard-subtitle {
  margin-bottom: 1rem;
  font-size: 1.18rem;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0 2.5rem;
}

.onboarding-panel {
  padding: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(20, 38, 61, 0.05);
}

.setup-sequence {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1.25rem;
}

.setup-step-card,
.decision-card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.setup-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.setup-step-card h3,
.decision-card h3 {
  margin-bottom: 0.65rem;
}

.setup-step-card p,
.decision-card p {
  margin-bottom: 0;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 1.25rem;
}

.decision-subtitle {
  margin: 0 0 0.65rem;
  color: var(--accent-strong);
  font-weight: 700;
}

.dashboard-card {
  display: grid;
  gap: 0.65rem;
  padding: 1.45rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 10px 24px rgba(20, 38, 61, 0.05);
}

.dashboard-card-title {
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--text);
}

.dashboard-card-copy {
  color: var(--muted);
  line-height: 1.5;
  font-size: 1rem;
}

.help-section {
  padding: 1.7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
}

.help-steps {
  display: grid;
  gap: 1.15rem;
}

.help-step,
.help-note {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.15rem;
}

.help-list {
  margin: 0;
  padding-left: 1.3rem;
  line-height: 1.8;
  font-size: 1rem;
}

.help-list li + li {
  margin-top: 0.35rem;
}

.help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.help-actions .action-note {
  width: fit-content;
  max-width: 100%;
}

.copy-block {
  margin-top: 1.2rem;
  padding: 1.2rem;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.copy-block code {
  display: block;
  width: 100%;
  border-radius: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-metadata {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.92rem/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
}

.deployment-url-block {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.deployment-url-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.deployment-url-input {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: 0.98rem/1.45 "Courier New", Courier, monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.copy-feedback {
  min-height: 1.2rem;
  font-size: 0.92rem;
  color: var(--success);
}

.screen-card-list {
  display: grid;
  gap: 1.2rem;
}

.screen-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(20, 38, 61, 0.05);
}

.screen-card summary {
  list-style: none;
}

.screen-card summary::-webkit-details-marker {
  display: none;
}

.screen-card-summary {
  display: grid;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.screen-card-summary:hover {
  background: rgba(236, 242, 249, 0.72);
}

.screen-card-summary:focus-visible {
  outline: 3px solid rgba(31, 99, 200, 0.24);
  outline-offset: 3px;
}

.screen-card[open] .screen-card-summary {
  border-bottom: 1px solid var(--border);
}

.screen-card-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.1rem;
}

.screen-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.screen-card-title {
  display: grid;
  gap: 0.28rem;
}

.screen-toggle-indicator {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.screen-toggle-indicator::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 140ms ease;
}

.screen-card[open] .screen-toggle-indicator::before {
  transform: rotate(135deg);
}

.screen-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.screen-summary-copy {
  color: var(--muted);
  font-size: 0.98rem;
}

.screen-toggle-state {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.screen-state-open {
  display: none;
}

.screen-card[open] .screen-state-open {
  display: inline;
}

.screen-card[open] .screen-state-closed {
  display: none;
}

.screen-card-body {
  display: grid;
  gap: 1.2rem;
  padding: 1.2rem 1.35rem 1.35rem;
}

.screen-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.2rem;
}

.screen-detail-panel {
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.screen-detail-panel h3 {
  margin: 0 0 0.9rem;
}

.screen-action-group {
  margin-top: 0;
}

.screen-danger-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.admin-panel {
  padding: 1.7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
}

.group-summary-panel {
  position: sticky;
  top: 0.75rem;
  z-index: 4;
  background: rgba(248, 251, 255, 0.96);
  backdrop-filter: blur(10px);
}

.group-summary-header {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.group-summary-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
}

.group-metric-card {
  display: grid;
  gap: 0.45rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.group-metric-card strong {
  font-size: 1.45rem;
}

.group-metric-label {
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-nav {
  position: sticky;
  top: 0.75rem;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.25rem 0 1.6rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.94);
  backdrop-filter: blur(10px);
}

.section-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 3.05rem;
  padding: 0.8rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.98rem;
  font-weight: 600;
}

.quick-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 0 0 1.8rem;
}

.button-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sync-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 380px) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.sync-workspace-sidebar {
  display: grid;
  gap: 1.2rem;
  align-self: start;
  position: sticky;
  top: 1.15rem;
  min-width: 0;
}

.sync-workspace-main {
  display: grid;
  gap: 1.2rem;
  min-width: 0;
}

.sync-sidebar-panel {
  display: grid;
  gap: 1rem;
}

.sync-sidebar-panel .group-summary-header {
  grid-template-columns: 1fr;
  gap: 1.15rem;
}

.sync-sidebar-panel .group-summary-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sync-sidebar-panel .group-metric-card:last-child {
  grid-column: 1 / -1;
}

.sync-sidebar-panel .group-metric-card,
.sync-sidebar-panel .workspace-screen-item,
.sync-sidebar-panel .slot-list-item {
  min-width: 0;
}

.sync-sidebar-panel .muted,
.sync-sidebar-panel .compact-note,
.sync-sidebar-panel .permission-note {
  max-width: 34ch;
  text-wrap: pretty;
}

.sidebar-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.workspace-screen-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workspace-screen-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
}

.workspace-screen-item-muted {
  grid-template-columns: 1fr;
}

.workspace-screen-copy {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.workspace-screen-copy p {
  margin: 0;
}

.orientation-summary-row,
.workspace-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.slot-list {
  display: grid;
  gap: 0.8rem;
}

.slot-list-item {
  position: relative;
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  color: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.slot-list-item:hover {
  border-color: rgba(31, 99, 200, 0.32);
  box-shadow: 0 10px 22px rgba(20, 38, 61, 0.08);
  transform: translateY(-1px);
}

.slot-list-item:focus-visible {
  outline: 3px solid rgba(31, 99, 200, 0.24);
  outline-offset: 3px;
}

.slot-list-item.is-selected {
  border-color: rgba(31, 99, 200, 0.52);
  box-shadow: 0 12px 26px rgba(20, 38, 61, 0.1);
  background: rgba(238, 245, 253, 0.98);
}

.slot-list-item.is-selected::before {
  content: "";
  position: absolute;
  top: 0.8rem;
  bottom: 0.8rem;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
}

.slot-list-item.is-selected:hover {
  border-color: rgba(31, 99, 200, 0.56);
  box-shadow: 0 12px 26px rgba(20, 38, 61, 0.1);
  transform: none;
}

.slot-list-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.slot-list-item-title {
  display: grid;
  gap: 0.25rem;
}

.slot-list-item-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.slot-list-item-title span {
  color: var(--muted);
  line-height: 1.35;
}

.slot-list-item.is-selected .slot-list-item-title strong {
  color: var(--accent-strong);
}

.slot-list-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.slot-list-editing-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: rgba(31, 99, 200, 0.12);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.coverage-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.15;
}

.coverage-chip-assigned {
  background: rgba(226, 238, 252, 0.96);
  color: var(--accent-strong);
}

.coverage-chip-default {
  background: rgba(229, 243, 237, 0.98);
  color: #1e6b48;
}

.coverage-chip-missing {
  background: rgba(252, 234, 237, 0.98);
  color: #a33b4c;
}

.coverage-chip-warning {
  background: rgba(253, 241, 220, 0.98);
  color: #8e6311;
}

.workspace-editor-panel {
  display: grid;
  gap: 1.25rem;
}

.workspace-editor-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.workspace-coverage-summary {
  display: grid;
  gap: 0.85rem;
}

.workspace-debug-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(236, 242, 249, 0.65);
}

.workspace-debug-card h3,
.workspace-editor-panel h3 {
  margin: 0 0 0.55rem;
}

.slot-grid {
  display: grid;
  gap: 1.2rem;
}

.playlist-builder-grid {
  display: grid;
  gap: 1.2rem;
}

.slot-create-card {
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(236, 242, 249, 0.7);
}

.slot-card {
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(20, 38, 61, 0.05);
}

.slot-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.1rem;
  margin-bottom: 1.2rem;
}

.slot-card-subtitle {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.slot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.slot-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.52rem 0.82rem;
  border-radius: 999px;
  background: rgba(236, 242, 249, 0.92);
  color: var(--text);
  font-size: 0.96rem;
}

.slot-pill-active {
  background: var(--success-soft);
  color: var(--success);
}

.slot-pill-inactive {
  background: var(--danger-soft);
  color: var(--danger);
}

.slot-summary {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

.slot-summary p {
  margin: 0;
}

.slot-summary-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.slot-toggle-state {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.slot-state-open {
  display: none;
}

.slot-details[open] .slot-state-open {
  display: inline;
}

.slot-details[open] .slot-state-closed {
  display: none;
}

.slot-list-helper {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.slot-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.slot-details {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(20, 38, 61, 0.05);
}

.slot-details summary {
  list-style: none;
}

.slot-details summary::-webkit-details-marker {
  display: none;
}

.slot-details-summary {
  display: grid;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.slot-details-summary:hover {
  background: rgba(236, 242, 249, 0.72);
}

.slot-details-summary:focus-visible {
  outline: 3px solid rgba(31, 99, 200, 0.24);
  outline-offset: 3px;
}

.slot-details-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.1rem;
}

.slot-details[open] .slot-details-summary {
  border-bottom: 1px solid var(--border);
}

.slot-details-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.slot-details-title {
  display: grid;
  gap: 0.28rem;
}

.slot-toggle-indicator {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.slot-toggle-indicator::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 140ms ease;
}

.slot-details[open] .slot-toggle-indicator::before {
  transform: rotate(135deg);
}

.slot-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.slot-details-body {
  display: grid;
  gap: 1.2rem;
  padding: 1.2rem 1.35rem 1.35rem;
}

.slot-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.2rem;
}

.slot-builder-panel {
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.slot-builder-panel h4 {
  margin: 0 0 0.95rem;
}

.slot-edit-form input[readonly] {
  background: rgba(236, 242, 249, 0.9);
  color: var(--muted);
}

.slot-orientation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.slot-orientation-card {
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(236, 242, 249, 0.76);
}

.slot-orientation-card h4 {
  margin: 0 0 0.95rem;
  text-transform: capitalize;
}

.slot-media-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1.2rem;
}

.slot-media-column {
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.slot-media-column h4 {
  margin: 0 0 0.95rem;
  font-size: 1.08rem;
}

.slot-media-column-available {
  background: rgba(236, 242, 249, 0.76);
}

.media-assignment-list {
  display: grid;
  gap: 0.95rem;
}

.media-assignment-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
}

.media-assignment-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  max-width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(243, 247, 252, 0.96);
  overflow: hidden;
}

.media-assignment-preview--landscape {
  aspect-ratio: 16 / 9;
}

.media-assignment-preview--portrait {
  width: 88px;
  aspect-ratio: 9 / 16;
}

.media-assignment-preview--square {
  width: 104px;
  aspect-ratio: 1 / 1;
}

.media-assignment-preview--auto {
  width: 116px;
  aspect-ratio: 4 / 3;
}

.media-assignment-preview .asset-preview {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  object-fit: contain;
}

.media-assignment-copy p {
  margin: 0;
}

.media-assignment-copy p + p {
  margin-top: 0.3rem;
}

.nested-block {
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.asset-preview {
  display: block;
  width: 176px;
  max-width: 100%;
  height: 104px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

@media (max-width: 1480px) {
  .sync-workspace {
    grid-template-columns: 1fr;
  }

  .sync-workspace-sidebar {
    position: static;
  }
}

@media (max-width: 1366px) {
  .action-group {
    flex-direction: column;
    align-items: stretch;
  }

  .action-group form,
  .action-group .action-link {
    width: 100%;
  }

  .action-group button,
  .action-group .action-link {
    width: 100%;
    justify-content: center;
  }

  .asset-preview {
    width: 152px;
    height: 92px;
  }

  .group-summary-header,
  .screen-card-grid,
  .slot-builder-grid,
  .slot-orientation-grid,
  .slot-media-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .page-shell {
    width: min(100%, calc(100% - 1rem));
    padding: 1rem 0;
  }

  .panel {
    padding: 1.5rem;
    border-radius: 20px;
  }

  .table-wrap {
    border: 0;
    background: transparent;
  }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table {
    border-collapse: separate;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 1.15rem;
  }

  .data-table tr {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    padding: 0.65rem 0;
    box-shadow: 0 8px 22px rgba(20, 38, 61, 0.06);
  }

  .data-table td {
    display: grid;
    grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    border-bottom: 1px solid rgba(29, 82, 131, 0.08);
  }

  .data-table td::before {
    content: attr(data-label);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
  }

  .data-table td > * {
    min-width: 0;
  }

  .data-table td[colspan] {
    display: block;
  }

  .data-table td[colspan]::before {
    content: none;
  }

  .data-table tbody tr td:last-child {
    border-bottom: 0;
  }

  .inline-form {
    align-items: stretch;
  }

  .text-input,
  .sort-input {
    width: 100%;
  }

  .asset-preview {
    width: min(240px, 100%);
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .section-nav,
  .quick-actions-bar {
    position: static;
  }

  .slot-card,
  .screen-card-summary,
  .screen-card-body,
  .screen-detail-panel,
  .slot-create-card,
  .slot-details-summary,
  .slot-details-body,
  .slot-builder-panel,
  .slot-orientation-card,
  .slot-media-column,
  .media-assignment-card,
  .admin-panel,
  .onboarding-panel,
  .setup-step-card,
  .decision-card {
    padding: 1.1rem;
  }

  .media-assignment-card {
    grid-template-columns: 1fr;
  }

  .media-assignment-preview--portrait {
    width: min(120px, 100%);
  }

  .media-assignment-preview--landscape,
  .media-assignment-preview--square,
  .media-assignment-preview--auto {
    width: min(220px, 100%);
  }

  .media-assignment-preview .asset-preview {
    width: 100%;
    height: 100%;
  }

  .landing-grid,
  .auth-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .site-header-main,
  .admin-header-main,
  .admin-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .site-nav {
    width: 100%;
    gap: 0.7rem;
  }

  .site-nav a,
  .nav-button {
    min-height: 2.9rem;
    padding: 0.72rem 0.98rem;
    font-size: 0.98rem;
  }

  .org-switcher-form,
  .org-switcher-static {
    min-width: 0;
    width: 100%;
  }

  .brand-monogram {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 0.82rem;
  }

  .brand-wordmark-line {
    font-size: 0.98rem;
  }

  .brand-wordmark-line:last-child {
    font-size: 0.84rem;
  }

  .session-meta {
    min-width: 0;
    width: 100%;
  }

  .landing-hero,
  .auth-copy,
  .landing-card,
  .auth-panel {
    padding: 1.5rem;
  }

  .workspace-screen-item {
    grid-template-columns: 1fr;
  }

  .slot-list-item-main,
  .workspace-editor-header {
    flex-direction: column;
  }
}
