:root {
  color-scheme: light;
  --ink: #050505;
  --muted: #5f6368;
  --soft: #eef0f3;
  --line: #d8dbe1;
  --paper: #f3f4f6;
  --panel: #f8f9fb;
  --white: #ffffff;
  --accent: #050505;
  --accent-soft: #eef0f3;
  --key: #050505;
  --danger: #c1121f;
  --warn: #946200;
  --success: #166534;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.10);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Helvetica, Arial, sans-serif;
  letter-spacing: 0;
}

.auth-page,
.marketing-page {
  min-height: 100vh;
  background: var(--paper);
}

.auth-page {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 24px;
  padding: 20px;
}

.auth-nav,
.marketing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 18px;
}

.auth-links,
.marketing-links,
.marketing-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.marketing-links {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-shell,
.signup-shell {
  align-self: center;
  justify-self: center;
  width: min(420px, 100%);
}

.signup-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(360px, 1fr);
  gap: 24px;
  width: min(1080px, 100%);
}

.auth-card {
  display: grid;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  padding: 20px;
  box-shadow: none;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-inline-link {
  justify-self: start;
  color: var(--muted);
  font-size: 0.86rem;
}

.reset-link-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
}

.reset-link-panel a {
  overflow-wrap: anywhere;
}

.signup-intro {
  align-self: start;
  padding-top: 12px;
}

.signup-intro p,
.hero-lede,
.marketing-card p,
.marketing-band p,
.product-preview p,
.signup-success p {
  color: var(--muted);
  line-height: 1.55;
}

.signup-success {
  display: grid;
  gap: 14px;
}

.marketing-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 244, 246, 0.96);
  padding: 18px clamp(16px, 4vw, 48px);
}

.marketing-page main {
  display: grid;
  gap: 22px;
  padding: 28px clamp(16px, 4vw, 48px) 48px;
}

.marketing-hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: 22px;
  align-items: stretch;
  min-height: calc(100vh - 130px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
}

.hero-copy h1 {
  margin-bottom: 18px;
  max-width: 900px;
}

.hero-lede {
  max-width: 660px;
  font-size: 1.05rem;
}

.product-preview,
.marketing-card,
.marketing-band {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
}

.product-preview {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: clamp(16px, 3vw, 28px);
}

.preview-top,
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.preview-top span {
  color: var(--muted);
}

.preview-grid {
  display: grid;
  gap: 12px;
}

.preview-grid > div {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  padding: 14px;
}

.preview-grid h2 {
  margin: 10px 0 6px;
}

.preview-metrics,
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preview-metrics span,
.workflow-steps span {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--soft);
  color: var(--muted);
  padding: 12px;
}

.preview-metrics strong,
.workflow-steps strong {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 500;
}

.marketing-section {
  display: grid;
  gap: 14px;
}

.section-head h2,
.marketing-band h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  line-height: 1.08;
}

.marketing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.marketing-card {
  padding: 16px;
}

.marketing-band {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(420px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
}

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

.auth-form label,
.org-switcher,
.automation-box label,
.dialog-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

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

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 28px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.eyebrow,
.panel-head span,
.status-panel,
.meta,
.article p,
.customer-card p {
  color: var(--muted);
  font-size: 0.84rem;
}

.brand span {
  max-width: 260px;
  line-height: 1.25;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #4a4a4a;
  padding: 0 12px;
  text-align: left;
  font-weight: 500;
}

.nav button.active,
.nav button:hover {
  border-color: #c8ccd4;
  background: #e9ebef;
  color: var(--ink);
}

.status-panel {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--soft);
  padding: 16px;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 44px clamp(24px, 4vw, 56px);
}

.topbar,
.top-actions,
.panel-head,
.reply-box div,
.row {
  display: flex;
  align-items: center;
}

.topbar,
.panel-head,
.row {
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 30px;
}

.top-actions,
.reply-box div {
  gap: 10px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #71717a;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2.05rem, 3.8vw, 3.6rem);
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.05rem;
  font-weight: 500;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.02rem;
  font-weight: 400;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
  padding: 0 16px;
  font-weight: 500;
}

.primary-button {
  border-color: var(--key);
  background: var(--key);
  color: var(--white);
}

.secondary-button:hover,
.icon-button:hover,
.ghost-button:hover {
  border-color: #111111;
}

.primary-button:hover {
  background: #222222;
}

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

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

.metric {
  padding: 16px;
}

.metric-button {
  display: block;
  width: 100%;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.metric-button:hover,
.metric-button:focus-visible {
  border-color: #111111;
  background: var(--soft);
  outline: none;
}

.metric strong {
  display: block;
  margin-bottom: 4px;
  font-size: 2rem;
  font-weight: 500;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel:focus {
  outline: 2px solid #111111;
  outline-offset: 3px;
}

.space-top {
  margin-top: 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.2fr);
  gap: 16px;
  margin-bottom: 16px;
}

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

.conversation-list,
.message-thread,
.booking-list,
.article-list,
#ticketPreview,
#bookingPreview,
#routingPreview {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.conversation,
.ticket-card,
.booking-card,
.customer-card,
.article,
.endpoint-card,
.lane {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
}

.conversation {
  width: 100%;
  padding: 12px;
}

.conversation.active,
.conversation:hover {
  border-color: #111111;
  background: var(--soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 3px;
  background: #e4e7ec;
  color: #333333;
  padding: 0 8px;
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
}

.pill.urgent,
.pill.emergency {
  background: #fff1f1;
  color: var(--danger);
}

.pill.high {
  background: #fff7da;
  color: var(--warn);
}

.pill.vip,
.pill.member {
  background: #eef0f3;
  color: var(--ink);
}

.pill.booked,
.pill.scheduled,
.pill.active,
.pill.triage {
  background: #edf7ef;
  color: var(--success);
}

.brief {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--soft);
  padding: 12px;
  line-height: 1.45;
}

.brief p {
  color: #3f4650;
}

.ai-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.message {
  max-width: 82%;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  padding: 10px 12px;
}

.message.ai,
.message.ai_sent,
.message.agent {
  margin-left: auto;
  background: var(--soft);
}

.message strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
}

.message-subject,
.message-body {
  display: block;
}

.message-subject {
  margin-bottom: 6px;
  font-weight: 700;
}

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

.reply-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.reply-box select {
  max-width: 180px;
}

textarea,
input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
}

textarea {
  min-height: 108px;
  padding-top: 10px;
  resize: vertical;
}

textarea:focus,
input:focus,
select:focus {
  border-color: #111111;
  outline: 2px solid #d8dbe1;
}

.table-wrap {
  margin-top: 14px;
  overflow: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  text-transform: uppercase;
}

.selected-row td {
  background: var(--soft);
}

.conversation-row {
  cursor: pointer;
}

.conversation-row:hover td,
.conversation-row:focus-visible td {
  background: var(--soft);
}

.conversation-row:focus-visible {
  outline: 2px solid #111111;
  outline-offset: -2px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-detail {
  margin-top: 14px;
}

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

.detail-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  padding: 12px;
}

.loading-state {
  min-height: 120px;
  align-content: center;
}

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

.info-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.info-list div,
.compact-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.info-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.info-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.usage-grid span {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--soft);
  color: var(--muted);
  padding: 10px;
  font-size: 0.82rem;
}

.usage-grid strong {
  display: block;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 500;
}

.limit-bars {
  display: grid;
  gap: 10px;
}

.limit-bars div {
  display: grid;
  gap: 5px;
}

progress {
  width: 100%;
  height: 10px;
  accent-color: var(--ink);
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

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

.connector-heading {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.connector-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.integration-config-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  box-shadow: var(--shadow);
}

.connector-card code {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--soft);
  color: var(--ink);
  padding: 2px 5px;
  overflow-wrap: anywhere;
}

.setup-steps {
  display: grid;
  gap: 8px;
}

.setup-steps span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
  padding: 9px;
  line-height: 1.45;
}

.credential-summary {
  display: grid;
  gap: 8px;
  margin: 0;
}

.credential-summary div {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(0, 1fr);
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.credential-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.credential-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.integration-form,
.secret-grid {
  display: grid;
  gap: 10px;
}

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

.integration-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.lane {
  min-height: 280px;
  background: var(--soft);
  padding: 10px;
}

.lane.drag-over {
  border-color: #111111;
  background: #e9ebef;
}

.lane h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.lane h3 span {
  display: inline-grid;
  min-width: 28px;
  min-height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.lane-dropzone {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 220px;
}

.ticket-card,
.customer-card,
.article,
.endpoint-card {
  padding: 12px;
}

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

.ticket-card[draggable="true"] {
  cursor: grab;
}

.ticket-card.dragging {
  opacity: 0.55;
}

.empty-lane {
  min-height: 72px;
  border: 1px dashed var(--line);
  border-radius: 3px;
  display: grid;
  place-items: center;
}

.booking-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(160px, 0.7fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
}

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

.customer-card {
  display: grid;
  gap: 8px;
}

.knowledge-layout {
  grid-template-columns: minmax(420px, 1.2fr) minmax(300px, 0.8fr);
}

.automation-box,
.endpoint-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.automation-box label {
  grid-template-columns: 1fr auto;
  align-items: center;
  color: var(--ink);
}

.endpoint-card {
  display: grid;
  gap: 8px;
}

code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--soft);
  color: var(--ink);
  padding: 7px 9px;
}

a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.score-grid span {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--soft);
  color: var(--muted);
  padding: 10px;
  font-size: 0.82rem;
}

.score-grid strong {
  display: block;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 500;
}

dialog {
  border: 0;
  border-radius: 3px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.dialog-card {
  display: grid;
  width: min(520px, calc(100vw - 28px));
  gap: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
}

.wide-dialog {
  width: min(720px, calc(100vw - 28px));
}

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

.full-width {
  grid-column: 1 / -1;
}

.error-state {
  border: 1px solid #f1b8ad;
  border-radius: 3px;
  background: #fff4f1;
  color: var(--danger);
  padding: 18px;
}

@media (max-width: 1040px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .split,
  .grid-three,
  .admin-detail-grid,
  .integration-settings,
  .connector-grid,
  .secret-grid,
  .marketing-hero,
  .marketing-grid,
  .marketing-band,
  .signup-shell,
  .metrics,
  .kanban,
  .customer-grid,
  .form-grid,
  .score-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 24px 14px;
  }

  .topbar,
  .top-actions,
  .auth-nav,
  .marketing-nav,
  .marketing-links,
  .marketing-actions,
  .section-head,
  .panel-head,
  .booking-card {
    align-items: stretch;
    flex-direction: column;
  }

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

  .message {
    max-width: 100%;
  }

  .info-list div,
  .compact-row,
  .preview-metrics,
  .workflow-steps,
  .usage-grid {
    grid-template-columns: 1fr;
  }
}

/* PrintRoster-inspired SaaS refresh */
:root {
  --ink: #071827;
  --muted: #506070;
  --soft: #edf4fb;
  --line: #e2e8f0;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --white: #ffffff;
  --accent: #2563eb;
  --accent-soft: #e8f1ff;
  --accent-sky: #00a8e8;
  --key: #2563eb;
  --danger: #dc2626;
  --warn: #b45309;
  --success: #047857;
  --shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.10), 0 4px 6px -4px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 22px 60px rgba(15, 23, 42, 0.14);
}

body {
  background: var(--paper);
  color: var(--ink);
}

.shell {
  display: block;
  width: 100%;
  max-width: 1200px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 24px 56px;
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: auto;
  display: grid;
  grid-template-columns: auto minmax(180px, 250px) minmax(0, 1fr);
  grid-template-areas:
    "brand account spacer"
    "nav nav nav";
  align-items: center;
  gap: 16px;
  margin: 0 -24px;
  padding: 14px 24px;
  border-right: 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.86);
  background: rgba(246, 248, 251, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  grid-area: brand;
  min-width: 0;
  gap: 10px;
  color: var(--ink);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
}

.brand strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.brand span,
.eyebrow,
.panel-head span,
.status-panel,
.meta,
.article p,
.customer-card p {
  color: var(--muted);
}

.brand span {
  font-size: 0.76rem;
  font-weight: 700;
  max-width: 260px;
  line-height: 1.25;
}

.org-switcher {
  grid-area: account;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.org-switcher select {
  min-height: 38px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.nav {
  grid-area: nav;
  display: flex;
  min-width: 0;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-start;
  overflow: visible;
}

.nav button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.nav button.active,
.nav button:hover {
  border-color: transparent;
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.status-panel {
  display: none;
}

.main {
  padding: 0;
}

.topbar {
  margin: 36px 0 24px;
}

.topbar h1 {
  color: var(--ink);
  font-size: clamp(2.35rem, 4.6vw, 4.3rem);
  font-weight: 900;
  line-height: 0.98;
}

.eyebrow {
  margin-bottom: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

h2 {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
}

h3 {
  font-weight: 800;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.20);
}

.primary-button:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.secondary-button,
.ghost-button,
.icon-button {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #f8fbff;
}

.metric,
.panel,
.conversation,
.ticket-card,
.booking-card,
.customer-card,
.article,
.endpoint-card,
.lane,
.detail-section,
.auth-card,
.product-preview,
.marketing-card,
.marketing-band,
.preview-grid > div,
.preview-metrics span,
.workflow-steps span,
.dialog-card {
  border-color: var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.panel,
.metric {
  padding: 18px;
}

.metric strong {
  color: var(--accent);
  font-weight: 900;
}

.conversation:hover,
.conversation.active,
.ticket-card:hover,
.customer-card:hover,
.article:hover {
  border-color: rgba(37, 99, 235, 0.42);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
}

.conversation {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.conversation:hover {
  transform: translateY(-1px);
}

textarea,
input,
select {
  border-radius: 8px;
  background: var(--paper);
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(37, 99, 235, 0.55);
  outline: 3px solid rgba(37, 99, 235, 0.16);
}

.pill {
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-weight: 800;
}

.pill.active,
.pill.booked,
.pill.scheduled,
.pill.triage,
.pill.member,
.pill.vip {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.pill.high {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warn);
}

.pill.urgent,
.pill.emergency {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  color: var(--muted);
  font-weight: 900;
}

td {
  background: #ffffff;
}

.selected-row td {
  background: var(--accent-soft);
}

code {
  border-radius: 8px;
  background: var(--paper);
}

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

dialog {
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.error-state {
  border-radius: 8px;
}

.marketing-page {
  background: var(--paper);
}

.marketing-nav,
.marketing-page main {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.marketing-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(226, 232, 240, 0.86);
  background: rgba(246, 248, 251, 0.92);
  backdrop-filter: blur(12px);
  padding: 14px 24px;
}

.marketing-page main {
  padding: 0 24px 56px;
}

.marketing-hero {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 500px);
  gap: 42px;
  min-height: calc(100vh - 132px);
  padding: 58px 0 48px;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 20px;
  max-width: 720px;
}

.hero-copy h1,
.signup-intro h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 6.6vw, 5.9rem);
  font-weight: 900;
  line-height: 0.95;
}

.hero-lede,
.signup-intro p,
.marketing-card p,
.marketing-band p,
.product-preview p,
.signup-success p {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.62;
}

.product-preview {
  padding: 18px;
  box-shadow: var(--shadow-lg);
}

.preview-top {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.preview-top strong,
.preview-grid h2,
.preview-metrics strong,
.workflow-steps strong {
  font-weight: 900;
}

.preview-grid > div,
.marketing-card,
.marketing-band {
  box-shadow: var(--shadow);
}

.preview-metrics span,
.workflow-steps span {
  background: var(--paper);
  box-shadow: none;
}

.preview-metrics strong,
.workflow-steps strong {
  color: var(--accent);
}

.marketing-grid {
  gap: 12px;
}

.marketing-card {
  padding: 18px;
}

.section-head h2,
.marketing-band h2 {
  color: var(--ink);
  font-weight: 900;
}

.marketing-band {
  padding: 22px;
}

.auth-page {
  background: var(--paper);
}

.auth-nav {
  width: min(1200px, 100%);
  justify-self: center;
}

.auth-card {
  padding: 22px;
}

.signup-shell {
  width: min(1080px, 100%);
}

@media (max-width: 1050px) {
  .shell {
    padding: 18px 18px 44px;
  }

  .sidebar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "account"
      "nav";
    margin: 0 -18px;
    padding: 14px 18px;
  }

  .brand,
  .org-switcher,
  .nav {
    justify-self: stretch;
  }

  .brand {
    justify-content: center;
  }

  .nav {
    justify-content: flex-start;
  }

  .marketing-page main {
    padding: 0 18px 44px;
  }

  .marketing-hero,
  .marketing-band,
  .signup-shell {
    grid-template-columns: 1fr;
  }

  .marketing-hero {
    min-height: auto;
    padding: 44px 0 36px;
  }

  .hero-copy {
    max-width: none;
  }

  .product-preview {
    max-width: 640px;
  }
}

@media (max-width: 720px) {
  .shell,
  .marketing-page main {
    padding: 0 16px 36px;
  }

  .sidebar,
  .marketing-nav {
    margin: 0 -16px;
    padding: 14px 16px;
  }

  .marketing-nav,
  .auth-nav {
    align-items: stretch;
  }

  .marketing-links,
  .auth-links {
    justify-content: stretch;
  }

  .marketing-links a,
  .auth-links a {
    flex: 1 1 auto;
  }

  .topbar {
    padding-top: 34px;
  }

  .topbar h1,
  .hero-copy h1,
  .signup-intro h1 {
    font-size: clamp(2.55rem, 13vw, 3.45rem);
  }

  .hero-lede {
    font-size: 1rem;
  }

  .top-actions,
  .marketing-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .preview-metrics,
  .workflow-steps {
    grid-template-columns: 1fr;
  }
}
