:root {
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #0b2d24;
  --ink-soft: #254d41;
  --muted: #5f746f;
  --subtle: #879791;
  --line: #dce9e4;
  --line-soft: #eaf1ee;
  --soft: #f3faf7;
  --soft-strong: #e8f6ef;
  --surface: #fff;
  --canvas: #f7faf9;
  --green: #16835f;
  --green-bright: #2ca779;
  --green-pale: #67c28f;
  --danger: #b42318;
  --warning: #9a6700;
  --shadow-sm: 0 2px 8px rgba(14, 74, 56, .05);
  --shadow-md: 0 15px 38px rgba(14, 74, 56, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; color: var(--ink); font-family: var(--font-sans); font-size: 16px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
p { line-height: 1.65; }
h1, h2, h3 { letter-spacing: -.035em; }
code { padding: .15rem .4rem; border: 1px solid var(--line); border-radius: .35rem; background: var(--soft); color: var(--ink-soft); font-size: .9em; }

.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; font-size: 14px; font-weight: 820; line-height: .96; letter-spacing: -.02em; text-transform: uppercase; }
.brand-mark { position: relative; display: inline-block; width: 34px; height: 34px; flex: 0 0 34px; }
.brand-mark i { position: absolute; z-index: 1; display: block; width: 11px; height: 11px; border-radius: 50%; background: #0d2d25; }
.brand-mark i:nth-child(1) { top: 11px; left: 0; }
.brand-mark i:nth-child(2) { top: 1px; right: 0; background: var(--green-pale); }
.brand-mark i:nth-child(3) { right: 0; bottom: 1px; background: #35aa7d; }
.brand-mark::after { position: absolute; top: 16px; left: 8px; width: 18px; height: 2px; background: #0d2d25; box-shadow: 0 5px 0 #0d2d25; content: ""; transform: rotate(-27deg); }

.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 12px; padding: 0 19px; border: 1px solid transparent; border-radius: 9px; font-size: 15px; font-weight: 720; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-1px); }
.button-dark { color: #fff; background: #103f32; box-shadow: 0 3px 8px rgba(16, 63, 50, .16); }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 10px 28px rgba(22, 131, 95, .2); }
.button-primary:hover { box-shadow: 0 14px 32px rgba(22, 131, 95, .28); }
.button-secondary { border-color: var(--line); background: #fff; color: var(--ink-soft); }

/* Public shell */
.public-body { min-height: 100vh; background: #fff; }
.public-shell { min-height: 100vh; overflow: hidden; }
.public-header { position: relative; z-index: 10; display: grid; min-height: 76px; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 clamp(22px, 5.2vw, 84px); border-bottom: 1px solid var(--line-soft); background: rgba(255, 255, 255, .92); backdrop-filter: blur(16px); }
.public-header nav { display: flex; gap: 34px; color: #49645d; font-size: 15px; font-weight: 620; }
.public-header nav a, .text-link { transition: color .2s; }
.public-header nav a:hover, .text-link:hover { color: var(--green); }
.public-actions { justify-self: end; display: flex; align-items: center; gap: 22px; }
.text-link { color: #49645d; font-size: 15px; font-weight: 650; }
.public-main { position: relative; min-height: calc(100vh - 76px); }
.public-main::before { position: absolute; inset: 0; opacity: .75; background-image: linear-gradient(rgba(22, 131, 95, .055) 1px, transparent 1px), linear-gradient(90deg, rgba(22, 131, 95, .055) 1px, transparent 1px); background-size: 40px 40px; mask-image: linear-gradient(to bottom, black, transparent 72%); content: ""; pointer-events: none; }
.public-hero { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: clamp(76px, 10vw, 124px) 24px 90px; text-align: center; }
.announcement { display: flex; width: fit-content; min-height: 36px; align-items: center; gap: 9px; margin: 0 auto 26px; padding: 3px 14px 3px 6px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .9); box-shadow: var(--shadow-sm); color: #57716a; font-size: 13px; font-weight: 650; }
.announcement span { padding: 5px 8px; border-radius: 999px; background: var(--soft-strong); color: var(--green); font-weight: 750; }
.public-hero h1 { max-width: 930px; margin: 0 auto; font-size: clamp(52px, 7vw, 92px); font-weight: 710; line-height: .99; letter-spacing: -.065em; }
.public-hero h1 span { color: var(--green); }
.hero-lede { max-width: 700px; margin: 28px auto 0; color: var(--muted); font-size: clamp(16px, 2vw, 19px); }
.hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }
.hero-proof { display: flex; justify-content: center; gap: 22px; margin: 20px 0 50px; color: #71857f; font-size: 14px; }
.hero-proof span::before { margin-right: 6px; color: var(--green); content: "✓"; font-weight: 900; }
.preview-card { display: grid; max-width: 990px; grid-template-columns: 220px 1fr; margin: 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 40px 90px rgba(14, 74, 56, .14), 0 6px 20px rgba(14, 74, 56, .06); text-align: left; }
.preview-side { padding: 24px 18px; border-right: 1px solid var(--line-soft); background: #fafcfb; }
.preview-side strong { display: block; margin-bottom: 24px; font-size: 15px; }
.preview-side span { display: block; margin: 7px 0; padding: 10px 12px; border-radius: 7px; color: var(--muted); font-size: 14px; font-weight: 650; }
.preview-side span:first-of-type { background: var(--soft-strong); color: var(--green); }
.preview-main { padding: 30px; }
.preview-main > span { color: var(--subtle); font-size: 12px; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.preview-main h2 { margin: 6px 0 22px; font-size: 30px; }
.preview-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.preview-metrics div { padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.preview-metrics small { display: block; color: var(--muted); }
.preview-metrics small { font-size: 13px; }
.preview-metrics strong { display: block; margin-top: 10px; font-size: 32px; }

/* Authentication */
.auth-layout { position: relative; z-index: 1; display: grid; min-height: calc(100vh - 76px); grid-template-columns: minmax(320px, .85fr) minmax(460px, 1.15fr); }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: clamp(48px, 7vw, 96px); background: #0b2f27; color: #fff; }
.auth-story::after { position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; background: rgba(44, 167, 121, .2); filter: blur(10px); content: ""; }
.auth-story > * { position: relative; z-index: 1; }
.auth-story .section-label { color: #8ed7b6; }
.auth-story h1 { max-width: 550px; margin: 18px 0; font-size: clamp(42px, 5vw, 70px); line-height: 1.02; }
.auth-story p { max-width: 520px; color: #b5cbc4; font-size: 16px; }
.auth-points { display: grid; gap: 16px; margin-top: 34px; }
.auth-points span { color: #d4e4df; font-size: 15px; }
.auth-points i { display: inline-grid; width: 22px; height: 22px; place-items: center; margin-right: 9px; border-radius: 50%; background: rgba(103, 194, 143, .18); color: #8ed7b6; font-size: 10px; font-style: normal; }
.auth-form-wrap { display: grid; place-items: center; padding: 48px 24px; background: rgba(247, 250, 249, .86); }
.auth-card { width: min(500px, 100%); min-width: 0; padding: clamp(28px, 4vw, 44px); border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-md); }
.section-label { display: block; color: var(--green); font-size: 12px; font-weight: 780; letter-spacing: .11em; text-transform: uppercase; }
.auth-card h2 { margin: 10px 0 8px; font-size: 34px; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); }
.demo-login { min-width: 0; margin-bottom: 24px; padding: 18px; overflow: hidden; border: 1px solid #bfe1d2; border-radius: 11px; background: var(--soft); }
.demo-login-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.demo-login-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 8px; background: var(--green); color: #fff; }
.demo-login-copy { min-width: 0; flex: 1; }
.demo-login form { min-width: 0; }
.demo-login-head strong, .demo-login-head small { display: block; overflow-wrap: anywhere; }
.demo-login-head small { margin-top: 2px; color: var(--muted); }
.demo-login .button { width: 100%; min-width: 0; min-height: 50px; height: auto; padding: 12px 14px; line-height: 1.35; text-align: center; white-space: normal; }
.form-divider { display: flex; align-items: center; gap: 12px; margin: 23px 0; color: var(--subtle); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.form-divider::before, .form-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.field { margin-top: 16px; }
.field label { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 14px; font-weight: 720; }
.field input { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #cbdad5; border-radius: 8px; outline: none; background: #fff; color: var(--ink); font-size: 16px; transition: border .2s, box-shadow .2s; }
.field input:focus { border-color: var(--green-bright); box-shadow: 0 0 0 3px rgba(44, 167, 121, .13); }
.login-form .button { width: 100%; margin-top: 22px; }
.form-error { padding: 11px 13px; border: 1px solid #f3c7c3; border-radius: 8px; background: #fff4f3; color: var(--danger); font-size: 14px; }

/* CRM shell */
.crm-body { min-height: 100vh; background: var(--canvas); }
.crm-shell { display: grid; min-height: 100vh; grid-template-columns: 238px minmax(0, 1fr); }
.crm-sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 24px 16px 18px; border-right: 1px solid var(--line); background: #fbfdfc; }
.crm-brand { margin: 0 8px 27px; }
.workspace-card { display: grid; min-height: 58px; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.workspace-avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 8px; background: var(--green); color: #fff; font-size: 14px; font-weight: 800; }
.workspace-card small, .workspace-card strong { display: block; }
.workspace-card small { color: var(--subtle); font-size: 12px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.workspace-card strong { overflow: hidden; margin-top: 3px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-card > span:last-child { color: var(--subtle); }
.side-navigation { display: flex; flex-direction: column; gap: 3px; margin-top: 25px; }
.nav-label { margin: 0 10px 7px; color: #7c9189; font-size: 12px; font-weight: 760; letter-spacing: .09em; text-transform: uppercase; }
.side-navigation a { display: grid; min-height: 44px; grid-template-columns: 27px 1fr; align-items: center; padding: 0 11px; border-radius: 7px; color: #526b63; font-size: 14px; font-weight: 650; transition: background .18s, color .18s, transform .18s; }
.side-navigation a:hover { background: #f0f6f3; color: var(--ink-soft); transform: translateX(2px); }
.side-navigation a > span { color: #80978e; font-size: 18px; }
.side-navigation a.active { background: var(--soft-strong); color: var(--green); }
.side-navigation a.active > span { color: var(--green); }
.sidebar-footer { margin-top: auto; }
.agent-status { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.agent-orb { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 8px; background: var(--green); color: #fff; }
.agent-status strong, .agent-status small { display: block; }
.agent-status strong { font-size: 13px; }
.agent-status small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.agent-status small i, .live-pill i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: #24b17d; box-shadow: 0 0 0 3px #e3f7ef; }
.sidebar-signout { width: 100%; margin-top: 8px; padding: 10px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; cursor: pointer; text-align: left; }
.sidebar-signout:hover { color: var(--ink); }
.crm-stage { min-width: 0; }
.crm-topbar { position: sticky; top: 0; z-index: 8; display: flex; min-height: 72px; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 3vw, 40px); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .93); backdrop-filter: blur(16px); }
.topbar-label { display: block; color: var(--subtle); font-size: 12px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.crm-topbar strong { display: block; margin-top: 3px; font-size: 15px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.live-pill { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: 12px; font-weight: 680; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-chip > b { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 9px; background: var(--soft-strong); color: var(--green); font-size: 13px; }
.user-chip span, .user-chip small { display: block; }
.user-chip span { font-size: 13px; font-weight: 720; }
.user-chip small { margin-top: 2px; color: var(--subtle); font-size: 12px; font-weight: 500; }
.crm-main { width: 100%; max-width: 1500px; margin: 0 auto; padding: clamp(26px, 4vw, 48px); }

/* CRM components */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-heading h1 { margin: 6px 0 0; font-size: clamp(30px, 3vw, 42px); line-height: 1.06; }
.page-heading p { max-width: 760px; margin: 9px 0 0; color: var(--muted); font-size: 16px; }
.page-heading-actions { display: flex; align-items: center; gap: 10px; }
.meta-pill { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 13px; font-weight: 680; }
.meta-pill i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--green-bright); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 135px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.metric-card::after { position: absolute; right: -18px; bottom: -28px; width: 82px; height: 82px; border-radius: 50%; background: var(--soft); content: ""; }
.metric-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 8px; background: var(--soft-strong); color: var(--green); font-size: 18px; }
.metric-card small { display: block; margin-top: 17px; color: var(--muted); font-size: 14px; font-weight: 680; }
.metric-card strong { display: block; margin-top: 4px; font-size: 34px; letter-spacing: -.04em; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.panel-body { padding: 20px; }
.panel-head { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 18px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 18px; }
.panel-head p, .panel-head small { display: block; margin: 4px 0 0; color: var(--subtle); font-size: 12px; }
.panel-link { color: var(--green); font-size: 13px; font-weight: 720; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th { padding: 13px 16px; background: #fafcfb; color: #6e837c; font-size: 12px; font-weight: 760; letter-spacing: .045em; text-align: left; text-transform: uppercase; }
td { padding: 17px 16px; border-top: 1px solid var(--line-soft); color: #49645d; font-size: 14px; line-height: 1.55; vertical-align: top; }
tbody tr { transition: background .18s; }
tbody tr:hover { background: #fbfdfc; }
td strong { color: var(--ink-soft); }
td a { color: var(--ink-soft); font-weight: 680; }
td a:hover { color: var(--green); }
.muted { color: var(--muted); }
.badge { display: inline-flex; width: fit-content; align-items: center; padding: 6px 9px; border-radius: 999px; background: #eff4f2; color: #49645d; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.review { background: #fff7df; color: var(--warning); }
.badge.failed { background: #fff0ee; color: var(--danger); }
.badge.success { background: var(--soft-strong); color: var(--green); }
.filter-bar { display: flex; align-items: end; gap: 12px; margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow-sm); }
.filter-bar label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 760; letter-spacing: .06em; text-transform: uppercase; }
.filter-bar input, .filter-bar select { min-width: 260px; min-height: 44px; padding: 0 12px; border: 1px solid #cbdad5; border-radius: 7px; outline: none; background: #fff; color: var(--ink); font-size: 14px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--green-bright); box-shadow: 0 0 0 3px rgba(44, 167, 121, .12); }
.filter-bar button { min-height: 44px; padding: 0 17px; border: 0; border-radius: 7px; background: var(--green); color: #fff; font-size: 14px; font-weight: 720; cursor: pointer; }
.workspace-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.workspace-link { display: grid; min-height: 138px; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; }
.workspace-link:hover { border-color: #b8dbcc; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.workspace-link .workspace-avatar { width: 48px; height: 48px; font-size: 16px; }
.workspace-link strong, .workspace-link small { display: block; }
.workspace-link strong { font-size: 17px; }
.workspace-link small { margin-top: 5px; color: var(--muted); font-size: 13px; }
.workspace-link > span:last-child { color: var(--green); font-size: 18px; }
.empty-state { padding: 38px 24px; color: var(--muted); text-align: center; }
.empty-state span { display: grid; width: 46px; height: 46px; place-items: center; margin: 0 auto 12px; border-radius: 11px; background: var(--soft); color: var(--green); font-size: 20px; }
.record-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.record-card { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.record-card + .record-card { margin-top: 18px; }
.record-card h2 { margin: 0 0 17px; font-size: 20px; }
.record-card h3 { margin: 20px 0 12px; font-size: 17px; }
.record-card ul { margin: 0; padding-left: 18px; }
.record-card li { margin: 10px 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.record-card a { color: var(--green); font-weight: 680; }
.record-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.record-meta div { padding: 13px; border-radius: 8px; background: var(--soft); }
.record-meta dt { color: var(--subtle); font-size: 12px; font-weight: 760; letter-spacing: .06em; text-transform: uppercase; }
.record-meta dd { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.activity-list { display: grid; gap: 0; }
.activity-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 11px; padding: 15px 20px; border-top: 1px solid var(--line-soft); }
.activity-row:first-child { border-top: 0; }
.activity-row-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; background: var(--soft-strong); color: var(--green); font-size: 12px; }
.activity-row p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.activity-row p strong { color: var(--ink-soft); }
.activity-row small { display: block; margin-top: 4px; color: var(--subtle); font-size: 12px; }
.mini-card { margin: 12px 0; padding: 14px; border: 1px solid var(--line-soft); border-radius: 9px; background: #fff; }
.mini-card strong, .mini-card small { display: block; }
.mini-card small { margin-top: 5px; color: var(--muted); font-size: 13px; }
.message { margin: 12px 0; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--green-bright); border-radius: 9px; background: #fff; }
.message.inbound { border-left-color: #67c28f; background: #fbfefc; }
.message.internal { border-left-color: #d4a72c; }
.message p { margin-bottom: 0; color: var(--ink-soft); font-size: 15px; }
pre { max-width: 100%; overflow: auto; padding: 13px; border-radius: 8px; background: #0b2f27; color: #d5e7e1; font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }
.pagination a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--green); font-weight: 700; }
.detail-link { color: var(--green); font-weight: 680; }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid, .record-grid { grid-template-columns: 1fr; }
  .preview-card { grid-template-columns: 180px 1fr; }
}

@media (max-width: 860px) {
  .public-header { grid-template-columns: 1fr auto; }
  .public-header nav, .public-actions .text-link { display: none; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: 350px; padding: 55px 28px; }
  .auth-story h1 { max-width: 680px; }
  .crm-shell { display: block; }
  .crm-sidebar { position: relative; z-index: 9; display: block; width: 100%; height: auto; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .crm-brand { margin: 0; }
  .workspace-card, .sidebar-footer { display: none; }
  .side-navigation { flex-direction: row; gap: 4px; margin: 12px 0 0; overflow-x: auto; }
  .nav-label { display: none; }
  .side-navigation a { display: flex; min-height: 36px; gap: 6px; padding: 0 10px; white-space: nowrap; }
  .side-navigation a > span { font-size: 13px; }
  .crm-topbar { position: relative; min-height: 60px; }
  .live-pill, .user-chip span { display: none; }
  .preview-card { grid-template-columns: 1fr; }
  .preview-side { display: none; }
}

@media (max-width: 620px) {
  .public-header { min-height: 68px; padding: 0 18px; }
  .public-actions .button { min-height: 38px; padding: 0 13px; }
  .public-main { min-height: calc(100vh - 68px); }
  .public-hero { padding: 64px 18px; }
  .public-hero h1 { font-size: clamp(43px, 14vw, 62px); }
  .hero-actions { flex-direction: column; }
  .hero-proof { align-items: center; flex-direction: column; gap: 8px; }
  .preview-main { padding: 20px; }
  .preview-metrics { grid-template-columns: 1fr; }
  .auth-story { min-height: 310px; }
  .auth-story h1 { font-size: 40px; }
  .auth-form-wrap { padding: 28px 14px; }
  .auth-card { padding: 25px 20px; }
  .crm-main { padding: 25px 16px; }
  .crm-topbar { padding: 0 17px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar input, .filter-bar select { width: 100%; min-width: 0; }
  .record-meta { grid-template-columns: 1fr; }
  th, td { padding: 12px; }
}

/* List-to-research worker (WIN-1573) */
.flash-list { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { margin: 0; padding: 12px 14px; border-radius: 8px; background: #eff4f2; color: #24443b; font-weight: 600; }
.flash.error { background: #fff0ee; color: var(--danger); }
.flash.success { background: var(--soft-strong); color: var(--green); }
.standin-banner { margin: 0 0 16px; padding: 12px 14px; border-left: 4px solid var(--warning); border-radius: 8px; background: #fff7df; color: #5b4a12; }
.standin-banner.failed { border-left-color: var(--danger); background: #fff0ee; color: var(--danger); }
.research-form, .review-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 12px 0; }
.research-form .field, .review-actions .field { display: grid; gap: 6px; min-width: 240px; flex: 1; }
.research-form select, .review-actions input { min-height: 44px; padding: 0 12px; border: 1px solid #cbdad5; border-radius: 7px; background: #fff; font-size: 14px; }
.draft-body { padding: 12px; border-radius: 8px; background: #f7faf9; white-space: normal; }
.trace-list { padding-left: 18px; }
.trace-ids dd { overflow-wrap: anywhere; font-family: ui-monospace, monospace; font-size: 12px; }

/* Synthetic calendar forms and long trace references. */
.booking-form { display: grid; gap: 12px; }
.booking-form .field { display: grid; gap: 6px; min-width: 0; }
.booking-form input:not([type="checkbox"]), .booking-form select { width: 100%; max-width: 100%; min-height: 44px; border: 1px solid #cbdad5; border-radius: 7px; padding: 8px; }
.booking-form button { margin-bottom: 8px; }
.booking-trace { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }

.booking-record { overflow-wrap: anywhere; }
.booking-record > * { min-width: 0; }
.booking-record .research-form .field { min-width: 0; }
.booking-record .research-form select { min-width: 0; max-width: 100%; width: 100%; }
@media (max-width: 1080px) { .booking-record { grid-template-columns: minmax(0, 1fr); } }
