:root {
  --bg: #f4efe5;
  --panel: rgba(255, 252, 247, 0.82);
  --panel-solid: #fffaf2;
  --panel-contrast: #15212b;
  --panel-muted: #54626d;
  --line: rgba(25, 39, 54, 0.12);
  --brand: #0f6b65;
  --brand-strong: #0c4d4a;
  --accent: #c77d31;
  --success: #2f8f61;
  --warning: #bb7b1f;
  --danger: #b24f44;
  --shadow: 0 24px 70px rgba(24, 33, 43, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --motion-fast: 180ms;
  --motion-medium: 240ms;
  --motion-slow: 720ms;
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  --font-body: "Aptos", "Segoe UI Variable", "Trebuchet MS", sans-serif;
  --font-display: "Georgia", "Cambria", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--panel-contrast);
  background:
    radial-gradient(circle at top left, rgba(23, 121, 113, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(199, 125, 49, 0.18), transparent 30%),
    linear-gradient(180deg, #f8f3ea 0%, #f1ebdf 100%);
}

body {
  position: relative;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(14px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.ambient-one {
  width: 360px;
  height: 360px;
  background: rgba(15, 107, 101, 0.18);
  top: -120px;
  right: -120px;
}

.ambient-two {
  width: 420px;
  height: 420px;
  background: rgba(199, 125, 49, 0.15);
  bottom: -180px;
  left: -120px;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px 0;
}

.main-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  padding: 18px 26px 28px;
  min-height: 0;
}

.brand-panel,
.context-panel,
.sidebar,
.surface-card,
.task-card,
.metric-card,
.page-hero,
.step-card,
.sop-sheet,
.review-card,
.settings-card,
.empty-state,
.modal-card,
.toast {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.brand-panel,
.context-panel {
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  min-height: 118px;
}

.brand-panel {
  flex: 1 1 520px;
  background: linear-gradient(135deg, rgba(15, 107, 101, 0.95), rgba(12, 77, 74, 0.94));
  color: #f8f5ee;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2vw, 2.3rem);
  line-height: 1.1;
}

.brand-copy {
  margin: 10px 0 0;
  color: rgba(248, 245, 238, 0.8);
  max-width: 720px;
  line-height: 1.5;
}

.context-panel {
  width: min(420px, 36vw);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.context-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--panel-muted);
}

.storage-pill,
.status-pill,
.source-pill,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.storage-pill {
  color: var(--brand-strong);
  background: rgba(15, 107, 101, 0.12);
}

.role-switch {
  display: inline-flex;
  background: rgba(16, 36, 43, 0.08);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.role-switch button {
  border: 0;
  background: transparent;
  color: var(--panel-contrast);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.role-switch button.active {
  background: var(--panel-solid);
  color: var(--brand-strong);
  box-shadow: 0 10px 24px rgba(15, 107, 101, 0.14);
}

.worker-select {
  width: 100%;
}

.sidebar {
  border-radius: var(--radius-xl);
  padding: 18px;
  position: sticky;
  top: 18px;
  height: fit-content;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.nav-button {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.45);
  color: var(--panel-contrast);
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  cursor: pointer;
}

.nav-button strong {
  display: block;
  font-size: 0.96rem;
}

.nav-button span {
  display: block;
  margin-top: 6px;
  color: var(--panel-muted);
  font-size: 0.86rem;
}

.nav-button.active {
  background: linear-gradient(135deg, rgba(15, 107, 101, 0.16), rgba(255, 250, 242, 0.95));
  border-color: rgba(15, 107, 101, 0.18);
  transform: translateX(3px);
}

.sidebar-note {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(18, 32, 45, 0.04);
  border: 1px solid var(--line);
}

.page {
  min-width: 0;
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-hero,
.surface-card,
.step-card,
.settings-card,
.empty-state,
.task-card,
.review-card,
.metric-card {
  border-radius: var(--radius-xl);
}

.page-hero {
  padding: 24px;
  background: linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(242, 233, 215, 0.84));
}

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

.hero-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 1.9vw, 2.2rem);
}

.hero-head p {
  margin: 0;
  color: var(--panel-muted);
  max-width: 840px;
  line-height: 1.55;
}

.hero-actions,
.inline-actions,
.task-actions,
.modal-actions,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.publish-control {
  position: relative;
  z-index: 2;
}

.publish-split {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(18, 23, 31, 0.08);
}

.publish-split .button {
  border-radius: 0;
  box-shadow: none;
}

.publish-toggle {
  min-width: 52px;
  padding-inline: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.publish-split .button:first-child {
  border-radius: 999px 0 0 999px;
  flex: 1 1 auto;
}

.publish-split .button:last-child {
  border-radius: 0 999px 999px 0;
}

.publish-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  top: auto;
  right: 0;
  z-index: 12;
  min-width: 240px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid #e3d9c9;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 22px 40px rgba(18, 23, 31, 0.1);
  backdrop-filter: blur(12px);
}

.modal-publish-control .publish-menu {
  top: calc(100% + 10px);
  bottom: auto;
  right: auto;
  left: 0;
}

.publish-menu-item {
  appearance: none;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #fffdf9;
  color: #243039;
  text-align: left;
  padding: 12px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform var(--motion-fast) var(--ease-premium),
    background-color var(--motion-fast) var(--ease-premium),
    border-color var(--motion-fast) var(--ease-premium),
    box-shadow var(--motion-medium) var(--ease-premium);
}

.publish-menu-item:hover {
  transform: translateY(-1px);
  background: #f7f2e9;
  border-color: #e2d7c7;
  box-shadow: 0 12px 24px rgba(18, 23, 31, 0.06);
}

.metrics-grid,
.surface-grid,
.task-grid,
.library-grid,
.review-grid,
.settings-grid {
  display: grid;
  gap: 18px;
}

.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.surface-grid {
  grid-template-columns: 1.5fr 1fr;
}

.task-grid,
.library-grid,
.review-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.metric-card,
.surface-card,
.task-card,
.review-card,
.settings-card,
.empty-state {
  padding: 20px;
}

.metric-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--panel-muted);
}

.metric-value {
  margin-top: 12px;
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--brand-strong);
}

.metric-footnote {
  margin-top: 8px;
  color: var(--panel-muted);
  line-height: 1.45;
}

.surface-card h3,
.step-card h3,
.settings-card h3,
.modal-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.surface-card p,
.settings-card p,
.review-meta,
.task-meta,
.field-hint,
.library-meta,
.task-summary,
.empty-state p,
.form-note,
.page-subtle {
  color: var(--panel-muted);
  line-height: 1.5;
}

.signal-list,
.task-list,
.detail-list,
.submission-list {
  display: grid;
  gap: 12px;
}

.signal-item,
.task-list-item,
.detail-item,
.submission-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
}

.signal-item strong,
.task-list-item strong,
.detail-item strong,
.submission-item strong {
  display: block;
  margin-bottom: 6px;
}

.chip-row,
.filter-row,
.stepper,
.task-stat-row,
.detail-grid,
.settings-stack,
.modal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: 1px solid transparent;
  background: rgba(12, 77, 74, 0.08);
  color: var(--brand-strong);
}

.chip.interactive {
  cursor: pointer;
}

.chip.active {
  background: rgba(12, 77, 74, 0.16);
  border-color: rgba(12, 77, 74, 0.18);
}

.task-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-card-head,
.review-head,
.settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.task-card h3,
.review-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.task-summary {
  margin: 8px 0 0;
}

.task-stat {
  min-width: 110px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(18, 32, 45, 0.04);
  border: 1px solid var(--line);
}

.task-stat strong {
  display: block;
  font-size: 0.84rem;
  color: var(--panel-muted);
  margin-bottom: 5px;
}

.task-stat span {
  font-weight: 700;
}

.status-pill {
  background: rgba(18, 32, 45, 0.08);
  color: var(--panel-contrast);
  border: 1px solid rgba(18, 32, 45, 0.08);
}

.status-pill.status-draft {
  background: rgba(214, 167, 42, 0.16);
  color: #8a6610;
  border-color: rgba(214, 167, 42, 0.2);
}

.status-pill.status-published {
  background: rgba(59, 96, 167, 0.14);
  color: #24446f;
}

.status-pill.status-available {
  background: rgba(15, 107, 101, 0.14);
  color: var(--brand-strong);
  border-color: rgba(15, 107, 101, 0.18);
}

.status-pill.status-assigned {
  background: rgba(100, 74, 191, 0.14);
  color: #5d41b5;
  border-color: rgba(100, 74, 191, 0.16);
}

.status-pill.status-in-progress {
  background: rgba(199, 125, 49, 0.16);
  color: #7a4b17;
}

.status-pill.status-submitted {
  background: rgba(177, 87, 34, 0.14);
  color: #83431b;
}

.status-pill.status-approved {
  background: rgba(47, 143, 97, 0.16);
  color: #205f41;
}

.status-pill.status-archived {
  background: rgba(54, 72, 83, 0.1);
  color: #41535f;
  border-color: rgba(54, 72, 83, 0.12);
}

.source-pill {
  background: rgba(12, 77, 74, 0.08);
  color: var(--brand-strong);
}

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

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
}

.button.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #f7f4ed;
}

.button.secondary {
  background: rgba(18, 32, 45, 0.06);
  color: var(--panel-contrast);
  border-color: var(--line);
}

.button.warning {
  background: rgba(199, 125, 49, 0.16);
  color: #7a4b17;
}

.button.success {
  background: rgba(47, 143, 97, 0.16);
  color: #205f41;
}

.button.ghost {
  background: transparent;
  color: var(--brand-strong);
  border-color: rgba(12, 77, 74, 0.16);
}

.button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.stepper {
  margin-bottom: 18px;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
}

.step-pill.active {
  background: rgba(15, 107, 101, 0.14);
  border-color: rgba(15, 107, 101, 0.18);
}

.step-index {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(18, 32, 45, 0.08);
  font-size: 0.86rem;
  font-weight: 800;
}

.step-card {
  padding: 22px;
}

.two-column {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.35fr 0.95fr;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(25, 39, 54, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--panel-contrast);
  padding: 13px 14px;
  border-radius: 16px;
  outline: none;
}

textarea {
  min-height: 128px;
  resize: vertical;
}

.dropzone {
  min-height: 170px;
  border: 2px dashed rgba(15, 107, 101, 0.26);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(15, 107, 101, 0.07), rgba(255, 252, 247, 0.9));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
}

.dropzone.dragging {
  border-color: rgba(199, 125, 49, 0.8);
  background: linear-gradient(135deg, rgba(199, 125, 49, 0.18), rgba(255, 252, 247, 0.95));
}

.dropzone strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.dropzone button {
  margin-top: 12px;
}

.upload-meta {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(18, 32, 45, 0.04);
  border: 1px solid var(--line);
}

.sop-sheet {
  border-radius: var(--radius-xl);
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 244, 235, 0.94));
}

.sop-sheet h1,
.sop-sheet h2,
.sop-sheet h3 {
  font-family: var(--font-display);
}

.sop-sheet h1 {
  margin: 0 0 20px;
  font-size: 1.9rem;
}

.sop-sheet h2 {
  margin: 22px 0 10px;
  font-size: 1.15rem;
}

.sop-sheet p,
.sop-sheet li {
  line-height: 1.65;
}

.sop-sheet ul,
.sop-sheet ol {
  padding-left: 20px;
}

.empty-state {
  text-align: center;
  padding: 36px 24px;
}

.review-card blockquote,
.modal-note {
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border-left: 4px solid rgba(15, 107, 101, 0.4);
  background: rgba(18, 32, 45, 0.04);
  color: var(--panel-muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 28, 0.5);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 30;
}

.modal-card {
  width: min(1040px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 30px;
  padding: 24px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.modal-grid {
  align-items: flex-start;
  flex-wrap: nowrap;
}

.modal-main {
  flex: 1 1 62%;
  min-width: 0;
}

.modal-side {
  flex: 0 0 320px;
  min-width: 280px;
}

.modal-edit-fields {
  display: grid;
  gap: 16px;
}

.modal-sop-editor {
  padding: 18px;
}

.modal-description-textarea {
  min-height: 110px;
}

.modal-sop-textarea {
  min-height: 640px;
  margin-top: 12px;
  line-height: 1.65;
  background: #fffdf9;
}

.modal-inline-field {
  margin-top: 16px;
}

.video-frame {
  width: 100%;
  border-radius: 20px;
  background: #101b1f;
  overflow: hidden;
  min-height: 200px;
}

.video-frame video {
  width: 100%;
  display: block;
}

.detail-grid {
  margin-top: 12px;
}

.detail-card {
  flex: 1 1 240px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(18, 32, 45, 0.04);
}

.detail-card-edit {
  display: grid;
  gap: 10px;
}

.detail-card-edit input,
.detail-card-edit select {
  background: #fffdf9;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  z-index: 40;
}

.toast {
  min-width: 280px;
  max-width: 360px;
  border-radius: 18px;
  padding: 14px 16px;
}

.toast strong {
  display: block;
  margin-bottom: 4px;
}

.toast.info {
  border-left: 5px solid var(--brand);
}

.toast.success {
  border-left: 5px solid var(--success);
}

.toast.warning {
  border-left: 5px solid var(--warning);
}

.toast.error {
  border-left: 5px solid var(--danger);
}

.hidden-input {
  display: none;
}

.mini-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(18, 32, 45, 0.04);
  border: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .topbar {
    flex-direction: column;
  }

  .context-panel {
    width: 100%;
  }

  .main-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .surface-grid,
  .two-column,
  .modal-grid {
    grid-template-columns: 1fr;
    flex-wrap: wrap;
  }

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

  .builder-step-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .topbar,
  .main-layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .builder-hero .hero-head {
    align-items: flex-start;
  }

  .builder-hero h2 {
    max-width: none;
  }

  .builder-stepper,
  .builder-page .detail-grid {
    grid-template-columns: 1fr;
  }

  .builder-main-card,
  .builder-side-card,
  .builder-sop-card {
    padding: 28px;
  }

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

  .builder-footer-left,
  .builder-footer-right {
    width: 100%;
  }

  .builder-footer-right {
    justify-content: flex-end;
  }
}

@media (max-width: 620px) {
  .brand-row,
  .hero-head,
  .task-card-head,
  .review-head,
  .settings-row,
  .modal-head {
    flex-direction: column;
  }

  .modal-sop-textarea {
    min-height: 420px;
  }

  .toast-stack {
    left: 16px;
    right: 16px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

/* Premium simplification overrides */

.ambient {
  display: none;
}

body {
  background: #f7f4ee;
}

.topbar {
  padding: 18px 56px 0;
}

.main-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0 56px 56px;
}

.sidebar {
  display: none;
}

.page {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

.simple-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 6px 0 18px;
  border-bottom: 1px solid rgba(25, 39, 54, 0.1);
}

.simple-header-copy {
  max-width: 360px;
  justify-self: start;
}

.simple-brand {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 2rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.simple-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  justify-self: end;
  min-width: 0;
}

.simple-header-nav {
  justify-self: center;
  align-self: center;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.top-nav-link {
  border: 0;
  background: transparent;
  color: var(--panel-muted);
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.top-nav-link.active {
  background: #ece7dd;
  color: var(--panel-contrast);
}

.simple-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 6px;
  border-radius: 20px;
  border: 1px solid rgba(224, 217, 204, 0.9);
  background: rgba(255, 253, 249, 0.9);
  box-shadow: 0 12px 24px rgba(19, 28, 37, 0.04);
}

.simple-worker-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.slim-select {
  min-width: 220px;
}

.simple-role-note {
  margin: 0;
  text-align: right;
}

.role-switch {
  background: #f1ece4;
  padding: 3px;
  flex-wrap: wrap;
}

.role-switch button {
  padding: 8px 12px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.role-switch button.active {
  box-shadow: none;
  background: #ffffff;
}

.page-content {
  gap: 36px;
  padding-top: 18px;
}

.premium-flow {
  gap: 26px;
}

.workflow-intro {
  padding: 8px 0 0;
}

.workflow-intro .hero-actions {
  margin-top: 24px;
}

.compact-intro .hero-head {
  align-items: center;
}

.workflow-lede {
  margin: 0;
  max-width: 700px;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.65;
  color: #4c5962;
}

.admin-task-page {
  gap: 30px;
}

.admin-task-page .workflow-intro {
  padding-top: 4px;
}

.admin-task-page .hero-head {
  align-items: flex-end;
  gap: 24px;
}

.admin-task-page .workflow-lede {
  max-width: 58ch;
  font-size: clamp(1.05rem, 1.35vw, 1.2rem);
  color: #5a6670;
}

.builder-page {
  gap: 28px;
  padding-top: 4px;
}

.builder-hero {
  padding: 6px 0 24px;
  border-bottom: 1px solid rgba(214, 205, 190, 0.72);
}

.builder-hero .hero-head {
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 30px;
}

.builder-hero .eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: #64788e;
}

.builder-hero h2 {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.7vw, 3.45rem);
  line-height: 0.99;
  letter-spacing: -0.06em;
  color: #162130;
  max-width: 11ch;
  font-weight: 600;
}

.builder-hero p {
  margin: 14px 0 0;
  max-width: 42ch;
  font-size: clamp(0.92rem, 1.1vw, 1.02rem);
  line-height: 1.56;
  color: #627079;
}

.builder-hero .hero-actions {
  margin-top: 0;
}

.builder-hero .hero-actions .button {
  min-height: 50px;
  padding-inline: 22px;
}

.builder-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 30px;
  background: rgba(255, 253, 249, 0.82);
  border: 1px solid rgba(226, 217, 204, 0.95);
  box-shadow: 0 16px 30px rgba(19, 28, 37, 0.04);
}

.builder-stepper .step-pill {
  width: 100%;
  min-height: 70px;
  padding: 15px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(213, 222, 231, 0.92);
  gap: 12px;
}

.builder-stepper .step-pill.active {
  background: linear-gradient(180deg, rgba(232, 248, 245, 0.98) 0%, rgba(240, 250, 247, 0.95) 100%);
  border-color: rgba(134, 224, 212, 0.95);
  box-shadow: 0 12px 22px rgba(15, 107, 101, 0.07);
}

.builder-stepper .step-index {
  width: 34px;
  height: 34px;
  font-size: 0.92rem;
  background: #eef2f6;
  color: #596674;
}

.builder-stepper .step-pill.active .step-index {
  background: #0f7e74;
  color: #fffdf9;
}

.builder-stepper strong {
  display: block;
  font-size: 0.93rem;
  font-weight: 600;
  color: #1d2834;
}

.builder-stepper .page-subtle {
  margin-top: 3px;
  font-size: 0.82rem;
  color: #73808a;
}

.builder-step-layout {
  gap: 24px;
  grid-template-columns: minmax(0, 1.72fr) minmax(300px, 0.9fr);
}

.builder-main-card,
.builder-side-card,
.builder-sop-card {
  border-radius: 30px;
  padding: 30px;
  border: 1px solid rgba(226, 217, 205, 0.95);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 18px 38px rgba(18, 23, 31, 0.05);
}

.builder-main-card .eyebrow,
.builder-side-card .eyebrow,
.builder-sop-card .eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  color: #6b7e8d;
}

.builder-main-card h3 {
  margin: 12px 0 0;
  font-size: clamp(1.72rem, 2.15vw, 2.32rem);
  line-height: 1;
  letter-spacing: -0.045em;
  color: #1a2532;
  max-width: 12ch;
}

.builder-card-copy {
  margin: 14px 0 0;
  max-width: 34ch;
  font-size: 0.94rem;
  line-height: 1.55;
}

.builder-side-card h3,
.builder-sop-card h3 {
  margin: 12px 0 0;
  font-size: clamp(1.34rem, 1.6vw, 1.68rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: #1e2834;
  max-width: 14ch;
}

.builder-main-card .form-grid,
.builder-main-card .detail-grid {
  margin-top: 22px;
}

.builder-main-card .form-grid {
  gap: 18px 16px;
}

.builder-page .field {
  gap: 8px;
}

.builder-page .field label {
  font-size: 0.96rem;
  font-weight: 700;
  color: #202b36;
}

.builder-page .step-card input,
.builder-page .step-card select {
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(209, 219, 228, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 2px 8px rgba(18, 23, 31, 0.035);
}

.builder-page .step-card textarea {
  min-height: 154px;
  padding: 16px 16px 14px;
  border-radius: 24px;
  border: 1px solid rgba(209, 219, 228, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 2px 8px rgba(18, 23, 31, 0.035);
}

.builder-page .step-card input::placeholder,
.builder-page .step-card textarea::placeholder {
  color: #8aa0bd;
}

.builder-page .field-hint,
.builder-page .form-note {
  font-size: 0.88rem;
  line-height: 1.5;
}

.builder-compact-hint {
  margin-top: -2px;
}

.builder-side-card .signal-list {
  gap: 14px;
  margin-top: 18px;
}

.builder-side-card .signal-item {
  padding: 20px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(210, 220, 229, 0.92);
  box-shadow: 0 8px 18px rgba(19, 28, 37, 0.03);
}

.builder-side-card .signal-item strong {
  margin-bottom: 8px;
  font-size: 0.94rem;
  color: #1c2733;
}

.builder-side-card .signal-item span {
  display: block;
  color: #5f6e78;
  font-size: 0.92rem;
  line-height: 1.58;
}

.builder-page .dropzone {
  min-height: 190px;
  padding: 24px;
  border-radius: 24px;
}

.builder-page .upload-meta {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(18, 32, 45, 0.03);
}

.builder-page .detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.builder-page .detail-card {
  padding: 18px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(210, 220, 229, 0.92);
  box-shadow: 0 8px 18px rgba(19, 28, 37, 0.028);
}

.builder-page .detail-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #77848d;
}

.builder-page .detail-card div {
  font-size: 0.98rem;
  color: #1d2731;
}

.builder-sop-card {
  padding: 30px;
}

.builder-footer-bar {
  padding: 18px 0 0;
  border-top: 1px solid rgba(214, 205, 190, 0.72);
}

.builder-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.builder-footer-left,
.builder-footer-right {
  display: flex;
  align-items: center;
}

.builder-footer-right {
  gap: 12px;
  margin-left: auto;
}

.builder-footer-bar .button {
  min-height: 48px;
  padding-inline: 20px;
}

.admin-home-page {
  min-height: calc(100vh - 210px);
  gap: 16px;
}

.admin-home-shell {
  position: relative;
  overflow: hidden;
  min-height: clamp(620px, 74vh, 820px);
  border-radius: 40px;
  padding: clamp(52px, 8vw, 96px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  border: 1px solid rgba(224, 217, 204, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 254, 251, 0.98), rgba(249, 244, 237, 0.96)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), rgba(255, 251, 245, 0.92) 42%, rgba(244, 239, 230, 0.92) 100%);
  box-shadow: 0 26px 70px rgba(21, 32, 44, 0.08);
}

.admin-home-shell::before,
.admin-home-shell::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.admin-home-shell::before {
  width: 420px;
  height: 420px;
  top: -140px;
  right: -110px;
  background: radial-gradient(circle, rgba(15, 107, 101, 0.12) 0%, rgba(15, 107, 101, 0) 72%);
}

.admin-home-shell::after {
  width: 360px;
  height: 360px;
  bottom: -160px;
  left: -120px;
  background: radial-gradient(circle, rgba(38, 73, 136, 0.1) 0%, rgba(38, 73, 136, 0) 70%);
}

.admin-home-panel {
  position: relative;
  z-index: 2;
  width: min(100%, 980px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-home-status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border-radius: 26px;
  background: rgba(255, 253, 249, 0.72);
  border: 1px solid rgba(230, 223, 211, 0.95);
  box-shadow: 0 14px 28px rgba(18, 24, 33, 0.04);
  width: min(100%, 980px);
  margin: 0 auto;
}

.admin-home-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.admin-home-metric-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a858d;
}

.admin-home-metric-value {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: #1b2833;
}

.admin-home-focus {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  text-align: center;
  min-height: 0;
  width: min(100%, 720px);
  padding: clamp(40px, 5vw, 56px) clamp(28px, 4vw, 44px);
}

.admin-home-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.admin-home-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.3rem, 7.6vw, 5.6rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: #15202c;
  max-width: 11ch;
}

.admin-home-copy p:last-child {
  margin: 0;
  max-width: 32ch;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.7;
  color: #56636d;
}

.admin-home-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.admin-home-button {
  min-width: min(100%, 320px);
  min-height: 68px;
  padding: 18px 34px;
  border-radius: 999px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 18px 36px rgba(15, 107, 101, 0.2);
}

.admin-home-secondary {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: #44535d;
  cursor: pointer;
}

.admin-home-secondary:hover {
  color: var(--brand-strong);
}

.admin-home-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.admin-home-thought {
  position: absolute;
  max-width: 220px;
  font-size: clamp(0.95rem, 1.3vw, 1.18rem);
  line-height: 1.5;
  color: rgba(61, 73, 82, 0.38);
  letter-spacing: 0.01em;
  animation: adminThoughtFloat 18s ease-in-out infinite;
}

.admin-home-thought.thought-1 {
  top: 11%;
  left: 4%;
  animation-delay: -1s;
}

.admin-home-thought.thought-2 {
  top: 12%;
  right: 4%;
  animation-delay: -6s;
}

.admin-home-thought.thought-3 {
  top: 54%;
  left: 3%;
  animation-delay: -3s;
}

.admin-home-thought.thought-4 {
  top: 55%;
  right: 4%;
  animation-delay: -8s;
}

.admin-home-thought.thought-5 {
  bottom: 10%;
  left: 36%;
  animation-delay: -10s;
}

@keyframes adminThoughtFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.6;
  }

  50% {
    transform: translate3d(0, -8px, 0);
    opacity: 0.82;
  }
}

.home-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-head-stacked {
  align-items: flex-start;
  gap: 10px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.62rem, 2.1vw, 2rem);
  letter-spacing: -0.03em;
  color: #18232c;
}

.section-subtitle {
  margin: 10px 0 0;
  max-width: 42ch;
  color: #6f7b83;
  font-size: 0.95rem;
  line-height: 1.6;
}

.task-status-section {
  padding: 30px;
  border-radius: 32px;
  border: 1px solid #e6dece;
  box-shadow: 0 16px 36px rgba(18, 23, 31, 0.045);
}

.task-status-assigned {
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.985) 0%, rgba(255, 251, 245, 0.97) 100%);
}

.task-status-available {
  background: linear-gradient(180deg, rgba(246, 252, 250, 0.985) 0%, rgba(238, 248, 244, 0.965) 100%);
  border-color: #d7e7df;
}

.task-status-draft {
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.985) 0%, rgba(250, 244, 232, 0.965) 100%);
  border-color: #e7ddc7;
}

.task-status-archived {
  background: linear-gradient(180deg, rgba(248, 246, 241, 0.94) 0%, rgba(243, 239, 232, 0.92) 100%);
  border-color: #e1d9cc;
}

.task-status-archived .section-subtitle,
.task-status-archived .task-worker-line,
.task-status-archived .empty-state p {
  color: #78848b;
}

.task-status-archived .task-card {
  border-color: #e2ddd4;
  background: rgba(255, 252, 247, 0.9);
  box-shadow: 0 8px 20px rgba(18, 23, 31, 0.04);
}

.status-empty {
  background: rgba(255, 255, 255, 0.48);
}

.task-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.task-card,
.page-hero,
.surface-card,
.step-card,
.settings-card,
.review-card,
.sop-sheet,
.modal-card,
.empty-state,
.metric-card {
  background: #fffdf9;
  border: 1px solid #e9e3d8;
  box-shadow: 0 10px 28px rgba(18, 23, 31, 0.05);
  backdrop-filter: none;
}

.page-hero,
.surface-card {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.task-card {
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  padding: 26px;
  gap: 20px;
}

.task-card-simple {
  min-height: 214px;
  justify-content: space-between;
  overflow: visible;
}

.task-card-simple::before {
  inset: 0;
  border-radius: 24px;
}

.task-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 2px;
}

.task-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.56rem, 1.8vw, 1.82rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #18232c;
}

.task-worker-line {
  margin: 0;
  color: #66727a;
  font-size: 0.98rem;
  line-height: 1.55;
}

.task-meta-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #88939a;
}

.task-meta-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: #243039;
}

.task-payout-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.task-payout-line strong {
  font-size: clamp(1.5rem, 2vw, 1.72rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #162029;
}

.task-note-line {
  margin-top: -2px;
  color: #7a858d;
  font-size: 0.94rem;
}

.task-card-top .status-pill {
  margin-top: 2px;
  flex-shrink: 0;
}

.task-card-simple > .button,
.task-card-simple .task-actions,
.task-card-simple .publish-control,
.task-card-simple .publish-split {
  width: 100%;
}

.task-card-simple .task-actions {
  margin-top: auto;
  align-items: stretch;
}

.task-card-simple .task-actions > * {
  flex: 1 1 0;
  min-width: 0;
}

.task-card-simple .button {
  min-height: 54px;
  justify-content: center;
}

.worker-dashboard-page,
.worker-list-page,
.worker-settings-page {
  gap: 28px;
}

.worker-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.worker-metric-card {
  min-height: 150px;
  justify-content: space-between;
  padding: 24px;
  position: relative;
  overflow: hidden;
  border-radius: 28px;
}

.worker-metric-card::before {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 160px;
  height: 160px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.worker-metric-featured {
  background: linear-gradient(135deg, #0f6b65 0%, #153c51 100%);
  color: #f8fbfb;
  border: 0;
  box-shadow: 0 18px 40px rgba(15, 107, 101, 0.22);
}

.worker-metric-soft {
  background: linear-gradient(180deg, #fffaf2 0%, #f6eee0 100%);
}

.worker-metric-clean {
  background: linear-gradient(180deg, #ffffff 0%, #f4f1ea 100%);
}

.worker-metric-accent {
  background: linear-gradient(180deg, #fff8ef 0%, #f8ebd8 100%);
}

.worker-metric-card .metric-label {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a777f;
}

.worker-metric-card .metric-value {
  font-size: clamp(1.9rem, 2.8vw, 2.5rem);
  line-height: 1.05;
}

.worker-metric-featured .metric-label,
.worker-metric-featured .metric-value {
  color: #f8fbfb;
}

.worker-section .section-head h2 {
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
}

.worker-task-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}

.worker-task-card {
  min-height: 0;
  gap: 20px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.worker-task-card:hover {
  transform: translateY(-2px);
  border-color: #d8cebf;
  box-shadow: 0 16px 32px rgba(18, 23, 31, 0.08);
}

.worker-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.worker-task-meta {
  display: grid;
  gap: 12px;
}

.worker-category-chip {
  width: fit-content;
}

.worker-payout {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #161c20;
  white-space: nowrap;
}

.worker-frequency {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f3eee6;
  color: #46545c;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.worker-task-copy {
  margin: 0;
  color: #617078;
  line-height: 1.55;
}

.worker-task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.worker-status-pill.is-available {
  background: rgba(15, 107, 101, 0.1);
  color: var(--brand-strong);
}

.worker-status-pill.is-active {
  background: rgba(199, 125, 49, 0.12);
  color: #8a5a1b;
}

.worker-status-pill.is-complete {
  background: rgba(47, 143, 97, 0.12);
  color: var(--success);
}

.status-pill,
.chip,
.source-pill,
.storage-pill {
  background: #f1ece3;
  color: #38444c;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.filter-row {
  gap: 10px;
}

.chip.interactive {
  background: #f3eee6;
  border: 1px solid transparent;
}

.chip.active {
  background: #e8e2d7;
  border-color: #ddd4c6;
}

.button {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 14px 20px;
  font-weight: 700;
  line-height: 1;
}

.button.primary {
  background: #161c20;
  color: #fffdf9;
  box-shadow: 0 12px 26px rgba(18, 23, 31, 0.12);
}

.button.secondary {
  background: #fffdf9;
  border: 1px solid #ddd4c6;
  color: #243039;
}

.button.warning,
.button.success,
.button.ghost {
  background: #f3eee6;
  color: #243039;
  border: 1px solid #ddd4c6;
}

.button.danger {
  background: rgba(178, 79, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(178, 79, 68, 0.18);
}

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

.empty-state {
  text-align: left;
  padding: 28px;
}

.compact-empty {
  max-width: 420px;
}

.hero-head {
  margin-bottom: 0;
}

.modal-card {
  border-radius: 28px;
}

body.signed-out .topbar {
  padding: 22px 26px 0;
}

body.signed-out .main-layout {
  grid-template-columns: minmax(0, 1fr);
}

body.signed-out .sidebar {
  display: none;
}

.auth-header {
  grid-template-columns: 1fr;
  justify-items: center;
}

.auth-shell {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  padding: 24px 0 40px;
}

.auth-card {
  width: min(100%, 470px);
  padding: 34px;
  border-radius: 30px;
  background: #fffdf9;
  border: 1px solid #e9e3d8;
  box-shadow: 0 24px 56px rgba(18, 23, 31, 0.08);
}

.auth-card h1 {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.05rem, 3vw, 2.8rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.auth-submit {
  justify-self: flex-start;
  min-width: 150px;
}

.auth-error {
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(178, 79, 68, 0.1);
  color: var(--danger);
  font-weight: 600;
}

.session-badge {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
  padding: 0 2px 0 1px;
}

.session-context {
  color: #66747d;
  font-size: 0.82rem;
  line-height: 1.3;
}

.slim-button {
  padding: 9px 13px;
  font-size: 0.88rem;
}

.settings-page {
  gap: 24px;
}

.settings-layout {
  grid-template-columns: minmax(320px, 0.94fr) minmax(420px, 1.16fr);
  gap: 22px;
  align-items: start;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
}

.settings-card-ai {
  grid-column: 1;
}

.settings-card-business {
  grid-column: 2;
}

.settings-card-accounts,
.settings-card-storage {
  grid-column: 1 / -1;
}

.settings-section-copy {
  margin: -4px 0 0;
  max-width: 64ch;
  color: #5c6870;
  line-height: 1.6;
}

.settings-stack {
  display: grid;
  gap: 16px;
}

.settings-stack-compact {
  max-width: 430px;
}

.settings-toggle {
  width: fit-content;
  align-self: flex-start;
  gap: 10px;
  padding-right: 16px;
}

.settings-toggle input {
  width: auto;
  margin: 0;
}

.account-list {
  display: grid;
  gap: 16px;
  margin-bottom: 0;
}

.account-row {
  display: grid;
  gap: 20px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fbf7f0 0%, #f5efe4 100%);
  border: 1px solid #e8decd;
}

.account-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.account-identity {
  min-width: 0;
}

.account-identity strong {
  font-size: 1.2rem;
  line-height: 1.1;
}

.account-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.account-row strong {
  display: block;
  margin-bottom: 4px;
}

.account-row span {
  color: #66747d;
  font-size: 0.95rem;
}

.account-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px 18px;
}

.account-editor-grid .field {
  min-width: 0;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.account-note {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(224, 216, 202, 0.92);
  color: #66747d;
  font-size: 0.93rem;
  line-height: 1.5;
}

.account-create {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fcf9f3 0%, #f3ecdf 100%);
  border: 1px solid #e8decd;
}

.account-create-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.account-create-head h4 {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.account-create-head p {
  margin: 0;
  max-width: 34ch;
  color: #66747d;
  line-height: 1.55;
}

.account-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px 18px;
}

.settings-card-storage .signal-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.top-nav-link,
.role-switch button,
.nav-button,
.chip.interactive,
.button,
.admin-home-secondary,
.task-card,
.worker-task-card,
.account-row {
  transition:
    transform var(--motion-fast) var(--ease-premium),
    box-shadow var(--motion-medium) var(--ease-premium),
    border-color var(--motion-fast) var(--ease-premium),
    background-color var(--motion-fast) var(--ease-premium),
    color var(--motion-fast) var(--ease-premium),
    filter var(--motion-fast) var(--ease-premium),
    opacity var(--motion-fast) var(--ease-premium);
  will-change: transform, box-shadow, filter;
}

.task-card,
.worker-task-card,
.account-row {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.task-card::before,
.worker-task-card::before,
.account-row::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(
      120deg,
      rgba(255, 255, 255, 0) 10%,
      rgba(255, 255, 255, 0.58) 30%,
      rgba(15, 107, 101, 0.06) 50%,
      rgba(199, 125, 49, 0.04) 64%,
      rgba(255, 255, 255, 0) 84%
    );
  transform: translate3d(-16%, 0, 0);
  transition:
    opacity var(--motion-fast) var(--ease-premium),
    transform var(--motion-slow) var(--ease-premium);
}

.task-card > *,
.worker-task-card > *,
.account-row > * {
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .button:hover,
  .chip.interactive:hover,
  .top-nav-link:hover,
  .role-switch button:hover,
  .nav-button:hover,
  .admin-home-secondary:hover {
    transform: translateY(-1px) scale(1.02);
  }

  .button:hover {
    transform: translateY(-2px) scale(1.022);
    filter: brightness(1.015);
    box-shadow: 0 18px 32px rgba(18, 23, 31, 0.11);
  }

  .button.primary:hover {
    box-shadow: 0 20px 36px rgba(22, 28, 32, 0.16);
  }

  .button.secondary:hover,
  .button.warning:hover,
  .button.success:hover,
  .button.ghost:hover {
    background: #ffffff;
    border-color: #d8cebf;
  }

  .top-nav-link:hover {
    background: rgba(22, 28, 32, 0.05);
    color: #243039;
  }

  .admin-home-secondary:hover {
    color: var(--brand-strong);
  }

  .role-switch button:hover,
  .nav-button:hover,
  .chip.interactive:hover {
    box-shadow: 0 12px 24px rgba(18, 23, 31, 0.06);
  }

  .role-switch button:hover {
    background: rgba(255, 255, 255, 0.9);
  }

  .chip.interactive:hover {
    background: #eee7db;
    border-color: #ddd2c1;
  }

  .task-card:hover,
  .worker-task-card:hover,
  .account-row:hover {
    transform: translateY(-4px);
    border-color: #dbd0c0;
    box-shadow: 0 24px 46px rgba(18, 23, 31, 0.1);
  }

  .task-card:hover::before,
  .worker-task-card:hover::before,
  .account-row:hover::before {
    opacity: 0.92;
    transform: translate3d(16%, 0, 0);
  }
}

.button:active,
.chip.interactive:active,
.top-nav-link:active,
.role-switch button:active,
.nav-button:active,
.admin-home-secondary:active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 8px 16px rgba(18, 23, 31, 0.08);
  filter: none;
}

.button:disabled,
.button:disabled:hover {
  transform: none;
  box-shadow: none;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .top-nav-link,
  .role-switch button,
  .nav-button,
  .chip.interactive,
  .button,
  .admin-home-secondary,
  .task-card,
  .worker-task-card,
  .account-row,
  .task-card::before,
  .worker-task-card::before,
  .account-row::before {
    transition: none;
    animation: none;
  }

  .task-card::before,
  .worker-task-card::before,
  .account-row::before {
    opacity: 0;
  }
}

@media (max-width: 980px) {
  .topbar {
    padding: 16px 20px 0;
  }

  .main-layout {
    padding: 0 20px 36px;
  }

  .simple-header {
    grid-template-columns: 1fr;
  }

  .simple-header-copy,
  .simple-header-nav,
  .simple-header-actions,
  .simple-controls,
  .top-nav {
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .simple-header-actions,
  .simple-header-nav {
    justify-self: stretch;
  }

  .simple-controls {
    padding: 8px;
  }

  .auth-card {
    padding: 28px 22px;
  }

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

  .settings-card-ai,
  .settings-card-business,
  .settings-card-accounts,
  .settings-card-storage {
    grid-column: 1;
  }

  .account-create-head {
    flex-direction: column;
  }

  .account-editor-grid,
  .account-create-grid {
    grid-template-columns: 1fr;
  }

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

  .worker-task-head,
  .worker-task-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-home-shell {
    min-height: 520px;
    padding: 36px 24px;
  }

  .admin-home-panel {
    gap: 24px;
  }

  .admin-home-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-home-thought {
    max-width: 190px;
    font-size: 0.94rem;
  }
}

@media (max-width: 640px) {
  .worker-metrics-grid {
    grid-template-columns: 1fr;
  }

  .admin-home-page {
    min-height: auto;
  }

  .admin-home-shell {
    min-height: 460px;
    border-radius: 30px;
    padding: 28px 20px;
  }

  .admin-home-status-strip {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .admin-home-copy h1 {
    font-size: clamp(2.65rem, 15vw, 3.7rem);
  }

  .admin-home-thought {
    display: none;
  }

  .admin-home-button {
    width: 100%;
  }
}
