:root {
  --ink: #0c2434;
  --ink-dark: #08171f;
  --teal: #34c7d6;
  --teal-dark: #148895;
  --paper: #ffffff;
  --surface: #edf3f5;
  --line: #d2e1e6;
  --muted: #667d88;
  --danger: #b42342;
  --success: #17795a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-dark);
  background: var(--surface);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--surface); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.topbar { position: sticky; top: 0; z-index: 20; color: white; background: var(--ink-dark); box-shadow: 0 8px 25px rgb(8 23 31 / .12); }
.topbar-inner { max-width: 1680px; margin: auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand small { display: block; color: #7fe3ec; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.brand strong { display: block; margin-top: 2px; font-size: 17px; }
.brand-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 15px; border-radius: 17px; color: var(--ink-dark); background: var(--teal); font-weight: 900; letter-spacing: -.04em; }
.brand-mark.small { width: 42px; height: 42px; margin: 0; border-radius: 13px; font-size: 14px; }
.account { display: flex; align-items: center; gap: 14px; font-size: 13px; color: rgb(255 255 255 / .72); }
.account form { margin: 0; }
.link-button { border: 0; padding: 0; color: #7fe3ec; background: none; font-weight: 700; }
.app-nav { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.app-nav a { border-radius: 9px; padding: 9px 11px; color: rgb(255 255 255 / .72); text-decoration: none; font-size: 13px; font-weight: 750; }
.app-nav a:hover, .app-nav a.active { color: white; background: rgb(255 255 255 / .11); }

.page-shell { max-width: 1680px; margin: auto; padding: 22px 24px 40px; }
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.week-controls, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.week-controls h1 { margin: 0 0 3px 4px; font-size: 20px; text-transform: capitalize; }
.sync { margin: 0 0 0 4px; color: var(--muted); font-size: 13px; }
.actions select, input, select, textarea { width: 100%; min-height: 42px; border: 1px solid #bfd2d8; border-radius: 10px; padding: 9px 11px; color: var(--ink); background: white; outline: none; transition: border-color .15s, box-shadow .15s; }
.actions select { width: auto; min-width: 190px; }
input:focus, select:focus, textarea:focus { border-color: var(--teal-dark); box-shadow: 0 0 0 3px rgb(52 199 214 / .16); }
textarea { resize: vertical; }

.button, .icon-button { min-height: 42px; border: 1px solid transparent; border-radius: 11px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 750; transition: transform .15s, background .15s, border-color .15s; }
.button:hover, .icon-button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--ink); }
.button.primary:hover { background: #103349; }
.button.secondary, .icon-button { color: var(--ink); background: white; border-color: var(--line); }
.button.secondary:hover, .icon-button:hover { border-color: var(--teal); }
.button.secondary.is-active { color: white; background: var(--ink); border-color: var(--ink); }
.button.full { width: 100%; }
.icon-button { width: 42px; padding: 0; font-size: 25px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.summary { min-height: 82px; border: 1px solid var(--line); border-radius: 15px; padding: 15px 17px; display: flex; flex-direction: column-reverse; justify-content: center; background: white; box-shadow: 0 2px 8px rgb(8 23 31 / .04); }
.summary strong { font-size: 26px; }
.summary span { color: var(--muted); font-size: 13px; }
.summary.accent { border-color: #e7d39f; background: #fffaf0; }

.calendar-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 3px 14px rgb(8 23 31 / .05); }
.calendar { min-width: 1260px; display: grid; grid-template-columns: 68px repeat(7, minmax(160px, 1fr)); align-items: start; }
.time-axis { position: sticky; left: 0; z-index: 6; color: var(--muted); background: white; border-right: 1px solid #cbdcdf; }
.axis-header { position: sticky; top: 0; z-index: 8; height: 59px; padding: 20px 8px 0; border-bottom: 1px solid #d9e6e9; color: var(--ink); background: white; font-size: 11px; font-weight: 800; text-align: center; text-transform: uppercase; }
.axis-start-gap { height: 16px; border-bottom: 1px solid #d9e6e9; background: #fbfdfe; }
.hour-label { height: 58px; padding: 4px 8px 0; border-bottom: 1px solid #d9e6e9; background: #fbfdfe; font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.day-column { min-height: 1467px; border-right: 1px solid #d9e6e9; background: #fbfdfe; }
.day-column:last-child { border-right: 0; }
.day-header { position: sticky; top: 0; z-index: 7; height: 59px; padding: 9px 12px; border-bottom: 1px solid #d9e6e9; background: white; }
.day-header span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.day-header strong { display: block; margin-top: 1px; font-size: 21px; }
.day-header.today { color: white; background: var(--ink); }
.day-header.today span { color: #7fe3ec; }
.day-timeline { position: relative; height: calc(24 * var(--hour-height)); margin-top: 16px; border-top: 1px solid #d9e6e9; background: repeating-linear-gradient(to bottom, #fbfdfe 0, #fbfdfe calc(var(--hour-height) - 1px), #d9e6e9 calc(var(--hour-height) - 1px), #d9e6e9 var(--hour-height)); }
.calendar-event { position: absolute; left: 5px; right: 5px; z-index: 2; min-height: 34px; padding: 7px 8px; overflow: auto; }

.appointment-card, .block-card { border: 1px solid #cfe1e5; border-radius: 12px; padding: 11px; background: white; box-shadow: 0 2px 7px rgb(8 23 31 / .05); }
.appointment-card { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.appointment-card:hover, .appointment-card:focus-visible { border-color: var(--teal-dark); box-shadow: 0 8px 22px rgb(8 23 31 / .14); outline: none; transform: translateY(-1px); }
.appointment-card.cancelled { opacity: .62; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.card-top > strong { color: var(--ink); font-size: 13px; }
.appointment-card h3 { margin: 9px 0 5px; color: var(--ink); font-size: 14px; }
.service-list { margin: 0; padding: 0; list-style: none; color: #526873; font-size: 12px; line-height: 1.45; }
.service-list li + li { margin-top: 3px; }
.service-list li::before { content: "•"; margin-right: 5px; color: var(--teal-dark); }
.map-link { display: inline-block; margin-top: 8px; color: var(--teal-dark); font-size: 12px; font-weight: 750; text-decoration: none; }
.map-link:hover { text-decoration: underline; }
.status { display: inline-flex; border: 1px solid currentColor; border-radius: 999px; padding: 3px 7px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status.proposed { color: #886516; background: #fff8e7; }
.status.confirmed { color: #0d7580; background: #eafafb; }
.status.change_requested { color: #a33650; background: #fff0f3; }
.status.completed { color: var(--success); background: #eefaf6; }
.status.cancelled { color: #66737a; background: #f1f4f5; }
.status.sent { color: #886516; background: #fff8e7; }
.status.revised { color: #0d7580; background: #eafafb; }
.status.accepted { color: var(--success); background: #eefaf6; }
.status.declined { color: #66737a; background: #f1f4f5; }
.status.prospect-new { color: #886516; background: #fff8e7; }
.status.prospect-contacted { color: #355e93; background: #eef5ff; }
.status.prospect-qualified, .status.prospect-appointment, .status.prospect-quote_sent { color: #0d7580; background: #eafafb; }
.status.prospect-won { color: var(--success); background: #eefaf6; }
.status.prospect-lost, .status.prospect-ineligible { color: #66737a; background: #f1f4f5; }
.card-actions { margin-top: 10px; padding-top: 9px; border-top: 1px solid #e5eef0; display: flex; gap: 5px; }
.card-icon { width: 31px; height: 31px; border: 0; border-radius: 8px; color: var(--teal-dark); background: #e8f6f7; font-weight: 900; }
.card-icon.success { color: var(--success); background: #eaf8f2; }
.card-icon.danger { color: var(--danger); background: #fff0f3; }
.card-icon.quote { display: inline-grid; place-items: center; color: #795d13; background: #fff8e7; text-decoration: none; }
.block-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; border-style: dashed; border-color: #c4ced3; color: #596b74; background: #f1f4f5; }
.block-card strong, .block-card b, .block-card span { display: block; }
.block-card strong { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.block-card b { margin-top: 5px; font-size: 13px; }
.block-card span { margin-top: 3px; font-size: 11px; }
.block-actions { display: flex; flex: 0 0 auto; gap: 5px; }

.flash { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 390px; padding: 13px 16px; border-radius: 11px; color: white; background: var(--ink); box-shadow: 0 12px 35px rgb(8 23 31 / .28); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .18s, transform .18s; }
.flash.show { opacity: 1; transform: translateY(0); }
.flash.error { background: #92243e; }

.modal { width: min(94vw, 520px); max-height: 92vh; padding: 0; border: 0; border-radius: 17px; color: var(--ink-dark); box-shadow: 0 24px 80px rgb(0 0 0 / .28); }
.modal.wide { width: min(94vw, 760px); }
.modal::backdrop { background: rgb(8 23 31 / .58); backdrop-filter: blur(3px); }
.modal-card { padding: 22px; overflow-y: auto; }
.modal-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.modal-card h2 { margin: 0; font-size: 21px; }
.modal-card header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.modal-card .close { border: 0; color: #667d88; background: none; font-size: 27px; line-height: 1; }
.modal-notice { margin-top: 16px; border-radius: 10px; padding: 11px 13px; font-size: 13px; line-height: 1.4; }
.modal-notice.error { border: 1px solid #efbdc8; color: #852039; background: #fff0f3; }
.modal-notice[hidden] { display: none; }
.modal-card > .form-grid { margin-top: 20px; }
.modal-card footer { margin-top: 22px; display: flex; justify-content: flex-end; gap: 9px; }
.appointment-detail-modal { width: min(94vw, 820px); }
.appointment-detail-content { margin-top: 18px; }
.detail-status-row { display: flex; align-items: end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.detail-status-editor { display: flex; align-items: end; gap: 8px; margin-left: auto; }
.detail-status-editor label { display: grid; gap: 5px; color: #203945; font-size: 12px; font-weight: 750; }
.detail-status-editor select { min-width: 160px; }
.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-grid .detail-span { grid-column: 1 / -1; }
.detail-grid dd { overflow-wrap: anywhere; }
.detail-grid a { color: var(--teal-dark); }
.detail-service-list { margin: 0; padding-left: 18px; }
.detail-actions { flex-wrap: wrap; }
.danger-button { border-color: #efbdc8; color: var(--danger); background: #fff0f3; }
.danger-button:hover { background: #ffe2e8; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label, .form-stack label, .services legend { color: #203945; font-size: 13px; font-weight: 750; }
.form-grid label input, .form-grid label select, .form-grid label textarea, .form-stack label input { margin-top: 6px; }
.span-two { grid-column: 1 / -1; }
.services { margin: 0; padding: 0; border: 0; }
.services legend { margin-bottom: 6px; }
.services label { min-height: 34px; display: flex; align-items: center; gap: 7px; color: #405864; font-weight: 600; }
.services input { width: 17px; min-height: 17px; margin: 0; accent-color: var(--teal-dark); }

.auth-body { min-height: 100vh; padding: 28px 16px; display: grid; place-items: center; background: radial-gradient(circle at top, #e8f8fa 0, var(--surface) 45%, #e4ecef 100%); }
.auth-card, .confirmation-card { width: min(100%, 440px); padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 18px 55px rgb(8 23 31 / .12); }
.install-card { width: min(100%, 650px); }
.auth-card h1, .confirmation-card h1 { margin: 0; color: var(--ink); text-align: center; font-size: 25px; }
.eyebrow { margin: 0 0 5px; color: var(--teal-dark); text-align: center; font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-card > .muted { text-align: center; }
.form-stack { display: grid; gap: 14px; margin-top: 20px; }
.form-stack hr { width: 100%; border: 0; border-top: 1px solid var(--line); }
.notice { margin: 17px 0; border-radius: 10px; padding: 11px 13px; color: #405864; background: #edf4f6; font-size: 13px; }
.notice.error { color: #852039; background: #fff0f3; }
.notice.success { color: #11684d; background: #eaf8f2; }
.intake-capture strong, .intake-capture small { display: block; }
.intake-capture small { margin-top: 5px; overflow-wrap: anywhere; }
.confirmation-card { text-align: center; }
.confirmation-card > .status { margin-top: 13px; }
.appointment-details { margin: 20px 0; display: grid; gap: 9px; text-align: left; }
.appointment-details div { border-radius: 10px; padding: 10px 12px; background: #f4f8f9; }
.appointment-details dt { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.appointment-details dd { margin: 4px 0 0; color: var(--ink); font-size: 14px; font-weight: 650; }
.confirmation-actions { display: grid; gap: 9px; }
.privacy-note { margin: 18px 0 0; color: #81939b; font-size: 11px; }
.quote-card { width: min(100%, 620px); }
.price-line { border: 1px solid #d8c48d; background: #fffaf0 !important; }
.price-line dd { font-size: 21px; }
.change-box { margin-top: 8px; color: var(--ink); text-align: left; font-size: 13px; font-weight: 750; }
.change-box textarea { margin-top: 6px; }

@media (max-width: 620px) {
  .detail-status-editor { width: 100%; align-items: stretch; flex-direction: column; margin-left: 0; }
  .detail-status-editor select, .detail-status-editor .button { width: 100%; }
}

.content-shell { max-width: 1500px; margin: auto; padding: 28px 24px 48px; }
.content-shell.narrow { max-width: 760px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.page-heading h1, .panel h1, .panel h2 { margin: 0; color: var(--ink); }
.page-heading h1 { font-size: 28px; }
.panel h2 { margin-bottom: 18px; font-size: 19px; }
.eyebrow.left { text-align: left; }
.panel { border: 1px solid var(--line); border-radius: 17px; padding: 22px; background: white; box-shadow: 0 4px 18px rgb(8 23 31 / .05); }
.management-grid { display: grid; grid-template-columns: minmax(330px, .8fr) minmax(620px, 1.7fr); gap: 18px; align-items: start; }
.span-wide { min-width: 0; }
.span-all { grid-column: 1 / -1; }
.form-stack select, .form-stack textarea { width: 100%; min-height: 42px; border: 1px solid #bfd2d8; border-radius: 10px; padding: 9px 11px; color: var(--ink); background: white; outline: none; }
.check-row { display: flex !important; align-items: center; gap: 9px; font-weight: 650 !important; }
.check-row input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--teal-dark); }
.form-hint { margin: -6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.link-panel { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 18px; }
.link-panel input { min-width: 0; }
.quote-share-panel { display: grid; gap: 14px; margin-bottom: 18px; }
.quote-share-panel strong { color: var(--ink); }
.quote-share-panel .form-hint { margin: 4px 0 0; }
.quote-share-link { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.quote-email-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; align-items: end; gap: 10px; }
.quote-email-form label { color: #203945; font-size: 13px; font-weight: 750; }
.quote-email-form input { margin-top: 6px; }
.inline-email-form { display: flex; align-items: center; gap: 7px; margin: 0; }
.inline-email-form .compact-email { width: 190px; min-height: 34px; padding: 6px 8px; font-size: 12px; }
.table-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.table-actions form { margin: 0; }
.quote-management { display: grid; gap: 8px; min-width: 280px; }
.quote-management .inline-email-form { align-items: stretch; }
.quote-management .compact-email { width: 180px; }
.client-request { min-width: 210px; max-width: 320px; white-space: normal; }
.edit-context { display: grid; gap: 4px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--mist); color: var(--slate); }
.edit-context strong { color: var(--ink); }
.quote-client-summary { display: grid; gap: 12px; padding: 14px; border: 1px solid #bcdce1; border-radius: 13px; background: #f2fafb; }
.quote-client-summary-heading strong, .quote-client-summary-heading small { display: block; }
.quote-client-summary-heading strong { color: var(--ink); font-size: 14px; }
.quote-client-summary-heading small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.quote-client-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.quote-client-details div { min-width: 0; border-radius: 10px; padding: 9px 10px; background: white; }
.quote-client-details .span-two { grid-column: 1 / -1; }
.quote-client-details dt { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.quote-client-details dd { margin: 4px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; font-weight: 700; }
.quote-client-details a { color: var(--teal-dark); }
.quote-client-summary p { margin: 0; color: var(--muted); font-size: 11px; }
.appointment-status-field small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.appointment-state-warning { margin: 0; }
.quote-client-actions { display: flex; justify-content: flex-end; }
.request-note { line-height: 1.5; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid #e1ebed; text-align: left; vertical-align: top; white-space: nowrap; }
.data-table th { color: var(--muted); background: #f5f9fa; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.data-table td small { display: block; margin-top: 4px; color: var(--muted); }
.data-table tr:last-child td { border-bottom: 0; }
.quote-tracking-table th:nth-child(4), .quote-tracking-table td:nth-child(4) { border-left: 1px solid #e1ebed; }
.empty-cell { padding: 32px !important; color: var(--muted); text-align: center !important; }
.table-link { color: var(--teal-dark); font-weight: 750; }
.button.compact { min-height: 34px; padding: 0 11px; font-size: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { border: 1px solid var(--line); border-radius: 15px; padding: 17px; background: white; box-shadow: 0 3px 12px rgb(8 23 31 / .04); }
.kpi span { display: block; min-height: 34px; color: var(--muted); font-size: 12px; }
.kpi strong { display: block; margin-top: 7px; color: var(--ink); font-size: 23px; }
.kpi.gold { border-color: #d8c48d; background: #fffaf0; }
.kpi.attention { border-color: #efbdc8; background: #fff5f7; }
.prospect-layout { grid-template-columns: minmax(360px, .9fr) minmax(700px, 1.8fr); }
.prospect-kpis { grid-template-columns: repeat(5, minmax(140px, 1fr)); }
.form-section-title { color: var(--ink); font-size: 13px; }
.appointment-suggestions { border: 1px solid #bcdce1; border-radius: 13px; padding: 14px; background: #f2fafb; }
.suggestion-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.suggestion-heading strong, .suggestion-heading small { display: block; }
.suggestion-heading strong { color: var(--ink); font-size: 14px; }
.suggestion-heading small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.suggestion-duration { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(130px, .7fr); align-items: center; gap: 10px; margin-top: 12px; }
.suggestion-duration select { margin-top: 0 !important; }
.suggestion-status { margin-top: 12px; color: var(--muted); font-size: 12px; }
.suggestion-status.loading { color: var(--teal-dark); font-weight: 750; }
.suggestion-status.error { color: var(--danger); }
.suggestion-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: suggestion; }
.suggestion-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid #d4e5e8; border-radius: 11px; padding: 10px; background: white; }
.suggestion-rank { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: white; background: var(--ink); font-size: 12px; font-weight: 900; }
.suggestion-copy strong, .suggestion-copy small { display: block; }
.suggestion-copy strong { color: var(--ink); font-size: 13px; }
.suggestion-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.suggestion-selected { margin-top: 8px; color: var(--success); font-size: 12px; font-weight: 800; }
.suggestion-empty { border: 1px dashed #c8d9dd; border-radius: 10px; padding: 12px; color: var(--muted); background: white; font-size: 12px; }
.panel-divider { margin: 26px 0; border: 0; border-top: 1px solid var(--line); }
.panel-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-heading-row h2 { margin-bottom: 0; }
.panel-heading-row select { min-width: 180px; }
.table-actions { display: flex; align-items: center; gap: 7px; }
.overdue { color: var(--danger); font-weight: 800; }
.attempt-list { display: grid; gap: 9px; margin-top: 18px; }
.attempt-list article { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #f7fafb; }
.attempt-list strong, .attempt-list span { display: block; }
.attempt-list span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.attempt-list p { margin: 8px 0 0; font-size: 13px; line-height: 1.45; }

@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; }
  .app-nav { order: 3; width: 100%; overflow-x: auto; }
  .day-header, .axis-header { top: 0; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .actions select { flex: 1 1 170px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary { min-height: 70px; }
  .account > span { display: none; }
  .management-grid { grid-template-columns: 1fr; }
  .prospect-layout { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .topbar-inner, .page-shell { padding-left: 14px; padding-right: 14px; }
  .brand strong { font-size: 14px; }
  .brand small { font-size: 9px; }
  .week-controls > div:last-child { flex-basis: 100%; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .actions select { width: 100%; }
  .form-grid.two, .desktop-two { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
  .auth-card, .confirmation-card { padding: 24px 20px; }
  .content-shell { padding-left: 14px; padding-right: 14px; }
  .link-panel { grid-template-columns: 1fr; }
  .quote-share-link, .quote-email-form, .detail-grid { grid-template-columns: 1fr; }
  .quote-client-details { grid-template-columns: 1fr; }
  .quote-client-details .span-two { grid-column: auto; }
  .quote-client-actions .button { width: 100%; }
  .quote-management .inline-email-form { align-items: stretch; flex-direction: column; }
  .quote-management .compact-email { width: 100%; }
  .detail-grid .detail-span { grid-column: auto; }
  .kpi-grid { grid-template-columns: 1fr; }
  .suggestion-heading, .suggestion-duration { grid-template-columns: 1fr; flex-direction: column; }
  .suggestion-heading .button { width: 100%; }
  .suggestion-item { grid-template-columns: auto minmax(0, 1fr); }
  .suggestion-item .button { grid-column: 1 / -1; width: 100%; }
}
