@layer legacy {
* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sandbox-chrome {
  position: sticky;
  top: 0;
  z-index: 20;
}

.sandbox-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--danger-text);
  font-size: var(--text-sm);
  line-height: 1.45;
  text-align: center;
}

.sandbox-banner strong {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.sandbox-banner-detail {
  font-weight: 600;
}

.sandbox-chrome .topbar,
.sandbox-chrome .public-topbar {
  position: relative;
  top: auto;
}

@media (max-width: 480px) {
  .sandbox-banner {
    gap: var(--space-1) var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }
}

@media print {
  .sandbox-chrome { position: static; }
  .sandbox-banner { border: 2px solid var(--border); }
}

.public-topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 clamp(var(--space-4), 4vw, var(--space-7));
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  padding: var(--space-1);
}

.public-brand {
  flex: 0 0 auto;
}

.public-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.public-nav-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.public-nav-links a:hover {
  background: var(--surface);
  color: var(--text);
}

.login-logo {
  width: 82px;
  height: 82px;
  display: block;
  object-fit: contain;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--text);
  padding: var(--space-2);
  box-shadow: var(--shadow-sm);
}

.nav-links,
.account-menu {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-links a {
  padding: var(--space-2) var(--space-2);
  color: var(--text);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
}

.nav-links a:hover {
  background: var(--surface);
  color: var(--text);
}

.account-menu {
  color: var(--text);
  font-size: var(--text-md);
}

.page {
  width: min(var(--page-max, 1680px), calc(100% - clamp(24px, 4vw, 72px)));
  margin: 0 auto;
  padding: var(--space-6) 0 64px;
}

.narrow-page {
  --page-max: 780px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  backdrop-filter: blur(8px);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: var(--text-2xl);
  line-height: 1;
  color: var(--text);
}

.page-heading h1 {
  color: var(--text);
}

.page-heading p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--text);
}

.page-heading .request-id-subtitle {
  margin-top: var(--space-2);
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 700;
}

h2 {
  color: var(--text);
  font-size: var(--text-lg);
}

.eyebrow {
  margin-bottom: var(--space-2);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.panel,
.metric-card,
.login-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.panel {
  padding: var(--space-5);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.metric-card {
  min-height: 180px;
  padding: var(--space-5);
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.metric-card strong {
  font-size: var(--text-2xl);
  line-height: 1;
  color: var(--text);
}

.metric-label {
  color: var(--muted);
  font-weight: 700;
}

.mini-list {
  display: grid;
  gap: var(--space-1);
  color: var(--muted);
  font-size: var(--text-sm);
}

.dashboard-kpis {
  margin-bottom: var(--space-4);
}

.dashboard-page {
  --page-max: 1840px;
}

.four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-hero {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.dashboard-hero-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.dashboard-hero-logo {
  width: min(330px, 100%);
  height: auto;
  display: block;
}

.dashboard-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.dashboard-hero-kicker::before {
  content: "";
  width: 42px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-soft), var(--danger));
}

.dashboard-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: var(--text-2xl);
  line-height: 1;
}

.dashboard-hero p {
  max-width: 920px;
  margin: 0;
  color: var(--text);
  font-size: var(--text-md);
  line-height: 1.55;
}

.dashboard-hero-notice {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--danger);
  color: var(--text);
  font-weight: 700;
}

.dashboard-hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.dashboard-status {
  color: var(--text);
  font-weight: 700;
}

.dashboard-page .panel,
.dashboard-page .metric-card {
  border-color: var(--accent-text);
  background: var(--accent-soft);
  color: var(--text);
}

.dashboard-page h2,
.dashboard-page h3,
.dashboard-page .metric-card strong {
  color: var(--text);
}

.dashboard-page .metric-label,
.dashboard-page .muted,
.dashboard-page .dashboard-control-row,
.dashboard-page .pagination-row,
.dashboard-page th {
  color: var(--text);
}

.dashboard-page td {
  color: var(--text);
}

.dashboard-page .record-link {
  color: var(--accent-text);
}

.dashboard-page .status-pill {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.dashboard-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  backdrop-filter: blur(8px);
}

.dashboard-tabs a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.dashboard-tabs a.active,
.dashboard-tabs a:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.dashboard-control-row,
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-3) 0;
  color: var(--muted);
  font-weight: 700;
}

.dashboard-filter-form {
  display: flex;
  align-items: end;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.dashboard-filter-form label {
  min-width: 160px;
}

.dashboard-filter-form input,
.dashboard-filter-form select {
  min-height: 38px;
  padding: var(--space-2) var(--space-2);
}

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

.pagination-row .surface-button,
.pagination-row .disabled-button,
.panel .surface-button {
  background: var(--accent-soft);
  color: var(--text);
}

.dashboard-page .pagination-row .surface-button,
.dashboard-page .pagination-row .disabled-button,
.dashboard-page .surface-button {
  background: var(--surface);
  color: var(--text);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: var(--space-4);
  align-items: start;
}

.dashboard-stack,
.summary-list {
  display: grid;
}

.dashboard-stack {
  gap: var(--space-4);
}

.summary-list {
  gap: 0;
}

.summary-item {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.summary-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.summary-item:last-child {
  padding-bottom: 0;
}

.production-queue-panel,
.queue-group-list {
  display: grid;
  gap: var(--space-3);
}

.queue-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.dashboard-page .queue-group,
.dashboard-page .production-master {
  border-color: var(--text);
  background: var(--surface);
}

.queue-group summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  min-height: 54px;
  padding: var(--space-3) var(--space-3);
  cursor: pointer;
  list-style: none;
}

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

.queue-group summary::before {
  content: "+";
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
}

.dashboard-page .queue-group summary::before {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.queue-group[open] summary::before {
  content: "-";
}

.queue-task-list {
  display: grid;
  border-top: 1px solid var(--border);
}

.dashboard-page .queue-task-list,
.dashboard-page .queue-task-row,
.dashboard-page .summary-item {
  border-color: var(--text);
}

.queue-task-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 90px auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-3);
  border-top: 1px solid var(--border);
}

.queue-task-row:first-child {
  border-top: 0;
}

.queue-task-row strong,
.queue-task-row .muted {
  display: block;
}

.production-master-list {
  display: grid;
  gap: var(--space-3);
}

.production-master {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.production-master-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-3);
  align-items: start;
}

.production-master-heading h3 {
  margin: 0 0 var(--space-1);
  color: var(--text);
  font-size: var(--text-md);
}

.dashboard-page .production-master-heading h3,
.dashboard-page .production-master-heading p,
.dashboard-page .production-master-meta {
  color: var(--text);
}

.production-master-heading p,
.production-master-meta {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.production-master .queue-group {
  background: var(--surface);
}

.dashboard-page .production-master .queue-group {
  background: var(--surface);
}

.production-master .queue-group summary {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.completed-panel {
  display: grid;
  gap: var(--space-4);
}

.completed-summary,
.sort-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.completed-summary span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 32px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
}

.sort-links span {
  color: var(--muted);
  font-weight: 700;
}

.sort-links a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
}

.sort-links a.active,
.sort-links a:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.dashboard-lookup-panel {
  display: grid;
  gap: var(--space-3);
}

.lookup-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: var(--space-3);
  align-items: end;
}

.split-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-4);
  align-items: start;
}

.settings-main,
.settings-side,
.settings-section {
  display: grid;
  gap: var(--space-4);
}

.settings-side {
  position: sticky;
  top: 84px;
}

.settings-panel {
  display: grid;
  gap: var(--space-4);
}

.panel-heading,
.settings-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.panel-heading h2,
.settings-section-heading h2 {
  margin-bottom: 0;
}

.settings-section-heading h2 {
  color: var(--text);
}

.role-reference-list {
  display: grid;
  gap: 0;
}

.role-reference-item {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.role-reference-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.role-reference-item:last-child {
  padding-bottom: 0;
}

.role-reference-item div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.role-reference-item strong {
  color: var(--text);
}

.role-reference-item code {
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 700;
}

.role-reference-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.user-directory-panel {
  display: grid;
  gap: var(--space-4);
}

.user-list {
  display: grid;
  gap: 0;
}

.user-list-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(190px, 0.9fr) minmax(170px, 0.7fr) auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
}

.user-list-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.user-list-row:last-child {
  padding-bottom: 0;
}

.user-list-profile {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  min-width: 0;
}

.user-list-profile h3 {
  margin: 0 0 var(--space-1);
  color: var(--text);
  font-size: var(--text-md);
}

.user-list-profile a {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
}

.user-avatar {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
}

.user-list-roles {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.user-list-roles span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 700;
}

.user-list-meta {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
}

.user-list-meta strong {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-list-meta span:not(.status-pill) {
  color: var(--text);
  font-weight: 700;
}

.user-role-form {
  display: grid;
  gap: var(--space-3);
}

.role-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
}

.role-toggle {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
}

.role-toggle:has(input:checked) {
  border-color: var(--accent-text);
  background: var(--accent-soft);
}

.role-toggle input {
  width: auto;
  flex: 0 0 auto;
}

.role-toggle span {
  min-width: 0;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.user-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
  color: var(--text);
}

.modal-dialog {
  z-index: 1000;
  width: min(680px, calc(100% - 32px));
  max-height: min(820px, calc(100vh - 48px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-dialog.action-dialog {
  width: min(560px, calc(100% - 32px));
}

.modal-dialog::backdrop {
  background: var(--accent-soft);
  backdrop-filter: blur(6px);
}

body:has(.modal-dialog[open]) {
  overflow: hidden;
}

.modal-card {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.modal-heading,
.modal-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.modal-heading h2 {
  margin-bottom: var(--space-1);
}

.modal-heading p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.modal-heading .modal-close-button,
.modal-actions .reset-button {
  background: var(--surface-soft);
  color: var(--text);
}

.modal-actions {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.form-stack {
  display: grid;
  gap: var(--space-4);
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

label,
fieldset {
  display: grid;
  gap: var(--space-2);
}

label span,
legend {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 700;
}

fieldset {
  padding: 0;
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-field);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  padding: var(--space-3) var(--space-3);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.button,
.small-button,
.ghost-button,
.sso-button {
  appearance: none;
  border: 0;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-4);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}

.button:hover {
  background: var(--accent);
}

.button:disabled,
.small-button:disabled,
.ghost-button:disabled {
  cursor: wait;
  opacity: 0.68;
  box-shadow: none;
}

.small-button {
  padding: var(--space-2) var(--space-2);
  background: var(--text);
  color: var(--on-accent);
}

.inline-action-form {
  display: inline-flex;
  margin: 0;
}

.ghost-button {
  padding: var(--space-2) var(--space-2);
  background: var(--surface);
  color: var(--text);
}

.ghost-button:hover {
  background: var(--surface);
  color: var(--text);
}

.full-width {
  width: 100%;
}

.sso-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.sso-button:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.google-mark {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 700;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.table-panel {
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 700;
}

.mono {
  font-family: var(--font-sans);
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}

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

.record-link {
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: none;
}

.record-link:hover {
  text-decoration: underline;
}

.detail-heading {
  align-items: flex-end;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: var(--space-4);
  align-items: start;
}

.detail-main,
.detail-side,
.activity-list,
.detail-list {
  display: grid;
  gap: var(--space-4);
}

.detail-side {
  position: sticky;
  top: 84px;
}

.detail-card {
  display: grid;
  gap: var(--space-4);
}

.detail-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.detail-card h2,
.detail-card h3 {
  margin-bottom: 0;
}

.detail-card h3 {
  color: var(--text);
  font-size: var(--text-md);
}

.key-value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
}

.key-value-grid div {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.key-value-grid dt {
  margin-bottom: var(--space-1);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.key-value-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-weight: 600;
}

.long-text {
  display: grid;
  gap: var(--space-2);
}

.long-text p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.detail-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.service-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.preserve-lines {
  white-space: pre-wrap;
}

.link-list,
.detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list {
  display: grid;
  gap: var(--space-2);
}

.link-list li,
.detail-list li,
.activity-item {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow-wrap: anywhere;
}

.completion-note {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-2);
  border-left: 3px solid var(--brand-green);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.activity-detail-grid {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
}

.activity-detail-grid div {
  display: grid;
  gap: var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.activity-detail-grid dt,
.activity-detail-grid dd {
  margin: 0;
}

.activity-detail-grid dt {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.activity-detail-grid dd {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.link-list a,
.key-value-grid a {
  color: var(--accent-text);
  font-weight: 700;
}

.detail-empty {
  padding: var(--space-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.calendar-check-panel {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.calendar-check-panel[hidden] {
  display: none;
}

.calendar-check-panel[data-level="ok"] {
  border-color: var(--accent-text);
  background: var(--accent-soft);
}

.calendar-check-panel[data-level="warn"] {
  border-color: var(--warning-text);
  background: var(--danger);
}

.calendar-check-panel[data-level="error"] {
  border-color: var(--danger-text);
  background: var(--danger);
}

.calendar-check-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.calendar-check-panel p {
  margin: 0;
  color: var(--muted);
}

.calendar-conflict-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.calendar-conflict-list li {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.calendar-conflict-list span {
  color: var(--muted);
  font-size: var(--text-sm);
}

body.request-portal-body {
  position: relative;
  background: var(--accent-soft);
  color: var(--muted);
  font-family: var(--font-sans);
}

.request-page {
  width: 100%;
  max-width: none;
  padding: var(--space-6) clamp(var(--space-4), 3vw, var(--space-7)) 56px;
}

.request-hero {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.request-hero-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.request-hero-logo {
  width: min(340px, 100%);
  height: auto;
  display: block;
}

.request-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.request-hero-kicker::before {
  content: "";
  width: 42px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-soft), var(--danger));
}

.request-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: var(--text-2xl);
  line-height: 1.02;
}

.request-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: var(--text-md);
  line-height: 1.6;
}

.request-shell {
  display: grid;
  gap: var(--space-5);
  align-items: start;
  width: min(100%, clamp(960px, 86vw, 1320px));
  margin-inline: auto;
}

.request-hero {
  width: min(100%, clamp(960px, 86vw, 1320px));
  margin-inline: auto;
}

.workflow-panel,
.request-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.workflow-panel {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
}

.workflow-panel h2 {
  margin: 0 0 var(--space-1);
  color: var(--muted);
  font-size: var(--text-md);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workflow-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.workflow-chip {
  display: grid;
  gap: var(--space-2);
  min-height: 116px;
  align-content: start;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, var(--accent-soft), var(--accent-soft));
  box-shadow: var(--shadow-sm);
}

.workflow-chip strong {
  color: var(--muted);
  font-size: var(--text-md);
}

.workflow-chip span {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.request-panel {
  padding: clamp(var(--space-5), 2.2vw, var(--space-6));
  overflow: visible;
}

.custom-request-fields {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.portal-content-page {
  min-height: calc(100vh - 64px);
}

.portal-content-panel {
  width: min(980px, 100%);
  margin: 0 auto;
  line-height: 1.65;
}

.portal-content-panel p {
  margin: 0 0 var(--space-4);
}

.thank-you-hero {
  margin-inline: auto;
}

.thank-you-panel {
  width: min(680px, 100%);
  display: grid;
  gap: var(--space-2);
  margin: 0 auto;
  text-align: center;
}

.thank-you-panel .eyebrow {
  margin: 0;
}

.thank-you-id {
  display: block;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1;
  letter-spacing: 0;
}

.thank-you-panel .form-actions {
  justify-content: center;
}

.portal-form {
  display: grid;
}

.form-section {
  display: none;
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.form-section.visible {
  display: grid;
}

.form-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.section-heading {
  display: grid;
  gap: var(--space-1);
  margin-bottom: calc(-1 * var(--space-1));
}

.section-heading h2 {
  margin-bottom: 0;
  color: var(--muted);
  font-size: var(--text-lg);
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.request-page .grid-two {
  gap: var(--space-4);
}

.request-overview-primary-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}

.request-page label {
  gap: var(--space-2);
}

.request-page label span {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.field-hint {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.request-page input,
.request-page select,
.request-page textarea {
  border: 1px solid var(--border-field);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  padding: var(--space-3) var(--space-3);
}

.request-priority-attachment-grid {
  align-items: start;
}

.request-priority-attachment-grid label {
  align-self: stretch;
  grid-template-rows: auto minmax(48px, auto) minmax(0, auto);
}

.request-priority-attachment-grid select,
.request-priority-attachment-grid input[type="file"] {
  min-height: 48px;
}

.request-priority-attachment-grid input[type="file"] {
  padding: var(--space-2) var(--space-2);
  color: var(--muted);
}

.request-priority-attachment-grid input[type="file"]::file-selector-button {
  min-height: 30px;
  margin-right: var(--space-2);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--on-accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.attachment-dropzone {
  display: grid;
  gap: var(--space-2);
  min-height: 118px;
  padding: var(--space-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.attachment-dropzone.drag-active {
  border-color: var(--accent-text);
  background: var(--accent-soft);
}

.attachment-dropzone-copy {
  display: grid;
  gap: var(--space-1);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.attachment-dropzone-copy strong {
  color: var(--muted);
  font-size: var(--text-sm);
}

.attachment-file-list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.attachment-file-list li {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 600;
}

.attachment-file-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.attachment-file-list button {
  border: 0;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--on-accent);
  padding: var(--space-1) var(--space-2);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
}

.attachment-file-empty {
  color: var(--muted);
}

.attachment-error {
  margin: var(--space-2) 0 0;
  color: var(--danger-text);
  font-size: var(--text-sm);
  font-weight: 700;
}

.request-submit-error {
  margin: 0 0 var(--space-3);
}

.request-compact-field::after {
  content: "";
  min-height: calc(0.84rem * 1.35);
}

.request-page input:focus,
.request-page select:focus,
.request-page textarea:focus {
  border-color: var(--accent-text);
  box-shadow: var(--shadow-sm);
}

.request-page textarea {
  min-height: 110px;
}

.request-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

.request-check-grid .check-row {
  min-height: 42px;
  justify-content: flex-start;
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.service-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.service-card {
  display: none;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.service-card.visible {
  display: grid;
}

.service-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding: 0;
}

.request-page .button,
.request-page .reset-button {
  min-height: 52px;
  border-radius: var(--radius-lg);
  padding: 0 var(--space-5);
  font-weight: 700;
}

.request-page .button {
  background: var(--accent);
  box-shadow: var(--shadow-sm);
}

.request-page .button:hover {
  background: var(--accent);
}

.request-page .reset-button {
  background: var(--surface-soft);
  color: var(--on-accent);
}

@media (max-width: 1180px) {
  .request-overview-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-5);
}

.login-panel {
  width: min(420px, 100%);
  padding: var(--space-5);
  display: grid;
  gap: var(--space-5);
}

.flash-stack {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.flash {
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  font-weight: 600;
}

.flash-success {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.flash-error {
  background: var(--danger);
  color: var(--danger);
}

.flash-info {
  background: var(--accent-soft);
  color: var(--text);
}

.check-grid,
.inline-role-form {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.check-row,
.inline-role-form label {
  display: inline-flex;
  align-items: center;
  width: auto;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.check-row input,
.inline-role-form input {
  width: auto;
}

.ops-shell {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.ops-rail {
  position: sticky;
  top: 84px;
  z-index: 80;
  display: grid;
  gap: var(--space-2);
  grid-auto-rows: max-content;
  align-content: start;
  min-height: 420px;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--warning-soft), var(--accent-soft));
  box-shadow: var(--shadow-sm);
  overflow: visible;
}

.ops-rail a {
  position: relative;
  z-index: 1;
  width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.ops-rail a.active,
.ops-rail a:hover {
  background: var(--danger);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}

.ops-rail a::after,
.settings-console-rail a::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 999;
  min-width: max-content;
  max-width: 180px;
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--warning-soft);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.ops-rail a:hover::after,
.ops-rail a:focus-visible::after,
.settings-console-rail a:hover::after,
.settings-console-rail a:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.ops-rail::after,
.settings-console-rail::after {
  content: "";
  align-self: end;
  justify-self: center;
  width: 28px;
  height: 34px;
  margin-top: auto;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, var(--warning-soft), var(--warning-soft));
  box-shadow: var(--shadow-sm);
}

.ops-main {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.ops-command {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--accent-soft), var(--danger));
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.ops-command-brand {
  display: grid;
  grid-template-columns: minmax(180px, 290px) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
}

.ops-command-brand img {
  width: 100%;
  max-width: 290px;
  height: auto;
  display: block;
}

.ops-command h1,
.ops-card h2,
.ops-card h3 {
  color: var(--text);
}

.ops-command h1 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-2xl);
  line-height: 0.96;
}

.ops-command p:not(.eyebrow),
.ops-card .muted,
.ops-card .summary-item,
.ops-card td,
.ops-card th {
  color: var(--text);
}

.ops-command-meta {
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.ops-palette {
  display: flex;
  gap: var(--space-2);
}

.ops-palette span {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.ops-palette span:nth-child(1) { background: var(--danger); }
.ops-palette span:nth-child(2) { background: var(--warning-soft); }
.ops-palette span:nth-child(3) { background: var(--danger); }
.ops-palette span:nth-child(4) { background: var(--surface-soft); }

.ops-big-stat {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.ops-big-stat span,
.ops-metric-card span {
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ops-big-stat strong {
  color: var(--text);
  font-size: var(--text-2xl);
  line-height: 0.95;
}

.ops-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.ops-signal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--danger);
  color: var(--text);
  font-weight: 700;
}

.ops-signal-row strong {
  color: var(--text);
}

.ops-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.ops-metric-card,
.ops-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.ops-metric-card {
  min-height: 118px;
  display: grid;
  gap: var(--space-2);
  align-content: center;
  padding: var(--space-4);
}

.ops-metric-card strong {
  color: var(--text);
  font-size: var(--text-2xl);
  line-height: 1;
}

.ops-metric-card.hero-metric {
  background: linear-gradient(135deg, var(--danger), var(--warning-soft));
}

.ops-card {
  padding: var(--space-4);
  overflow: hidden;
}

.ops-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.ops-card-heading h2,
.ops-card h2 {
  margin: 0;
}

.ops-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: var(--space-4);
  align-items: start;
}

.ops-left-stack,
.ops-side-stack {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

.ops-side-stack {
  position: sticky;
  top: 84px;
}

.ops-card table {
  min-width: 760px;
}

.ops-card th {
  border-color: var(--text);
}

.ops-card td {
  border-color: var(--text);
}

.ops-card .record-link {
  color: var(--accent-text);
}

.ops-card .status-pill,
.ops-metric-card .status-pill {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.ops-card .dashboard-filter-form label span {
  color: var(--text);
}

.ops-card .dashboard-filter-form input,
.ops-card .dashboard-filter-form select {
  border-color: var(--text);
  background: var(--surface);
  color: var(--muted);
}

.ops-card .pagination-row {
  color: var(--text);
}

.ops-card .pagination-row .surface-button,
.ops-card .pagination-row .disabled-button,
.ops-card .surface-button {
  background: var(--surface);
  color: var(--text);
}

.ops-card .production-master,
.ops-card .queue-group {
  border-color: var(--text);
  background: var(--surface);
}

.ops-card .queue-task-row,
.ops-card .queue-task-list,
.ops-card .summary-item {
  border-color: var(--text);
}

.settings-console-page {
  --page-max: 1840px;
}

.settings-console-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.settings-console-hero h1 {
  margin: 0 0 var(--space-2);
  color: var(--text);
  font-size: var(--text-2xl);
}

.settings-console-hero p:not(.eyebrow) {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--text);
  line-height: 1.55;
}

.settings-console-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.settings-console-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(330px, 390px);
  gap: var(--space-4);
  align-items: start;
}

.settings-console-layout.section-page-layout {
  grid-template-columns: 68px minmax(0, 1fr);
  overflow: visible;
}

.settings-console-rail,
.settings-console-side {
  position: sticky;
  top: 84px;
}

.settings-console-rail {
  z-index: 80;
  display: grid;
  gap: var(--space-2);
  grid-auto-rows: max-content;
  align-content: start;
  min-height: 520px;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--warning-soft), var(--accent-soft));
  box-shadow: var(--shadow-sm);
  overflow: visible;
}

.settings-console-rail a {
  position: relative;
  z-index: 1;
  width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.settings-console-rail a:hover,
.settings-console-rail a.active {
  background: var(--danger);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}

.settings-console-rail a.active span {
  color: var(--on-accent);
}

.settings-console-rail span {
  display: inline-grid;
  width: 100%;
  min-height: 42px;
  place-items: center;
  border-radius: var(--radius-lg);
  color: currentColor;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.settings-console-rail strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.settings-console-main,
.settings-console-side,
.template-editor-list,
.automation-list {
  display: grid;
  gap: var(--space-4);
}

.settings-section-overview {
  background: var(--surface);
}

.settings-actions-row,
.settings-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.settings-editor-section {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.settings-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.settings-section-title h2 {
  margin: 0;
  color: var(--text);
}

.settings-field-grid {
  display: grid;
  gap: var(--space-3);
}

.settings-field-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-editor-section label span,
.settings-editor-section legend {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.settings-editor-section textarea {
  min-height: 96px;
}

.template-editor {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.settings-list-grid,
.settings-card-form {
  display: grid;
  gap: var(--space-4);
}

.settings-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  min-height: 116px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.settings-list-row-main {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  min-height: 116px;
}

.settings-row-icon {
  align-self: stretch;
  display: grid;
  place-items: center;
  min-height: 116px;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(circle, var(--accent-soft) 1px, transparent 1px) 0 0 / 12px 12px,
    var(--surface-soft);
  color: var(--accent-text);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.settings-row-copy {
  min-width: 0;
  padding-block: var(--space-4);
}

.settings-list-row h3 {
  margin: var(--space-1) 0 var(--space-1);
  color: var(--text);
  font-size: var(--text-md);
}

.settings-list-row p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.settings-list-row .settings-row-actions {
  padding: var(--space-4);
}

.settings-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.settings-detail-item {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.settings-detail-item.wide {
  grid-column: 1 / -1;
}

.settings-detail-item span {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-detail-item pre {
  overflow: auto;
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.settings-field-map,
.settings-reference-panel {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.settings-field-map-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px minmax(180px, 1fr) 100px;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-sm);
}

.settings-field-map-row strong {
  color: var(--text);
}

.settings-inline-form,
.settings-card-actions,
.settings-test-form {
  display: flex;
  gap: var(--space-2);
  align-items: end;
  flex-wrap: wrap;
}

.settings-inline-form label,
.settings-test-form input {
  flex: 1 1 240px;
}

.settings-card-actions {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.template-workbench,
.template-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: var(--space-4);
  align-items: start;
}

.template-detail-stack {
  display: grid;
  gap: var(--space-3);
}

.template-token-panel,
.template-preview-card,
.template-preview-side {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.template-token-grid {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.template-token-grid span {
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

.template-preview-card {
  background: linear-gradient(180deg, var(--surface), var(--bg));
}

.template-preview-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.template-preview-card-header img {
  max-width: 150px;
  max-height: 46px;
  object-fit: contain;
}

.template-preview-card-header span {
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.template-preview-card h3,
.template-preview-side h3 {
  margin: 0;
  color: var(--text);
  font-size: var(--text-lg);
  line-height: 1.25;
}

.template-preview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.template-preview-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.template-preview-meta span {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: var(--text-sm);
}

.template-preview-meta strong {
  color: var(--text);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-save-button {
  justify-self: start;
}

.danger-button {
  background: var(--danger);
  color: var(--white);
}

.warning-button {
  background: var(--danger);
  color: var(--on-accent);
}

.status-pill.subtle {
  background: var(--accent-soft);
  color: var(--muted);
}

.settings-preview-frame {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.settings-preview-text {
  overflow-x: auto;
  overflow-y: visible;
  margin: 0;
  max-height: none;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.5;
  white-space: pre-wrap;
}

.template-editor h3 {
  margin: 0;
  color: var(--text);
  font-size: var(--text-md);
}

.automation-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.automation-row.compact {
  padding: var(--space-2);
}

.automation-row input {
  width: 18px;
  margin-top: var(--space-1);
}

.automation-row span {
  display: grid;
  gap: var(--space-1);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.automation-row strong {
  color: var(--text);
  font-size: var(--text-sm);
}

.settings-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.settings-status-grid span {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.settings-status-grid strong {
  color: var(--text);
  font-size: var(--text-sm);
  text-transform: none;
}

.settings-legacy-routing {
  display: grid;
  gap: var(--space-3);
}

.settings-legacy-routing summary {
  cursor: pointer;
  color: var(--accent-text);
  font-weight: 700;
}

.settings-legacy-routing[open] {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
}

.settings-save-panel {
  background: var(--accent-soft);
  color: var(--text);
}

.settings-save-panel h2 {
  color: var(--text);
}

.settings-save-panel .muted {
  color: var(--text);
}

.task-assignee-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  min-width: 260px;
}

.task-assignee-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border-field);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-2);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
}

.service-assignee-form {
  width: 100%;
  min-width: 0;
}

.service-notes-block {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  line-height: 1.45;
}

.service-notes-block > strong {
  color: var(--muted);
  font-size: var(--text-sm);
}

.status-lookup-panel {
  max-width: 960px;
  margin-inline: auto;
}

.status-lookup-form {
  gap: var(--space-5);
}

.reports-page .ops-command {
  align-items: flex-start;
}

.reports-filter-form {
  align-self: stretch;
  justify-content: flex-end;
}

.report-bucket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* Unified application navigation */
.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 68px;
}

.portal-nav-shell {
  min-width: 0;
}

.portal-nav-toggle {
  display: none;
}

.portal-nav-shell > .nav-links {
  display: flex;
  justify-content: center;
  gap: var(--space-1);
}

.nav-links > a,
.nav-dropdown > summary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 700;
  list-style: none;
  text-decoration: none;
  white-space: nowrap;
}

.nav-dropdown > summary::-webkit-details-marker,
.portal-nav-toggle::-webkit-details-marker {
  display: none;
}

.nav-links > a:hover,
.nav-links > a.active,
.nav-dropdown > summary:hover,
.nav-dropdown.active > summary,
.nav-dropdown[open] > summary {
  background: var(--surface);
  color: var(--on-accent);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 120;
  min-width: 190px;
  display: grid;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  box-shadow: var(--shadow-md);
}

.nav-dropdown:not([open]) > .nav-dropdown-menu {
  display: none;
}

.nav-dropdown-menu-right {
  right: 0;
  left: auto;
}

.nav-dropdown-menu a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
}

.nav-dropdown-menu a:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.account-menu {
  justify-self: end;
  gap: var(--space-2);
  white-space: nowrap;
}

/* Dashboard, reporting, and accounting */
.ops-metric-card {
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease, background-color 140ms ease;
}

a.ops-metric-card:hover,
.ops-metric-card.active-metric {
  border-color: var(--on-accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.report-queue-metrics {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.report-queue-metrics .ops-metric-card {
  min-height: 104px;
  padding: var(--space-4);
}

.report-queue-metrics .ops-metric-card strong {
  font-size: var(--text-2xl);
}

.report-queue-metrics .risk-metric {
  border-color: var(--danger-text);
}

.report-queue-metrics .tentative-metric {
  border-color: var(--text);
}

.reports-command {
  align-items: center;
}

.report-filter-panel {
  overflow: visible;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: var(--space-3);
  align-items: end;
}

.report-filter-grid label {
  min-width: 0;
}

.report-filter-grid label > span {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.request-filter-panel .report-filter-grid label > span {
  color: var(--muted);
}

.report-filter-grid input,
.report-filter-grid select {
  width: 100%;
  min-height: 43px;
}

.filter-search {
  grid-column: span 2;
}

.filter-submit {
  min-height: 43px;
}

.management-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.management-metric {
  display: grid;
  gap: var(--space-2);
  min-height: 156px;
  align-content: start;
}

.management-metric > span {
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.management-metric > strong {
  color: var(--text);
  font-size: var(--text-2xl);
  line-height: 1;
}

.management-metric p,
.report-definition-note p {
  margin: 0;
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.report-results-table {
  min-width: 1120px;
}

.removed-user-label {
  margin-top: var(--space-1);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 700;
}

.status-pill.tentative {
  background: var(--warning-soft);
  color: var(--text);
}

.project-urgency-filter {
  grid-column: span 2;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.project-urgency-filter legend {
  margin-bottom: var(--space-1);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-urgency-filter > div {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.project-urgency-filter label {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 700;
}

.project-urgency-filter input {
  width: 15px;
  min-height: 15px;
  margin: 0;
}

.project-urgency-filter label > span {
  margin: 0;
  color: inherit;
  font-size: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.project-title-link {
  display: inline-block;
  margin-bottom: var(--space-1);
  font-weight: 700;
}

.project-schedule-status,
.project-date-warning,
.project-unassigned {
  display: inline-flex;
  margin-bottom: var(--space-1);
}

.ops-card .project-status-overdue {
  background: var(--danger);
  color: var(--danger-text);
}

.ops-card .project-status-due-today {
  background: var(--warning-soft);
  color: var(--text);
}

.ops-card .project-status-upcoming {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.ops-card .project-status-awaiting-completion-note {
  background: var(--accent-soft);
  color: var(--text);
}

.ops-card .project-status-date-to-confirm,
.ops-card .project-date-warning,
.ops-card .project-unassigned {
  background: var(--surface);
  color: var(--text);
}

.project-urgency-form {
  display: grid;
  gap: var(--space-1);
}

.project-urgency-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border-field);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
}

.project-urgency-form select:disabled {
  opacity: 0.66;
}

.urgency-save-status {
  min-height: 16px;
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 700;
}

.urgency-save-status.success { color: var(--accent-text); }
.urgency-save-status.error { color: var(--danger-text); }

.current-work-page {
  display: grid;
  gap: var(--space-4);
}

.current-work-page > .flash {
  margin-bottom: 0;
}

.current-work-page .ops-command,
.current-work-page .ops-card {
  margin-bottom: 0;
}

.current-work-section {
  overflow: visible;
}

.current-work-section-heading .ops-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.current-work-filter-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: var(--space-4);
}

.current-work-filter-grid .project-urgency-filter > div {
  flex-wrap: wrap;
}

.current-work-table {
  min-width: 1320px;
  table-layout: fixed;
}

.current-work-table th:nth-child(1) { width: 15%; }
.current-work-table th:nth-child(2) { width: 18%; }
.current-work-table th:nth-child(3) { width: 10%; }
.current-work-table th:nth-child(4) { width: 13%; }
.current-work-table th:nth-child(5) { width: 15%; }
.current-work-table th:nth-child(6) { width: 11%; }
.current-work-table th:nth-child(7) { width: 11%; }
.current-work-table th:nth-child(8) { width: 7%; }

.current-work-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.current-work-js .urgency-fallback-submit {
  display: none;
}

.awaiting-note-panel {
  border-color: var(--text);
}

.awaiting-note-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-2);
}

.awaiting-note-links a {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.awaiting-note-links a:hover {
  border-color: var(--accent-text);
  background: var(--accent-soft);
}

.awaiting-note-links span {
  color: var(--text);
  font-size: var(--text-sm);
}

.accounting-tabs {
  display: flex;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.accounting-tabs a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.accounting-tabs a.active,
.accounting-tabs a:hover {
  border-color: var(--on-accent);
  background: var(--accent);
  color: var(--on-accent);
}

.accounting-tabs span {
  min-width: 24px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--surface);
  text-align: center;
}

.inline-alert {
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
}

.inline-alert.error {
  border-color: var(--danger-text);
  background: var(--danger);
  color: var(--text);
}

.request-filter-panel {
  margin-bottom: var(--space-4);
}

.request-results-heading {
  margin-bottom: var(--space-3);
}

.request-results-heading h2 {
  margin: 0;
}

/* Settings section navigation replaces the old icon rail. */
.settings-console-layout.section-page-layout {
  grid-template-columns: minmax(0, 1fr);
}

.settings-section-nav {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}

.settings-section-nav a {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.settings-section-nav a:hover,
.settings-section-nav a.active {
  background: var(--accent);
  color: var(--on-accent);
}

@media (max-width: 1280px) {
  .topbar {
    padding-inline: var(--space-4);
    gap: var(--space-3);
  }

  .nav-links > a,
  .nav-dropdown > summary {
    padding-inline: var(--space-1);
    font-size: var(--text-xs);
  }

  .account-menu > span {
    display: none;
  }

  .report-queue-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .report-filter-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .management-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .topbar,
  .public-topbar,
  .page-heading,
  .account-menu {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links,
  .public-nav-links {
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .metric-grid,
  .four-up,
  .split-layout,
  .settings-layout,
  .settings-console-layout,
  .settings-field-grid.two-up,
  .grid-two,
  .dashboard-layout,
  .ops-shell,
  .ops-command,
  .ops-command-brand,
  .ops-metrics,
  .ops-work-grid,
  .detail-layout,
  .key-value-grid,
  .user-list-row,
  .queue-group summary,
  .queue-task-row,
  .production-master-heading,
  .lookup-form,
  .service-detail-grid,
  .request-shell,
  .workflow-list,
  .service-card-grid,
  .request-check-grid {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
  }

  .settings-side,
  .settings-console-rail,
  .settings-console-side,
  .ops-rail,
  .ops-side-stack {
    position: static;
  }

  .ops-rail,
  .settings-console-rail {
    display: flex;
    overflow-x: auto;
  }

  .ops-rail a {
    flex: 0 0 44px;
  }

  .settings-console-rail a {
    flex: 0 0 44px;
  }

  .settings-list-row,
  .settings-list-row-main,
  .settings-detail-grid,
  .settings-field-map-row,
  .template-workbench,
  .template-preview-layout,
  .template-preview-meta {
    grid-template-columns: 1fr;
  }

  .settings-list-row-main {
    min-height: 0;
  }

  .settings-row-icon {
    min-height: 72px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .settings-row-copy {
    padding: 0 var(--space-4) var(--space-4);
  }

  .settings-row-actions {
    justify-content: flex-start;
  }

  .panel-heading,
  .settings-section-heading,
  .settings-section-title,
  .settings-console-hero,
  .modal-heading,
  .modal-actions,
  .ops-card-heading,
  .ops-signal-row,
  .dashboard-control-row,
  .pagination-row,
  .dashboard-filter-form,
  .dashboard-hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-filter-form,
  .lookup-form,
  .lookup-form .button {
    width: 100%;
  }

  .settings-status-grid {
    grid-template-columns: 1fr;
  }

  .request-hero {
    min-height: 210px;
    padding: var(--space-5);
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-card {
    min-height: 140px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: var(--space-2) var(--space-4);
  }

  .brand {
    align-self: center;
  }

  .portal-nav-shell {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .portal-nav-toggle {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
  }

  .portal-nav-shell:not([open]) > .nav-links {
    display: none;
  }

  .portal-nav-shell[open] > .nav-links {
    display: grid;
  }

  .portal-nav-shell > .nav-links {
    width: 100%;
    gap: var(--space-1);
    padding-top: var(--space-2);
  }

  .nav-links > a,
  .nav-dropdown > summary {
    width: 100%;
    justify-content: flex-start;
    padding-inline: var(--space-2);
    font-size: var(--text-sm);
  }

  .nav-dropdown-menu,
  .nav-dropdown-menu-right {
    position: static;
    min-width: 0;
    margin: var(--space-1) 0 var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    box-shadow: none;
  }

  .account-menu {
    justify-self: end;
    align-items: center;
    flex-direction: row;
  }

  .account-menu > span {
    display: none;
  }

  .report-filter-grid,
  .management-metrics,
  .report-queue-metrics {
    grid-template-columns: 1fr;
  }

  .filter-search {
    grid-column: auto;
  }

  .project-urgency-filter {
    grid-column: auto;
  }

  .project-urgency-filter > div {
    flex-wrap: wrap;
  }

  .current-work-section-heading,
  .current-work-section-heading .ops-actions {
    width: 100%;
  }

  .current-work-section-heading .ops-actions {
    justify-content: flex-start;
  }

  .current-work-table-wrap {
    overflow: visible;
  }

  .ops-card .current-work-table,
  .current-work-table tbody,
  .current-work-table tr,
  .current-work-table td {
    width: 100%;
    min-width: 0;
    display: block;
  }

  .current-work-table thead {
    display: none;
  }

  .current-work-table tbody {
    display: grid;
    gap: var(--space-3);
  }

  .current-work-table tr {
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }

  .current-work-table td {
    display: grid;
    grid-template-columns: minmax(105px, 0.4fr) minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-2) 0;
  }

  .current-work-table td::before {
    content: attr(data-label);
    color: var(--text);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .current-work-table td.empty-state {
    display: block;
  }

  .accounting-tabs {
    width: 100%;
  }

  .accounting-tabs a {
    flex: 1;
    justify-content: center;
  }
}

/* Portal navigation: a quiet, persistent workspace rail and a mobile drawer. */
.has-portal-sidebar {
  --portal-sidebar-width: 260px;
  --portal-banner-height: 44px;
  padding-left: var(--portal-sidebar-width);
}

.has-portal-sidebar .sandbox-banner {
  margin-left: calc(-1 * var(--portal-sidebar-width));
}

.portal-sidebar {
  position: fixed;
  left: 12px;
  top: calc(var(--portal-banner-height, 0px) + 12px);
  bottom: 12px;
  z-index: 30;
  width: calc(var(--portal-sidebar-width, 260px) - 24px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg);
  color: var(--accent-text);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-4);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  color: var(--accent-text);
  font-weight: 700;
  font-size: var(--text-sm);
  line-height: 1.3;
  text-decoration: none;
}

.sidebar-brand img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  padding: var(--space-1);
}

.sidebar-brand small {
  display: block;
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.sidebar-navigation {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--text) transparent;
  padding: 0 var(--space-3) var(--space-3);
}

.sidebar-group { margin: 0 0 var(--space-3); }
.sidebar-group-label,
.sidebar-secondary > summary {
  margin: 0;
  padding: var(--space-2) var(--space-3) var(--space-2);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sidebar-group-links { display: grid; gap: var(--space-1); }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 42px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  color: var(--accent-text);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  transition: background-color 160ms ease, color 160ms ease;
}

.sidebar-link svg,
.sidebar-secondary svg,
.sidebar-toggle svg,
.sidebar-close svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-link:hover { background: var(--surface-soft); color: var(--accent-text); }
.sidebar-link.active {
  background: var(--accent-soft);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.sidebar-secondary {
  border-top: 1px solid var(--border);
  padding-top: var(--space-1);
  margin-top: var(--space-4);
}

.sidebar-secondary > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding-block: var(--space-2);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-md);
}

.sidebar-secondary > summary::-webkit-details-marker { display: none; }
.sidebar-secondary > summary:hover { background: var(--surface-soft); }
.sidebar-secondary > summary svg { width: 14px; height: 14px; transition: transform 160ms ease; }
.sidebar-secondary[open] > summary svg { transform: rotate(90deg); }
.sidebar-secondary:not([open]) > .sidebar-group-links { display: none; }

.sidebar-account {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2) var(--space-2);
  flex: 0 0 auto;
  margin: 0 var(--space-4);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
}

.sidebar-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-xs);
  font-weight: 700;
}

.sidebar-account-info { min-width: 0; }
.sidebar-account-info strong,
.sidebar-account-info > span { display: block; overflow-wrap: anywhere; }
.sidebar-account-info strong { font-size: var(--text-xs); }
.sidebar-account-info > span { margin-top: var(--space-1); color: var(--muted); font-size: var(--text-xs); }
.sidebar-account form { grid-column: 1 / -1; }
.sidebar-signout {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--accent-text);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
}

.sidebar-signout:hover { background: var(--accent-soft); }
.sidebar-link:focus-visible,
.sidebar-secondary > summary:focus-visible,
.sidebar-brand:focus-visible,
.sidebar-signout:focus-visible,
.sidebar-toggle:focus-visible,
.sidebar-close:focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 2px;
}

.sidebar-mobile-bar,
.sidebar-toggle,
.sidebar-close,
.sidebar-overlay { display: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .has-portal-sidebar { padding-left: 0; }
  .has-portal-sidebar .sandbox-banner { margin-left: 0; }
  .sidebar-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 58px;
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--accent-soft);
    color: var(--text);
    backdrop-filter: blur(16px);
  }
  .sidebar-current-section { text-align: right; font-size: var(--text-xs); font-weight: 600; }
  .portal-sidebar { position: relative; inset: auto; width: auto; margin: var(--space-3); }
  .sidebar-enhanced .sidebar-toggle,
  .sidebar-enhanced .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 42px;
    min-width: 42px;
    padding: var(--space-2) var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
  }
  .sidebar-enhanced .sidebar-close { margin-left: auto; border-color: var(--text); background: var(--surface); }
  .sidebar-enhanced .portal-sidebar {
    position: fixed;
    top: var(--portal-banner-height, 0px);
    left: 0;
    bottom: 0;
    width: min(300px, calc(100vw - 48px));
    margin: 0;
    border-radius: 0 20px 20px 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 50;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 200ms ease, visibility 200ms;
  }
  .sidebar-open .portal-sidebar { transform: translateX(0); visibility: visible; }
  .sidebar-overlay:not([hidden]) {
    display: block;
    position: fixed;
    inset: var(--portal-banner-height, 0px) 0 0;
    z-index: 40;
    background: var(--accent-soft);
    backdrop-filter: blur(3px);
  }
  html.portal-nav-open,
  .sidebar-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-sidebar,
  .sidebar-link,
  .sidebar-secondary > summary svg { transition: none; }
}

@media print {
  .has-portal-sidebar { padding-left: 0; }
  .has-portal-sidebar .sandbox-banner { margin-left: 0; }
  .portal-sidebar,
  .sidebar-mobile-bar,
  .sidebar-overlay { display: none !important; }
}

/* Authenticated Home appearance; legacy accounting and intake retain their layout. */
html[data-portal-theme] {
  color-scheme: light;
}
html[data-portal-theme="dark"] {
  color-scheme: dark;
}
.home-page { background: var(--bg); color: var(--text); }
.has-portal-sidebar .portal-sidebar { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.has-portal-sidebar .sidebar-brand, .has-portal-sidebar .sidebar-link { color: var(--text); }
.has-portal-sidebar .sidebar-brand small, .has-portal-sidebar .sidebar-group-label, .has-portal-sidebar .sidebar-secondary > summary, .has-portal-sidebar .sidebar-account-info > span { color: var(--muted); }
.has-portal-sidebar .sidebar-link.active, .has-portal-sidebar .sidebar-avatar { background: var(--accent-soft); color: var(--accent-text); }
.has-portal-sidebar .sidebar-link:hover, .has-portal-sidebar .sidebar-secondary > summary:hover { background: var(--surface-soft); color: var(--accent-text); }
.has-portal-sidebar .sidebar-account, .has-portal-sidebar .sidebar-secondary { border-color: var(--border); }
.has-portal-sidebar .sidebar-signout, .has-portal-sidebar .sidebar-close { background: var(--surface-soft); border-color: var(--border); color: var(--muted); }
.has-portal-sidebar .sidebar-mobile-bar { background: var(--surface); color: var(--text); border-color: var(--border); }
.home-main { width: min(1320px, 100%); margin: 0 auto; padding: var(--space-6) clamp(var(--space-4),3vw,var(--space-6)) var(--space-6); }
.home-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-5); }
.home-heading h1 { margin: var(--space-1) 0 var(--space-2); font-size: var(--text-2xl); font-weight: 800; letter-spacing: -.045em; line-height: 1.2; }
.home-greeting-dot { color: var(--accent-text); }
.home-heading p:not(.home-eyebrow) { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.home-eyebrow { margin: 0; color: var(--muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; line-height: 1.5; }
.home-heading-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-4); }
.home-theme-control { display: grid; gap: var(--space-1); color: var(--muted); font-size: var(--text-xs); }
.home-theme-control select { min-height: 34px; width: 108px; padding: var(--space-1) var(--space-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); font-size: var(--text-xs); }
.home-button, .home-secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: var(--space-3); min-height: 44px; padding: var(--space-2) var(--space-4); border-radius: var(--radius-lg); text-decoration: none; font-size: var(--text-xs); font-weight: 600; line-height: 1.4; }
.home-button { background: var(--accent); color: var(--on-accent); border: 1px solid var(--border); }
.home-button:hover { background: var(--accent); }
.home-secondary-button { border: 1px solid var(--border); color: var(--accent-text); background: var(--surface-soft); }
.home-secondary-button:hover { background: var(--accent-soft); }
.home-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.home-metric { position: relative; display: flex; flex-direction: column; gap: var(--space-2); min-height: 136px; padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); text-decoration: none; }
.home-metric > span:first-child { color: var(--muted); font-size: var(--text-xs); padding-right: var(--space-6); }
.home-metric strong { font-size: var(--text-2xl); font-weight: 600; line-height: 1; letter-spacing: -.04em; }
.home-metric small { font-size: var(--text-xs); color: var(--muted); }
.home-metric-icon { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 34px; height: 34px; background: var(--accent-soft); color: var(--accent-text); border-radius: var(--radius-lg); font-size: var(--text-lg); }
.home-columns { display: grid; grid-template-columns: minmax(0,1fr) minmax(265px,300px); gap: var(--space-5); align-items: start; }
.home-work-column, .home-support-column { display: grid; min-width: 0; gap: var(--space-4); }
.home-panel { padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-sm); min-width: 0; }
.home-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.home-panel h2 { margin: var(--space-1) 0 0; font-size: var(--text-lg); font-weight: 600; letter-spacing: -.025em; line-height: 1.3; }
.home-text-link { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--accent-text); font-weight: 600; font-size: var(--text-xs); text-decoration: none; min-height: 36px; }
.home-text-link:hover { text-decoration: underline; }
.home-section-note { margin: 0 0 var(--space-4); color: var(--muted); font-size: var(--text-xs); line-height: 1.6; }
.home-empty { text-align: center; padding: var(--space-6) var(--space-4) var(--space-7); }
.home-empty-symbol { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--accent-text); font-size: var(--text-lg); }
.home-empty h3 { margin: var(--space-4) 0 var(--space-2); font-size: var(--text-md); font-weight: 600; }
.home-empty p { max-width: 300px; margin: 0 auto; color: var(--muted); font-size: var(--text-xs); line-height: 1.7; }
.home-task-list, .home-schedule-list, .home-tool-list { margin: 0; padding: 0; list-style: none; }
.home-task { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: var(--space-3); border-top: 1px solid var(--border); padding: var(--space-4) 0; }
.home-task-icon, .home-tool-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-lg); background: var(--surface-soft); color: var(--accent-text); font-size: var(--text-lg); }
.home-task-context { color: var(--muted); font-size: var(--text-xs); line-height: 1.5; }
.home-task-content { min-width: 0; overflow-wrap: anywhere; }
.home-task h3 { margin: var(--space-1) 0; font-size: var(--text-sm); line-height: 1.4; font-weight: 600; }
.home-task h3 a { text-decoration: none; }
.home-task h3 a:hover { text-decoration: underline; }
.home-task-detail { color: var(--muted); font-size: var(--text-xs); }
.home-task-tags { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); color: var(--muted); font-size: var(--text-xs); }
.home-status, .home-priority { display: inline-block; border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-1) var(--space-1); background: var(--surface-soft); color: var(--text); }
.home-priority { color: var(--accent-text); background: var(--accent-soft); }
.home-task-action { grid-column: 2; display: inline-flex; align-items: center; gap: var(--space-2); justify-self: start; min-height: 36px; color: var(--accent-text); text-decoration: none; font-size: var(--text-xs); font-weight: 600; }
.home-task-action:hover { text-decoration: underline; }
.home-manager-action { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); background: var(--surface-soft); border-radius: var(--radius-lg); padding: var(--space-4); margin-top: var(--space-1); }
.home-manager-action strong { font-size: var(--text-xs); font-weight: 600; }
.home-manager-action p { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.5; }
.home-assistant { display: flex; align-items: center; gap: var(--space-4); background: linear-gradient(110deg,var(--surface),var(--accent-soft)); }
.home-assistant-symbol { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--radius-lg); font-size: var(--text-2xl); color: var(--accent-text); }
.home-development-label { display: inline-block; font-size: var(--text-xs); color: var(--muted); font-weight: 600; }
.home-assistant p, .home-stay-connected p { color: var(--muted); font-size: var(--text-xs); line-height: 1.7; margin: var(--space-2) 0 0; }
.home-stay-connected { display: flex; align-items: center; gap: var(--space-4); justify-content: space-between; flex-wrap: wrap; }
.home-stay-connected > div { max-width: 360px; }
.home-stay-connected h2 { font-size: var(--text-sm); }
.home-calendar-symbol { font-size: var(--text-xl); color: var(--accent-text); }
.home-source-label { color: var(--accent-text); font-size: var(--text-xs); line-height: 1.6; margin: 0 0 var(--space-3); font-weight: 600; }
.home-schedule-empty { padding: var(--space-4) 0; border-top: 1px solid var(--border); color: var(--muted); }
.home-schedule-empty p { font-size: var(--text-xs); line-height: 1.6; margin: 0 0 var(--space-1); }
.home-schedule-empty span { font-size: var(--text-xs); line-height: 1.6; }
.home-schedule-list li { display: grid; grid-template-columns: 47px minmax(0,1fr); gap: var(--space-3); padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.home-schedule-list time { font-size: var(--text-xs); line-height: 1.5; color: var(--accent-text); font-weight: 600; }
.home-schedule-list strong { display: block; font-weight: 600; font-size: var(--text-xs); overflow-wrap: anywhere; line-height: 1.5; }
.home-schedule-list span { display: block; font-size: var(--text-xs); color: var(--muted); line-height: 1.5; margin-top: var(--space-1); overflow-wrap: anywhere; }
.home-tool-list li { display: flex; gap: var(--space-3); padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.home-tool-list li:last-child { padding-bottom: 0; }
.home-tool-icon { flex: 0 0 36px; }
.home-tool-list h3 { font-size: var(--text-xs); line-height: 1.4; font-weight: 600; margin: var(--space-1) 0 var(--space-1); }
.home-tool-list p { font-size: var(--text-xs); color: var(--muted); line-height: 1.5; margin: 0 0 var(--space-1); }
.home-tool-list span:not(.home-tool-icon) { color: var(--muted); font-size: var(--text-xs); line-height: 1.5; }
.home-main :is(a,select):focus-visible { outline: 3px solid var(--border-field); outline-offset: 3px; }
@media(min-width:1500px) { .home-task { grid-template-columns: 36px minmax(0,1fr) auto; } .home-task-action { grid-column: 3; grid-row: 1; align-self: center; } }
@media(max-width:1190px) { .home-columns { grid-template-columns: minmax(0,1fr) 265px; gap: var(--space-4); } .home-panel { padding: var(--space-4); } }
@media(max-width:760px) {
  .home-main { padding: var(--space-5) var(--space-4) var(--space-6); } .home-heading { flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-5); }
  .home-heading-controls { width: 100%; justify-content: space-between; } .home-columns { grid-template-columns: 1fr; }
  .home-metrics { gap: var(--space-2); margin-bottom: var(--space-4); } .home-metric { padding: var(--space-4) var(--space-3); min-height: 135px; border-radius: var(--radius-lg); }
  .home-metric > span:first-child { padding-right: 0; font-size: var(--text-xs); } .home-metric strong { font-size: var(--text-xl); } .home-metric small { font-size: var(--text-xs); line-height: 1.5; }
  .home-metric-icon { display: none; } .home-panel { padding: var(--space-4); } .home-assistant { align-items: flex-start; gap: var(--space-3); }
  .home-work-column { display: contents; } .home-support-column { display: contents; }
  .home-work { order: 1; } .home-schedule { order: 2; } .home-tools { order: 3; } .home-assistant { order: 4; } .home-stay-connected { order: 5; }
}
@media(prefers-reduced-motion:reduce) { .home-page * { scroll-behavior: auto; } }
@media print { .home-heading-controls, .home-tools, .home-assistant, .home-stay-connected { display: none; } .home-main { width: 100%; padding: var(--space-3); } .home-columns { display: block; } .home-panel { break-inside: avoid; box-shadow: none; margin-bottom: var(--space-3); } }

/* Workspace revision: functional layout and provisional green/glass treatment.
   Reference-specific matching awaits supported Library materialization on Windows. */
.home-page { background: var(--bg); }
.home-panel, .portal-sidebar { backdrop-filter:blur(22px) saturate(125%); -webkit-backdrop-filter:blur(22px) saturate(125%); }
.home-panel { box-shadow:var(--shadow-sm); }
.home-columns { grid-template-columns:minmax(0,1fr) minmax(265px,300px); }
.workspace-filters { display:flex; flex-wrap:wrap; gap:var(--space-2); margin:var(--space-4) 0 var(--space-3); }
.workspace-filters a { display:flex; align-items:center; gap:var(--space-2); text-decoration:none; font-size:var(--text-xs); padding:var(--space-2) var(--space-2); border:1px solid var(--border); border-radius:var(--radius-md); color:var(--muted); }
.workspace-filters a[aria-current] { color:var(--accent-text); background:var(--accent-soft); border-color:var(--accent-text); }
.workspace-filters strong { font-size:var(--text-xs); }
.workspace-project-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3); align-items:start; }
.workspace-project { border:1px solid var(--border); border-radius:var(--radius-lg); padding:var(--space-4); background:var(--surface-soft); min-width:0; overflow-wrap:anywhere; }
.workspace-project header h3 { font-size:var(--text-sm); font-weight:700; margin:0 0 var(--space-1); line-height:1.4; color:var(--text); }
.workspace-project header p { font-size:var(--text-xs); color:var(--muted); margin:0 0 var(--space-2); }
.home-task { grid-template-columns:26px minmax(0,1fr); gap:var(--space-2); padding:var(--space-3) 0; }
.home-task:last-child { padding-bottom:0; }
.home-task-icon { width:26px; height:28px; background:transparent; border-radius:0; }
.workspace-task-icon { width:24px; height:24px; }
.home-task h4 { margin:var(--space-1) 0 var(--space-1); font-size:var(--text-xs); font-weight:600; line-height:1.5; color:var(--text); }
.home-task h4 a { text-decoration:none; } .home-task h4 a:hover { text-decoration:underline; }
.home-task-tags { margin-top:0; gap:var(--space-1); font-size:var(--text-xs); line-height:1.5; }
.home-status,.home-priority { padding:var(--space-1) var(--space-1); }
.home-task-action { background:transparent; border:0; padding:0; cursor:pointer; min-height:30px; font-size:var(--text-xs); color:var(--accent-text); }
.workspace-overdue .workspace-date { color:var(--danger-text); font-weight:700; }
.workspace-overdue .home-task-icon { color:var(--danger-text); }
html[data-portal-theme="dark"] .workspace-overdue :is(.workspace-date,.home-task-icon) { color:var(--danger-text); }
.workspace-task-editor { margin-top:var(--space-2); padding-top:var(--space-2); border-top:1px solid var(--border); }
.workspace-task-editor label { display:block; color:var(--text); font-size:var(--text-xs); margin-bottom:var(--space-2); }
.workspace-task-editor label span { color:var(--muted); }
.workspace-task-editor :is(select,textarea) { display:block; width:100%; min-width:0; margin-top:var(--space-1); padding:var(--space-2); border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface); color:var(--text); font:inherit; }
.workspace-editor-buttons { display:flex; flex-wrap:wrap; gap:var(--space-2); }
.workspace-editor-buttons button { min-height:34px; padding:var(--space-2) var(--space-3); font-size:var(--text-xs); cursor:pointer; }
.workspace-editor-buttons button:disabled { opacity:.6; cursor:wait; }
.workspace-task-feedback,.workspace-saved-feedback { font-size:var(--text-xs); line-height:1.6; color:var(--text); overflow-wrap:anywhere; margin:var(--space-1) 0 0; }
.workspace-task-feedback:empty,.workspace-saved-feedback:empty { display:none; }
.workspace-pagination { display:flex; justify-content:center; align-items:center; gap:var(--space-3); flex-wrap:wrap; margin-top:var(--space-4); color:var(--muted); font-size:var(--text-xs); }
.workspace-pagination .home-secondary-button { min-height:34px; padding:var(--space-2) var(--space-2); font-size:var(--text-xs); }
.workspace-pagination [aria-disabled] { opacity:.65; }
.workspace-unassigned { display:flex; justify-content:space-between; align-items:center; gap:var(--space-3); margin-top:var(--space-4); padding:var(--space-3); border:1px solid var(--border); background:var(--warning-soft); color:var(--danger-text); border-radius:var(--radius-md); text-decoration:none; font-size:var(--text-xs); }
.workspace-unassigned strong span { display:inline-block; padding:var(--space-1) var(--space-2); border-radius:var(--radius-sm); background:var(--accent-soft); margin-left:var(--space-1); }
html[data-portal-theme="dark"] .workspace-unassigned { background:var(--warning-soft); color:var(--text); border-color:var(--muted); }
html[data-portal-theme="dark"] .workspace-unassigned strong span { background:var(--warning-soft); }
.workspace-calendar-month { display:flex; align-items:center; justify-content:space-between; margin:var(--space-3) 0; font-size:var(--text-xs); }
.workspace-calendar-month a { display:grid; place-items:center; width:32px; height:32px; border:1px solid var(--border); border-radius:var(--radius-md); text-decoration:none; font-size:var(--text-xl); color:var(--accent-text); }
.workspace-calendar { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:var(--space-1); }
.workspace-weekday { text-align:center; font-size:var(--text-xs); padding:var(--space-1) 0; color:var(--muted); }
.workspace-calendar a { position:relative; display:grid; place-items:center; min-height:30px; border:1px solid transparent; border-radius:var(--radius-md); text-decoration:none; font-size:var(--text-xs); padding:var(--space-1) 0 var(--space-2); color:var(--text); }
.workspace-calendar a:hover { background:var(--surface-soft); }
.workspace-calendar .workspace-calendar-today { border-color:var(--accent-text); }
.workspace-calendar a[aria-current] { background:var(--accent-soft); color:var(--accent-text); font-weight:700; }
.workspace-calendar-dot { position:absolute; bottom:3px; width:3px; height:3px; border-radius:var(--radius-full); background:var(--accent-text); }
.workspace-selected-date { margin:var(--space-4) 0 var(--space-2); font-size:var(--text-xs); color:var(--text); }
.workspace-schedule-projects section { padding:var(--space-2) 0; border-top:1px solid var(--border); }
.workspace-schedule-projects h4 { font-size:var(--text-xs); font-weight:700; margin:0 0 var(--space-1); line-height:1.5; overflow-wrap:anywhere; color:var(--text); }
.workspace-schedule-projects ul { list-style:none; padding:0; margin:0; color:var(--muted); font-size:var(--text-xs); line-height:1.7; }
.workspace-favorites { list-style:none; padding:0; margin:0; display:grid; gap:var(--space-1); }
.workspace-favorites a { display:flex; justify-content:space-between; font-size:var(--text-xs); text-decoration:none; padding:var(--space-2) 0; border-top:1px solid var(--border); color:var(--accent-text); }
.home-assistant { padding:var(--space-4) var(--space-5); }.home-assistant h2 { font-size:var(--text-sm); }
.workspace-tool-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--space-3); margin:var(--space-4) 0 0; }
.workspace-tool-card { display:block; border:1px solid var(--border); border-radius:var(--radius-lg); padding:var(--space-4); background:var(--surface-soft); text-decoration:none; color:var(--text); }
a.workspace-tool-card:hover { border-color:var(--accent-text); }
.workspace-tool-card strong { display:block; font-size:var(--text-sm); line-height:1.5; }
.workspace-tool-card small { display:block; margin-top:var(--space-1); color:var(--muted); }
.workspace-tool-card p { color:var(--muted); font-size:var(--text-xs); line-height:1.6; margin-bottom:0; }
.workspace-tool-group { margin-top:var(--space-5); }
.workspace-welcome { display:flex; align-items:center; gap:var(--space-3); border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface); color:var(--text); padding:var(--space-3) var(--space-4); margin-bottom:var(--space-4); animation:workspace-welcome 1.6s ease both; pointer-events:none; }
.workspace-welcome img { width:72px; height:38px; object-fit:contain; }.workspace-welcome span { font-size:var(--text-sm); font-weight:600; }
@keyframes workspace-welcome { 0% {opacity:0;transform:translateY(-4px)} 15%,65% {opacity:1;transform:none} 100% {opacity:0;transform:translateY(-4px)} }
.home-main :is(a,button,select,textarea):focus-visible { outline:3px solid var(--border-field);outline-offset:3px; }
[hidden] { display:none !important; }
@media(min-width:1500px) { .home-task { grid-template-columns:26px minmax(0,1fr); }.home-task-action { grid-column:auto;grid-row:auto; } }
@media(max-width:1280px) { .workspace-project-grid { grid-template-columns:1fr; }.workspace-tool-grid {grid-template-columns:repeat(2,minmax(0,1fr));} }
@media(max-width:760px) { .home-columns {grid-template-columns:1fr;}.workspace-project-grid,.workspace-tool-grid { grid-template-columns:1fr; }.workspace-project { padding:var(--space-3); }.workspace-unassigned {flex-wrap:wrap;} }
@media(prefers-reduced-motion:reduce) { .workspace-welcome {animation:none;} }
@media print { .workspace-welcome,.workspace-task-editor,.workspace-filters,.workspace-pagination {display:none;} .home-panel {backdrop-filter:none;background:white;color:black;} }

.workspace-update-status { display:flex; align-items:center; flex-wrap:wrap; gap:var(--space-3); padding:var(--space-3) var(--space-4); margin-bottom:var(--space-4); border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface); color:var(--text); font-size:var(--text-xs); line-height:1.6; }
.workspace-update-status .home-secondary-button { font-size:var(--text-xs); min-height:34px; padding:var(--space-2) var(--space-2); }
.home-button { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.home-button:hover { background:var(--accent); filter:brightness(.94); }
.home-main :is(a,button,select,textarea):focus-visible { outline-color:var(--accent); }
.workspace-project-link { text-decoration:none; color:var(--text); }
.workspace-project-link:hover { text-decoration:underline; text-underline-offset:3px; }
.workspace-appearance { display:grid; gap:var(--space-1); }
.workspace-appearance-controls { display:flex; gap:var(--space-2); flex-wrap:wrap; }
.workspace-appearance small { max-width:232px; font-size:var(--text-xs); color:var(--muted); line-height:1.5; }
.workspace-tools-tabs { display:flex; gap:var(--space-2); flex-wrap:wrap; margin-bottom:var(--space-4); }
.workspace-tools-tabs a { padding:var(--space-2) var(--space-4); border-radius:var(--radius-md); border:1px solid var(--border); color:var(--text); background:var(--surface); text-decoration:none; }
.workspace-tools-tabs [aria-current] { background:var(--accent-soft); color:var(--accent-text); border-color:var(--accent-text); }
.workspace-hr-form { border:1px solid var(--border); background:var(--surface-soft); border-radius:var(--radius-lg); padding:var(--space-4); min-width:0; }
.workspace-hr-form h3 { font-size:var(--text-md); margin-top:0; }
.workspace-manager-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3); margin-top:var(--space-4); }
.workspace-manager-actions .workspace-unassigned { margin:0; }
.workspace-confirmation { display:flex; flex-direction:column; gap:var(--space-2); background:var(--warning-soft); color:var(--danger-text); border:1px solid var(--border); border-radius:var(--radius-lg); padding:var(--space-3); text-decoration:none; font-size:var(--text-xs); }
.workspace-confirmation strong { display:flex; justify-content:space-between; gap:var(--space-3); }
.workspace-confirmation strong span { font-size:var(--text-md); }
.workspace-confirmation small { font-size:var(--text-xs); }
html[data-portal-theme="dark"] .workspace-confirmation { background:var(--warning-soft); color:var(--text); border-color:var(--muted); }
.workspace-welcome {
  position:fixed; inset:0; z-index:100; width:100%; height:100vh; height:100dvh;
  display:grid; place-content:center; justify-items:center; gap:var(--space-5);
  margin:0; padding:var(--space-5); border:0; border-radius:0;
  background:var(--bg); background:linear-gradient(135deg,var(--surface),transparent),var(--bg);
  text-align:center; pointer-events:none; animation:workspace-welcome-overlay 2.8s ease both;
}
.workspace-welcome img { width:min(300px,60vw); height:auto; max-height:160px; object-fit:contain; }
.workspace-welcome span { font-size:var(--text-sm); line-height:1.4; font-weight:600; }
@keyframes workspace-welcome-overlay { 0%,65% {opacity:1} 100% {opacity:0} }
@media(max-width:980px) { .workspace-manager-actions {grid-template-columns:1fr;} }
@media(max-width:760px) { .home-heading-controls {justify-content:flex-start;} .workspace-appearance small {max-width:100%;} }
@media(prefers-reduced-motion:reduce) { .workspace-welcome {animation:none;} }

/* Observed local references: frosted layers, broad glows, and the six Forest swatches. */
.home-page {
  isolation:isolate;
  background:
    radial-gradient(ellipse at 94% 8%,var(--surface))),transparent 42%),
    radial-gradient(ellipse at 8% 74%,var(--surface))),transparent 52%),
    var(--bg);
}
@keyframes workspace-ambient-glow { from {transform:translate(-1.5%,-1%) scale(1.02)} to {transform:translate(1.5%,1%) scale(1.02)} }
.home-page .home-panel, .home-page .portal-sidebar, .home-page .sidebar-mobile-bar {
  background:var(--surface);
  border-color:var(--border);
  backdrop-filter:blur(24px) saturate(135%);
  -webkit-backdrop-filter:blur(24px) saturate(135%);
  box-shadow:var(--shadow-sm);
}
html[data-portal-theme="dark"] .home-page :is(.home-panel,.portal-sidebar,.sidebar-mobile-bar) {
  box-shadow:var(--shadow-sm);
}
.home-page .workspace-project, .home-page .workspace-tool-card, .home-page .workspace-hr-form {
  background:var(--surface-soft);
  border-color:var(--border);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  box-shadow:var(--shadow-sm);
}
html[data-portal-theme="dark"] .home-page :is(.workspace-project,.workspace-tool-card,.workspace-hr-form) {
  box-shadow:var(--shadow-sm);
}
.home-page .home-assistant { background:var(--surface); }
.home-page .home-task { border-color:var(--border); }
.home-page .home-theme-control select, .home-page .workspace-task-editor :is(select,textarea) {
  background:var(--surface); color:var(--text); border-color:var(--border);
}
.home-page .workspace-task-editor { background:var(--surface); }
.home-page .workspace-calendar a, .home-page .workspace-filters a, .home-page .home-secondary-button {
  background:var(--surface-soft); color:var(--text);
}
.home-page .workspace-calendar [aria-current], .home-page .workspace-filters [aria-current], .home-page .home-secondary-button:hover {
  background:var(--accent-soft); color:var(--accent-text); border-color:var(--accent-text);
}
.home-page .workspace-tools-tabs a { background:var(--surface-soft); }
.home-page .workspace-tools-tabs [aria-current] { background:var(--accent-soft); color:var(--accent-text); }
.home-page .workspace-welcome { background:radial-gradient(ellipse at 20% 16%,var(--surface),transparent 66%),var(--bg); }

@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  .home-page :is(.home-panel,.portal-sidebar,.sidebar-mobile-bar,.workspace-project,.workspace-tool-card,.workspace-hr-form) { background:var(--surface); }
}
@media(prefers-reduced-motion:reduce) { }
@media(forced-colors:active) {
  .home-page :is(.home-panel,.workspace-project,.workspace-tool-card,.workspace-hr-form,.portal-sidebar) { background:Canvas; color:CanvasText; border-color:CanvasText; box-shadow:none; backdrop-filter:none; }
}
@media print {
  .home-page :is(.home-panel,.workspace-project,.workspace-tool-card,.workspace-hr-form) {background:white;color:black;box-shadow:none;backdrop-filter:none;}
}


/* Use wide-screen space without stretching navigation; keep handheld layout unchanged. */
@media(min-width:1025px) {
  .home-main { width:100%; max-width:none; margin:0; padding-inline:clamp(var(--space-5),1.6vw,var(--space-6)); }
  .home-columns { grid-template-columns:minmax(0,1fr) clamp(300px,18vw,380px); }
}
@media(min-width:1200px) { .workspace-project-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* A lighter frosted project layer separates dark cards from their surrounding panel. */
html[data-portal-theme="dark"] .home-page .workspace-project {
  background:var(--surface);
  border-color:var(--surface);
  box-shadow:var(--shadow-sm);
}
html[data-portal-theme="dark"] .workspace-project :is(header p,.home-task-tags) { color:var(--text); font-size:var(--text-xs); }
html[data-portal-theme="dark"] .workspace-project .home-task-action { font-size:var(--text-xs); }
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  html[data-portal-theme="dark"] .home-page .workspace-project { background:var(--surface); }
}
@media(forced-colors:active) {
  html[data-portal-theme="dark"] .home-page .workspace-project { background:Canvas; color:CanvasText; border-color:CanvasText; box-shadow:none; }
  html[data-portal-theme="dark"] .workspace-project :is(header p,.home-task-tags) { color:CanvasText; }
}
@media print {
  html[data-portal-theme="dark"] .home-page .workspace-project { background:white; color:black; box-shadow:none; }
  html[data-portal-theme="dark"] .workspace-project :is(header p,.home-task-tags) { color:black; }
}
html[data-portal-palette="cinnex"] .home-heading h1 { font-weight:800; }
html[data-portal-palette="cinnex"][data-portal-theme="dark"] .home-page .workspace-project { background:var(--surface); }
/* Retain the original red foreground; a dark date badge gives it a clear contrast floor. */
html[data-portal-theme="dark"] .workspace-project .workspace-overdue .workspace-date { background:var(--danger); border-radius:var(--radius-sm); padding:var(--space-1) var(--space-1); }
@media(max-width:760px) {
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
  html[data-portal-palette="cinnex"][data-portal-theme="dark"] .home-page .workspace-project { background:var(--surface); }
}
@media(forced-colors:active) {
  html[data-portal-palette="cinnex"][data-portal-theme="dark"] .home-page .workspace-project { background:Canvas; color:CanvasText; }
  html[data-portal-theme="dark"] .workspace-project .workspace-overdue .workspace-date { background:Canvas; color:CanvasText; }
}
@media print {
  html[data-portal-palette="cinnex"][data-portal-theme="dark"] .home-page .workspace-project { background:white; color:black; }
}

/* Keep the Assistant banner and sparkle distinct from work cards. */
.home-page .home-assistant {
  display:flex; align-items:center; gap:var(--space-4);
  background:linear-gradient(110deg,var(--surface),var(--accent-soft));
  color:var(--text); border-color:var(--text);
}
html[data-portal-theme="dark"] .home-page .home-assistant {
  border-color:var(--accent-text);
}
.home-page .home-assistant h2 { color:var(--text); }
.home-page .home-assistant :is(p,.home-development-label) { color:var(--muted); }
.home-page .home-assistant-symbol { color:var(--accent-text); border-color:currentColor; }
@media(max-width:760px) { .home-page .home-assistant { align-items:flex-start; gap:var(--space-3); } }
@media(forced-colors:active) {
  .home-page .home-assistant { background:Canvas; color:CanvasText; border-color:CanvasText; }
  .home-page .home-assistant :is(h2,p,.home-development-label,.home-assistant-symbol) { color:CanvasText; }
}

/* Home discovery and operational preview reuse the established glass and palette tokens. */
.workspace-discovery { margin-bottom:var(--space-4); padding:var(--space-5) var(--space-5); }
.workspace-search-entry,.workspace-ask-entry { display:flex; align-items:center; gap:var(--space-2); }
.workspace-search-entry { margin-top:var(--space-4); padding:var(--space-2) var(--space-2); border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface-soft); }
.workspace-search-entry > span { font-size:var(--text-2xl); color:var(--accent-text); }
.workspace-search-entry input { flex:1; min-width:0; font-size:var(--text-md); padding:var(--space-2) var(--space-1); border:0; background:transparent; color:var(--text); }
.workspace-search-entry :is(button,input),.workspace-ask-entry input { min-height:44px; }
.workspace-search-entry input::placeholder,.workspace-search-filters input::placeholder,.workspace-ask input::placeholder { color:var(--muted); opacity:1; }
.workspace-search-filters,.workspace-ask-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-3); margin-top:var(--space-4); }
.workspace-search-filters label,.workspace-ask-form label,.workspace-ask-body label { display:flex; flex-direction:column; gap:var(--space-1); color:var(--muted); font-size:var(--text-xs); font-weight:600; }
.workspace-search-filters :is(input,select),.workspace-ask :is(input,select) { width:100%; min-width:0; min-height:40px; padding:var(--space-2) var(--space-3); color:var(--text); background:var(--surface-soft); border:1px solid var(--border); border-radius:var(--radius-md); font:inherit; }
.workspace-search-filters select,.workspace-ask select { background-color:var(--bg); }
.workspace-discovery .home-section-note { margin-bottom:0; }
.workspace-search-output { margin-top:var(--space-4); }
.workspace-search-output[aria-busy=true] { opacity:.8; }
.workspace-search-results { list-style:none; padding:0; margin:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 var(--space-4); }
.workspace-search-results li { min-width:0; display:flex; justify-content:space-between; gap:var(--space-4); padding:var(--space-4) 0; border-bottom:1px solid var(--border); }
.workspace-search-results a { display:block; color:var(--accent-text); font-weight:700; text-decoration:none; overflow-wrap:anywhere; }
.workspace-search-results a:hover { text-decoration:underline; }
.workspace-search-results p { font-size:var(--text-xs); color:var(--muted); margin:var(--space-1) 0 0; overflow-wrap:anywhere; }
.workspace-result-kind { display:block; color:var(--muted); font-size:var(--text-xs); margin-bottom:var(--space-1); }
.workspace-result-status { color:var(--muted); font-size:var(--text-xs); flex-shrink:0; max-width:35%; overflow-wrap:anywhere; }
.workspace-search-pages { display:flex; align-items:center; justify-content:center; gap:var(--space-3); margin:var(--space-3) 0 0; font-size:var(--text-xs); flex-wrap:wrap; }
.workspace-attention { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-3) var(--space-4); margin:0 0 var(--space-4); padding:var(--space-3) var(--space-4); border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface); }
.workspace-attention h2 { font-size:var(--text-sm); margin:0; }
.workspace-attention .home-section-note { font-size:var(--text-xs); margin:var(--space-1) 0 0; }
.workspace-attention-items { display:flex; align-items:stretch; gap:var(--space-2); flex:1; justify-content:flex-end; flex-wrap:wrap; }
.workspace-attention-items > a { margin:0; flex-direction:row; display:flex; align-items:center; gap:var(--space-3); padding:var(--space-2) var(--space-3); border-radius:var(--radius-md); border:1px solid var(--border); font-size:var(--text-xs); text-decoration:none; min-height:44px; min-width:0; }
.workspace-attention-items > a:hover { text-decoration:underline; }
.workspace-attention-items strong { font-size:var(--text-md); }
.workspace-attention-items small { display:block; margin-top:var(--space-1); font-size:var(--text-xs); }
.workspace-attention-overdue { color:var(--text); background:var(--surface-soft); }
.workspace-attention-overdue strong { color:var(--danger-text); }
html[data-portal-theme=dark] .workspace-attention-overdue strong { color:var(--danger-text); }
.workspace-approval-note { flex-basis:100%; margin:0; font-size:var(--text-xs); color:var(--muted); }
.workspace-ask { padding:0; margin-bottom:var(--space-4); overflow:hidden; }
.workspace-ask > summary { display:flex; align-items:center; gap:var(--space-3); cursor:pointer; list-style:none; padding:var(--space-4) var(--space-5); }
.workspace-ask > summary::-webkit-details-marker { display:none; }
.workspace-ask > summary strong { font-size:var(--text-sm); display:block; }
.workspace-ask > summary small { font-size:var(--text-xs); color:var(--muted); display:block; margin-top:var(--space-1); }
.workspace-ask-mark { color:var(--accent-text); font-size:var(--text-xl); line-height:1; }
.workspace-ask-chevron { margin-left:auto; font-size:var(--text-lg); }
.workspace-ask[open] .workspace-ask-chevron { transform:rotate(180deg); }
.workspace-ask-body { padding:0 var(--space-5) var(--space-5); border-top:1px solid var(--border); }
.workspace-sample-notice { color:var(--muted); font-size:var(--text-xs); line-height:1.7; padding:var(--space-3) 0; margin:0; }
.workspace-sample-notice strong { display:block; color:var(--text); }
.workspace-ask-entry { margin-top:var(--space-1); }
.workspace-ask-entry input { flex:1; }
.workspace-ask-entry button { flex-shrink:0; }
.workspace-ask-examples { display:flex; gap:var(--space-2); margin-top:var(--space-2); flex-wrap:wrap; }
.workspace-ask-examples .home-secondary-button { font-size:var(--text-xs); min-height:40px; }
.workspace-ask-filters { padding:var(--space-3); border:1px solid var(--border); border-radius:var(--radius-lg); grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,2fr); }
.workspace-ask-filters legend { color:var(--muted); font-size:var(--text-xs); padding:0 var(--space-1); }
.workspace-ask-filters p { color:var(--muted); font-size:var(--text-xs); align-self:center; margin:0; }
.workspace-ask-answer { margin-top:var(--space-4); border-top:1px solid var(--border); padding-top:var(--space-4); }
.workspace-ask-answer :is(h3,p) { overflow-wrap:anywhere; }
.workspace-ask-answer h3 { font-size:var(--text-md); margin:0; }
.workspace-ask-answer > p { font-size:var(--text-xs); line-height:1.7; }
.workspace-sample-table { overflow:auto; border:1px solid var(--border); border-radius:var(--radius-lg); }
.workspace-sample-table table { min-width:0; table-layout:fixed; width:100%; border-collapse:collapse; font-size:var(--text-xs); }
.workspace-sample-table caption { text-align:left; padding:var(--space-3); color:var(--muted); font-size:var(--text-xs); }
.workspace-sample-table :is(th,td) { overflow-wrap:anywhere; color:var(--text); padding:var(--space-3); text-align:left; border-top:1px solid var(--border); }
.workspace-sample-table th { background:var(--surface-soft); }
.workspace-ask-source { margin-top:var(--space-4); padding:var(--space-3); border-radius:var(--radius-lg); background:var(--surface-soft); font-size:var(--text-xs); }
.workspace-ask-source p { color:var(--muted); line-height:1.7; }
.home-page :is(.workspace-discovery,.workspace-ask,.workspace-attention) :focus-visible { outline:2px solid var(--accent-text); outline-offset:3px; }
@media(max-width:1024px) { .workspace-search-results { grid-template-columns:minmax(0,1fr); } .workspace-attention-items { justify-content:flex-start; } }
@media(max-width:760px) {
  .workspace-discovery { padding:var(--space-4) var(--space-4); }
  .workspace-search-entry { flex-wrap:wrap; gap:var(--space-2); }
  .workspace-search-entry input { flex-basis:calc(100% - 45px); }
  .workspace-search-entry button { flex:1; }
  .workspace-search-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .workspace-attention { padding:var(--space-3) var(--space-4); }
  .workspace-attention-items { flex-basis:100%; }
  .workspace-attention-items > a { flex:1 1 160px; }
  .workspace-ask > summary { padding:var(--space-4); }
  .workspace-ask-body { padding:0 var(--space-4) var(--space-4); }
  .workspace-ask-entry { flex-wrap:wrap; }
  .workspace-ask-entry input { flex-basis:100%; }
  .workspace-ask-entry button { width:100%; }
  .workspace-ask-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .workspace-ask-filters p { grid-column:1/-1; }
  .workspace-sample-table :is(th,td) { padding:var(--space-2) var(--space-2); font-size:var(--text-xs); letter-spacing:0; }
  .workspace-ask-answer .home-panel-heading { align-items:flex-start; flex-wrap:wrap; }
}
@media(forced-colors:active) { .workspace-attention,.workspace-ask-source,.workspace-search-entry { background:Canvas; color:CanvasText; border-color:CanvasText; } .workspace-attention-overdue strong { color:CanvasText; } }

/* CinNex green accents in the existing light and dark themes. */
.has-portal-sidebar .button:not(.danger-button):not(.danger) { background:var(--accent); color:var(--white); }
.has-portal-sidebar .button:not(.danger-button):not(.danger):hover { background:var(--accent); }
.home-page .home-assistant { border-color:var(--text); }
html[data-portal-theme="dark"] .home-page .home-assistant { border-color:var(--accent-text); }
.workspace-topbar { display:flex; align-items:center; gap:var(--space-4); min-height:66px; padding:var(--space-2) clamp(var(--space-5),1.6vw,var(--space-6)); position:sticky; top:0; z-index:35; background:var(--surface); border-bottom:1px solid var(--border); backdrop-filter:blur(12px); color:var(--text); }
.workspace-topbar-sandbox { top:var(--portal-banner-height,44px); }
.workspace-topbar form { display:flex; flex:1; gap:var(--space-2); max-width:760px; min-width:0; }
.workspace-topbar input { flex:1; min-width:0; min-height:42px; border:1px solid var(--border); background:var(--surface-soft); color:var(--text); border-radius:var(--radius-md); padding:var(--space-2) var(--space-3); }
.workspace-topbar input::placeholder { color:var(--muted); opacity:1; }
.workspace-topbar button { min-height:42px; padding:var(--space-2) var(--space-3); }
.workspace-topbar button svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; }
.workspace-topbar .workspace-appearance { margin-left:auto; }
.workspace-topbar .home-theme-control { min-width:105px; }
.workspace-topbar .home-theme-control select { min-height:38px; }
.workspace-topbar .workspace-appearance small { font-size:var(--text-xs); }
.workspace-top-label { font-weight:700; }
.workspace-home-overview { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:var(--space-4); align-items:start; margin-bottom:var(--space-4); }
.workspace-home-overview > :is(.workspace-attention,.workspace-ask) { margin:0; min-width:0; }
.workspace-home-overview .workspace-attention { flex-direction:column; align-items:stretch; }
.workspace-home-overview .workspace-attention-items { justify-content:flex-start; }
.workspace-home-overview .workspace-attention-items > a { flex:1 1 150px; }
.workspace-completion-details { margin:var(--space-3) 0; padding:var(--space-3); border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface-soft); }
.workspace-completion-details > summary { cursor:pointer; font-size:var(--text-xs); font-weight:700; color:var(--text); }
.workspace-completion-details > summary span { font-weight:400; color:var(--muted); }
.workspace-completion-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3); margin-top:var(--space-3); }
.completion-field { min-width:0; }
.completion-field small { display:block; margin-top:var(--space-1); color:var(--muted); font-size:var(--text-xs); line-height:1.6; }
.completion-field [data-detail-value] { margin-top:var(--space-1); }
.workspace-task-editor :is(input:not([type=hidden]),select,textarea),.workspace-update-editor textarea { min-width:0; width:100%; color:var(--text); background:var(--surface-soft); border:1px solid var(--border); border-radius:var(--radius-md); padding:var(--space-2) var(--space-2); min-height:40px; }
.workspace-task-editor select { background-color:var(--bg); }
.workspace-task-actions { display:flex; align-items:center; gap:var(--space-3); flex-wrap:wrap; }
.workspace-task-actions a { font-size:var(--text-xs); color:var(--accent-text); text-decoration:none; }
.workspace-task-actions a:hover { text-decoration:underline; }
.workspace-update-editor { margin-top:var(--space-3); padding:var(--space-3); border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface-soft); }
.workspace-update-editor label { display:grid; gap:var(--space-1); font-size:var(--text-xs); font-weight:600; }
.workspace-update-feedback,.workspace-note-saved { color:var(--accent-text); font-size:var(--text-xs); margin:var(--space-2) 0 0; line-height:1.6; }
.workspace-task-history { margin-top:var(--space-3); color:var(--text); font-size:var(--text-xs); }
.workspace-task-history summary { cursor:pointer; color:var(--accent-text); }
.workspace-task-history > .home-secondary-button { margin-top:var(--space-2); font-size:var(--text-xs); }
.workspace-history-list { list-style:none; padding:0; margin:var(--space-2) 0; }
.workspace-history-list > li { border-top:1px solid var(--border); padding:var(--space-3) 0; }
.workspace-history-heading { display:flex; align-items:baseline; gap:var(--space-3); justify-content:space-between; flex-wrap:wrap; }
.workspace-history-heading > span { color:var(--muted); font-size:var(--text-xs); }
.workspace-history-note { white-space:pre-wrap; overflow-wrap:anywhere; font-size:var(--text-xs); line-height:1.7; }
.workspace-history-details { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3); font-size:var(--text-xs); }
.workspace-history-details dt { color:var(--muted); }
.workspace-history-details dd { margin:var(--space-1) 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.workspace-history-page > .home-section-note { margin-bottom:var(--space-4); }
.home-page :is(.workspace-update-editor,.workspace-completion-details,.workspace-task-history,.workspace-topbar) :focus-visible { outline:2px solid var(--accent-text); outline-offset:3px; }
@media(max-width:1024px) {
 .workspace-topbar { top:58px; padding:var(--space-2) var(--space-4); gap:var(--space-2); }
 .workspace-topbar-sandbox { top:calc(var(--portal-banner-height,44px) + 58px); }
 .workspace-topbar .workspace-appearance small { display:none; }
 .workspace-topbar .home-theme-control > span { font-size:var(--text-xs); }
}
@media(max-width:760px) {
 .workspace-home-overview { grid-template-columns:minmax(0,1fr); gap:var(--space-3); }
 .workspace-topbar { padding:var(--space-2) var(--space-3); }
 .workspace-topbar .home-theme-control { min-width:78px; }
 .workspace-topbar .home-theme-control select { width:78px; padding:var(--space-1); font-size:var(--text-xs); }
 .workspace-topbar input { padding:var(--space-2); font-size:var(--text-xs); }
 .workspace-completion-grid,.workspace-history-details { grid-template-columns:minmax(0,1fr); }
 .workspace-task-actions { gap:var(--space-2) var(--space-3); }
}
@media(forced-colors:active) { .workspace-topbar,.workspace-update-editor,.workspace-completion-details { background:Canvas; color:CanvasText; border-color:CanvasText; backdrop-filter:none; } }
@media print { .workspace-topbar,.workspace-task-actions,.workspace-update-editor { display:none; } }

.workspace-topbar .home-button { background:var(--accent); color:var(--on-accent); border-color:var(--on-accent); }

.has-portal-sidebar .sidebar-link.active { box-shadow:var(--shadow-sm); }

/* Home review: clear task actions, accessible dialog and retained work. */
.workspace-home-overview { display:block; }
.workspace-home-overview .workspace-attention { flex-direction:row; align-items:center; }
.workspace-topbar form { transition:opacity .18s ease; }
.workspace-topbar form:focus-within { opacity:1; }
.home-heading-controls { display:flex; gap:var(--space-3); align-items:center; flex-wrap:wrap; }
.home-heading-controls > :is(a,button) { min-height:44px; }
.workspace-ask:not([open]) { display:none; }
.workspace-ask[open] { display:flex; flex-direction:column; width:min(850px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px); margin:auto; padding:0; border:1px solid var(--border); color:var(--text); background:var(--bg); box-shadow:var(--shadow-sm); }
.workspace-ask::backdrop { background:var(--accent-soft); backdrop-filter:blur(7px); }
.workspace-ask-heading { display:flex; justify-content:space-between; align-items:center; gap:var(--space-4); padding:var(--space-4) var(--space-5); flex-shrink:0; }
.workspace-ask-heading h2 { font-size:var(--text-lg); margin:0; }
.workspace-ask-heading button { min-height:44px; }
.workspace-ask-body { overflow:auto; overscroll-behavior:contain; min-height:0; }
.workspace-modal-open { overflow:hidden; }
.workspace-task-actions .home-task-action { min-height:44px; padding:var(--space-2) var(--space-3); font-size:var(--text-xs); border-radius:var(--radius-md); white-space:normal; }
html[data-portal-theme="dark"] .workspace-project .workspace-task-actions .home-task-action { font-size:var(--text-xs); }
.workspace-task-actions [data-update-task] { color:var(--accent-text); background:transparent; border:1px solid var(--border); }
.workspace-task-actions [data-edit-task] { color:var(--on-accent); background:var(--accent); border:1px solid var(--accent); font-weight:700; }
.workspace-latest-note { margin-top:var(--space-3); padding-left:var(--space-3); border-left:2px solid var(--border); }
.workspace-latest-note .home-section-note { font-size:var(--text-xs); margin:0; }
.workspace-latest-note .workspace-history-note { margin:var(--space-1) 0 var(--space-3); }
.workspace-task-history { margin:var(--space-3) 0; font-size:var(--text-xs); }
.workspace-task-history > summary { min-height:44px; align-content:center; }
.workspace-task-history > .home-text-link { display:inline-flex; align-items:center; min-height:44px; }
.workspace-task-history > .home-secondary-button { min-height:44px; font-size:var(--text-xs); }
.workspace-task-feedback button,.workspace-update-feedback button { display:block; margin-top:var(--space-2); min-height:44px; }
.workspace-completion-details { margin-top:0; }
.workspace-task-editor { padding:var(--space-3); border:1px solid var(--border); border-radius:var(--radius-md); }
.workspace-task-editor .workspace-completion-details { padding:0; border:0; background:transparent; margin:0 0 var(--space-3); }
.workspace-task-editor .workspace-completion-grid { margin-top:0; }
.workspace-task-editor > .workspace-completion-notes { display:grid; gap:var(--space-1); margin:var(--space-3) 0 var(--space-3); }
.workspace-task-editor .workspace-notes-caption { display:block; color:var(--text); font-size:var(--text-xs); line-height:1.6; }
.workspace-task-editor .workspace-notes-caption > span { display:inline; font:inherit; white-space:nowrap; }
.workspace-task-editor .workspace-completion-notes textarea { margin:0; }
.workspace-task-editor .workspace-editor-buttons { gap:var(--space-2); }
.workspace-task-editor .workspace-editor-buttons button { min-height:44px; }
.workspace-task-editor .workspace-task-feedback:empty { display:none; }
.workspace-update-editor .workspace-mention-label { margin-top:var(--space-3); }
.workspace-mention-label select { width:100%; max-width:100%; padding:var(--space-2); color:var(--text); background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-md); }
.workspace-mention-label small { color:var(--muted); font-weight:400; }
.workspace-retained-drafts { margin-bottom:var(--space-4); padding:var(--space-2) var(--space-4); }
.workspace-retained-drafts summary { min-height:44px; align-content:center; cursor:pointer; font-size:var(--text-xs); }
.workspace-retained-drafts p { color:var(--muted); font-size:var(--text-xs); line-height:1.6; }
.workspace-retained-drafts article { padding:var(--space-3) 0; border-top:1px solid var(--border); }
.workspace-retained-drafts h3 { margin:0 0 var(--space-2); font-size:var(--text-xs); }
.workspace-retained-drafts dl { margin:0 0 var(--space-3); font-size:var(--text-xs); }
.workspace-retained-drafts dl > div + div { margin-top:var(--space-2); }
.workspace-retained-drafts dt { color:var(--muted); }
.workspace-retained-drafts dd { margin:var(--space-1) 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.workspace-retained-drafts button { min-height:44px; }
.workspace-retained-drafts :focus-visible { outline:2px solid var(--accent-text); outline-offset:3px; }
.home-work[data-stale=true] { border-style:dashed; }
@media(max-width:760px) {
 .workspace-home-overview .workspace-attention { flex-direction:column; align-items:stretch; }
 .workspace-ask[open] { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); }
 .workspace-ask-heading { padding:var(--space-3) var(--space-4); }
 .workspace-task-actions { align-items:stretch; }
 .workspace-task-actions .home-task-action { flex:1 1 135px; }
 .workspace-editor-buttons button { min-height:44px; }
}
@media(prefers-reduced-motion:reduce) { .workspace-topbar form { transition:none; } }
@media(forced-colors:active) {
 .workspace-task-actions [data-edit-task] { background:ButtonFace; color:ButtonText; border-color:ButtonText; }
 .workspace-ask[open] { background:Canvas; color:CanvasText; border-color:CanvasText; }
 .workspace-ask::backdrop { background:Canvas; opacity:.8; backdrop-filter:none; }
 .workspace-topbar form.workspace-search-faded { opacity:1; }
}

/* Shared team Overview: isolated from personal Home and the accounting view. */
.overview-main { max-width: 1480px; }
.overview-context { color: var(--muted); font-size: var(--text-xs); margin: calc(-1 * var(--space-3)) 0 var(--space-4); }
.overview-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-3); margin-bottom:var(--space-4); }
.overview-metrics .home-metric { min-height:128px; padding:var(--space-4); }
.overview-attention { display:flex; align-items:center; gap:var(--space-5); margin-bottom:var(--space-5); }
.overview-attention h2 { margin:var(--space-1) 0; }
.overview-attention-links { flex:1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--space-3); }
.overview-attention-link { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); padding:var(--space-4); border-radius:var(--radius-lg); background:var(--surface-soft); border:1px solid var(--border); color:var(--text); text-decoration:none; font-size:var(--text-xs); }
.overview-attention-link strong { font-size:var(--text-xl); }
.overview-attention-link:hover { background:var(--accent-soft); }
.overview-columns { display:grid; grid-template-columns:minmax(0,2fr) minmax(280px,1fr); align-items:start; gap:var(--space-5); }
.overview-support { display:grid; gap:var(--space-5); min-width:0; }
.overview-projects { display:grid; gap:var(--space-4); }
.overview-project { border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; }
.overview-project header { display:flex; justify-content:space-between; align-items:start; gap:var(--space-3); padding:var(--space-4); background:var(--surface-soft); }
.overview-project h3,.overview-summary-list h3 { margin:0 0 var(--space-1); font-size:var(--text-sm); line-height:1.5; }
.overview-project header p { margin:0; font-size:var(--text-xs); color:var(--muted); }
.overview-main a { overflow-wrap:anywhere; }
.overview-project h3 a,.overview-summary-list h3 a,.overview-task-title { color:var(--text); text-decoration:none; }
.overview-main a:hover { text-decoration:underline; }
.overview-task-list,.overview-summary-list { list-style:none; margin:0; padding:0; }
.overview-task-list li { display:flex; align-items:center; justify-content:space-between; gap:var(--space-4); padding:var(--space-3) var(--space-4); border-top:1px solid var(--border); }
.overview-task-title { font-size:var(--text-xs); font-weight:600; }
.overview-owner { display:block; color:var(--muted); font-size:var(--text-xs); margin-top:var(--space-1); overflow-wrap:anywhere; }
.overview-task-meta { display:flex; justify-content:flex-end; flex-wrap:wrap; align-items:center; gap:var(--space-2); max-width:52%; font-size:var(--text-xs); }
.overview-date { font-size:var(--text-xs); color:var(--muted); }
.overview-date.is-overdue { color:var(--danger-text); }
html[data-portal-theme="dark"] .overview-date.is-overdue { color:var(--danger-text); }
.overview-summary-list li { padding:var(--space-4) 0; border-bottom:1px solid var(--border); }
.overview-summary-list p { margin:var(--space-1) 0; font-size:var(--text-xs); color:var(--muted); }
.overview-summary-list time { color:var(--muted); font-size:var(--text-xs); }
.overview-summary-list + .home-text-link { display:inline-block; margin-top:var(--space-4); }
.overview-tentative { margin-top:var(--space-4); padding:var(--space-4); border:1px dashed var(--border); border-radius:var(--radius-lg); }
.overview-tentative h3 { font-size:var(--text-sm); margin:0; }
.overview-main :focus-visible { outline:3px solid var(--accent-text); outline-offset:3px; }
@media(max-width:1200px) { .overview-columns {grid-template-columns:minmax(0,1fr);} .overview-support {grid-template-columns:repeat(2,minmax(0,1fr));} .overview-attention {align-items:stretch; flex-direction:column;} }
@media(max-width:650px) { .overview-metrics {grid-template-columns:repeat(2,minmax(0,1fr));} .overview-support {grid-template-columns:minmax(0,1fr);} .overview-attention-links {grid-template-columns:minmax(0,1fr);} .overview-main .home-panel {padding:var(--space-4);} .overview-project header,.overview-task-list li {flex-direction:column; align-items:stretch;} .overview-task-meta {max-width:none; justify-content:flex-start;} .overview-main .home-panel-heading {flex-wrap:wrap;} .overview-metrics .home-metric {padding:var(--space-4);min-height:125px;} }
/* Overview work browser: compact project-first hierarchy, scoped to this page. */
.overview-page .overview-main{max-width:1440px}.overview-page .home-heading{margin-bottom:var(--space-2)}.overview-page .home-heading-controls{gap:var(--space-4)}.overview-page .overview-work{scroll-margin-top:var(--space-4)}.overview-page .overview-totals{margin:var(--space-1) 0;color:var(--muted);font-size:var(--text-sm)}.overview-page .overview-help{max-width:32rem;font-size:var(--text-xs);color:var(--muted)}.overview-page summary{cursor:pointer}.overview-page .overview-help p{line-height:1.6}.overview-page .overview-filter-form{margin:var(--space-4) 0}.overview-page .overview-filter-main{display:flex;gap:var(--space-3);align-items:end;flex-wrap:wrap}.overview-page .overview-filter-main>label:first-child{flex:1;min-width:180px}.overview-page label{display:flex;flex-direction:column;gap:var(--space-1);font-size:var(--text-xs);min-width:0}.overview-page input,.overview-page select{max-width:100%;min-width:0}.overview-page .overview-advanced{margin-top:var(--space-3);font-size:var(--text-sm)}.overview-page .overview-filter-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-4);padding:var(--space-3) 0}.overview-page .overview-filter-fields fieldset{grid-column:1/-1;border:0;padding:0;display:flex;flex-wrap:wrap;gap:var(--space-4)}.overview-page .overview-check{display:inline-flex;flex-direction:row;align-items:center;gap:var(--space-2)}.overview-page .overview-check input{width:auto}.overview-page .overview-filter-extra{display:flex;gap:var(--space-4);flex-wrap:wrap}.overview-page .overview-exports{font-size:var(--text-xs);margin-bottom:var(--space-4)}.overview-page .overview-exports a{display:inline-block;margin:var(--space-2) var(--space-4) var(--space-1) 0}.overview-page .overview-project{border:1px solid var(--border);border-radius:var(--radius-sm);margin:var(--space-3) 0;padding:0;overflow:hidden}.overview-page .overview-project>summary{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);list-style:none;padding:var(--space-4) var(--space-4)}.overview-page .overview-project>summary::-webkit-details-marker{display:none}.overview-page .overview-project h3{font-size:var(--text-md);font-weight:700;margin:0;line-height:1.4}.overview-page .overview-project-heading{min-width:0}.overview-page .overview-project-heading p,.overview-page .overview-review-project p{font-size:var(--text-xs);margin:var(--space-1) 0 0;color:var(--muted)}.overview-page .overview-matching{display:inline-flex;align-items:center;gap:var(--space-2);font-size:var(--text-xs);line-height:1.4;color:var(--danger-text);flex-shrink:0;background:none;border:0;padding:0}.overview-page .overview-chevron{font-size:var(--text-lg);transition:transform .15s}.overview-page details[open]>.overview-matching .overview-chevron,.overview-page details[open]>summary .overview-chevron{transform:rotate(180deg)}html[data-portal-theme=dark] .overview-page .overview-matching{color:var(--danger-text)}.overview-page .overview-task-list{margin:0 var(--space-4) var(--space-4) var(--space-6);padding:0 0 0 var(--space-4);border-left:2px solid var(--border)}.overview-page .overview-task-title{font-size:var(--text-sm);font-weight:600}.overview-page .overview-owner{font-size:var(--text-xs)}.overview-page .overview-task-meta{font-size:var(--text-xs)}.overview-page [data-overview-urgency]{display:flex;gap:var(--space-2);align-items:end;flex-wrap:wrap}.overview-page [data-overview-urgency] label{font-size:var(--text-xs)}.overview-page [data-overview-urgency] select{padding:var(--space-1);font-size:var(--text-xs)}.overview-page [data-overview-urgency] button{padding:var(--space-1) var(--space-3);font-size:var(--text-xs)}.overview-page [data-urgency-status]{flex-basis:100%}.overview-page .overview-review-project{padding:var(--space-4)}.overview-page .overview-activity{margin-top:var(--space-4)}.overview-page .overview-activity h2{font-size:var(--text-md)}.overview-page .overview-activity .overview-summary-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-2) var(--space-4)}.overview-page .overview-summary-list h3{font-size:var(--text-sm)}.overview-page .overview-summary-list p,.overview-page .overview-summary-list time{font-size:var(--text-xs)}.overview-page [aria-busy=true]{opacity:.65}.overview-page summary:focus-visible,.overview-page #team-work-title:focus-visible{outline:2px solid currentColor;outline-offset:3px}.overview-page .workspace-pagination{flex-wrap:wrap;font-size:var(--text-xs)}
@media(max-width:700px){.overview-page .home-panel-heading{flex-wrap:wrap;gap:var(--space-2)}.overview-page .overview-filter-fields{grid-template-columns:1fr}.overview-page .overview-project>summary{align-items:start;padding:var(--space-3);flex-wrap:wrap;gap:var(--space-2)}.overview-page .overview-project-heading{flex-basis:100%}.overview-page .overview-task-list{margin:0 var(--space-3) var(--space-3) var(--space-4);padding-left:var(--space-3)}.overview-page .overview-activity .overview-summary-list{grid-template-columns:1fr}.overview-page .overview-filter-main{align-items:stretch}.overview-page .overview-filter-main>label{flex-basis:100%}.overview-page .overview-help{max-width:100%}}
@media(prefers-reduced-motion:reduce){.overview-page .overview-chevron{transition:none}}
.overview-page .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:calc(-1 * var(--space-1));overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.overview-page .overview-projects{display:block}.overview-page .overview-project>summary{padding:var(--space-3) var(--space-4)}.overview-page .overview-project{margin:var(--space-2) 0}.overview-page .overview-project-heading a{overflow-wrap:anywhere}.overview-page .overview-task-meta{max-width:60%}
@media(max-width:700px){.overview-page .overview-task-meta{max-width:none}}
.overview-page input:not([type=checkbox]):not([type=hidden]),.overview-page select,.overview-page option{background:var(--surface-soft);color:var(--text);border-color:var(--border)}.overview-page input::placeholder{color:var(--muted);opacity:1}.overview-page .overview-project>summary>.overview-matching{display:inline-flex;flex-direction:row;white-space:nowrap;flex-wrap:nowrap;align-items:center}.overview-page .overview-chevron{display:inline-block;flex:none;line-height:1}

/* Intake abuse trap, excluded from keyboard and accessibility navigation. */
.intake-honey { position:absolute!important; width:1px!important; height:1px!important; overflow:hidden!important; clip-path:inset(50%)!important; }

/* The signed-out sandbox loads only this public stylesheet. */
.portal-skip-link{position:fixed;top:8px;left:8px;z-index:20000;padding:var(--space-3) var(--space-4);background:var(--surface);color:var(--accent-text);border:2px solid var(--border);border-radius:var(--radius-md);transform:translateY(-200%)}
.portal-skip-link:focus{transform:none}

/* Guided intake: native fallback and lazy steps share the same token-based surface. */
.intake-shell.request-shell{display:block;max-width:1060px;margin-inline:auto}
.intake-wizard [hidden]{display:none!important}
.intake-wizard .form-section,.intake-wizard .service-card{display:block}
.intake-wizard [data-step]{min-width:0;padding:clamp(var(--space-4),3vw,var(--space-5));border:1px solid var(--border);border-radius:var(--radius-xl);background:var(--surface);color:var(--text);scroll-margin-top:var(--space-6)}
.intake-wizard [data-step] [data-step]{padding:0;border:0}
.intake-wizard .intake-progress{display:flex;gap:var(--space-1);flex-wrap:wrap;margin-bottom:var(--space-2)}
.intake-progress button{font:inherit;border:1px solid var(--border);border-radius:var(--radius-md);padding:var(--space-2) var(--space-2);background:var(--surface);color:var(--text);cursor:pointer}
.intake-progress button[aria-current]{border-color:var(--accent);font-weight:700;box-shadow:var(--shadow-sm)}
.intake-wizard progress{width:100%;accent-color:var(--accent-text);block-size:10px}
.intake-categories{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-3)}
.intake-wizard .intake-choice{display:flex;align-items:flex-start;gap:var(--space-3);padding:var(--space-4);border:1px solid var(--border);border-radius:var(--radius-lg);cursor:pointer;background:var(--surface)}
.intake-choice input{width:auto;flex:none;margin-top:var(--space-1);accent-color:var(--accent-text)}
.intake-choice span{display:grid;gap:var(--space-1)}.intake-choice small{color:var(--text-muted)}
.intake-choice:has(:checked){outline:2px solid var(--accent-text);outline-offset:-2px}
.intake-wizard :focus-visible{outline:3px solid var(--accent-text);outline-offset:3px}
.intake-wizard .service-card{margin-block:var(--space-3);padding:var(--space-4);border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}
.intake-wizard .form-actions{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.intake-wizard .form-actions button{min-height:44px}
.intake-wizard [data-field-error],.intake-wizard .attachment-error{color:var(--text);font-weight:600}
.intake-wizard [aria-invalid=true]{outline:2px solid var(--accent-text)}
.intake-review-section{padding-block:var(--space-3);border-bottom:1px solid var(--border)}
.intake-review-section dl{display:grid;grid-template-columns:minmax(95px,1fr) 3fr;gap:var(--space-2) var(--space-4)}
.intake-review-section dt{font-weight:600}.intake-review-section dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.intake-wizard .flash-error{white-space:pre-wrap}
.intake-wizard [data-intake-bloom] .cnx-loader{width:72px;height:72px;--cnx-green:#8ec744;--cnx-orange:#f1592a}
.intake-wizard .cnx-loader .p{fill:#8ec744;transform-box:view-box;transform-origin:100px 100px;animation:intake-bloom 1.8s cubic-bezier(.2,.8,.2,1) infinite both}
.intake-wizard .cnx-loader .tr{fill:#f1592a;animation-delay:.12s}.intake-wizard .cnx-loader .br{animation-delay:.24s}.intake-wizard .cnx-loader .bl{animation-delay:.36s}
@keyframes intake-bloom{0%,100%{transform:scale(.3);opacity:0}20%,72%{transform:scale(1);opacity:1}}
@supports(backdrop-filter:blur(8px)){.intake-wizard [data-step]{background:var(--surface);backdrop-filter:blur(8px)}}
@media(prefers-reduced-transparency:reduce){.intake-wizard [data-step]{background:var(--surface);backdrop-filter:none}}
@media(prefers-reduced-motion:reduce){.intake-wizard .cnx-loader .p{animation:none;opacity:1;transform:none}}
@media(max-width:640px){.intake-categories{grid-template-columns:1fr}.intake-wizard .grid-two{grid-template-columns:minmax(0,1fr)}.intake-progress button{font-size:var(--text-sm)}.intake-review-section dl{grid-template-columns:1fr}.intake-review-section dd{margin-bottom:var(--space-2)}.intake-wizard [data-step]{padding:var(--space-3)}}

/* Public intake also has complete tokens without the protected staff stylesheet. */
.request-portal-body .intake-shell .request-panel{background:var(--surface);color:var(--text)}
.intake-wizard :is(h2,h3,h4,label,legend,label>span){color:var(--text)}
.intake-wizard :is(p,.field-hint,.intake-choice small){color:var(--muted)}
.intake-wizard :is(input,select,textarea){background:var(--surface);color:var(--text);border-color:var(--border)}
.intake-wizard :is(.check-row,.attachment-dropzone,.attachment-file-list li,.custom-request-fields){background:var(--surface-soft);color:var(--text);border-color:var(--border)}
.intake-wizard :is(.ghost-button,.reset-button,.attachment-file-list button){background:var(--surface-soft);color:var(--text);border-color:var(--border)}
.intake-wizard .button{background:var(--accent);color:var(--on-accent);border-color:var(--on-accent)}
.intake-wizard .button:hover{background:var(--accent);color:var(--on-accent)}
.intake-wizard :is(.attachment-dropzone-copy,.attachment-dropzone-copy strong,.attachment-file-empty){color:var(--muted)}
.intake-wizard .check-row:has(:checked){outline:2px solid var(--accent-text);outline-offset:-2px}
.intake-enhanced [data-step]{animation:intake-step-in .18s ease-out}
@keyframes intake-step-in{from{opacity:.7;transform:translateY(6px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.intake-enhanced [data-step]{animation:none}}

.request-portal-body .request-intake-header{display:block;max-width:1060px;margin:0 auto var(--space-4);padding:var(--space-4);border:1px solid var(--border);border-radius:var(--radius-xl);background:var(--surface);color:var(--text)}
.request-portal-body .request-intake-header :is(h1,h2,strong){color:var(--text)}
.request-portal-body .request-intake-header p{color:var(--muted);line-height:1.5}
.intake-wizard .attachment-dropzone-copy span{color:var(--muted)}

/* Native/plain intake: category selection hides scheduling without discarding entered values. */
.intake-wizard:has([name=requestCategory][value=production]:checked) #scheduleSection,
.intake-wizard:has([name=requestCategory][value=web]:checked) #scheduleSection { display:none; }


}
