/* R20AU · one visual language for staff, customers and sign-in. */
:root {
  --bg: #f5f6fa;
  --panel: #fff;
  --panel-soft: #f8f9fc;
  --ink: #242537;
  --ink-soft: #4c5065;
  --muted: #697187;
  --line: #e6e8f0;
  --line-strong: #ccd0df;
  --brand: #6355df;
  --brand-dark: #5042c2;
  --brand-soft: #eeebff;
  --radius: 18px;
  --radius-sm: 11px;
  --sidebar: 250px;
  --shadow-sm: 0 2px 6px #25274304, 0 6px 24px #25274304;
  --shadow: 0 16px 44px #2527430d;
  --shadow-float: 0 20px 64px #25274326;
  --dock-height: 70px;
}

html { scroll-padding-top: 96px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: #6355df18;
}
[hidden] { display: none !important; }
a, button, input, select, textarea { touch-action: manipulation; }
button, .btn { transition: background .16s, box-shadow .16s, border-color .16s, transform .16s; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #7467e9;
  outline-offset: 3px;
}
button:disabled, .btn[aria-disabled="true"] { cursor: wait; }
input, select, textarea { max-width: 100%; }
img, video { max-width: 100%; }
.main, .content, .card, .form-grid > *, .detail-grid > *, .dashboard-grid > * { min-width: 0; }
.main { background: radial-gradient(ellipse at 95% 0%, #e9e5fa70, transparent 45%); }
.content { padding: 28px 30px 92px; max-width: 1920px; margin-inline: auto; }
.content > * { min-width: 0; }
.card, .public-offer-card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card { background: #fff; }
.card:not(.table-card):not(.compact-card):not(.data-section) { padding: 23px; }
.card-head { gap: 14px; margin-bottom: 20px; }
.card-head h2, .card h2 { font-size: 17px; letter-spacing: -.025em; }
.card-head p, .page-head p { color: var(--muted); line-height: 1.6; }
.section-kicker, .eyebrow { color: var(--brand-dark); letter-spacing: .12em; font-size: 10px; }
.page-head { margin-bottom: 25px; gap: 20px; }
.page-head h1 { margin-top: 4px; font-size: clamp(26px, 2.4vw, 36px); line-height: 1.15; letter-spacing: -.045em; }
.page-head p { margin-top: 9px; max-width: 70ch; }
.head-actions, .inline-actions, .form-actions { gap: 9px; }
.btn, button.primary, button.secondary, button.tertiary, button.danger {
  min-height: 42px; padding: 10px 17px; border-radius: 11px; font-size: 13px; font-weight: 650;
}
.btn.small, button.small { padding: 7px 11px; min-height: 34px; font-size: 12px; }
.primary, .btn.primary { color: #fff; border-color: var(--brand); background: var(--brand); box-shadow: 0 4px 10px #6355df24; }
.primary:hover, .btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); box-shadow: 0 6px 16px #6355df30; }
.secondary, .btn.secondary { color: var(--ink); background: #fff; border-color: var(--line-strong); }
.secondary:hover, .btn.secondary:hover { background: var(--panel-soft); border-color: #b2a9ed; }
.tertiary, .btn.tertiary { color: var(--brand-dark); background: var(--brand-soft); border-color: transparent; }
@media (hover: hover) {
  .btn:hover, button.primary:hover, button.secondary:hover { transform: translateY(-1px); }
  .btn:active, button:active { transform: translateY(0); }
}

/* A quiet rail with a single clear active destination. */
.sidebar { background: #fcfcfe; padding: 18px 12px 12px; backdrop-filter: none; border-right: 1px solid #e4e5ef; }
.sidebar-head { margin-bottom: 21px; }
.brand:hover { background: var(--brand-soft); }
.nav-list { gap: 5px; scrollbar-width: thin; scrollbar-color: #d4d0e5 transparent; }
.nav-link { min-height: 42px; border-radius: 11px; color: #52556d; font-size: 13px; font-weight: 550; padding: 7px 10px; }
.nav-link:hover { color: var(--brand-dark); background: #f0edfc; }
.nav-link.active { color: #fff; background: var(--brand); box-shadow: 0 5px 14px #6355df26; font-weight: 650; }
.nav-link.active .nav-icon { color: #fff; background: #ffffff20; }
.nav-link.active .nav-count { color: #fff; background: #ffffff24; }
.nav-icon { width: 28px; height: 28px; border-radius: 8px; }
.nav-divider { margin-top: 18px; margin-bottom: 7px; color: #74768a; }
.sidebar-status { border: 1px solid var(--line); background: #fff; border-radius: 12px; margin: 14px 2px 10px; }
.sidebar-bottom { border-top: 1px solid var(--line); padding-top: 13px; }
.user-chip { border-radius: 12px; }
.avatar { background: #eae5ff; color: var(--brand-dark); box-shadow: none; border-radius: 12px; }
.sidebar-bottom .version { color: #74768a; font-size: 10px; }
.sidebar-bottom > a.ghost { font-size: 11px; }
.mobile-dock { display: none; }

.topbar { min-height: 76px; height: auto; padding: 15px 30px; gap: 20px; background: #fbfcfee8; box-shadow: none; }
.global-search { max-width: 620px; height: 44px; border-radius: 12px; background: #f0f1f7; border: 1px solid transparent; }
.global-search input { font-size: 13px; }
.global-search input::placeholder { color: #73798d; }
.global-search kbd { color: #697187; background: #fff; border-color: #d8dce7; }
.global-search-results { border-radius: 14px; box-shadow: var(--shadow-float); border-color: var(--line); }
.global-search-result { padding: 12px 15px; }
.global-search-result.active, .global-search-result:hover { background: var(--brand-soft); }
.topbar-clock time { font-variant-numeric: tabular-nums; color: var(--ink); }
.topbar-wordmark { color: #52566b; }

/* Dashboard: a distinct opening panel, then calm, readable information. */
.dashboard-head {
  position: relative; isolation: isolate; overflow: hidden;
  margin-bottom: 24px; padding: 29px 30px; border: 1px solid #3e3c65;
  border-radius: 22px; background: #28263f; color: #fff;
  box-shadow: 0 12px 32px #28263f12;
}
.dashboard-head::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 350px; height: 350px; right: 8%; top: -210px;
  border: 65px solid #b3a6ff13; border-radius: 50%;
  box-shadow: 0 0 0 55px #b3a6ff09;
  animation: ui-orbit 3s ease-out both;
}
.dashboard-head h1 { color: #fff; font-size: clamp(26px, 2.6vw, 38px); letter-spacing: -.045em; }
.dashboard-head .eyebrow { color: #c3bafa; }
.dashboard-head p { color: #d1cfe0; max-width: 58ch; }
.dashboard-chips { gap: 7px; margin-top: 17px; }
.dashboard-chips > * { color: #e2dff0; background: #ffffff0d; border-color: #ffffff20; font-size: 11px; }
.dashboard-head .primary { color: #302656; background: #e7ddff; border-color: #e7ddff; box-shadow: none; }
.dashboard-head .secondary { color: #fff; background: #ffffff10; border-color: #ffffff30; }
.dashboard-head .btn:hover { box-shadow: 0 4px 14px #0002; }
.dashboard-metrics { gap: 16px; margin-bottom: 24px; }
.metric-card, .metric-card.metric-cyan, .metric-card.metric-indigo, .metric-card.metric-pink {
  position: relative; padding: 22px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-sm); transition: border-color .2s, transform .2s;
}
.metric-card::before { display: none; }
.metric-card .metric-icon { border-radius: 13px; color: #6758d7; background: #efeaff; }
.metric-card.metric-cyan .metric-icon { color: #187d82; background: #e4f4f1; }
.metric-card.metric-pink .metric-icon { color: #ba516c; background: #fbedf1; }
.metric-card strong { font-size: clamp(25px, 2.4vw, 34px); letter-spacing: -.045em; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric-card small, .metric-card p { color: var(--muted); }
@media (hover: hover) { .metric-card:hover { transform: translateY(-3px); border-color: #c9c0f5; } }
.dashboard-grid, .dashboard-focus-grid { gap: 20px; }
.dashboard-task-list { gap: 9px; }
.dashboard-task-row, .dashboard-offer-followup-row { border-radius: 12px; }
.dashboard-task-title { line-height: 1.5; }
.dashboard-task-title b { font-size: 13px; }
.dashboard-task-main { padding: 12px 8px 12px 12px; }
.dashboard-task-main small { font-size: 11px; }
.dashboard-task-status { font-size: 10px; }
.dashboard-task-row { grid-template-columns: minmax(0, 1fr) 48px; }
.dashboard-task-complete { width: 40px; height: 40px; min-height: 40px; }
.dashboard-task-more { font-size: 12px; padding: 8px; }
.dashboard-offer-followup-row small { font-size: 11px; }
.dashboard-offer-followup-row > strong { font-size: 12px; }
.dashboard-alert-center { border-radius: 16px; }
.dashboard-task-card, .dashboard-workplan-card, .dashboard-deals-card { box-shadow: var(--shadow-sm); }
.dashboard-location-week-scroll { min-width: 0; max-width: 100%; }

/* Forms retain native controls, with clearer focus and touch areas. */
.field label { margin-bottom: 7px; color: #4c5065; font-size: 12px; font-weight: 650; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea,
.filterbar input, .filterbar select {
  min-height: 43px; border-color: #dce0eb; border-radius: 10px; background: #fbfcff;
  color: var(--ink); font-size: 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus,
.filterbar input:focus, .filterbar select:focus {
  border-color: #9285e9; background: #fff; box-shadow: 0 0 0 3px #6355df12;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
.field .helptext, .field small { color: var(--muted); line-height: 1.55; }
.errorlist { border-radius: 9px; line-height: 1.55; }
.errorlist li { color: #a3213a; }
.form-grid { gap: 19px 20px; }
.filterbar.card { padding: 14px; gap: 10px; border-radius: 14px; margin-bottom: 18px; }
.filter-search { min-width: min(230px, 100%); }
.sticky-actions, .deal-save-actions, .offer-save-actions {
  gap: 10px; padding: 12px 15px; border: 1px solid #e1dff0;
  border-radius: 14px; box-shadow: 0 8px 30px #25274315; background: #ffffffed;
  backdrop-filter: blur(14px);
}
.deal-tabs { gap: 6px; padding: 5px; background: #ebedf5; border: 0; border-radius: 12px; }
.deal-tabs button { color: #64697f; border: 0; border-radius: 9px; min-height: 40px; }
.deal-tabs button.active { color: var(--brand-dark); background: #fff; box-shadow: 0 2px 6px #2527430a; }
.data-section > summary { padding: 18px 21px; }
.offer-step-number { background: var(--brand-soft); color: var(--brand-dark); border-radius: 10px; }
.offer-choice-mode label { transition: background .18s, border-color .18s, box-shadow .18s; }
.offer-choice-mode label:has(input:checked) { border-color: #9383e6; box-shadow: 0 0 0 2px #6355df10; }
.task-relation-search { min-width: 0; }
.task-relation-results { box-shadow: var(--shadow-float); border-radius: 12px; }
.task-relation-option { padding-block: 12px; }
.task-relation-search:has([aria-busy="true"]) [data-task-relation-status]::before,
.global-search[aria-busy="true"] .global-search-status::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px;
  border: 2px solid #d8d1f3; border-top-color: var(--brand); border-radius: 50%;
  vertical-align: -2px; animation: ui-spin .75s linear infinite;
}

/* R20AX: item controls fit the actual form width beside the live preview. */
.deal-form .card.form-accordion.order-accordion { padding: 0; }
.deal-form .order-accordion > summary { flex-wrap: wrap; align-items: flex-start; }
.deal-form .order-total-chip { max-width: 100%; flex-wrap: wrap; gap: 0 3px; }
.deal-form .order-items { gap: 14px; }
.deal-form .order-items .item-row {
  display: block; min-width: 0; max-width: 100%; padding: 14px;
  overflow: visible; background: var(--panel-soft);
}
.deal-form .deal-item-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-width: 0; margin-bottom: 12px;
}
.deal-form .deal-item-header .item-number { align-items: flex-start; min-width: 0; text-align: left; }
.deal-form .deal-item-header .delete-wrap { flex: 0 0 auto; padding: 0; }
.deal-form .deal-item-header .icon-btn { width: 40px; height: 40px; }
.deal-form .deal-item-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.deal-form .deal-item-details {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px;
}
.deal-form .deal-item-pricing {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 12px; align-items: start; border-top: 1px solid var(--line); padding-top: 12px;
}
.deal-form .deal-item-fields > *, .deal-form .deal-item-pricing > *, .deal-form .deal-item-details > * { min-width: 0; }
.deal-form .item-row input, .deal-form .item-row textarea { min-width: 0; width: 100%; max-width: 100%; }
.deal-form .item-row textarea { min-height: 64px; height: auto; resize: vertical; }
.deal-form .item-row label { overflow-wrap: anywhere; }
.deal-form .item-row .line-total {
  min-height: 43px; max-width: 100%; background: var(--brand-soft); border-color: #ddd7f8;
  white-space: normal; overflow-wrap: anywhere;
}
.deal-form .order-accordion .add-row-btn { max-width: 100%; white-space: normal; }

/* Lists and boards: contain large datasets without widening the whole page. */
.table-card { overflow: hidden; }
.table-wrap { width: 100%; max-width: 100%; min-width: 0; border-radius: inherit; scrollbar-width: thin; scrollbar-color: #c6c4d9 #f6f7fb; }
thead th { padding: 15px 16px; background: #f8f9fd; color: #6b7084; font-size: 10px; letter-spacing: .07em; border-bottom: 1px solid var(--line); }
tbody td { padding: 16px; border-bottom-color: #edeff5; color: #454a60; font-size: 13px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f8f7fe; }
tbody td a { color: #5143b4; }
tbody td small { line-height: 1.5; color: #737b8e; }
.deals-table th { font-size: 10px; padding: 14px 7px; }
.deals-table td { font-size: 12px; padding: 14px 7px; line-height: 1.5; }
.deals-table td small { font-size: 10px; line-height: 1.5; }
.money-cell { font-variant-numeric: tabular-nums; color: var(--ink); }
.badge { border-radius: 7px; padding: 4px 8px; font-size: 10px; line-height: 1.35; }
.pagination { padding: 16px 20px; gap: 12px; }
.empty { padding: 44px 20px; color: var(--muted); }
.pipeline { min-width: 0; max-width: 100%; gap: 16px; padding-bottom: 24px; }
.stage-column { border-radius: 16px; background: #eceef6; border: 1px solid #e3e5f0; }
.stage-head { padding: 17px 14px; }
.deal-card { border: 1px solid #e1e4ed; border-radius: 12px; box-shadow: 0 2px 6px #25274305; }
.deal-card:hover { border-color: #bdb2eb; box-shadow: 0 5px 14px #2527430a; }
.deal-card[draggable="true"] { cursor: grab; }
.deal-card.dragging { cursor: grabbing; }
.ui-scroll-hint { display: block; margin: 6px 2px 9px; color: #6a6183; font-size: 11px; }
.table-card > .ui-scroll-hint { padding-inline: 16px; }
.file-item { border-radius: 12px; }
.message { border-radius: 12px; box-shadow: var(--shadow-sm); }
.global-overdue-alert { border-radius: 14px; }
.floating-tool-button { box-shadow: 0 5px 20px #26234a28; }

/* Feedback: real indeterminate progress, with an always available minimize. */
.ui-progress { position: fixed; inset: 0 0 auto; z-index: 10100; pointer-events: none; }
.ui-progress-track { display: block; height: 3px; overflow: hidden; background: #b4a7ed55; }
.ui-progress-track::after {
  content: ""; display: block; width: 32%; height: 100%; background: #8070ed;
  box-shadow: 0 0 12px #7662e8; animation: ui-progress 1.25s ease-in-out infinite;
}
.ui-progress-label {
  display: block; width: fit-content; max-width: calc(100vw - 32px); margin: 9px 16px 0 auto;
  padding: 9px 13px; border: 1px solid #ded9f5; border-radius: 10px;
  background: #fff; color: #574781; box-shadow: var(--shadow); font-size: 12px;
}
.ui-progress.is-notice .ui-progress-track { display: none; }
.page-loading { z-index: 10000; pointer-events: none; }
.page-loading-backdrop { background: #f7f7fc70; backdrop-filter: blur(1.5px); }
.page-loading-card {
  pointer-events: auto; width: min(400px, calc(100vw - 36px)); border: 1px solid #ded8f2;
  padding: 29px; border-radius: 22px; box-shadow: 0 25px 100px #30274726;
  animation: ui-feedback-enter .18s ease-out;
}
.page-loading-card b { display: block; margin: 6px 0 10px; font-size: 17px; color: var(--ink); }
.page-loading-card p { margin: 0 0 15px; color: #696479; font-size: 13px; line-height: 1.6; }
.page-loading-spinner { width: 36px; height: 36px; border-width: 3px; border-color: #e8e2f7; border-top-color: var(--brand); }
.page-loading-card .tertiary { min-height: 44px; }
.ui-busy { position: relative; cursor: wait; }
.ui-busy::after {
  content: ""; display: inline-block; flex: 0 0 13px; width: 13px; height: 13px; margin-left: 9px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -2px; animation: ui-spin .75s linear infinite;
}
.ui-connection {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 10110;
  width: max-content; max-width: calc(100vw - 30px); padding: 12px 18px;
  color: #79470a; background: #fff4d7; border: 1px solid #ecd3a3;
  border-radius: 12px; font-size: 13px; box-shadow: var(--shadow);
}
.assistant-message.pending > div::after { content: " ···"; animation: ui-pending 1.2s ease-in-out infinite; }
.chat-send:disabled { opacity: .65; animation: ui-pending 1.2s ease-in-out infinite; }

/* Authentication and customer pages share the same finish. */
.security-login-body {
  min-height: 100dvh; background: radial-gradient(ellipse at 10% 10%, #e6dff8, transparent 55%),
    radial-gradient(ellipse at 100% 100%, #dcecec, transparent 45%), #f5f5fb;
}
.security-login-card { width: min(440px, 100%); padding: 38px; border: 1px solid #fff; border-radius: 24px; box-shadow: 0 20px 70px #28263f12; }
.security-login-card .login-logo { margin-bottom: 28px; }
.security-login-card h1 { color: var(--ink); letter-spacing: -.04em; font-size: 28px; }
.security-login-card .login-security-note { border-top: 1px solid var(--line); padding-top: 20px; color: #6e7183; }
.public-offer-body { background: #f4f4fa; padding: 40px 24px 72px; }
.public-offer-shell { max-width: 900px; }
.public-offer-head { padding: 0 6px 20px; color: var(--muted); }
.public-offer-card { padding: clamp(22px, 4vw, 38px); margin-bottom: 20px; }
.public-offer-card h1 { font-size: clamp(25px, 4vw, 36px); line-height: 1.2; letter-spacing: -.04em; }
.public-offer-card h2 { letter-spacing: -.025em; }
.public-offer-card .offer-product { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.public-offer-card .offer-total { border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); padding: 18px; }
.public-offer-card .offer-choice-note { border-radius: 10px; line-height: 1.6; }
.public-offer-card .success-panel, .public-offer-card.success-panel { border-color: #c8e4dc; }

body.experience-ready .content > *, body.experience-ready .public-offer-card,
body.experience-ready .security-login-card { animation: ui-feedback-enter .3s ease-out backwards; }
body.experience-ready .content > :nth-child(2) { animation-delay: .025s; }
body.experience-ready .content > :nth-child(3) { animation-delay: .05s; }
@keyframes ui-feedback-enter { from { opacity: .45; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ui-progress { 0% { transform: translateX(-110%); } 100% { transform: translateX(420%); } }
@keyframes ui-spin { to { transform: rotate(360deg); } }
@keyframes ui-pending { 50% { opacity: .45; } }
@keyframes ui-orbit { from { transform: translate(24px, -20px) scale(.9); opacity: .4; } to { transform: none; opacity: 1; } }

@media (max-width: 1180px) {
  .content { padding-inline: 22px; }
  .topbar { padding-inline: 22px; }
  .dashboard-head { padding: 25px; }
  .dashboard-head .head-actions { flex-wrap: wrap; }
}
@media (max-width: 850px) {
  html { scroll-padding-top: 80px; }
  body { --sidebar: 250px; }
  body.sidebar-open { touch-action: auto; }
  .sidebar { z-index: 300; padding-top: max(16px, env(safe-area-inset-top)); }
  .sidebar:not(.open) { visibility: hidden; }
  .sidebar-backdrop { z-index: 290; background: #21233560; backdrop-filter: blur(3px); }
  .sidebar-close { min-width: 44px; min-height: 44px; }
  .nav-link { min-height: 46px; }
  .sidebar .nav-list { touch-action: pan-y; }
  .topbar { gap: 10px; min-height: 66px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; }
  .topbar-identity { display: none; }
  .global-search { height: 44px; max-width: none; }
  .global-search input { font-size: 16px; }
  .global-search input::placeholder { color: #73798d; }
  .global-search kbd { display: none; }
  .global-search-results { max-height: min(65dvh, 430px); }
  .content { padding: 20px 16px calc(var(--dock-height) + 86px + env(safe-area-inset-bottom)); }
  .card:not(.table-card):not(.compact-card):not(.data-section) { padding: 19px; }
  .page-head { margin-bottom: 20px; }
  .page-head h1 { font-size: 29px; }
  .page-head .head-actions { gap: 8px; }
  .page-head .head-actions > * { min-width: 0; }
  .dashboard-head { padding: 24px 22px; gap: 20px; }
  .dashboard-head .head-actions { width: 100%; }
  .dashboard-head .head-actions > * { flex: 1; text-align: center; }
  .dashboard-head h1 { font-size: 30px; }
  .dashboard-head .head-actions { justify-content: flex-start; }
  .dashboard-metrics { gap: 10px; }
  .metric-card { padding: 17px; }
  .mobile-dock {
    position: fixed; z-index: 80; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(var(--dock-height) + env(safe-area-inset-bottom)); gap: 3px;
    padding: 7px max(10px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    background: #fffffff5; border-top: 1px solid #e5e2ef; box-shadow: 0 -5px 25px #28263f08; backdrop-filter: blur(18px);
  }
  .mobile-dock > * { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 51px; padding: 6px 2px; color: #6d7087; font-size: 10px; font-weight: 650; background: none; border: 0; border-radius: 11px; text-decoration: none; }
  .mobile-dock svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-dock [aria-current="page"], .mobile-dock button[aria-expanded="true"] { color: var(--brand-dark); background: var(--brand-soft); }
  .table-wrap { max-width: 100%; }
  .pipeline { width: 100%; grid-auto-columns: min(82vw, 330px); }
  .sticky-actions, .deal-save-actions, .offer-save-actions { bottom: calc(var(--dock-height) + 8px + env(safe-area-inset-bottom)); flex-wrap: wrap; padding: 10px; }
  .sticky-actions > *, .deal-save-actions > *, .offer-save-actions > * { flex: 1 1 auto; }
  .company-chat.floating-tool { bottom: calc(var(--dock-height) + 16px + env(safe-area-inset-bottom)); }
  .pipes-assistant.floating-tool { bottom: calc(var(--dock-height) + 16px + env(safe-area-inset-bottom)); }
  .floating-tool-button, .chat-ribbon.floating-tool-button, .assistant-ribbon.floating-tool-button { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .ui-connection { bottom: calc(var(--dock-height) + 14px + env(safe-area-inset-bottom)); }
  .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea, .filterbar input, .filterbar select { min-height: 46px; font-size: 16px; }
  .btn, button, .btn.small, button.small { min-height: 44px; }
  .deal-tabs { max-width: 100%; }
  .deal-tabs button { min-width: max-content; }
  .pagination { flex-wrap: wrap; justify-content: center; }
  .file-item { overflow-wrap: anywhere; }
}
@media (max-width: 720px) {
  .dashboard-head { display: flex; flex-direction: column; align-items: flex-start; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .page-head > .btn { width: 100%; text-align: center; }
  .dashboard-grid, .dashboard-focus-grid, .detail-grid, .form-grid, .price-sheet-sidebar { grid-template-columns: minmax(0, 1fr); }
  .form-grid > * { grid-column: auto; }
  .head-actions, .card-head .inline-actions { flex-wrap: wrap; }
  .filterbar { display: grid; grid-template-columns: minmax(0, 1fr); }
  .filterbar > * { width: 100%; min-width: 0; }
  :is(.ui-card-table, .mobile-card-table), :is(.ui-card-table, .mobile-card-table) tbody, :is(.ui-card-table, .mobile-card-table) tr, :is(.ui-card-table, .mobile-card-table) td { display: block; width: 100%; min-width: 0; max-width: 100%; }
  :is(.ui-card-table, .mobile-card-table) { border-spacing: 0; table-layout: auto; }
  :is(.ui-card-table, .mobile-card-table) colgroup { display: none; }
  :is(.ui-card-table, .mobile-card-table) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  :is(.ui-card-table, .mobile-card-table) tbody { padding: 12px; background: #f5f6fa; }
  :is(.ui-card-table, .mobile-card-table) tr { padding: 4px 0 8px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
  :is(.ui-card-table, .mobile-card-table) tr:last-child { margin-bottom: 0; }
  :is(.ui-card-table, .mobile-card-table) td {
    position: relative; min-height: 36px; padding: 8px 14px 8px 40%; border: 0;
    white-space: normal; overflow-wrap: anywhere; text-align: left; font-size: 13px;
  }
  :is(.ui-card-table, .mobile-card-table) td::before { content: attr(data-label); position: absolute; left: 14px; top: 9px; width: 32%; color: #73768a; font-size: 10px; letter-spacing: .04em; font-weight: 600; }
  :is(.ui-card-table, .mobile-card-table) td:first-child { padding: 13px 14px; margin-bottom: 7px; border-bottom: 1px solid var(--line); font-size: 15px; }
  :is(.ui-card-table, .mobile-card-table) td:first-child::before { position: static; display: block; width: 100%; margin-bottom: 5px; }
  :is(.ui-card-table, .mobile-card-table) td small { margin-top: 3px; white-space: normal; }
  :is(.ui-card-table, .mobile-card-table) td.empty { padding: 26px 16px; border: 0; }
  :is(.ui-card-table, .mobile-card-table) td.empty::before { display: none; }
  :is(.ui-card-table, .mobile-card-table) .badge { max-width: 100%; white-space: normal; }
  :is(.ui-card-table, .mobile-card-table) .money-cell { font-weight: 700; }
  :is(.ui-card-table, .mobile-card-table) .inline-actions { flex-wrap: wrap; }
  :is(.ui-card-table, .mobile-card-table) .deal-row-lost { background: #fff3f4; border-color: #e4b7c0; }
  .table-card:has(:is(.ui-card-table, .mobile-card-table)) { background: transparent; box-shadow: none; }
  .public-offer-body { padding: 22px 14px 42px; }
  .public-offer-card { padding: 22px 19px; }
  .public-offer-card .offer-product { padding: 17px; }
  .public-offer-card .btn { width: 100%; white-space: normal; text-align: center; }
  .public-offer-head { gap: 16px; }
  .company-chat .chat-panel, .pipes-assistant .assistant-panel { z-index: 400; }
}
@media (max-width: 420px) {
  .content { padding-inline: 12px; }
  .topbar { padding-inline: 12px; }
  .dashboard-head { padding: 23px 20px; }
  .dashboard-head h1 { font-size: 28px; }
  .dashboard-chips { flex-wrap: wrap; }
  .metric-card, .metric-card.metric-cyan, .metric-card.metric-indigo, .metric-card.metric-pink { padding: 16px; }
  .card:not(.table-card):not(.compact-card):not(.data-section) { padding: 17px; }
  .security-login-card { padding: 27px 22px; }
  .mobile-dock { gap: 2px; padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .ui-progress-track::after { width: 100%; opacity: .6; }
}
@media print {
  .mobile-dock, .ui-progress, .page-loading, .ui-connection, .ui-scroll-hint, .floating-tool { display: none !important; }
  body, .main, .content { background: #fff; }
  .content { padding: 0; }
  .dashboard-head { color: #222; background: #fff; border-color: #ccc; box-shadow: none; }
  .dashboard-head h1, .dashboard-head p, .dashboard-head .eyebrow { color: #222; }
  .dashboard-head::after { display: none; }
  .card { box-shadow: none; }
}
/* Session recovery stays above loading feedback and inside phone safe areas. */
.session-notice { position:fixed; z-index:100100; right:max(1rem,env(safe-area-inset-right)); bottom:calc(1rem + env(safe-area-inset-bottom)); width:min(34rem,calc(100vw - 2rem)); max-height:calc(100dvh - 2rem); overflow:auto; padding:1.1rem; border:1px solid #d6d0ff; border-radius:1rem; background:#fff; color:#26233d; box-shadow:0 12px 48px #25204433; }
.session-notice[hidden], .session-notice [hidden] { display:none !important; }
.session-notice p { margin:0 0 .75rem; overflow-wrap:anywhere; }
.session-notice-actions { display:flex; flex-wrap:wrap; gap:.5rem; }
@media (max-width:760px) { .session-notice { bottom:calc(5.5rem + env(safe-area-inset-bottom)); } .session-notice-actions > * { flex:1 1 100%; text-align:center; } }
@media print { .session-notice { display:none !important; } }

/* R20BB: advisory only; long contact names wrap on narrow screens. */
.contact-phone-warning { min-width:0; margin:.75rem 0; padding:.8rem 1rem; border:1px solid #e7c768; border-radius:.75rem; background:#fff8df; color:#634805; overflow-wrap:anywhere; line-height:1.5; }
.contact-phone-warning[hidden] { display:none !important; }
