/* ─── Lovable-aligned design system for Kiwi Outreach ─── */

:root {
  /* Color palette — warm ivory / deep ink / olive accent */
  --background: #f9f8f6;
  --foreground: #181d25;
  --surface: #f3f2ee;
  --surface-raised: #fdfcfa;
  --muted: #edece8;
  --muted-foreground: #969ca6;
  --border: #e4e2dd;
  --primary: #335b49;
  --primary-foreground: #f9f8f6;
  --accent: #e8ede9;
  --danger: hsl(0 60% 50%);
  --danger-soft: hsl(0 85% 97%);
  --success: #335b49;
  --success-soft: hsl(152 35% 95%);
  --warning: hsl(38 70% 42%);
  --warning-soft: hsl(45 85% 95%);
  --shadow-soft: 0 1px 0 rgba(24, 18, 11, 0.03);
  --radius: 2px;
  --sidebar-width: 13.5rem;
  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

/* ─── Reset ─── */

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-feature-settings: normal;
  font-variation-settings: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

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

button {
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* ─── Form elements ─── */

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-foreground);
}

textarea {
  min-height: 10rem;
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(17, 14, 11, 0.25);
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
  gap: 1rem;
}

/* ─── Typography tokens ─── */

.text-label,
.field label,
.app-nav-group-title {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}

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

.page-title,
.section-title,
.display-xl,
.display-lg,
.display-md {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.display-xl {
  font-size: 3rem;
  line-height: 1;
}

.display-lg {
  font-size: 1.875rem;
  line-height: 1.15;
}

.display-md {
  font-size: 1.5rem;
  line-height: 1.15;
}

.page-title {
  font-size: 1.875rem;
  line-height: 1.15;
}

.section-title {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.2;
}

.page-subtitle,
.section-subtitle,
.muted,
.field-note {
  color: var(--muted-foreground);
}

.page-subtitle {
  max-width: 42rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.section-subtitle {
  font-size: 0.875rem;
  line-height: 1.6;
}

.app-topbar-meta,
.sidebar-foot-note {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

/* ─── Buttons — Lovable style ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.btn:hover {
  background: var(--muted);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: #2a4d3d;
  border-color: #2a4d3d;
}

.btn-secondary {
  background: var(--surface-raised);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--muted);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-ghost:hover {
  background: var(--muted);
}

.btn-danger {
  border-color: hsl(0 50% 85%);
  color: hsl(0 55% 42%);
  background: var(--danger-soft);
}

.btn-danger:hover {
  background: hsl(0 85% 95%);
}

/* Full-width button variant for auth forms */
.btn-full {
  width: 100%;
  height: 3rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ─── Pills / badges ─── */

.pill,
.inline-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  background: var(--surface-raised);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-connected {
  background: var(--success-soft);
  border-color: hsl(152 28% 82%);
  color: var(--success);
}

.status-sent,
.status-completed,
.status-queued {
  background: var(--accent);
  border-color: hsl(152 22% 84%);
  color: var(--primary);
}

.status-opened,
.status-replied {
  background: var(--success-soft);
  border-color: hsl(152 28% 82%);
  color: var(--success);
}

.status-warning,
.status-pending {
  background: var(--warning-soft);
  border-color: hsl(40 65% 82%);
  color: var(--warning);
}

.status-failed,
.status-error,
.status-suppressed {
  background: var(--danger-soft);
  border-color: hsl(0 50% 85%);
  color: hsl(0 50% 44%);
}

/* ─── Flash messages ─── */

.flash-list {
  display: grid;
  gap: 0.75rem;
}

.flash {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
}

.flash.success,
.flash.info {
  background: var(--success-soft);
  border-color: hsl(152 28% 82%);
}

.flash.warning {
  background: var(--warning-soft);
  border-color: hsl(40 65% 82%);
}

.flash.error {
  background: var(--danger-soft);
  border-color: hsl(0 50% 85%);
}

/* ─── Public shell ─── */

.public-body {
  background: var(--background);
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(249, 248, 246, 0.8);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.public-header-inner,
.public-footer-inner {
  width: min(72rem, calc(100% - 3rem));
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.public-header-inner {
  display: flex;
  min-height: 3.5rem;
  align-items: center;
  justify-content: space-between;
}

.public-brand,
.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0rem;
}

.public-brand-mark,
.app-brand-mark {
  display: none;
}

.public-brand-wordmark,
.app-brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.public-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 150ms ease;
}

.public-nav a:hover {
  color: var(--foreground);
}

/* "Request access" link in nav — accent-colored */
.public-nav a:last-of-type {
  color: var(--primary);
}

.public-main {
  width: min(72rem, calc(100% - 3rem));
  margin: 0 auto;
  padding: 4rem 0 6rem;
}

.public-footer {
  border-top: 1px solid var(--border);
  margin-top: 0;
}

.public-footer-inner {
  min-height: 4rem;
  padding: 1rem 0;
  align-items: start;
}

.public-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.public-footer-links a:hover {
  color: var(--foreground);
}

.public-footer-copy {
  display: grid;
  gap: 0.35rem;
}

.public-footer-note {
  max-width: 30rem;
}

.public-footer-links-legal {
  row-gap: 0.5rem;
  font-size: 0.75rem;
}

/* ─── Public page layouts ─── */

.public-frame,
.page-shell {
  display: grid;
  gap: 3rem;
}

.page-shell-tight {
  gap: 2rem;
}

.public-hero {
  padding: 2rem 0 3rem;
  text-align: center;
}

.public-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  max-width: 42rem;
  margin: 0 auto;
}

.public-hero-copy,
.public-side-stack,
.auth-header,
.section-head-copy,
.page-header-copy {
  display: grid;
  gap: 0.75rem;
}

.public-hero-copy {
  gap: 1.25rem;
}

.public-lead {
  max-width: 36rem;
  margin: 0 auto;
  color: var(--muted-foreground);
  font-size: 1rem;
  line-height: 1.65;
}

.public-hero .button-row {
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.public-side-stack {
  gap: 1rem;
}

/* Cards — flat, border-first, minimal shadow */
.public-side-card,
.section-card,
.auth-card,
.pricing-card,
.metric-tile,
.dialog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.public-side-card,
.section-card,
.auth-card,
.pricing-card,
.dialog-card {
  padding: 1.5rem;
}

.feature-list,
.section-stack,
.list-stack,
.status-list,
.settings-stack {
  display: grid;
  gap: 1rem;
}

.feature-row,
.list-row,
.status-row {
  display: grid;
  gap: 0.3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.feature-row:first-child,
.list-row:first-child,
.status-row:first-child {
  padding-top: 0;
  border-top: 0;
}

/* ─── Metric strip ─── */

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.metric-tile {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 0.35rem;
  padding: 1.25rem 1.5rem;
}

.metric-title {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}

.metric-number {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.025em;
}

.metric-detail {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

/* ─── Public sections ─── */

.public-section {
  display: grid;
  gap: 2rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.pricing-hero {
  padding-bottom: 2rem;
}

.public-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.public-grid-3,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

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

.pricing-card.featured {
  border-color: var(--primary);
}

.pricing-card-enterprise {
  grid-column: span 2;
  position: relative;
  overflow: hidden;
  border-color: rgba(51, 91, 73, 0.28);
  background:
    radial-gradient(circle at top right, rgba(51, 91, 73, 0.14), transparent 36%),
    linear-gradient(135deg, #fdfcf9 0%, #f3f5f1 48%, #e8ede9 100%);
  box-shadow: 0 10px 24px rgba(24, 29, 37, 0.06);
}

.pricing-card-enterprise::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #335b49 0%, #6d8e7a 100%);
}

.pricing-card-head {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.pricing-card-value {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.pricing-card-subtitle {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.pricing-card-enterprise .pricing-card-subtitle {
  max-width: 28rem;
  color: rgba(24, 29, 37, 0.78);
}

.pricing-card-copy,
.checkout-summary-text,
.checkout-status {
  font-size: 0.8125rem;
}

.pricing-list {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.pricing-list li::before {
  content: "\2713";
  display: inline-block;
  width: 1.25rem;
  color: var(--primary);
}

.pricing-card-enterprise .pricing-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  color: var(--foreground);
}

.pricing-card-enterprise .pricing-list li {
  position: relative;
  min-height: 100%;
  padding: 0.85rem 0.9rem 0.85rem 2rem;
  border: 1px solid rgba(51, 91, 73, 0.14);
  background: rgba(253, 252, 250, 0.74);
}

.pricing-card-enterprise .pricing-list li::before {
  position: absolute;
  left: 0.75rem;
  width: auto;
}

.pricing-card-actions {
  margin-top: 1.25rem;
}

.pricing-footer-note {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  text-align: center;
}

.pricing-footer-links-centered {
  justify-content: center;
  margin-top: 0.75rem;
}

/* ─── Auth pages — Lovable login style ─── */

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.auth-page {
  width: min(100%, 26rem);
}

.auth-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.auth-header {
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.auth-header .display-lg {
  font-size: 1.875rem;
  letter-spacing: -0.025em;
}

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

.auth-links,
.auth-link-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.auth-links a,
.auth-link-line a {
  color: var(--foreground);
  font-weight: 500;
}

/* ─── App shell ─── */

.app-shell {
  min-height: 100vh;
  position: relative;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: transform 180ms ease;
}

.app-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 0.75rem 1rem;
  gap: 1.5rem;
}

.app-brand {
  gap: 0;
  padding: 0 0.5rem;
}

.app-nav {
  display: grid;
  gap: 1.25rem;
}

.app-nav-group {
  display: grid;
  gap: 0.125rem;
}

.app-nav-group-title {
  padding: 0 0.75rem;
  margin-bottom: 0.25rem;
}

.app-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background-color 120ms ease, color 120ms ease;
}

.app-nav-link:hover {
  color: var(--foreground);
  background: var(--surface-raised);
}

.app-nav-link.active {
  color: var(--foreground);
  background: var(--surface-raised);
  border-color: var(--border);
}

.app-sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 0.75rem 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.25rem;
}

.app-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  min-width: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(249, 248, 246, 0.85);
  backdrop-filter: blur(12px);
}

.app-sidebar-toggle,
.app-sidebar-scrim {
  display: none;
}

.app-topbar-copy {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.app-topbar-copy > div {
  min-width: 0;
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.org-switcher {
  display: grid;
  gap: 0.35rem;
  min-width: 14rem;
}

.org-switcher select {
  min-width: 14rem;
  padding: 0.55rem 0.8rem;
}

.app-topbar-meta {
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.app-container {
  width: min(84rem, calc(100% - 4rem));
  max-width: 84rem;
  margin: 0 auto;
  padding: 2.25rem 0 4rem;
}

/* ─── Page header ─── */

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.section-card-spaced {
  margin-bottom: 1.5rem;
}

.button-row-spaced {
  margin-top: 1rem;
}

.button-row-align-end {
  align-self: end;
}

.tracker-filter-field {
  min-width: 14rem;
}

.dialog-header-spaced {
  margin-bottom: 1rem;
}

.checkout-summary-status-list {
  margin-top: 1rem;
}

/* ─── Layout grid ─── */

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 1fr);
  gap: 1.25rem;
}

.stack-column {
  display: grid;
  gap: 1.25rem;
}

.section-card.flush {
  padding: 0;
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* ─── Data tables ─── */

.table-wrap {
  overflow: auto;
  overscroll-behavior-x: contain;
}

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

.data-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  padding: 0.75rem 1rem;
  background: var(--surface);
  white-space: nowrap;
}

.data-table td {
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--border);
  vertical-align: top;
  font-size: 0.8125rem;
  word-break: break-word;
}

.data-table tbody tr:hover td {
  background: rgba(243, 242, 238, 0.5);
}

.data-table .empty-state {
  padding: 1.5rem 1rem;
}

.responsive-table td[data-label]::before {
  content: "";
}

/* ─── Field grids & filters ─── */

.field-grid,
.filters,
.toolbar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

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

.field-note {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* ─── Chips / tags ─── */

.chip-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ─── Contact list (compose) ─── */

.contact-list {
  border-top: 1px solid var(--border);
}

.contact-chip {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background-color 120ms ease;
}

.contact-chip:first-child {
  border-top: 0;
}

.contact-chip:hover {
  background: rgba(243, 242, 238, 0.5);
}

.contact-chip-head,
.split-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.nav-label {
  display: flex;
  align-items: start;
  gap: 0.75rem;
}

.contact-chip-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.contact-chip-top .nav-label {
  display: flex;
  align-items: start;
  gap: 0.75rem;
}

.contact-chip-email {
  font-size: 0.8rem;
}

.contact-chip input[type="checkbox"] {
  margin-top: 0.15rem;
}

/* ─── Compose layout ─── */

.compose-workbench {
  display: grid;
  grid-template-columns: minmax(15.5rem, 18rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.compose-main-column,
.compose-panel-body,
.review-grid,
.compose-support-grid,
.compose-rail-top,
.compose-rail-header,
.compose-editor-head,
.compose-assist,
.compose-filter-stack {
  display: grid;
  gap: 1rem;
}

.compose-rail {
  position: sticky;
  top: 5.25rem;
  overflow: hidden;
}

.compose-rail-header {
  padding: 1.1rem 1.1rem 0.95rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, rgba(243, 242, 238, 0.42), rgba(253, 252, 250, 0));
}

.compose-rail .section-title {
  font-size: 1.1rem;
  line-height: 1.15;
}

.compose-rail .section-subtitle {
  font-size: 0.8rem;
  line-height: 1.55;
}

.compose-rail-meta {
  display: flex;
  align-items: flex-start;
}

.compose-rail-actions {
  gap: 0.5rem;
}

.compose-rail-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  height: 2.4rem;
  padding: 0 0.8rem;
}

.compose-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.compose-field-search input,
.compose-filter-grid select {
  height: 2.9rem;
}

.compose-contact-list {
  max-height: calc(100vh - 14.75rem);
  overflow: auto;
}

.compose-editor-card {
  padding: 1.75rem;
}

.compose-editor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.compose-form-grid {
  gap: 1.1rem;
}

.compose-assist {
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(243, 242, 238, 0.38);
}

.compose-assist-copy {
  display: grid;
  gap: 0.35rem;
}

.compose-body-field textarea {
  min-height: 22rem;
  line-height: 1.75;
}

.compose-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

.compose-schedule-note {
  align-self: end;
}

.compose-schedule-summary {
  display: grid;
  gap: 0.25rem;
  min-height: 2.75rem;
  justify-content: start;
}

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

.compose-support-grid-empty {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.compose-preview-card {
  display: grid;
  gap: 0.45rem;
  padding: 1rem 1.05rem;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(243, 242, 238, 0.36);
}

.compose-preview-subject {
  margin-top: 0.2rem;
}

.compose-preview-body {
  white-space: pre-wrap;
}

.compose-send-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.status-list .status-row strong,
.list-row strong,
.feature-row strong {
  font-weight: 600;
  font-size: 0.875rem;
}

/* ─── Segmented control ─── */

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  flex-wrap: wrap;
}

.segmented a {
  padding: 0.4rem 0.75rem;
  border-radius: calc(var(--radius) - 1px);
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background-color 120ms ease, color 120ms ease;
}

.segmented a:hover {
  color: var(--foreground);
}

.segmented a.active {
  background: var(--surface-raised);
  color: var(--foreground);
  border: 1px solid var(--border);
}

/* ─── Toolbar ─── */

.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolbar-row > * {
  min-width: 0;
}

/* ─── Platform & team utility layouts ─── */

.platform-control-plane,
.org-members-page {
  display: grid;
  gap: 1.5rem;
}

.platform-section {
  display: grid;
  gap: 1rem;
}

.platform-stat-grid,
.platform-plan-grid {
  display: grid;
  gap: 1rem;
}

.platform-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.platform-plan-grid {
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.stat-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  line-height: 1;
  letter-spacing: -0.025em;
}

.stat-label {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.45;
}

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

.form-inline-field {
  flex: 1 1 12rem;
  min-width: min(100%, 14rem);
}

.inline-form-grid .btn {
  flex: 0 0 auto;
}

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

.action-inline-form .form-input {
  min-width: 8rem;
}

/* ─── Settings ─── */

.settings-stack {
  gap: 2rem;
}

.settings-overview {
  gap: 1.25rem;
}

.settings-checklist,
.settings-guide-grid {
  display: grid;
  gap: 1rem;
}

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

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

.settings-step-card,
.settings-guide-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.settings-guide-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.settings-step-card strong {
  font-size: 0.95rem;
}

.guide-success {
  background: var(--success-soft);
  border-color: hsl(152 28% 82%);
}

.guide-warning {
  background: var(--warning-soft);
  border-color: hsl(45 70% 70%);
}

.settings-bullet-list,
.settings-ordered-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted-foreground);
  font-size: 0.84rem;
  line-height: 1.65;
}

.settings-bullet-stack {
  display: grid;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.84rem;
  line-height: 1.65;
}

.settings-bullet-list strong,
.settings-ordered-list strong,
.settings-bullet-stack strong {
  color: var(--foreground);
  font-weight: 600;
}

.settings-section {
  display: grid;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.settings-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.settings-section .section-subtitle {
  max-width: 48rem;
}

/* ─── Checkbox pills ─── */

.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  font-size: 0.8125rem;
}

/* ─── Empty state ─── */

.empty-state {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

/* ─── Dialog ─── */

.dialog-card {
  width: min(100%, 28rem);
}

/* ─── Centered card (auth-like pages on public shell) ─── */

.centered-card {
  width: min(100%, 28rem);
  margin: 0 auto;
}

.supporting-copy {
  max-width: 34rem;
}

.legal-check {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0.85rem 1rem;
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.6;
}

.legal-check-inline {
  display: flex;
  margin-bottom: 1rem;
}

.legal-check input {
  width: auto;
  margin-top: 0.2rem;
}

.legal-check a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.policy-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 19rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.policy-summary-card,
.policy-article {
  position: relative;
}

.checkout-summary-card {
  margin-bottom: 1.25rem;
}

.checkout-plan-name {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.checkout-chip-row {
  margin-top: 1rem;
}

.checkout-status {
  margin-top: 0.75rem;
  min-height: 1.25rem;
  color: var(--foreground);
}

.policy-summary-meta,
.policy-section {
  display: grid;
  gap: 0.65rem;
}

.policy-section {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.policy-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.policy-paragraph,
.policy-list {
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.75;
}

.policy-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.5rem;
}

.public-hero-policy {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}

.legal-gate-card {
  max-width: 56rem;
}

.legal-gate-grid {
  display: grid;
  gap: 1.5rem;
}

.legal-gate-form,
.legal-gate-logout {
  max-width: 34rem;
}

/* ─── CTA section (landing bottom) ─── */

.cta-section {
  text-align: center;
  padding: 4rem 0;
  display: grid;
  gap: 1rem;
  justify-items: center;
}

/* ─── Responsive — tablet ─── */

@media (min-width: 768px) {
  .display-xl {
    font-size: 3.5rem;
  }

  .display-lg,
  .page-title {
    font-size: 2rem;
  }

  .display-md {
    font-size: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .display-xl {
    font-size: 3.75rem;
  }

  .display-lg,
  .page-title {
    font-size: 2.25rem;
  }
}

/* ─── Responsive — collapse ─── */

@media (max-width: 1100px) {
  .compose-workbench,
  .compose-support-grid,
  .compose-support-grid-empty,
  .settings-checklist,
  .settings-guide-grid,
  .policy-layout {
    grid-template-columns: 1fr;
  }

  .layout-grid,
  .pricing-grid,
  .public-grid-3 {
    grid-template-columns: 1fr;
  }

  .pricing-card-enterprise {
    grid-column: span 1;
  }

  .pricing-card-enterprise .pricing-list {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .filters,
  .toolbar-grid,
  .compose-filter-grid {
    grid-template-columns: 1fr;
  }

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

  .compose-rail {
    position: static;
  }

  .compose-main-column {
    order: 1;
  }

  .compose-rail {
    order: 2;
  }

  .compose-contact-list {
    max-height: 22rem;
  }
}

@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(19rem, calc(100vw - 2rem));
    max-width: 100%;
    border-bottom: 0;
    transform: translateX(calc(-100% - 1rem));
    z-index: 30;
    box-shadow: var(--shadow-soft);
  }

  .app-main {
    margin-left: 0;
  }

  .app-shell.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-open .app-sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .app-sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(17, 14, 11, 0.24);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 25;
  }

  .app-sidebar-toggle {
    display: inline-flex;
    height: 2.5rem;
    padding: 0 1rem;
  }

  .app-topbar {
    padding: 0.9rem 1rem;
    align-items: stretch;
    flex-direction: column;
  }

  .app-container,
  .public-main,
  .public-header-inner,
  .public-footer-inner {
    width: calc(100% - 2rem);
  }

  .app-topbar-copy,
  .app-topbar-actions {
    width: 100%;
  }

  .app-topbar-copy {
    justify-content: space-between;
    align-items: flex-start;
  }

  .app-topbar-actions {
    justify-content: space-between;
  }

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

  .page-header {
    align-items: start;
    flex-direction: column;
  }

  .page-header-actions {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .public-header-inner,
  .public-footer-inner,
  .app-topbar,
  .app-container,
  .public-main {
    width: calc(100% - 1.5rem);
  }

  .public-header-inner,
  .public-footer-inner,
  .toolbar-row,
  .auth-links,
  .auth-link-line {
    flex-direction: column;
    align-items: start;
  }

  .public-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
  }

  .public-footer-inner {
    display: grid;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .responsive-table thead {
    display: none;
  }

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

  .responsive-table tbody tr {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
  }

  .responsive-table tbody tr:first-child {
    border-top: 0;
  }

  .responsive-table td {
    padding: 0;
    border-top: 0;
    gap: 0.2rem;
  }

  .responsive-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    margin-bottom: 0.2rem;
  }

  .responsive-table .button-row,
  .action-inline-form,
  .inline-form-grid {
    width: 100%;
  }

  .action-inline-form .btn,
  .inline-form-grid .btn,
  .page-header-actions .btn {
    width: 100%;
  }

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

  .app-topbar-copy {
    flex-direction: column;
    align-items: stretch;
  }

  .app-sidebar-toggle {
    align-self: flex-start;
  }

  .app-topbar-meta {
    font-size: 0.72rem;
  }

  .app-container {
    width: calc(100% - 1.5rem);
    padding-top: 1.5rem;
  }

  .compose-contact-list {
    max-height: 18rem;
  }

  .auth-body {
    padding: 1.25rem 0.75rem;
  }

  .section-card,
  .public-side-card,
  .pricing-card,
  .dialog-card {
    padding: 1rem;
  }
}
