@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/playfair-display-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: #17162b;
  --ink-soft: #25233d;
  --text: #2b2a36;
  --muted: #5f697a;
  --muted-dark: #515a68;
  --paper: #f7f3ea;
  --canvas: #f5f6f8;
  --panel: #ffffff;
  --mist: #efe7d4;
  --gold: #e2b94f;
  --gold-dark: #6f5518;
  --green: #26735d;
  --green-soft: #e6f4ef;
  --clay: #ad503f;
  --clay-soft: #fbebe7;
  --purple: #6b5e9c;
  --purple-soft: #eeeafd;
  --blue: #315eaa;
  --blue-soft: #edf4ff;
  --line: #e3e5ea;
  --line-dark: #d2d5dc;
  --control-border: #81899a;
  --white: #ffffff;
  --dark-muted: #c8c7d2;
  --portal-gold: #e2b94f;
  --portal-gold-on: #17162b;
  --portal-gold-ink: #6f5518;
  --portal-gold-soft: #fff6dc;
  --portal-gold-vivid: #e2b94f;
  --portal-blue: #315eaa;
  --portal-blue-on: #ffffff;
  --portal-blue-ink: #244b8c;
  --portal-blue-soft: #edf4ff;
  --portal-blue-vivid: #6fa5f2;
  --portal-green: #26735d;
  --portal-green-on: #ffffff;
  --portal-green-ink: #1f604e;
  --portal-green-soft: #e6f4ef;
  --portal-green-vivid: #65b99c;
  --portal-purple: #6b5e9c;
  --portal-purple-on: #ffffff;
  --portal-purple-ink: #584684;
  --portal-purple-soft: #eeeafd;
  --portal-purple-vivid: #a696df;
  --shadow-sm: 0 4px 14px rgba(23, 22, 43, 0.06);
  --shadow: 0 18px 48px rgba(23, 22, 43, 0.12);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar-width: 264px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-modal-open,
body.is-sidebar-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 1;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

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

h1,
h2,
h3 {
  color: var(--ink);
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.14;
}

h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.55rem, 5vw, 2.25rem);
}

h2 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.2rem, 4vw, 1.55rem);
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.workspace-sidebar :focus-visible,
.portal-header :focus-visible,
.auth-intro :focus-visible {
  outline-color: var(--gold);
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -100px;
  z-index: 10000;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mobile-only {
  display: inline-flex;
}

.eyebrow {
  margin-bottom: 0.4rem;
  color: var(--gold-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow-light {
  color: var(--gold);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.91rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled,
.icon-button:disabled,
.avatar-button:disabled {
  border-color: var(--control-border);
  background: #eceef2;
  box-shadow: none;
  color: var(--muted-dark);
}

.button-primary {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 8px 22px rgba(226, 185, 79, 0.2);
  color: var(--ink);
}

.button-primary:hover:not(:disabled) {
  background: #ecc562;
}

.button-secondary {
  border-color: var(--control-border);
  background: var(--panel);
  color: var(--ink);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--ink);
}

.button-danger {
  border-color: #8f281d;
  background: #9f2d20;
  color: var(--white);
}

.button-danger:hover:not(:disabled) {
  border-color: #741f17;
  background: #812218;
}

.button-full {
  width: 100%;
}

.button-compact {
  min-height: 44px;
  padding-inline: 0.8rem;
}

.button-small-light {
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.text-button,
.back-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 800;
}

.text-button:hover,
.back-button:hover {
  text-decoration: underline;
}

.record-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.record-action {
  min-width: 44px;
  justify-content: center;
  padding-inline: 0.45rem;
}

.contact-phone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  margin: 0.65rem 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--mist);
}

.contact-phone-details {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.contact-phone-details small {
  color: var(--muted-dark);
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.35;
}

.contact-phone-number {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 44px;
  align-items: center;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.contact-phone-number:hover,
.contact-phone-number:focus-visible {
  color: var(--blue);
  text-decoration: underline;
}

.phone-copy-button {
  min-width: 62px;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.4rem;
}

.icon-button,
.avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 11px;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.15rem;
}

.icon-button:hover,
.avatar-button:hover {
  border-color: var(--line-dark);
  background: #f8f8fa;
}

.icon-button.dark {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.avatar-button {
  overflow: hidden;
  border-radius: 50%;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
}

.avatar-gold {
  background: var(--gold);
  color: var(--ink);
}

.notice {
  margin-bottom: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #b8d2ff;
  border-radius: 10px;
  background: var(--blue-soft);
  color: #244c8e;
  font-size: 0.88rem;
  font-weight: 650;
}

.notice.is-error,
.notice[data-kind="error"] {
  border-color: #efb7aa;
  background: var(--clay-soft);
  color: #833f31;
}

.notice.is-success,
.notice[data-kind="success"] {
  border-color: #a9d9ca;
  background: var(--green-soft);
  color: #185643;
}

.notice[data-kind="warning"] {
  border-color: #d5b65e;
  background: #fff7dc;
  color: #684f0b;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.9rem;
  background: var(--paper);
  color: var(--muted-dark);
}

.app-loading img {
  width: 54px;
  height: 54px;
}

.app-loading p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 800;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(23, 22, 43, 0.15);
  border-top-color: var(--gold-dark);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.noscript-card {
  width: min(92vw, 520px);
  margin: 12vh auto;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.noscript-card img {
  margin: 0 auto 1.4rem;
}

/* Authentication */
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
}

.auth-intro {
  display: none;
}

.auth-card-wrap {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(100%, 480px);
  padding: 1.4rem;
  border: 1px solid rgba(23, 22, 43, 0.1);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card-logo {
  display: inline-flex;
  margin-bottom: 1.8rem;
}

.auth-card-logo img {
  width: 170px;
  height: auto;
}

.auth-panel h1,
.auth-panel h2 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.8rem, 8vw, 2.35rem);
}

.auth-subtitle {
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.field,
.form-grid {
  min-width: 0;
}

.field label,
.label-row label {
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.35;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}

.field > label {
  display: block;
  margin-bottom: 0.4rem;
}

.field input,
.field select,
.field textarea,
.search-field input,
.global-search input,
.filter-bar select,
.task-section-head select,
.view-toolbar select {
  width: 100%;
  min-height: 46px;
  padding: 0.72rem 0.78rem;
  border: 1px solid var(--control-border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  outline: 0;
}

/* Data-entry controls are intentionally more generous than compact search and
   filter controls. This keeps long forms comfortable without bloating tables. */
.field input:not([type="checkbox"]):not([type="radio"]),
.field select {
  min-width: 0;
  min-height: 52px;
  padding: 0.82rem 0.9rem;
  line-height: 1.35;
}

.field select {
  padding-right: 2.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field textarea {
  min-width: 0;
  min-height: 132px;
  padding: 0.82rem 0.9rem;
  line-height: 1.55;
  resize: vertical;
}

.field textarea[rows="3"] {
  min-height: 116px;
}

.field textarea[rows="7"] {
  min-height: 220px;
}

.field input:is([type="date"], [type="time"], [type="datetime-local"]) {
  min-inline-size: 100%;
  padding-right: 0.7rem;
  color-scheme: light;
}

.field input:is([type="date"], [type="time"], [type="datetime-local"])::-webkit-calendar-picker-indicator {
  width: 22px;
  height: 22px;
  padding: 0.25rem;
  cursor: pointer;
}

.field input[type="file"] {
  min-height: 58px;
  padding: 0.38rem;
  overflow: hidden;
  line-height: 1.35;
}

.field input[type="file"]::file-selector-button {
  min-height: 44px;
  margin-right: 0.75rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.field input::placeholder,
.field textarea::placeholder,
.search-field input::placeholder,
.global-search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled,
.search-field input:disabled,
.global-search input:disabled,
.filter-bar select:disabled,
.task-section-head select:disabled,
.view-toolbar select:disabled {
  border-color: var(--control-border);
  background: #eceef2;
  color: var(--muted-dark);
  -webkit-text-fill-color: var(--muted-dark);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus,
.global-search input:focus,
.filter-bar select:focus,
.task-section-head select:focus,
.view-toolbar select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 94, 170, 0.14);
}

@media (hover: hover) {
  .field input:hover:not(:disabled):not(:focus),
  .field select:hover:not(:disabled):not(:focus),
  .field textarea:hover:not(:disabled):not(:focus) {
    border-color: var(--muted-dark);
  }

  .field input[type="file"]::file-selector-button:hover {
    border-color: var(--ink);
    background: var(--mist);
  }
}

.field input[readonly] {
  background: #f6f6f8;
  color: var(--muted);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 4.3rem;
}

.password-toggle {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  min-width: 44px;
  min-height: 44px;
  padding: 0.25rem 0.45rem;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--blue);
  font-size: 0.8125rem;
  font-weight: 800;
}

.field-help {
  max-width: 62ch;
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.contact-team-summary {
  padding: 0.9rem 1rem;
  border: 1px solid #c9d9f2;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--text);
}

.contact-team-summary strong {
  display: block;
  color: var(--blue);
  font-size: 0.9rem;
}

.contact-team-summary p {
  margin: 0.25rem 0 0;
  color: var(--muted-dark);
  font-size: 0.9rem;
}

.contact-note-help {
  margin-top: -0.45rem;
}

.field-row {
  display: grid;
  gap: 1.1rem;
}

.check-row {
  display: flex;
  min-height: 44px;
  align-items: flex-start;
  gap: 0.65rem;
  padding-block: 0.55rem;
  color: var(--muted-dark);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.check-row input {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 0.05rem;
  accent-color: var(--ink);
}

.auth-switch {
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: 0.87rem;
  text-align: center;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
}

.security-note span {
  color: var(--green);
}

/* Pending access */
.status-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(circle at 20% 10%, #fff8df 0, transparent 30%), var(--paper);
}

.status-card {
  width: min(100%, 620px);
  padding: clamp(1.5rem, 6vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.status-card > img {
  width: 180px;
  height: auto;
  margin: 0 auto 2rem;
}

.status-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 1rem;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 1.4rem;
  font-weight: 800;
}

.status-card > p:not(.eyebrow):not(.support-line) {
  max-width: 50ch;
  margin-inline: auto;
  color: var(--muted);
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.support-line {
  margin: 1.8rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.support-line a {
  color: var(--blue);
  font-weight: 800;
}

/* Team workspace */
.workspace {
  min-height: 100vh;
  min-height: 100dvh;
}

.workspace-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  display: flex;
  width: min(88vw, var(--sidebar-width));
  flex-direction: column;
  overflow: auto;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-102%);
  background: var(--ink);
  color: var(--dark-muted);
  box-shadow: 16px 0 48px rgba(23, 22, 43, 0.2);
  transition: transform 180ms ease;
}

body.is-sidebar-open .workspace-sidebar {
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

body.is-sidebar-open {
  overflow: hidden;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(23, 22, 43, 0.5);
  backdrop-filter: blur(2px);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.sidebar-brand img {
  width: 132px;
  height: auto;
}

.sidebar-brand span {
  padding-left: 0.65rem;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sidebar-close {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
}

.workspace-switcher > span:last-child,
.user-mini > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.workspace-switcher strong,
.user-mini strong {
  overflow: hidden;
  color: var(--white);
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-switcher small,
.user-mini small {
  color: var(--dark-muted);
  font-size: 0.8125rem;
}

.workspace-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0.75rem 1rem;
}

.nav-label {
  margin: 1rem 0.65rem 0.45rem;
  color: var(--dark-muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  gap: 0.65rem;
  margin: 0.08rem 0;
  padding: 0.62rem 0.72rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--dark-muted);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.nav-item.is-active {
  background: rgba(226, 185, 79, 0.14);
  box-shadow: inset 3px 0 0 var(--gold);
  color: var(--white);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  color: var(--gold);
  font-size: 1rem;
}

.nav-count {
  min-width: 21px;
  margin-left: auto;
  padding: 0.12rem 0.35rem;
  border-radius: 999px;
  background: var(--clay);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-mini {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-foot .icon-button {
  border-color: rgba(255, 255, 255, 0.48);
  background: transparent;
  color: var(--dark-muted);
}

.workspace-content {
  min-width: 0;
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
}

.header-start,
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.header-start > div:last-child { display: block; }

.header-eyebrow {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.global-search {
  display: none;
}

.notification-wrap {
  position: relative;
}

.notification-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  right: -3px;
  top: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: var(--clay);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 14px;
}

.notification-panel {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  top: 74px;
  z-index: 120;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.notification-panel .panel-head {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.notification-panel h2 {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
}

.notification-list {
  display: grid;
  max-height: 420px;
  gap: 0.5rem;
  padding: 0.55rem;
  overflow: auto;
}

.empty-compact {
  margin: 0;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.workspace-main {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 1rem;
}

.app-view {
  min-width: 0;
}

.welcome-row,
.view-toolbar,
.panel-head,
.task-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.welcome-row {
  display: grid;
  margin-bottom: 1rem;
}

.welcome-row h2 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.5rem, 6vw, 2.1rem);
}

.welcome-row p:last-child,
.view-description,
.settings-copy {
  margin-bottom: 0;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.metric-card {
  padding: 1rem;
}

.metric-card-link {
  position: relative;
  display: block;
  width: 100%;
  min-height: 156px;
  appearance: none;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  border-color: var(--control-border);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.metric-card-link:hover {
  border-color: var(--blue);
  box-shadow: 0 10px 26px rgba(23, 22, 43, 0.12);
  transform: translateY(-2px);
}

.metric-card-link:active {
  transform: translateY(0);
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  color: var(--muted-dark);
  font-size: 0.8125rem;
  font-weight: 750;
}

.metric-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-gold { background: var(--gold); }
.dot-green { background: var(--green); }
.dot-clay { background: var(--clay); }
.dot-purple { background: var(--purple); }

.metric-card > strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.9rem;
  line-height: 1;
}

.metric-card > .metric-note {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.metric-card-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  color: var(--blue);
  font-size: 0.875rem;
  font-weight: 800;
}

.metric-card-cue > span {
  transition: transform 160ms ease;
}

.metric-card-link:hover .metric-card-cue > span,
.metric-card-link:focus-visible .metric-card-cue > span {
  transform: translateX(3px);
}

.dashboard-grid {
  display: grid;
  gap: 0.9rem;
}

.panel {
  min-width: 0;
  padding: 1rem;
}

.is-revealed {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  animation: reveal-pulse 700ms ease-out 2;
}

@keyframes reveal-pulse {
  50% { box-shadow: 0 0 0 7px rgba(49, 94, 170, 0.15); }
}

.panel-head {
  align-items: center;
  margin-bottom: 0.85rem;
}

.panel-head h2,
.task-section-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.panel-head .eyebrow,
.task-section-head .eyebrow {
  margin-bottom: 0.25rem;
}

.stack-list,
.timeline,
.task-list {
  display: grid;
  gap: 0.65rem;
}

.activity-card-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem;
}

.activity-card-copy {
  min-width: 0;
}

.activity-card-copy strong {
  display: block;
  overflow-wrap: anywhere;
}

.activity-card-copy p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.activity-card-copy small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted-dark);
}

.activity-delete-button {
  min-width: 76px;
}

.activity-delete-summary {
  display: grid;
  grid-column: 1 / -1;
  gap: 0.25rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--canvas);
}

.activity-delete-summary span {
  color: var(--muted);
  font-size: 0.875rem;
}

.activity-delete-warning {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.context-summary {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--canvas);
}

.context-summary span {
  color: var(--muted);
  font-size: 0.875rem;
}

.note-body {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.empty-state {
  display: grid;
  min-height: 190px;
  place-content: center;
  justify-items: center;
  padding: 1.4rem;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 150px;
  padding: 1rem;
}

.empty-state > span:first-child {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 0.7rem;
  place-items: center;
  border-radius: 50%;
  background: var(--mist);
  color: var(--gold-dark);
  font-weight: 800;
}

.empty-state h2,
.empty-state h3 {
  margin: 0 0 0.25rem;
}

.empty-state p {
  max-width: 38ch;
  margin: 0;
  font-size: 0.875rem;
}

.view-toolbar {
  display: grid;
  margin-bottom: 1rem;
}

.view-toolbar > .button,
.view-toolbar > .toolbar-actions {
  justify-self: start;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.filter-bar {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.search-field,
.global-search {
  position: relative;
}

.search-field > span,
.global-search > span {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-field input,
.global-search input {
  padding-left: 2.1rem;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

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

#view-projects table {
  min-width: 860px;
}

.project-name-button {
  display: grid;
  width: 100%;
  min-width: 230px;
  min-height: 64px;
  align-content: center;
  gap: 0.2rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.project-name-button strong,
.project-name-button small,
.project-name-button span {
  overflow-wrap: anywhere;
}

.project-name-button small {
  color: var(--muted);
  font-size: 0.84rem;
}

.project-name-button span {
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 800;
}

.project-name-button:hover,
.project-name-button:focus-visible {
  border-color: var(--line-dark);
  background: var(--mist);
}

.project-workspace {
  display: grid;
  gap: 1rem;
  outline: none;
}

.project-back-button {
  justify-self: start;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.project-workspace-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid rgba(226, 185, 79, 0.38);
  border-radius: 18px;
  background: linear-gradient(135deg, #17162b 0%, #292746 100%);
  color: var(--white);
  box-shadow: 0 16px 34px rgba(23, 22, 43, 0.16);
}

.project-workspace-hero h2,
.project-workspace-hero p {
  margin: 0;
}

.project-workspace-hero h2 {
  margin-top: 0.2rem;
  color: var(--white);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.project-workspace-hero .eyebrow {
  color: #f2d478;
}

.project-workspace-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.project-workspace-status .status-pill {
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.project-workspace-status .status-pill.status-secure {
  border-color: #b9e1d2;
  background: #e6f4ef;
  color: #1f604e;
}

.project-workspace-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.project-workspace-tabs button {
  display: inline-flex;
  min-height: 46px;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.8rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-dark);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 800;
  cursor: pointer;
}

.project-workspace-tabs button strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--mist);
  color: var(--ink);
  font-size: 0.8rem;
}

.project-workspace-tabs button:hover,
.project-workspace-tabs button.is-active {
  background: var(--ink);
  color: var(--white);
}

.project-workspace-tabs button.is-active strong {
  background: var(--gold);
}

.project-workspace-content {
  display: grid;
  min-width: 0;
  gap: 1rem;
}

.project-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.project-section-head h2,
.project-section-head p {
  margin: 0;
}

.project-section-head > div > p:last-child {
  max-width: 720px;
  margin-top: 0.25rem;
  color: var(--muted);
}

.project-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 1rem;
}

.project-brief > p {
  margin-top: 1rem;
  white-space: pre-line;
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}

.project-facts div {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafb;
}

.project-facts dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-facts dd {
  margin: 0.25rem 0 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.project-workspace-roster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 0.65rem;
}

.project-workspace-member {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 64px;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
}

.project-workspace-member > span:last-child {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.project-workspace-member strong,
.project-workspace-member small {
  overflow-wrap: anywhere;
}

.project-workspace-member small {
  color: var(--muted);
  font-size: 0.84rem;
}

.project-update-head {
  margin-top: 0.4rem;
}

.project-thread-switcher {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
}

.project-thread-switcher button {
  display: grid;
  min-width: min(260px, 78vw);
  min-height: 56px;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-thread-switcher button.is-active {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
  background: var(--mist);
}

.project-thread-switcher small {
  color: var(--muted);
  font-size: 0.84rem;
}

.project-message-panel {
  min-width: 0;
}

.project-members-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.4rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: left;
}

.project-members-button:hover {
  background: var(--mist);
}

.project-member-avatars {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: 0.8125rem;
}

th,
td {
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #fafafb;
  color: var(--muted-dark);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  font-size: 0.875rem;
}

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

td .empty-state {
  min-height: 260px;
}

.pipeline-summary {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.pipeline-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.pipeline-summary span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 750;
}

.pipeline-summary strong {
  color: var(--ink);
  font-size: 1rem;
}

.pipeline-board {
  display: grid;
  grid-auto-columns: minmax(260px, 82vw);
  grid-auto-flow: column;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.6rem;
  scroll-snap-type: x proximity;
}

.pipeline-column {
  min-height: 420px;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eceef2;
  scroll-snap-align: start;
}

.pipeline-column-won {
  border-color: #9fcfbe;
  background: var(--green-soft);
}

.pipeline-column-lost {
  border-color: #e0b4aa;
  background: var(--clay-soft);
}

.pipeline-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.25rem 0.75rem;
}

.pipeline-column h2 {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
}

.pipeline-column header span {
  min-width: 24px;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #d9dce3;
  color: var(--muted-dark);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.pipeline-cards {
  display: grid;
  gap: 0.55rem;
}

.pipeline-task-section {
  display: grid;
  gap: 0.5rem;
  margin: 0.7rem 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafb;
}

.pipeline-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pipeline-task-head strong {
  color: var(--ink);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pipeline-task-head span {
  color: var(--muted-dark);
  font-size: 0.8rem;
  font-weight: 750;
}

.pipeline-task-list {
  display: grid;
  gap: 0.35rem;
}

.pipeline-task-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  min-height: 44px;
  align-items: start;
  gap: 0.55rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.pipeline-task-item input {
  width: 20px;
  height: 20px;
  margin: 0.1rem 0 0;
  accent-color: var(--ink);
}

.pipeline-task-item span {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.pipeline-task-item strong,
.pipeline-task-item small {
  overflow-wrap: anywhere;
}

.pipeline-task-item strong {
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.35;
}

.pipeline-task-item small,
.pipeline-task-empty {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.pipeline-task-item.is-overdue small {
  color: var(--clay);
  font-weight: 750;
}

.pipeline-task-empty {
  margin: 0;
  padding-top: 0.15rem;
}

[data-deal-stage] {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 2.1rem 0.6rem 0.7rem;
  border: 1px solid var(--control-border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.column-empty {
  padding: 1rem;
  border: 1px dashed var(--line-dark);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.8125rem;
  text-align: center;
}

.segmented {
  display: flex;
  gap: 0.25rem;
  max-width: 100%;
  margin-bottom: 0.8rem;
  padding: 0.25rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.segmented button {
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-dark);
  font-size: 0.875rem;
  font-weight: 800;
  white-space: nowrap;
}

.segmented button.is-active {
  background: var(--ink);
  color: var(--white);
}

.segmented.compact {
  margin: 0.65rem;
}

.task-section-head {
  display: grid;
  margin-bottom: 1rem;
}

.task-section-head select {
  width: auto;
}

.conversation-layout {
  display: grid;
  min-height: 560px;
  padding: 0;
  overflow: hidden;
}

.thread-list-wrap {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.thread-search {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.thread-list {
  max-height: 340px;
  overflow: auto;
}

.thread-list .nav-item {
  min-height: 52px;
  margin: 0;
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink-soft);
}

.thread-list .nav-item > span {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.thread-list .nav-item strong,
.thread-list .nav-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-list .nav-item strong {
  color: var(--ink);
  font-size: 0.875rem;
}

.thread-list .nav-item small {
  color: var(--muted-dark);
  font-size: 0.875rem;
  font-weight: 650;
}

.thread-list .nav-item:hover {
  background: var(--paper);
  color: var(--ink);
}

.thread-list .nav-item.is-active {
  background: var(--mist);
  box-shadow: inset 4px 0 0 var(--gold-dark);
  color: var(--ink);
}

.thread-list .nav-item.is-active strong,
.thread-list .nav-item.is-active small {
  color: var(--ink);
}

.conversation-detail {
  min-width: 0;
  padding: clamp(0.85rem, 2vw, 1.2rem);
}

.conversation-detail h2,
.conversation-detail .panel p,
.conversation-detail .activity-delete-summary {
  overflow-wrap: anywhere;
}

.conversation-detail .empty-state {
  min-height: 310px;
}

.file-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.file-breadcrumb button {
  min-height: 44px;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--blue);
  font-size: 0.875rem;
  font-weight: 800;
}

.file-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.file-card-layout,
.member-card,
.stage-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.file-card-copy,
.member-card-copy,
.stage-card-copy {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
}

.file-card-copy strong,
.file-card-copy p,
.file-card-copy small,
.member-card-copy strong,
.member-card-copy p,
.stage-card-copy strong,
.stage-card-copy small {
  overflow-wrap: anywhere;
}

.file-card-copy p,
.file-card-copy small,
.member-card-copy p,
.stage-card-copy small {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.member-card-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.recovery-actions {
  display: grid;
  gap: 0.65rem;
  margin-block: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
}

.recovery-actions .button {
  justify-self: start;
}

.recovery-actions p,
.recovery-card p,
.health-check-card p {
  margin: 0;
  color: var(--muted-dark);
  font-size: 0.875rem;
  line-height: 1.55;
}

.recovery-list,
.health-check-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.recovery-card,
.health-check-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.recovery-card > div {
  display: grid;
  min-width: 0;
  gap: 0.35rem;
}

.recovery-card .status-pill {
  width: fit-content;
}

.health-check-card {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.health-indicator {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.health-warning .health-indicator {
  background: var(--portal-gold-soft);
  color: var(--gold-dark);
}

.health-fail .health-indicator {
  background: var(--clay-soft);
  color: var(--clay);
}

.project-member-picker {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--control-border);
  border-radius: 12px;
  background: #fafafb;
}

.project-member-picker legend {
  padding-inline: 0.35rem;
  color: var(--ink);
  font-weight: 800;
}

.project-member-picker > p {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.project-member-options,
.project-member-roster {
  display: grid;
  gap: 0.55rem;
}

.project-member-option,
.project-roster-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 52px;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.project-member-option {
  grid-template-columns: auto minmax(0, 1fr);
  cursor: pointer;
}

.project-member-option input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--ink);
}

.project-member-copy {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.project-member-copy strong,
.project-member-copy small {
  overflow-wrap: anywhere;
}

.project-member-copy small {
  color: var(--muted);
  font-size: 0.84rem;
}

.project-member-section {
  display: grid;
  grid-column: 1 / -1;
  gap: 0.7rem;
}

.project-member-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-member-section-head h3,
.project-member-section-head p {
  margin: 0;
}

.project-member-section-head p {
  color: var(--muted);
  font-size: 0.84rem;
}

.project-member-invite {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.45fr);
  gap: 1rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}

.check-row small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.stage-card {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.stage-position {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  background: var(--mist);
  color: var(--gold-dark);
  font-weight: 800;
}

.folder-grid {
  display: grid;
  gap: 0.65rem;
}

.folder-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 92px;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-align: left;
  touch-action: manipulation;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.folder-card:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 9px 22px rgba(23, 22, 43, 0.1);
  transform: translateY(-1px);
}

.folder-card:active {
  transform: translateY(0);
}

.folder-card-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--mist);
  color: var(--gold-dark);
  font-size: 1.15rem;
  font-weight: 800;
}

.folder-card-copy {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.folder-card-copy strong,
.folder-card-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.folder-card-copy strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.folder-card-copy small {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.folder-card-arrow {
  color: var(--blue);
  font-weight: 800;
  transition: transform 150ms ease;
}

.folder-card:hover .folder-card-arrow,
.folder-card:focus-visible .folder-card-arrow {
  transform: translateX(3px);
}

.action-list {
  display: grid;
  grid-column: 1 / -1;
  width: 100%;
  gap: 0.55rem;
}

.action-row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 76px;
  gap: 0.9rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  touch-action: manipulation;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.action-row-card:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: var(--shadow-sm);
}

.action-row-copy {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.action-row-copy strong,
.action-row-copy span,
.action-row-copy small {
  overflow-wrap: anywhere;
}

.action-row-copy span,
.action-row-copy small {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.action-row-cue {
  color: var(--blue);
  font-size: 0.875rem;
  font-weight: 800;
  white-space: nowrap;
}

.notification-card.is-read {
  background: #fafafb;
}

.quick-create-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: 1fr;
  align-items: stretch;
  width: 100%;
  gap: 0.7rem;
}

.quick-create-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 88px;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  text-align: left;
  touch-action: manipulation;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.quick-create-card:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 9px 22px rgba(23, 22, 43, 0.1);
  transform: translateY(-1px);
}

.quick-create-card:active {
  transform: translateY(0);
}

.quick-create-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--mist);
  color: var(--gold-dark);
  font-size: 1.15rem;
  font-weight: 800;
}

.quick-create-copy {
  min-width: 0;
}

.quick-create-copy strong,
.quick-create-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.quick-create-copy strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.quick-create-copy small {
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.quick-create-arrow {
  color: var(--blue);
  font-weight: 800;
}

.settings-layout {
  display: grid;
  gap: 0.8rem;
}

.settings-nav {
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.settings-nav button {
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-dark);
  font-size: 0.875rem;
  font-weight: 800;
  white-space: nowrap;
}

.settings-nav button.is-active {
  background: var(--mist);
  box-shadow: inset 3px 0 0 var(--gold-dark);
  color: var(--gold-dark);
}

.settings-panel {
  min-height: 360px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  column-gap: 1.1rem;
  row-gap: 1.15rem;
  max-width: 760px;
  margin-top: 1.2rem;
}

.form-grid > .field-row,
.form-grid > .check-row,
.form-grid > .context-summary,
.form-grid > .field:has(textarea),
.form-grid > .field:has(input[type="file"]) {
  grid-column: 1 / -1;
}

.modal-content-grid > :not(.form-actions) {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.55rem;
}

.form-grid > p {
  grid-column: 1 / -1;
}

.form-wide {
  grid-column: 1 / -1;
  margin-block: -0.45rem 0;
}

.approval-company-create {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--control-border);
  border-radius: 12px;
  background: var(--canvas);
}

.approval-company-create[hidden] {
  display: none;
}

.field[hidden] {
  display: none;
}

.approval-company-create h3,
.approval-company-create > p {
  grid-column: 1 / -1;
  margin: 0;
}

.approval-company-create h3 {
  color: var(--ink);
  font-size: 1rem;
}

.approval-company-create > p {
  color: var(--muted-dark);
  font-size: 0.9rem;
  line-height: 1.5;
}

.opportunity-company-toggle {
  width: 100%;
  justify-content: center;
  padding: 0.8rem 1rem;
  border: 1px dashed var(--gold-dark);
  border-radius: var(--radius-sm);
  background: var(--portal-gold-soft);
  text-align: center;
}

.opportunity-company-toggle:hover,
.opportunity-company-toggle:focus-visible {
  border-style: solid;
  text-decoration: none;
}

#opportunity-existing-company[hidden],
#contact-existing-company[hidden] {
  display: none;
}

#opportunity-existing-company > .field,
#contact-existing-company > .field {
  margin: 0;
}

.member-list,
.reorder-list,
.preference-list,
.security-list {
  display: grid;
  gap: 0;
  margin-top: 1rem;
}

.preference-list label,
.security-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.preference-list label:last-child,
.security-list article:last-child {
  border-bottom: 0;
}

.preference-list span,
.security-list article > div {
  display: grid;
}

.preference-list strong,
.security-list strong {
  color: var(--ink);
  font-size: 0.875rem;
}

.preference-list small,
.security-list p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
}

.preference-list input {
  width: 20px;
  height: 20px;
  accent-color: var(--ink);
}

.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.status-secure {
  background: var(--green-soft);
  color: var(--green);
}

.status-do-not-contact {
  color: #8f1d2c;
  background: #fff0f2;
  box-shadow: inset 0 0 0 1px #efb4bd;
}

.status-no-website {
  color: #6f4300;
  background: #fff6df;
  box-shadow: inset 0 0 0 1px #e8ca86;
}

/* Client portal */
.client-portal {
  --portal-accent: var(--portal-gold);
  --portal-accent-on: var(--portal-gold-on);
  --portal-accent-ink: var(--portal-gold-ink);
  --portal-accent-soft: var(--portal-gold-soft);
  --portal-accent-vivid: var(--portal-gold-vivid);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
}

.client-portal.portal-accent-blue {
  --portal-accent: var(--portal-blue);
  --portal-accent-on: var(--portal-blue-on);
  --portal-accent-ink: var(--portal-blue-ink);
  --portal-accent-soft: var(--portal-blue-soft);
  --portal-accent-vivid: var(--portal-blue-vivid);
}

.client-portal.portal-accent-green {
  --portal-accent: var(--portal-green);
  --portal-accent-on: var(--portal-green-on);
  --portal-accent-ink: var(--portal-green-ink);
  --portal-accent-soft: var(--portal-green-soft);
  --portal-accent-vivid: var(--portal-green-vivid);
}

.client-portal.portal-accent-purple {
  --portal-accent: var(--portal-purple);
  --portal-accent-on: var(--portal-purple-on);
  --portal-accent-ink: var(--portal-purple-ink);
  --portal-accent-soft: var(--portal-purple-soft);
  --portal-accent-vivid: var(--portal-purple-vivid);
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  min-height: 70px;
  padding: 0.8rem 1rem;
  background: var(--ink);
  color: var(--white);
}

.portal-header > a img {
  width: 132px;
  height: auto;
}

.portal-company-switcher {
  width: 100%;
  min-height: 44px;
  order: 2;
  padding: 0.55rem 2rem 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 9px;
  background: #24203d;
  color: var(--white);
  font: inherit;
  font-weight: 700;
}

.portal-header nav {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.25rem;
  order: 3;
  overflow-x: auto;
}

.portal-header nav button {
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dark-muted);
  font-size: 0.875rem;
  font-weight: 800;
}

.portal-header nav button.is-active {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 -3px 0 var(--portal-accent-vivid);
  color: var(--white);
}

.portal-actions {
  display: flex;
  gap: 0.45rem;
}

.portal-main {
  width: min(100% - 2rem, 1200px);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3.5rem) 0;
}

.client-portal .eyebrow {
  color: var(--portal-accent-ink);
}

.client-portal .button-primary {
  border-color: var(--portal-accent);
  background: var(--portal-accent);
  box-shadow: 0 8px 22px rgba(23, 22, 43, 0.16);
  color: var(--portal-accent-on);
}

.client-portal .button-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.client-portal .portal-header :focus-visible {
  outline-color: var(--portal-accent-vivid);
}

.client-portal .empty-state > span:first-child {
  background: var(--portal-accent-soft);
  color: var(--portal-accent-ink);
}

.portal-view > h1,
.portal-view .view-toolbar h1 {
  font-size: clamp(2rem, 7vw, 3.25rem);
}

.portal-grid {
  display: grid;
  gap: 0.9rem;
  margin-top: 2rem;
}

/* Compact spacing preserves the same type sizes and 44px interactive targets. */
body.density-compact .workspace-main {
  padding: 0.75rem;
}

body.density-compact .metric-grid,
body.density-compact .dashboard-grid,
body.density-compact .stack-list,
body.density-compact .timeline,
body.density-compact .task-list,
body.density-compact .folder-grid,
body.density-compact .portal-grid {
  gap: 0.5rem;
}

body.density-compact .metric-card,
body.density-compact .panel {
  padding: 0.8rem;
}

body.density-compact th,
body.density-compact td {
  padding: 0.6rem 0.7rem;
}

body.density-compact .pipeline-column,
body.density-compact .thread-list .nav-item,
body.density-compact .preference-list label,
body.density-compact .security-list article {
  padding-block: 0.65rem;
}

body.density-compact .portal-main {
  padding-block: clamp(1rem, 3vw, 2rem);
}

@media (max-width: 420px) {
  .portal-header {
    padding-inline: 0.65rem;
  }

  .portal-header > a img {
    width: 100px;
  }

  .portal-actions {
    gap: 0.25rem;
  }

  .action-row-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }

  .action-row-cue {
    justify-self: start;
  }

  .file-card-layout,
  .member-card,
  .stage-card,
  .recovery-card,
  .health-check-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .file-card-layout .button,
  .member-card-action,
  .member-card-action .button {
    width: 100%;
  }

  .member-card-action {
    justify-content: stretch;
  }

  .recovery-card .button,
  .recovery-actions .button {
    width: 100%;
  }

  .project-roster-row,
  .project-member-invite {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .project-roster-row .button,
  .project-roster-row .record-actions,
  .project-roster-row .record-actions .button {
    width: 100%;
  }

  #quick-create-button {
    width: 44px;
    padding-inline: 0;
    font-size: 0;
  }

  #quick-create-button > span {
    font-size: 1.1rem;
  }

  #account-button {
    display: none;
  }
}

@media (min-width: 380px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Overlays */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 500;
  overflow: auto;
  padding: 1rem;
  background: rgba(23, 22, 43, 0.58);
  backdrop-filter: blur(4px);
}

.modal-root > .auth-card {
  width: min(100%, 640px);
  margin: clamp(0rem, 4vh, 2.5rem) auto 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.modal-root .panel-head {
  margin-bottom: 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.modal-root .panel-head h2 {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
}

.modal-root #modal-form {
  width: 100%;
  max-width: none;
  margin-top: 1.2rem;
}

.modal-root .form-actions {
  margin-top: 0.15rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.auth-card[data-modal-size="wide"] {
  width: min(100%, 760px);
}

.modal-root > .auth-card:has(#delete-confirmation-help) {
  width: min(100%, 520px);
}

.auth-card[data-modal-size="wide"] #modal-form {
  width: 100%;
  max-width: none;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 600;
  display: grid;
  width: min(calc(100% - 2rem), 380px);
  gap: 0.55rem;
  pointer-events: none;
}

@media (min-width: 560px) {
  .auth-card { padding: 2rem; }
  .field-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { grid-template-columns: minmax(240px, 1fr) minmax(170px, auto); }
  .pipeline-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline-summary > div { display: grid; gap: 0.2rem; }
  .task-section-head { display: flex; align-items: center; }
  .notification-panel { left: auto; right: 1rem; width: 380px; }
  .quick-create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .portal-header nav { width: auto; order: initial; }
  .portal-company-switcher { width: min(220px, 22vw); order: initial; }
}

@media (min-width: 1200px) {
  .portal-header { flex-wrap: nowrap; }
}

@media (min-width: 760px) {
  .workspace-header { min-height: 78px; padding: 0.8rem 1.25rem; }
  .header-eyebrow { display: block; }
  .workspace-main { padding: 1.4rem; }
  .welcome-row { display: flex; align-items: flex-end; margin-bottom: 1.4rem; }
  .welcome-row .button { flex-shrink: 0; }
  .metric-grid { gap: 0.9rem; }
  .metric-card { padding: 1.2rem; }
  .panel { padding: 1.2rem; }
  .view-toolbar { display: flex; align-items: center; }
  .view-toolbar > .button,
  .view-toolbar > .toolbar-actions { justify-self: auto; flex-shrink: 0; }
  .conversation-layout { grid-template-columns: minmax(260px, 34%) minmax(0, 1fr); }
  .thread-list-wrap { border-right: 1px solid var(--line); border-bottom: 0; }
  .thread-list { max-height: 590px; }
  .conversation-detail .empty-state { min-height: 560px; }
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 559px) {
  .project-workspace-hero,
  .project-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .project-workspace-status {
    justify-content: flex-start;
  }

  .project-section-head .button {
    width: 100%;
  }

  .project-workspace-tabs {
    margin-inline: -0.25rem;
  }

  .project-message-panel {
    padding: 1rem;
  }

  .conversation-detail > .panel-head {
    align-items: stretch;
    flex-direction: column;
    gap: 0.75rem;
  }

  .conversation-detail > .panel-head > div:first-child {
    width: 100%;
    min-width: 0;
  }

  .conversation-detail > .panel-head h2 {
    overflow-wrap: anywhere;
  }

  .conversation-detail > .panel-head > .record-actions {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.5rem;
  }

  .conversation-detail > .panel-head > .record-actions .status-pill {
    width: fit-content;
  }

  .conversation-detail > .panel-head [data-archive-conversation] {
    width: 100%;
    min-height: 48px;
    padding-inline: 1rem;
    line-height: 1.25;
    white-space: normal;
  }

  .modal-root {
    padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
  }

  .modal-root > .auth-card {
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
    border-radius: 16px;
  }

  .modal-root #modal-form,
  .modal-root .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal-root .form-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .modal-root .form-actions .button {
    width: 100%;
  }

  .project-member-invite,
  .project-roster-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-member-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .field input[type="file"] {
    min-height: 60px;
  }
}

@media (min-width: 1000px) {
  .auth-shell { display: grid; grid-template-columns: minmax(420px, 0.95fr) minmax(480px, 1.05fr); }
  .auth-intro {
    position: relative;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 4.5rem);
    background:
      radial-gradient(circle at 88% 8%, rgba(226, 185, 79, 0.22) 0, transparent 30%),
      linear-gradient(145deg, var(--ink) 0%, #24203d 62%, #342d4c 100%);
    color: var(--dark-muted);
  }
  .auth-intro::after {
    position: absolute;
    right: -90px;
    bottom: -120px;
    width: 390px;
    height: 390px;
    border: 1px solid rgba(226, 185, 79, 0.15);
    border-radius: 50%;
    box-shadow: 0 0 0 55px rgba(226, 185, 79, 0.04), 0 0 0 110px rgba(226, 185, 79, 0.025);
    content: "";
  }
  .auth-brand,
  .auth-intro-copy,
  .auth-benefits,
  .auth-intro-foot { position: relative; z-index: 1; }
  .auth-brand img { width: 190px; height: auto; }
  .auth-intro-copy { max-width: 620px; margin-block: auto; padding-block: 4rem 2.5rem; }
  .auth-intro-copy h1 { max-width: 14ch; margin-bottom: 1.2rem; color: var(--white); font-size: clamp(3rem, 5vw, 5rem); }
  .auth-intro-copy > p:last-child { max-width: 48ch; margin-bottom: 0; font-size: 1.05rem; }
  .auth-benefits { display: grid; gap: 0.65rem; margin: 0 0 2rem; padding: 0; list-style: none; }
  .auth-benefits li { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; font-weight: 700; }
  .auth-benefits span { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: rgba(226, 185, 79, 0.14); color: var(--gold); }
  .auth-intro-foot { margin: 0; color: var(--dark-muted); font-size: 0.8125rem; }
  .auth-card-wrap { padding: clamp(2rem, 5vw, 5rem); }
  .workspace { padding-left: var(--sidebar-width); }
  .workspace-sidebar { transform: none; box-shadow: none; }
  .workspace-sidebar { visibility: visible; pointer-events: auto; }
  .sidebar-close,
  #sidebar-open,
  .sidebar-backdrop { display: none !important; }
  .workspace-header { padding-inline: 1.7rem; }
  .workspace-main { padding: 1.7rem; }
  .mobile-only { display: none; }
  .global-search { display: block; width: min(32vw, 300px); }
  .global-search input { min-height: 42px; padding-right: 3rem; background: #f8f8fa; }
  .global-search kbd { position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%); padding: 0.18rem 0.35rem; border: 1px solid var(--line-dark); border-radius: 5px; background: var(--panel); color: var(--muted-dark); font-size: 0.8125rem; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); }
  .folder-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: 210px minmax(0, 1fr); align-items: start; }
  .settings-nav { display: grid; overflow: visible; padding: 0.5rem; }
  .settings-nav button { width: 100%; text-align: left; }
}

@media (min-width: 1300px) {
  .workspace-main { padding: 2rem; }
  .pipeline-board { grid-auto-columns: minmax(240px, 1fr); }
  .folder-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #4f5868;
    --line: #c9ccd3;
    --line-dark: #aeb3bd;
    --control-border: #626b7b;
  }

  .metric-card,
  .panel,
  .notification-panel,
  .field input,
  .field select,
  .field textarea {
    border-width: 2px;
  }
}

@media (forced-colors: active) {
  .button,
  .nav-item,
  .segmented button,
  .status-pill {
    border: 1px solid ButtonText;
  }
}
