:root {
  --ink: #173b4a;
  --muted: #5f7782;
  --line: #b8e2ea;
  --soft: #eaf7fa;
  --surface: #ffffff;
  --green: #087e9a;
  --green-2: #0797b3;
  --green-soft: #e3f5f8;
  --coral: #d95f5b;
  --coral-soft: #fff0ef;
  --amber: #7a6200;
  --amber-soft: #fff9d8;
  --blue: #2d9fc0;
  --blue-soft: #e7f7fb;
  --sun: #f4d64e;
  --shadow: 0 10px 26px rgba(8, 126, 154, .10);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { background: var(--soft); color: var(--ink); font-family: "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif; letter-spacing: 0; }
body { margin: 0; min-height: 100vh; background: var(--soft); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; flex: 0 0 auto; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 26px; line-height: 1.25; font-weight: 760; color: #173b4a; }
h2 { margin-bottom: 0; font-size: 18px; line-height: 1.35; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 650; }

.site-header { position: sticky; z-index: 40; top: 0; height: 68px; padding: 0 max(24px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; gap: 28px; background: rgba(248,253,254,.97); border-top: 4px solid #1bb6d1; border-bottom: 1px solid var(--line); box-shadow: 0 4px 18px rgba(8,126,154,.07); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.brand > span:last-child { min-width: 0; display: grid; }
.brand strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.brand small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; background: #087e9a; color: white; border-bottom: 4px solid var(--sun); font-weight: 800; }
.brand-mark { overflow: hidden; border: 1px solid #8ccfdb; border-bottom: 3px solid var(--sun); border-radius: 50%; }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-mark.large { width: 48px; height: 48px; font-size: 20px; }
.desktop-nav { display: flex; align-items: stretch; gap: 4px; height: 100%; }
.desktop-nav a, .desktop-nav button { display: flex; align-items: center; gap: 7px; padding: 0 16px; color: #4b6671; font-size: 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer; }
.desktop-nav a:hover, .desktop-nav a:focus-visible, .desktop-nav button:hover, .desktop-nav button:focus-visible { color: var(--green); background: var(--green-soft); border-bottom-color: var(--green); outline: 0; }
.desktop-nav a.current { color: var(--green); background: #e3f5f8; border-bottom-color: var(--sun); }
.desktop-nav .nav-placeholder:disabled { opacity: .62; cursor: default; }
.desktop-nav .nav-placeholder:disabled:hover, .desktop-nav .nav-placeholder:disabled:focus-visible { color: #4b6671; background: transparent; border-bottom-color: transparent; }
.logout-form { margin-left: auto; }

.page-shell { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 32px 0 80px; }
.page-heading, .today-header, .customer-identity { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading.compact { justify-content: flex-start; max-width: 720px; margin-inline: auto; }
.heading-actions { display: flex; gap: 8px; }
.page-back-link, .back-link {
  width: fit-content;
  min-height: 44px;
  margin: -5px 0 8px;
  padding: 0 10px 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 6px;
  color: #536f79;
  font-size: 13px;
  font-weight: 700;
  touch-action: manipulation;
}
.page-back-link:hover, .back-link:hover { background: #e7f4f6; color: var(--green); }
.page-back-link svg, .back-link svg { width: 21px; height: 21px; }

.button { min-height: 42px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 7px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; }
.button.primary { background: #087e9a; color: white; box-shadow: 0 5px 12px rgba(8,126,154,.18); }
.button.primary:hover { background: #066b83; }
.button.secondary { border-color: #69c9dc; color: #087e9a; background: #f6fcfd; }
.button.subtle { background: #f0f8fa; border-color: var(--line); color: #466571; }
.button.small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.button.wide { width: 100%; }
.button:focus-visible, .icon-button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(244,214,78,.58); outline-offset: 2px; }
.icon-button { width: 42px; height: 42px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--green); cursor: pointer; }
.icon-button.small { width: 30px; height: 30px; }
.icon-button.small svg { width: 17px; }

.search-bar { height: 54px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; margin-bottom: 28px; padding-left: 16px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 16px rgba(8,126,154,.07); }
.search-bar svg { color: #718991; }
.search-bar input { width: 100%; height: 48px; border: 0; outline: 0; background: transparent; font-size: 15px; }
.search-bar button { align-self: stretch; padding: 0 20px; border: 0; border-left: 1px solid var(--line); background: #e8f7fa; color: var(--green); font-weight: 750; cursor: pointer; }
.customer-filter-form { margin-bottom: 22px; }
.customer-filter-form .search-bar { margin-bottom: 10px; }
.filter-panel { overflow: hidden; background: #f8fcfd; border: 1px solid var(--line); border-radius: var(--radius); }
.filter-panel summary { min-height: 46px; padding: 0 14px; display: flex; align-items: center; gap: 8px; color: #365f70; cursor: pointer; list-style: none; font-size: 13px; font-weight: 700; }
.filter-panel summary::-webkit-details-marker { display: none; }
.filter-panel summary span { display: flex; align-items: center; gap: 7px; }
.filter-panel summary > b { margin-left: auto; padding: 3px 7px; border-radius: 5px; background: #fff7c2; color: #6d5700; font-size: 10px; }
.filter-panel summary > svg { margin-left: auto; transition: transform .18s ease; }
.filter-panel summary > b + svg { margin-left: 0; }
.filter-panel[open] summary { border-bottom: 1px solid var(--line); }
.filter-panel[open] summary > svg { transform: rotate(180deg); }
.filter-fields { padding: 14px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.filter-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-actions { padding: 0 14px 14px; display: flex; justify-content: flex-end; gap: 8px; }
.filter-actions .button { min-height: 38px; }
.filter-body { padding: 12px 14px 4px; display: grid; gap: 10px; }
.filter-group { min-width: 0; padding: 0; border: 0; }
.filter-group > header { min-height: 28px; display: flex; align-items: center; gap: 7px; color: #315966; font-size: 12px; }
.filter-group > header svg { width: 16px; height: 16px; }
.filter-basic-grid { display: grid; grid-template-columns: 180px 180px minmax(320px, 1fr); gap: 10px; }
.filter-basic-grid > label, .filter-staff-grid label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-date-range { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-date-range > div { display: grid; grid-template-columns: minmax(0,1fr) 18px minmax(0,1fr); align-items: center; gap: 5px; }
.filter-date-range label { min-width: 0; display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 4px; }
.filter-date-range label small { color: #6a858f; font-size: 10px; }
.filter-date-range svg { width: 15px; color: #83a0aa; }
.staff-filter-group { overflow: hidden; border: 1px solid #d9e9ec; border-radius: 6px; background: #fbfefe; }
.staff-filter-group > summary { min-height: 40px; padding: 0 10px; display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.staff-filter-group > summary::-webkit-details-marker { display: none; }
.staff-filter-group > summary span { display: flex; align-items: center; gap: 7px; color: #315966; font-size: 12px; }
.staff-filter-group > summary span svg { width: 16px; }
.staff-filter-group > summary small { margin-left: auto; color: var(--muted); font-size: 10px; }
.staff-filter-group > summary > svg { width: 16px; transition: transform .18s ease; }
.staff-filter-group[open] > summary > svg { transform: rotate(180deg); }
.filter-staff-grid { padding: 10px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; border-top: 1px solid #dfecef; }
.active-filter-chips { margin-top: 7px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.active-filter-chips::-webkit-scrollbar { display: none; }
.active-filter-chips span { flex: 0 0 auto; padding: 4px 8px; border: 1px solid #abd8e2; border-radius: 999px; background: #eff9fb; color: #276779; font-size: 10px; }

.action-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.action-section { overflow: hidden; background: white; border: 1px solid var(--line); border-left: 4px solid #86b8c2; border-radius: var(--radius); box-shadow: 0 5px 18px rgba(8,126,154,.055); }
.action-section > header { min-height: 52px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.action-section > header > div { display: flex; align-items: center; gap: 9px; }
.action-section > header strong { min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #8da5ab; }
.tone-danger { border-left-color: var(--coral); }.tone-danger > header { background: #fff8f7; }.tone-danger .status-dot { background: var(--coral); }
.tone-care { border-left-color: #2d9fc0; }.tone-care > header { background: #edf9fc; }.tone-care .status-dot { background: var(--blue); }
.tone-primary { border-left-color: #0797b3; }.tone-primary > header { background: #eaf8fb; }.tone-primary .status-dot { background: var(--green-2); }
.tone-warning { border-left-color: var(--sun); }.tone-warning > header { background: #fffbef; }.tone-warning .status-dot { background: var(--amber); }
.tone-muted > header { background: #f3fafc; }
.action-row { min-height: 70px; padding: 9px 10px 9px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #ddeef2; }
.action-row:last-child { border-bottom: 0; }
.action-main { min-width: 0; flex: 1; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.action-copy, .customer-copy, .customer-value { min-width: 0; display: grid; gap: 3px; }
.action-copy strong, .customer-copy strong { font-size: 14px; }
.action-copy small, .customer-copy small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.customer-name-line { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.customer-name-line > strong { flex: 0 0 auto; }
.customer-name-line > small { min-width: 0; color: #357d91; font-size: 10px; }
.customer-spark { width: 20px; height: 20px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; }
.customer-spark svg { width: 15px; height: 15px; stroke-width: 2.4; }
.customer-spark.spark-on { background: #fff5b8; color: #bd8d00; }
.customer-spark.spark-off { background: #edf2f3; color: #9aabb0; }
.customer-spark.spark-off svg { opacity: .58; }
.customer-spark.spark-error { color: #9aabb0; font-size: 13px; font-weight: 800; }
.inventory-name-line, .deleted-name-line, .member-name-line { min-width: 0; display: inline-flex; align-items: center; gap: 7px; }
.inventory-name-line strong, .deleted-name-line strong, .member-name-line strong { min-width: 0; }
.member-badge { padding: 3px 7px; border-radius: 5px; background: #fff7c2; color: #6d5700; font-size: 11px; font-weight: 750; }
.action-follow { border-color: transparent; background: var(--soft); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #dff4f8; color: #087e9a; border: 1px solid #b8e2ea; font-weight: 800; }
.avatar.large { width: 56px; height: 56px; font-size: 21px; }
.empty-state { margin: 0; padding: 28px 16px; color: var(--muted); text-align: center; font-size: 13px; }

.customer-list { background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 20px rgba(8,126,154,.06); }
.customer-row { min-height: 76px; padding: 11px 14px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto 20px; align-items: center; gap: 12px; border-bottom: 1px solid #ddeef2; }
.customer-row:last-child { border-bottom: 0; }
.customer-row:hover { background: #f1fafc; }
.customer-value { justify-items: end; }
.customer-value strong { font-family: Consolas, "SFMono-Regular", monospace; font-size: 14px; }
.customer-value small { color: var(--green-2); font-size: 11px; font-weight: 700; }
.customer-row > svg { color: #829aa3; }
.empty-page { min-height: 280px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-page svg { width: 34px; height: 34px; margin-bottom: 12px; }
.empty-page h2 { color: var(--ink); margin-bottom: 6px; }
.empty-page p { margin: 0; font-size: 13px; }
.empty-page.compact { min-height: 190px; }

.record-form { max-width: 720px; margin: 0 auto; padding: 22px; background: white; border: 1px solid var(--line); border-top: 5px solid #1bb6d1; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(8,126,154,.07); }
.field-group { display: grid; gap: 7px; margin-bottom: 19px; }
.field-group > label, .stack-form > label { display: grid; gap: 7px; color: #2b4550; font-size: 13px; font-weight: 700; }
.required { margin-left: 6px; color: var(--coral); font-size: 10px; font-weight: 650; }
.form-control { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #bed9df; border-radius: 6px; background: white; color: var(--ink); }
textarea.form-control { resize: vertical; }
.form-control:focus { border-color: #087e9a; outline: 3px solid #fff7c2; }
.date-picker-input { cursor: pointer; }
.date-picker-input::-webkit-calendar-picker-indicator { width: 24px; height: 24px; padding: 8px; cursor: pointer; }
.field-disabled { opacity: .5; }
.field-disabled .form-control { background: var(--soft); }
.help-text { color: var(--muted); font-size: 11px; }
.field-error, .form-error { color: #9b382f; font-size: 12px; }
.form-error { margin-bottom: 16px; padding: 11px 12px; background: var(--coral-soft); border-left: 3px solid var(--coral); }
.has-error .form-control { border-color: var(--coral); }
.form-actions { position: sticky; bottom: 12px; padding-top: 8px; background: white; }
.roster-picker { display: grid; }
.roster-trigger { width: 100%; min-height: 50px; padding: 8px 12px; display: none; grid-template-columns: 20px minmax(0,1fr) 18px; align-items: center; gap: 9px; border: 1px solid #bed9df; border-radius: 6px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.roster-trigger:hover { border-color: #8cbec7; }
.roster-trigger:focus-visible { border-color: #087e9a; outline: 3px solid #fff7c2; }
.roster-trigger > svg { width: 18px; height: 18px; color: #68838d; }
.roster-trigger > svg:last-child { width: 16px; }
.roster-trigger-content { min-width: 0; display: grid; gap: 5px; }
.roster-placeholder { color: #758991; font-size: 14px; }
.roster-tags { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.roster-tags:empty { display: none; }
.roster-tags > span { max-width: 100%; padding: 4px 7px; overflow: hidden; border: 1px solid #b9dce2; border-radius: 4px; background: #eaf7f9; color: #076f82; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.roster-dialog { width: min(520px, calc(100% - 28px)); max-height: min(680px, calc(100dvh - 32px)); margin: auto; padding: 0; overflow: hidden; border: 1px solid #bad5da; border-radius: 8px; background: #f8fbfc; color: var(--ink); box-shadow: 0 24px 70px rgba(18,52,62,.28); }
.roster-dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.roster-dialog::backdrop { background: rgba(20,48,56,.46); }
.roster-dialog > header { min-height: 70px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d7e5e8; background: #fff; }
.roster-dialog > header small { color: #087e9a; font-size: 10px; font-weight: 750; }
.roster-dialog > header h2 { margin: 2px 0 0; font-size: 19px; }
.roster-dialog-body { min-height: 0; padding: 12px; display: grid; grid-template-rows: auto minmax(120px,1fr) auto; gap: 10px; overflow: hidden; }
.roster-search { min-height: 46px; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid #bed9df; border-radius: 6px; background: #fff; }
.roster-search:focus-within { border-color: #087e9a; outline: 3px solid #fff7c2; }
.roster-search svg { width: 18px; height: 18px; color: #68838d; }
.roster-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.roster-options { min-height: 0; display: grid; align-content: start; border: 1px solid #c9dde1; border-radius: 6px; overflow-y: auto; overscroll-behavior: contain; background: #fff; }
.roster-option { min-height: 50px; padding: 9px 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #e3edef; color: #294651; cursor: pointer; }
.roster-option:last-child { border-bottom: 0; }
.roster-option:hover { background: #f2fafb; }
.roster-option.selected { background: #e8f7fa; color: #076f82; font-weight: 700; }
.roster-option input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: #087e9a; }
.roster-option span { min-width: 0; overflow-wrap: anywhere; }
.roster-option[hidden] { display: none; }
.roster-empty { margin: 0; padding: 13px; border: 1px dashed #c7dce0; border-radius: 6px; background: #fff; color: var(--muted); font-size: 12px; text-align: center; }
.roster-dialog > footer { padding: 11px 12px calc(11px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; border-top: 1px solid #d7e5e8; background: #fff; }
.roster-dialog > footer .button { width: 100%; }
.roster-picker.is-enhanced > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.roster-picker.is-enhanced .roster-trigger { display: grid; }

/* Form choices stay in the form flow: fixed options, instant filtering, no modal layer. */
.inline-choice { position: relative; min-width: 0; display: grid; }
.inline-choice-control, .inline-choice-dropdown { display: none; }
.inline-choice.is-enhanced > select { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.inline-choice.is-enhanced .inline-choice-control { min-width: 0; min-height: 48px; padding: 5px 10px; display: flex; align-items: center; gap: 7px; border: 1px solid #c8dadd; border-radius: 6px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.inline-choice.is-enhanced .inline-choice-control:hover { border-color: #95bec6; }
.inline-choice.is-enhanced .inline-choice-control:focus-within, .inline-choice.is-open .inline-choice-control { border-color: var(--green); box-shadow: 0 0 0 3px rgba(244, 214, 78, .4); }
.inline-choice.is-enhanced .inline-choice-control[aria-invalid="true"] { border-color: #c85c54; }
.inline-choice-search-icon, .inline-choice-chevron { width: 17px; height: 17px; flex: 0 0 auto; color: #64818a; }
.inline-choice.is-open .inline-choice-chevron { transform: rotate(180deg); }
.inline-choice-control > input[type="search"] { min-width: 0; height: 36px; flex: 1 1 90px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; }
.inline-choice-control > input[type="search"]::-webkit-search-cancel-button { display: none; }
.inline-choice-clear { width: 28px; height: 28px; flex: 0 0 auto; padding: 0; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #67828a; cursor: pointer; }
.inline-choice-clear:hover, .inline-choice-clear:focus-visible { background: #eef6f7; color: var(--ink); }
.inline-choice-clear svg { width: 15px; height: 15px; }
.inline-choice-dropdown { position: absolute; z-index: 45; top: calc(100% + 5px); left: 0; width: 100%; max-height: min(286px, 48dvh); overflow-y: auto; overscroll-behavior: contain; border: 1px solid #b8d4d9; border-radius: 6px; background: #fff; box-shadow: 0 13px 30px rgba(18, 52, 62, .16); }
.inline-choice.is-enhanced.is-open .inline-choice-dropdown { display: block; animation: inline-choice-open .14s ease-out; }
.inline-choice.opens-up .inline-choice-dropdown { top: auto; bottom: calc(100% + 5px); transform-origin: bottom; }
.inline-choice-dropdown[hidden] { display: none !important; }
.inline-choice-options { display: grid; align-content: start; }
.inline-choice-option { width: 100%; min-height: 46px; padding: 9px 12px; display: grid; grid-template-columns: minmax(0, 1fr) 18px; align-items: center; gap: 9px; border: 0; border-bottom: 1px solid #e3edef; background: #fff; color: #294651; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.inline-choice-option:last-child { border-bottom: 0; }
.inline-choice-option:hover, .inline-choice-option:focus-visible, .inline-choice-option.is-active { outline: 0; background: #f2fafb; }
.inline-choice-option[aria-selected="true"] { color: #076f82; background: #e8f7fa; font-weight: 750; }
.inline-choice-option > span { min-width: 0; overflow-wrap: anywhere; }
.inline-choice-option > svg { width: 16px; height: 16px; color: var(--green); opacity: 0; }
.inline-choice-option[aria-selected="true"] > svg { opacity: 1; }
.inline-choice-option[hidden] { display: none; }
.inline-choice-empty { min-height: 54px; margin: 0; padding: 16px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.inline-choice-empty[hidden] { display: none; }
.inline-choice-multi-control { min-height: 52px !important; flex-wrap: wrap; align-content: center; cursor: text; }
.inline-choice-tags { min-width: 0; display: contents; }
.inline-choice-tag { max-width: 150px; min-height: 30px; padding: 4px 5px 4px 9px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid #b7d8dd; border-radius: 4px; background: #eef8f9; color: #175a69; font-size: 11px; font-weight: 750; }
.inline-choice-tag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-choice-tag > button { width: 22px; height: 22px; flex: 0 0 auto; padding: 0; display: grid; place-items: center; border: 0; border-radius: 3px; background: transparent; color: #47747e; cursor: pointer; }
.inline-choice-tag > button:hover, .inline-choice-tag > button:focus-visible { background: #dceff2; color: var(--ink); }
.inline-choice-tag > button svg { width: 13px; height: 13px; }
@keyframes inline-choice-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .inline-choice.is-enhanced.is-open .inline-choice-dropdown { animation: none; } }
.export-notice { margin: 8px 0 18px; padding: 13px; display: flex; gap: 10px; background: var(--green-soft); border: 1px solid var(--line); border-radius: 6px; color: var(--green); }
.export-notice div { display: grid; gap: 4px; }
.export-notice p { margin: 0; color: #4b6671; font-size: 12px; line-height: 1.5; }
.form-notice { margin: 0 0 16px; padding: 10px 12px; border: 1px solid #ead59a; border-radius: 6px; background: #fff9df; color: #765f00; font-size: 13px; line-height: 1.5; }

.customer-identity { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.identity-main { display: flex; align-items: center; gap: 14px; }
.phone-line { margin-top: 5px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-family: Consolas, monospace; font-size: 13px; }
.creator-line { margin-top: 7px; display: flex; align-items: center; gap: 5px; color: #5f7782; font-size: 11px; }
.creator-line svg { width: 14px; height: 14px; }
.alert { min-height: 48px; margin: -8px 0 18px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; border-radius: 6px; font-size: 13px; }
.alert.danger { background: var(--coral-soft); color: #7f312b; border: 1px solid #ecc8c3; }
.alert span { color: #8d4d47; }
.member-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); background: white; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 20px rgba(8,126,154,.06); }
.member-strip > div { min-height: 88px; padding: 17px 18px; display: grid; align-content: center; gap: 7px; border-right: 1px solid var(--line); background: #e7f7fa; }
.member-strip > div:nth-child(2) { background: #f0fbfd; }
.member-strip > div:nth-child(3) { background: #fffadf; }
.member-strip > div:last-child { border-right: 0; }
.member-strip small { color: var(--muted); font-size: 11px; }
.member-strip strong { font-size: 18px; }
.member-strip .level-progress { background: #dff4f8; }
.customer-stats { margin-top: 12px; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.customer-stats > div { min-height: 92px; padding: 15px 14px; display: grid; align-content: center; gap: 8px; border-right: 1px solid #d9ecf0; }
.customer-stats > div:last-child { border-right: 0; }
.customer-stats small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.customer-stats strong { color: #173b4a; font-family: "DIN Alternate", Consolas, monospace; font-size: 21px; line-height: 1.15; }
.customer-stats .is-date strong { font-size: 17px; }
.customer-stats em { margin-left: 3px; color: var(--muted); font-family: inherit; font-size: 12px; font-style: normal; font-weight: 600; }
.detail-actions { margin: 18px 0; display: flex; flex-wrap: wrap; gap: 10px; }
.inventory-band { min-height: 68px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.profile-facts { min-width: 0; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.profile-facts > span:not(.inventory-trace) { display: grid; gap: 4px; }
.profile-facts small, .inventory-trace { color: var(--muted); font-size: 11px; }
.profile-facts strong { font-size: 15px; }
.profile-actions { display: flex; align-items: center; gap: 8px; }
.profile-actions form { margin: 0; }
.plain-section { margin-top: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.plain-section h2 { margin-bottom: 10px; }
.plain-section p { margin-bottom: 0; color: #4b6671; font-size: 14px; line-height: 1.75; }
.appointment-section { margin-top: 24px; }
.appointment-section > header { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.appointment-section > header h2 { margin: 0; }
.appointment-section > header span { color: var(--muted); font-size: 12px; }
.appointment-list { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.appointment-list-head, .appointment-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(90px, .7fr) minmax(135px, 1fr) minmax(100px, .8fr) minmax(90px, .7fr); align-items: center; gap: 12px; }
.appointment-list-head { min-height: 40px; padding: 8px 16px; background: #f4f8f9; color: #63777e; font-size: 12px; font-weight: 700; }
.appointment-row { min-height: 58px; padding: 10px 16px; border-top: 1px solid #e0eaec; }
.appointment-row > span { min-width: 0; display: grid; gap: 3px; }
.appointment-row small { display: none; color: var(--muted); font-size: 10px; }
.appointment-row strong { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.appointment-status { width: fit-content; padding: 4px 8px; border-radius: 5px; background: #edf6f7; color: #41616b !important; font-size: 12px !important; }
.appointment-status.status-scheduled { background: #e8f7fa; color: #087e9a !important; }
.appointment-status.status-arrived { background: #eef8ef; color: #247c45 !important; }
.appointment-status.status-deal { background: #fff7cf; color: #816600 !important; }
.appointment-status.status-canceled { background: #f1f3f4; color: #73838a !important; }
.appointment-empty { min-height: 76px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); font-size: 13px; }
.appointment-empty svg { width: 20px; height: 20px; flex: 0 0 auto; }
.appointment-load-error { min-height: 76px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border: 1px solid #f0c9c4; border-radius: 6px; background: #fff6f4; color: #a94438; font-size: 13px; }
.appointment-load-error svg { width: 20px; height: 20px; flex: 0 0 auto; }
.appointment-load-error a { margin-left: auto; color: inherit; font-weight: 700; white-space: nowrap; }
.preserve-lines { white-space: pre-line; }

.timeline-section { margin-top: 28px; }
.timeline-section > header { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.timeline-section > header span { color: var(--muted); font-size: 12px; }
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 20px; width: 1px; background: #b8dbe2; }
.timeline-item { position: relative; display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 12px; margin-bottom: 14px; }
.timeline-icon { z-index: 1; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: white; border: 1px solid var(--line); color: var(--green); }
.kind-risk .timeline-icon { color: var(--coral); border-color: #e4bcb7; background: var(--coral-soft); }
.kind-followup .timeline-icon { color: var(--blue); background: var(--blue-soft); border-color: #b8e2ea; }
.kind-refund .timeline-icon { color: #b87834; background: #fff7ec; border-color: #edc998; }
.timeline-content { padding: 17px 18px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(8,126,154,.05); }
.timeline-content > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.timeline-content > header > div { display: grid; gap: 4px; }
.timeline-content > header span { color: var(--muted); font-size: 11px; }
.timeline-content p { margin: 12px 0 0; color: #4b6671; font-size: 13px; line-height: 1.65; }
.timeline-content p b { color: var(--ink); }
.timeline-content .visit-staff { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.visit-staff span { padding: 3px 6px; border: 1px solid #c9e2e7; border-radius: 4px; background: #eff9fb; color: #315966; font-size: 11px; }
.visit-note-list { margin-top: 13px; display: grid; gap: 8px; }
.visit-note-list section { padding: 10px 11px; border-left: 3px solid #31a7be; background: #f3fafc; }
.visit-note-list section:nth-child(2) { border-left-color: #f0cf35; background: #fffdf2; }
.visit-note-list section:nth-child(3) { border-left-color: #54a17e; background: #f3faf6; }
.visit-note-list section.legacy-note { border-left-color: #9caeb4; background: #f6f8f8; }
.visit-note-list section > strong { color: #294f5c; font-size: 12px; }
.timeline-content .visit-note-list p { margin-top: 5px; }
.existing-attachments-readonly { padding: 10px; border: 1px solid #c8e1e6; border-radius: 6px; background: #f5fbfc; }
.existing-attachments-readonly header { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.existing-attachments-readonly header span { display: flex; align-items: center; gap: 6px; color: #286779; font-size: 12px; font-weight: 750; }
.existing-attachments-readonly header svg { width: 16px; }
.existing-attachments-readonly header small { color: var(--muted); font-size: 10px; }
.existing-attachments-readonly > div { display: grid; grid-template-columns: repeat(auto-fill,minmax(72px,1fr)); gap: 7px; }
.existing-attachments-readonly img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; border-radius: 5px; }
.timeline-content .amount { margin-top: 11px; font-family: Consolas, monospace; color: var(--green); font-size: 22px; font-weight: 750; }
.timeline-content .amount small { margin-left: 10px; font-family: inherit; color: var(--muted); font-size: 12px; font-weight: 600; }
.status-pill { padding: 4px 7px; border-radius: 5px; background: var(--soft); color: var(--muted); font-size: 10px; font-weight: 750; }
.status-pill.success { background: var(--green-soft); color: var(--green); }
.status-pill.danger { background: var(--coral-soft); color: var(--coral); }
.visit-statuses { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.status-pill.surgery { border: 1px solid #ead875; background: #fff9d8; color: #6f5900; }
.next-contact { display: flex; align-items: center; gap: 6px; color: var(--blue) !important; }
.next-contact svg { width: 16px; }
.timeline-content footer, .appointment-row footer { margin-top: 15px; padding-top: 11px; display: flex; align-items: center; gap: 12px; border-top: 1px solid #ddeef2; color: var(--muted); font-size: 11px; }
.timeline-content footer span, .appointment-row footer span { min-width: 0; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-content footer form, .appointment-row footer form { margin: 0; }
.timeline-content footer a, .timeline-content footer button, .appointment-row footer a, .appointment-row footer button { padding: 0; border: 0; background: transparent; color: var(--green-2); cursor: pointer; font: inherit; }
.appointment-row footer { grid-column: 1 / -1; margin-top: 2px; padding-top: 9px; }
.attachment-grid { margin-top: 13px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.attachment-grid a { width: 100%; aspect-ratio: 1; display: block; overflow: hidden; border-radius: 5px; background: var(--soft); }
.attachment-grid img { width: 100%; height: 100%; display: block; object-fit: cover; }
.attachment-item { position: relative; min-width: 0; }
.attachment-action-trigger { display: none; }
.attachment-delete-button { position: absolute; z-index: 2; top: 5px; right: 5px; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.86); border-radius: 50%; background: rgba(151,49,43,.92); color: white; box-shadow: 0 3px 9px rgba(48,31,29,.25); cursor: pointer; touch-action: manipulation; }
.attachment-delete-button:hover { background: #8d2824; }
.attachment-delete-button:focus-visible { outline: 3px solid rgba(240,207,53,.72); outline-offset: 2px; }
.attachment-delete-button:disabled { opacity: .55; cursor: wait; }
.attachment-delete-button svg { width: 16px; height: 16px; stroke-width: 2.5; }
.attachment-empty { grid-column: 1 / -1; margin: 0; padding: 18px 10px; border: 1px dashed #bed9df; border-radius: 5px; background: #f7fbfc; color: var(--muted); text-align: center; font-size: 12px; }
.attachment-control-error,
.attachment-delete-error { margin: 8px 0 0; color: #9b382f; font-size: 12px; }
.attachment-preview-dialog { inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #101719; color: white; }
.attachment-preview-dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr); }
.attachment-preview-dialog::backdrop { background: #101719; }
.attachment-preview-dialog > header { min-height: 56px; padding: max(10px,env(safe-area-inset-top)) 12px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(61,184,202,.52); background: rgba(16,23,25,.96); }
.attachment-preview-dialog > header strong { font-size: 14px; letter-spacing: 0; }
.attachment-preview-dialog > header button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.34); border-radius: 50%; background: rgba(255,255,255,.08); color: white; cursor: pointer; }
.attachment-preview-dialog > header button:focus-visible { outline: 3px solid rgba(240,207,53,.82); outline-offset: 2px; }
.attachment-preview-dialog > header svg { width: 19px; height: 19px; }
.attachment-preview-stage { min-width: 0; min-height: 0; padding: 12px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); display: grid; place-items: center; overflow: hidden; }
.attachment-preview-stage img { max-width: 100%; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); width: auto; height: auto; display: block; object-fit: contain; }
.attachment-preview-stage p { margin: 0; color: rgba(255,255,255,.82); font-size: 14px; text-align: center; }
.attachment-preview-stage img[hidden],
.attachment-preview-stage p[hidden] { display: none; }
.attachment-preview-stage [data-attachment-preview-error] { color: #ffd2cc; }
.more-actions { width: fit-content; margin: 30px 0 0 auto; color: #6c8791; font-size: 11px; }
.more-actions summary { display: flex; align-items: center; justify-content: flex-end; gap: 5px; cursor: pointer; list-style: none; }
.more-actions summary::-webkit-details-marker { display: none; }
.more-actions summary svg { width: 15px; height: 15px; }
.more-actions > div { margin-top: 9px; padding: 12px; background: white; border: 1px solid #ead3d0; border-radius: 6px; text-align: right; }
.more-actions p { margin: 0 0 8px; color: var(--muted); font-size: 10px; }
.text-danger { border: 0; background: transparent; color: var(--coral); cursor: pointer; }

.north-star { min-height: 150px; padding: 24px 26px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; background: #087e9a; color: white; border-top: 5px solid var(--sun); border-radius: var(--radius); box-shadow: 0 10px 24px rgba(8,126,154,.18); }
.north-star > div { grid-row: span 2; }
.north-star span, .north-star p, .north-star small { color: #d6f0f5; }
.north-star span { font-size: 11px; font-weight: 700; }
.north-star h2 { margin: 7px 0 6px; font-size: 22px; }
.north-star p { margin: 0; font-size: 12px; }
.north-star > strong { font-family: Consolas, monospace; font-size: 38px; text-align: right; }
.north-star > small { text-align: right; }
.metric-row { margin: 18px 0 28px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: white; overflow: hidden; box-shadow: 0 5px 18px rgba(8,126,154,.055); }
.metric { min-height: 105px; padding: 17px; display: grid; align-content: center; gap: 5px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric small, .metric span { color: var(--muted); font-size: 11px; }
.metric strong { font-family: "DIN Alternate", Consolas, monospace; font-size: 24px; color: #087e9a; }
.level-overview { margin: 0 0 28px; background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 5px 18px rgba(8,126,154,.055); }
.level-overview > header { min-height: 66px; padding: 13px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.level-overview > header > span { color: var(--muted); font-size: 11px; }
.level-grid { display: grid; grid-template-columns: repeat(9,minmax(0,1fr)); }
.level-card { min-width: 0; min-height: 94px; padding: 14px 8px; display: grid; align-content: center; justify-items: center; gap: 6px; border-right: 1px solid var(--line); border-top: 4px solid #3cb8d2; background: #f7fcfd; }
.level-card:last-child { border-right: 0; }
.level-card:nth-child(2), .level-card:nth-child(5), .level-card:nth-child(8) { border-top-color: #087e9a; background: #ebf8fb; }
.level-card:nth-child(3), .level-card:nth-child(6), .level-card:nth-child(9) { border-top-color: var(--sun); background: #fffddf; }
.level-card > small { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.level-card > button { padding: 0; display: inline-flex; align-items: baseline; gap: 3px; border: 0; background: transparent; color: #087e9a; cursor: pointer; }
.level-card > button strong { font-family: "DIN Alternate", Consolas, monospace; font-size: 25px; text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 4px; }
.level-card > button span { color: var(--muted); font-size: 10px; }
.member-dialog { width: min(620px, calc(100% - 28px)); max-height: min(720px, calc(100vh - 36px)); max-height: min(720px, calc(100dvh - 36px)); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: white; color: var(--ink); box-shadow: 0 24px 70px rgba(8,63,79,.26); }
.member-dialog[open] { display: flex; flex-direction: column; }
.member-dialog::backdrop { background: rgba(18,55,69,.44); }
.member-dialog > header { position: sticky; z-index: 2; top: 0; min-height: 72px; padding: 14px 17px; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; background: #f0fafd; border-bottom: 1px solid var(--line); }
.member-dialog-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.member-dialog-list > a { min-height: 72px; padding: 10px 14px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto 18px; align-items: center; gap: 10px; border-bottom: 1px solid #ddeef2; }
.member-dialog-list > a:hover { background: #f0fafd; }
.member-dialog-list > a > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.member-dialog-list > a small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.member-dialog-list > a b { color: #087e9a; font-family: Consolas, monospace; font-size: 12px; }
.member-dialog-list > a > svg { width: 17px; color: #829aa3; }
.data-section { margin-top: 22px; background: white; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.data-section > header { min-height: 70px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.data-section > header > span { color: var(--muted); font-size: 12px; }
.rfm-match-count strong { margin: 0 2px; color: var(--green); font-size: 16px; }
.rfm-pagination-error { margin: 0; padding: 10px 18px; border-bottom: 1px solid #ecc8c3; background: var(--coral-soft); color: #7f312b; font-size: 12px; }
.rfm-pagination button, .cohort-pagination button { padding: 0; border: 0; background: transparent; color: #9aaeb5; font: inherit; font-weight: 750; cursor: not-allowed; opacity: 1; }
.cohort-pagination-error { min-height: 46px; padding: 9px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #ecc8c3; background: var(--coral-soft); color: #7f312b; font-size: 12px; }
.cohort-pagination-error a { flex: 0 0 auto; color: #7f312b; font-weight: 750; text-decoration: underline; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { min-width: 94px; padding: 12px 14px; text-align: left; border-bottom: 1px solid #ddeef2; white-space: nowrap; }
th { color: var(--muted); background: #f1fafc; font-size: 11px; }
td small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
td a { color: var(--green-2); font-weight: 700; }

.login-shell { width: 100%; min-height: 100vh; padding: 24px; display: grid; place-items: center; background: #e8f7fa; }
.login-panel { width: min(400px, 100%); padding: 30px; background: white; border: 1px solid var(--line); border-top: 5px solid #1bb6d1; border-radius: var(--radius); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 30px; }
.login-brand h1 { font-size: 22px; }
.login-brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.stack-form { display: grid; gap: 18px; }
.toast-stack { position: fixed; z-index: 100; top: 78px; right: 20px; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 15px; border-radius: 6px; background: var(--green); color: white; box-shadow: var(--shadow); font-size: 13px; transition: opacity .2s, transform .2s; }
.toast.error { background: var(--coral); }
.toast-hide { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.mobile-nav { display: none; }

@media (max-width: 760px) {
  body { background: #edf9fb; }
  .site-header { position: sticky; height: 58px; padding: 0 14px; border-top-width: 3px; }
  .brand { min-width: 0; }
  .brand strong { font-size: 14px; }
  .brand small { display: none; }
  .brand-mark { width: 31px; height: 31px; }
  .desktop-nav { display: none; }
  .logout-form { margin-left: auto; }
  .site-header .icon-button { width: 36px; height: 36px; border: 0; background: var(--soft); }
  .page-shell { width: 100%; padding: 16px 14px calc(86px + env(safe-area-inset-bottom)); }
  h1 { font-size: 23px; }
  .page-heading, .today-header { align-items: flex-start; margin-bottom: 17px; }
  .today-header .button, .page-heading .button { min-height: 42px; padding: 0 11px; }
  .heading-actions .button { font-size: 12px; }
  .heading-actions { flex-wrap: wrap; justify-content: flex-end; }
  .search-bar { margin-bottom: 18px; height: 56px; }
  .customer-filter-form { margin-bottom: 14px; }
  .customer-filter-form .search-bar { margin-bottom: 9px; }
  .filter-panel { margin-inline: -1px; }
  .filter-fields { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .filter-fields label:first-child { grid-column: 1 / -1; }
  .filter-actions .button { flex: 1; min-height: 42px; }
  .action-board { grid-template-columns: 1fr; gap: 14px; }
  .action-section > header { min-height: 48px; }
  .action-row { min-height: 72px; }
  .member-badge { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav {
    position: fixed;
    z-index: 70;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 5px max(6px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    overflow: visible;
    background: rgba(248,253,254,.97);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(8,126,154,.10);
  }
  .mobile-nav > a, .mobile-nav > button {
    min-width: 0;
    min-height: 54px;
    padding: 3px 1px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: #536d78;
    font-size: 11px;
    line-height: 1.15;
    cursor: pointer;
    touch-action: manipulation;
  }
  .mobile-nav > a > span, .mobile-nav > button > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-nav svg { width: 21px; height: 21px; }
  .mobile-nav .nav-placeholder:disabled { opacity: .58; cursor: default; }
  .mobile-nav .mobile-add { justify-self: center; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--sun); color: var(--ink); box-shadow: 0 7px 16px rgba(164,132,0,.24); }
  .mobile-nav .mobile-add svg { width: 25px; height: 25px; }
  .mobile-nav a.current:not(.mobile-add) { color: #087e9a; font-weight: 750; }
  .mobile-nav a.current:not(.mobile-add) svg { stroke-width: 2.4; }
  .customer-list { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .customer-row { padding-inline: 14px; grid-template-columns: 40px minmax(0,1fr) auto 16px; gap: 9px; }
  .customer-value strong { font-size: 12px; }
  .customer-name-line { gap: 7px; }
  .customer-name-line > small { font-size: 9px; }
  .record-form { margin-inline: -14px; padding: 18px 14px 24px; border-left: 0; border-right: 0; border-radius: 0; box-shadow: none; }
  .form-control { min-height: 48px; font-size: 16px; }
  .customer-identity { margin-bottom: 15px; }
  .identity-main { gap: 11px; }
  .avatar.large { width: 49px; height: 49px; }
  .member-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .member-strip > div { min-height: 78px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
  .member-strip > div:nth-child(2) { border-right: 0; }
  .member-strip > div:nth-last-child(-n+2) { border-bottom: 0; }
  .member-strip strong { font-size: 16px; }
  .customer-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .customer-stats > div { min-height: 94px; padding: 14px 10px; border-bottom: 1px solid #e3efed; }
  .customer-stats > div:nth-child(3n) { border-right: 0; }
  .customer-stats > div:nth-last-child(-n+3) { border-bottom: 0; }
  .customer-stats small { font-size: 12px; }
  .customer-stats strong { font-size: 21px; }
  .customer-stats .is-date strong { font-size: 15px; }
  .detail-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-actions .subtle { grid-column: auto; }
  .detail-actions .button { width: 100%; }
  .inventory-band { align-items: stretch; flex-direction: column; }
  .profile-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .inventory-trace { grid-column: 1 / -1; }
  .profile-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-actions .button, .profile-actions button { width: 100%; }
  .timeline-section { margin-inline: -4px; }
  .appointment-section { margin-inline: -4px; }
  .appointment-list-head { display: none; }
  .appointment-row { min-height: 86px; padding: 11px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; border-top: 1px solid #e0eaec; }
  .appointment-row:first-child { border-top: 0; }
  .appointment-row small { display: block; }
  .appointment-row strong { font-size: 12px; }
  .timeline-item { grid-template-columns: 34px minmax(0,1fr); gap: 8px; }
  .timeline::before { left: 17px; }
  .timeline-icon { width: 34px; height: 34px; }
  .timeline-icon svg { width: 17px; height: 17px; }
  .timeline-content { padding: 14px; }
  .attachment-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .north-star { padding: 20px; grid-template-columns: 1fr auto; }
  .north-star h2 { font-size: 17px; }
  .north-star > strong { font-size: 29px; }
  .metric-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { min-height: 92px; border-bottom: 1px solid var(--line); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-last-child(-n+2) { border-bottom: 0; }
  .level-overview { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .level-overview > header { min-height: 62px; padding-inline: 14px; }
  .level-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .level-card { min-height: 82px; border-bottom: 1px solid var(--line); }
  .level-card:nth-child(3n) { border-right: 0; }
  .level-card:nth-last-child(-n+3) { border-bottom: 0; }
  .level-card > button strong { font-size: 23px; }
  .member-dialog { width: calc(100% - 28px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); margin: auto; border-radius: 8px; }
  .data-section { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .data-section > header { align-items: flex-start; gap: 12px; }
  .north-star { min-height: 138px; padding: 19px 17px; }
  .login-shell { padding: 18px; }
  .login-panel { padding: 24px 20px; }
  .toast-stack { top: 64px; left: 14px; right: 14px; }
  .toast { max-width: none; }
}

/* Membership operations workspace: dense on desktop, horizontally scannable
   on phones without hiding any source fact. */
.operations-heading { margin-bottom: 14px; }
.operations-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.operations-tabs a { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 750; border-bottom: 2px solid transparent; }
.operations-tabs a:hover, .operations-tabs a:focus-visible, .operations-tabs a.current { color: var(--green); border-bottom-color: var(--sun); background: var(--green-soft); outline: 0; }
.operations-view-switch { min-height: 42px; margin-bottom: 12px; display: flex; align-items: center; gap: 4px; }
.operations-view-switch > a, .operations-scope-switch a { min-height: 34px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #c8dce0; color: #557079; background: #fff; font-size: 11px; font-weight: 750; white-space: nowrap; }
.operations-view-switch > a:first-child, .operations-scope-switch a:first-child { border-radius: 5px 0 0 5px; }
.operations-view-switch > a:nth-child(2), .operations-scope-switch a:last-child { margin-left: -4px; border-radius: 0 5px 5px 0; }
.operations-view-switch a.current { position: relative; z-index: 1; border-color: #74bbc6; color: #076f80; background: #e9f6f8; }
.operations-scope-switch { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.operations-load-error { min-height: 88px; padding: 14px 16px; display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 11px; border: 1px solid #e4aaa4; border-left: 4px solid #d95d55; border-radius: 6px; background: #fff7f6; }
.operations-load-error > svg { width: 21px; color: #bd453f; }
.operations-load-error strong { color: #8c3531; font-size: 13px; }
.operations-load-error p { margin: 3px 0 0; color: #795a58; font-size: 11px; }
.operations-summary { margin-bottom: 16px; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.operations-summary article { min-width: 0; min-height: 84px; padding: 12px 13px; display: grid; align-content: center; gap: 3px; border-right: 1px solid #dcebed; }
.operations-summary article:last-child { border-right: 0; }
.operations-summary small, .operations-summary span { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.operations-summary strong { color: var(--ink); font-size: 25px; line-height: 1; font-variant-numeric: tabular-nums; }
.operations-summary article:nth-child(4) strong { color: var(--green); }
.operations-summary article:nth-child(5) strong { color: #c66f35; }
.operations-summary article:nth-child(6) strong { color: #176a58; }
.operations-flow, .operations-rate-section, .operations-list { margin-top: 16px; }
.operations-flow-scroll { padding: 16px 18px 13px; overflow-x: auto; }
.operations-flow-track { min-width: 690px; display: flex; align-items: stretch; gap: 8px; }
.operations-flow-track > svg { align-self: center; width: 18px; color: #88aab2; }
.operations-flow-node { min-width: 116px; flex: 1; padding: 11px 10px; display: grid; justify-items: center; gap: 3px; border: 1px solid #b9dbe1; border-radius: 6px; background: #f8fcfd; }
.operations-flow-node:hover, .operations-flow-node:focus-visible { border-color: var(--green); background: var(--green-soft); outline: 0; }
.operations-flow-node strong { color: var(--ink); font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.operations-flow-node span { color: #2d5b67; font-size: 11px; font-weight: 750; white-space: nowrap; }
.operations-flow-node small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.operations-branch { margin-top: 10px; display: flex; align-items: center; gap: 12px; color: #8b5a2b; font-size: 11px; }
.operations-branch span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid #e7c185; border-radius: 5px; background: #fff9ef; }
.operations-branch svg { width: 14px; }
.operations-rate-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; padding: 14px 16px 16px; }
.operations-rate-grid article { min-width: 0; padding: 10px 11px; border: 1px solid #d5e6e9; border-radius: 6px; background: #fbfdfd; }
.operations-rate-grid article > small { color: var(--muted); font-size: 10px; font-weight: 750; }
.operations-rate-grid article > div { margin-top: 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 5px; }
.operations-rate-grid article strong { color: var(--green); font-size: 20px; font-variant-numeric: tabular-nums; }
.operations-rate-grid article span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.operations-rate-grid footer { margin-top: 8px; color: #78939a; font-size: 9px; }
.operations-filters { margin-top: 16px; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.75); }
.operations-filters form { display: grid; grid-template-columns: 150px 180px minmax(180px,1fr) auto auto; align-items: end; gap: 8px; }
.operations-filters label { min-width: 0; display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.operations-filters .form-control { min-width: 0; min-height: 38px; padding-inline: 9px; font-size: 12px; }
.operations-filters .button { min-height: 38px; padding-inline: 11px; font-size: 11px; }
.operations-rows { display: grid; gap: 5px; padding: 7px; }
.operations-row { min-width: 0; min-height: 72px; padding: 9px 10px; display: grid; grid-template-columns: minmax(190px,1.5fr) minmax(130px,1fr) 120px minmax(90px,.8fr) auto; grid-template-areas: "customer stage next tags actions"; align-items: center; gap: 12px; border: 1px solid #d3e5e8; border-radius: 6px; background: #fff; }
.operations-row:hover { border-color: #8fcbd5; background: #fbfeff; }
.operations-customer { min-width: 0; display: flex; align-items: center; gap: 8px; }
.operations-customer { grid-area: customer; }
.operations-customer > span:last-child { min-width: 0; display: grid; gap: 3px; }
.operations-customer strong, .operations-customer small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operations-customer strong { font-size: 13px; }
.operations-customer small { color: var(--muted); font-size: 10px; }
.operations-stage, .operations-next { min-width: 0; display: grid; gap: 3px; }
.operations-stage { grid-area: stage; }
.operations-next { grid-area: next; }
.operations-stage b { width: fit-content; padding: 3px 7px; border-radius: 4px; background: var(--blue-soft); color: #286f82; font-size: 10px; }
.operations-stage small, .operations-next small { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operations-stage > em { width: fit-content; color: #9a621e; font-size: 9px; font-style: normal; font-weight: 700; }
.operations-next strong { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.operations-tags { grid-area: tags; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.operations-tags em { min-height: 22px; padding: 3px 6px; flex: 0 0 auto; display: inline-flex; align-items: center; border: 1px solid #a9cbd2; border-radius: 4px; color: #356977; background: #eef7f8; font-size: 9px; font-style: normal; font-weight: 750; white-space: nowrap; }
.operations-tags .tag-red { color: #9e3737; border-color: #e6a5a1; background: #f7d8d5; }
.operations-tags .tag-orange { color: #8b571f; border-color: #edc38d; background: #f9e5ca; }
.operations-tags .tag-purple { color: #69498f; border-color: #cbb8df; background: #e9dff2; }
.operations-tags .tag-green { color: #176a58; border-color: #91cdbd; background: #d4eee6; }
.operations-tags .tag-blue { color: #285b9e; border-color: #a9c3e4; background: #dce9f7; }
.operations-tags .tag-teal { color: #176579; border-color: #9fcbd5; background: #d9edf1; }
.operations-actions { grid-area: actions; display: flex; gap: 5px; justify-content: flex-end; }
.operations-actions .button { min-height: 33px; padding-inline: 8px; font-size: 10px; }
.operations-actions svg { width: 14px; height: 14px; }

@media (max-width: 900px) {
  .operations-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .operations-summary article:nth-child(3) { border-right: 0; }
  .operations-summary article:nth-child(-n+3) { border-bottom: 1px solid #dcebed; }
  .operations-rate-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .operations-filters form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .operations-filters .operations-query, .operations-filters .button { grid-column: 1 / -1; }
  .operations-row { grid-template-columns: minmax(170px,1.3fr) minmax(120px,1fr) minmax(90px,.7fr) auto; grid-template-areas: "customer stage next actions" "tags tags tags actions"; gap: 8px; }
  .operations-next { display: grid; }
}

@media (max-width: 560px) {
  .operations-heading { align-items: flex-start; }
  .operations-heading .heading-actions { width: auto; }
  .operations-heading .heading-actions .button:first-child { display: none; }
  .operations-tabs { margin-inline: -8px; padding-inline: 8px; }
  .operations-view-switch { overflow-x: auto; }
  .operations-scope-switch { margin-left: 6px; }
  .operations-load-error { grid-template-columns: 20px minmax(0,1fr); }
  .operations-load-error .button { grid-column: 1 / -1; }
  .operations-summary { grid-template-columns: repeat(2,minmax(0,1fr)); border-radius: 6px; }
  .operations-summary article { min-height: 70px; padding: 9px 10px; border-right: 1px solid #dcebed; border-bottom: 1px solid #dcebed; }
  .operations-summary article:nth-child(2n) { border-right: 0; }
  .operations-summary article:nth-last-child(-n+2) { border-bottom: 0; }
  .operations-summary strong { font-size: 22px; }
  .operations-flow, .operations-rate-section, .operations-list { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .operations-flow > header, .operations-rate-section > header, .operations-list > header { padding-inline: 14px; }
  .operations-flow-scroll { padding-inline: 14px; }
  .operations-rate-grid { padding-inline: 14px; }
  .operations-filters { margin-inline: -6px; }
  .operations-row { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "customer actions" "stage actions" "next actions" "tags actions"; align-items: center; min-height: 92px; }
  .operations-actions { flex-direction: column; }
  .operations-actions .button { min-height: 30px; }
}

/* Homepage live metric area */
.home-metrics-zone { overflow: visible; }
.home-metrics-content { min-width: 0; }
.home-metrics-toolbar { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-metrics-toolbar > span:first-child { display: grid; gap: 2px; }
.home-metrics-toolbar strong { font-size: 13px; }
.home-metrics-toolbar small { color: var(--muted); font-size: 10px; }
.home-metrics-toolbar-controls { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.home-hospital-filter { min-width: 112px; max-width: 180px; height: 30px; padding: 0 26px 0 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-soft); background: #fff; font: inherit; font-size: 10px; font-weight: 750; cursor: pointer; }
.home-hospital-filter:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.home-metrics-periods { min-height: 30px; padding: 2px; display: grid; grid-template-columns: repeat(3, minmax(38px, 1fr)); border: 1px solid var(--line); border-radius: 5px; background: var(--soft); }
.home-metrics-periods button { min-width: 38px; min-height: 26px; padding: 0 7px; border: 0; border-radius: 3px; color: var(--ink-soft); background: transparent; font-size: 10px; font-weight: 750; cursor: pointer; }
.home-metrics-periods button[aria-pressed="true"] { color: #fff; background: var(--green); }
.home-metrics-periods button:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.home-metric-error { margin: 0 0 8px; padding: 7px 10px; border: 1px solid #e8b6b0; border-radius: 5px; color: #a94438; background: #fff6f4; font-size: 11px; }
.home-metric-error[hidden] { display: none; }
.home-executive-grid { display: grid; grid-template-columns: 1.35fr 1fr 1.15fr; border: 1px solid var(--line); background: #fff; }
.home-executive-block { min-width: 0; min-height: 102px; padding: 13px 15px; border-right: 1px solid var(--line-soft); }
.home-executive-block:last-child { border-right: 0; }
.home-block-label { color: var(--muted); font-size: 11px; font-weight: 750; }
.home-executive-value { display: block; max-width: 100%; margin-top: 8px; padding: 0; overflow: hidden; border: 0; color: var(--ink); background: transparent; font-family: "DIN Alternate", "Inter", "Segoe UI", sans-serif; font-size: 27px; font-weight: 850; line-height: 1; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; text-align: left; }
.home-executive-value:hover, .home-executive-value:focus-visible { color: var(--green); }
.home-executive-subvalues { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 5px 12px; }
.home-metric-subvalue { padding: 0; border: 0; background: transparent; font-size: 10px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.home-metric-subvalue:hover, .home-metric-subvalue:focus-visible { text-decoration: underline; }
.home-new-text { color: #2b65d9; }
.home-returning-text { color: #bd6c20; }
.home-flow-panel { padding: 10px 14px 7px; border: 1px solid var(--line); border-top: 0; background: #fff; }
.home-flow-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-flow-title-row strong { font-size: 11px; }
.home-flow-title-row small { color: var(--muted); font-size: 9px; }
.home-funnel { height: 54px; margin-top: 7px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: start; position: relative; }
.home-funnel::before { content: ""; height: 2px; position: absolute; top: 14px; right: 9%; left: 9%; background: #b8dce3; }
.home-funnel-node { z-index: 1; display: grid; justify-items: center; gap: 4px; }
.home-funnel-node-icon { width: 10px; height: 10px; display: block; margin: 0 auto; border: 3px solid #fff; outline: 2px solid var(--green); border-radius: 50%; background: var(--green); }
.home-funnel-node small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.home-flow-number { min-width: 31px; min-height: 23px; padding: 0 5px; border: 0; border-radius: 4px; color: var(--ink); background: transparent; font-family: "DIN Alternate", "Inter", "Segoe UI", sans-serif; font-size: 19px; font-weight: 850; line-height: 1; cursor: pointer; }
.home-flow-number:hover, .home-flow-number:focus-visible { color: var(--green); background: #f0fafb; }
.home-expand-row { display: flex; justify-content: center; border: 1px solid var(--line); border-top: 0; background: #fff; }
.home-expand-button { min-height: 31px; padding: 0 12px; display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--teal-deep); cursor: pointer; font-size: 10px; font-weight: 800; }
.home-expand-button svg { width: 14px; transition: transform .18s ease; }
.home-expand-button[aria-expanded="true"] svg { transform: rotate(180deg); }
.home-flow-details { border: 1px solid var(--line); border-top: 0; background: #fbfdfd; }
.home-split-flow-row { min-height: 62px; padding: 8px 12px; display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--line-soft); }
.home-split-flow-row:last-child { border-bottom: 0; }
.home-split-flow-label { display: grid; gap: 3px; }
.home-split-flow-label strong { font-size: 11px; }
.home-split-flow-label small { color: var(--muted); font-size: 9px; }
.home-split-flow-row .home-funnel { height: 45px; margin: 0; }
.home-tone-new .home-split-flow-label strong { color: #2b65d9; }
.home-tone-new .home-funnel-node-icon { outline-color: #2b65d9; background: #2b65d9; }
.home-tone-returning .home-split-flow-label strong { color: #bd6c20; }
.home-tone-returning .home-funnel-node-icon { outline-color: #e69545; background: #e69545; }
.home-metric-dialog { width: min(620px, calc(100% - 28px)); max-height: min(720px, calc(100dvh - 36px)); margin: auto; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgba(8, 63, 79, .26); }
.home-metric-dialog[open] { display: flex; flex-direction: column; }
.home-metric-dialog::backdrop { background: rgba(18, 55, 69, .44); }
.home-metric-dialog > header { min-height: 72px; padding: 14px 17px; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; background: #f0fafd; border-bottom: 1px solid var(--line); }
.home-metric-dialog > header h2 { margin: 2px 0 0; font-size: 18px; }
.home-metric-dialog-state { min-height: 35px; padding: 9px 14px; color: var(--muted); font-size: 10px; }
.home-metric-dialog-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.home-metric-dialog-list > a { min-height: 67px; padding: 9px 14px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: center; gap: 10px; border-top: 1px solid #ddeef2; }
.home-metric-dialog-list > a:hover, .home-metric-dialog-list > a:focus-visible { background: #f0fafd; }
.home-metric-dialog-list > a > svg { width: 17px; color: #829aa3; }
.home-metric-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #087e9a; background: #e8f7fa; font-size: 14px; font-weight: 800; }
.home-metric-customer-copy { min-width: 0; display: grid; gap: 3px; }
.home-metric-customer-copy strong, .home-metric-customer-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-metric-customer-copy strong { font-size: 12px; }
.home-metric-customer-copy small { color: var(--muted); font-size: 10px; }
.home-metric-customer-detail { color: #087e9a !important; }
.home-metric-dialog-empty { min-height: 130px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .home-layout { grid-template-rows: auto 25dvh auto; }
  .home-metrics-zone { overflow: visible; }
  .home-metrics-toolbar { min-height: 34px; }
  .home-metrics-toolbar strong { font-size: 12px; }
  .home-metrics-toolbar small { display: none; }
  .home-metrics-toolbar-controls { gap: 4px; }
  .home-hospital-filter { min-width: 88px; max-width: 120px; height: 28px; padding-left: 6px; padding-right: 19px; font-size: 9px; }
  .home-metrics-periods { min-height: 28px; grid-template-columns: repeat(3, minmax(34px, 1fr)); }
  .home-metrics-periods button { min-width: 34px; min-height: 24px; padding: 0 5px; font-size: 9px; }
  .home-executive-grid { grid-template-columns: 1.15fr .85fr 1fr; }
  .home-executive-block { min-height: 82px; padding: 8px 7px; }
  .home-block-label { font-size: 9px; }
  .home-executive-value { margin-top: 6px; font-size: 18px; }
  .home-executive-subvalues { margin-top: 8px; display: grid; gap: 3px; }
  .home-metric-subvalue { overflow: hidden; font-size: 8px; text-overflow: ellipsis; text-align: left; }
  .home-flow-panel { padding: 7px 8px 4px; }
  .home-flow-title-row strong { font-size: 9px; }
  .home-flow-title-row small { font-size: 7px; }
  .home-funnel { height: 46px; margin-top: 5px; }
  .home-funnel-node-icon { width: 8px; height: 8px; border-width: 2px; outline-width: 1px; }
  .home-flow-number { min-width: 26px; min-height: 21px; padding: 0 3px; font-size: 15px; }
  .home-funnel-node small { font-size: 8px; }
  .home-split-flow-row { min-height: 53px; padding: 6px 7px; grid-template-columns: 54px minmax(0, 1fr); }
  .home-split-flow-label { gap: 2px; }
  .home-split-flow-label strong { font-size: 8px; line-height: 1.25; }
  .home-split-flow-label small { font-size: 7px; }
  .home-split-flow-row .home-funnel { height: 40px; }
  .home-metric-dialog { width: calc(100% - 28px); max-height: calc(100dvh - 32px); border-radius: 8px; }
  .home-metric-dialog > header { min-height: 66px; padding: 11px 13px; }
  .home-metric-dialog > header h2 { font-size: 16px; }
}

/* Mobile filter sheets: keep the result list in place while filters scroll independently. */
.feedback-filter-panel,
.schedule-mobile-filter-panel { display: contents; }
.feedback-filter-panel > summary,
.schedule-mobile-filter-panel > summary { display: none; }
.schedule-mobile-filter-content { display: contents; }
.feedback-filter-actions { display: none; }

@media (max-width: 760px) {
  .customer-filter-form .filter-panel[open],
  .feedback-filter-panel[open],
  .schedule-mobile-filter-panel[open] {
    position: fixed;
    z-index: 80;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    height: min(82dvh, 680px);
    max-height: calc(100dvh - 20px - env(safe-area-inset-bottom));
    margin: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-color: #c1dce1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 -12px 30px rgba(17, 54, 63, .15);
  }

  body.mobile-filter-open { overflow: hidden; }
  .mobile-filter-backdrop { position: fixed; z-index: 79; inset: 0; display: none; border: 0; background: rgba(17, 54, 63, .38); }
  body.mobile-filter-open .mobile-filter-backdrop { display: block; }

  .customer-filter-form .filter-panel[open] > summary,
  .feedback-filter-panel[open] > summary,
  .schedule-mobile-filter-panel[open] > summary {
    min-height: 52px;
    padding-inline: 14px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: #315966;
    font-size: 14px;
  }

  .customer-filter-form .filter-panel[open] > summary > svg:last-child,
  .feedback-filter-panel[open] > summary::after,
  .schedule-mobile-filter-panel[open] > summary::after { display: none; }

  .customer-filter-form .filter-panel[open] .filter-body,
  .feedback-filter-panel[open] .feedback-filter-grid,
  .schedule-mobile-filter-panel[open] .schedule-mobile-filter-fields {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .customer-filter-form .filter-panel[open] .filter-body { padding: 12px 12px 4px; }
  .customer-filter-form .filter-panel[open] .filter-actions,
  .feedback-filter-panel[open] .feedback-filter-actions,
  .schedule-mobile-filter-panel[open] .schedule-filter-actions {
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--line);
    background: #fff;
  }
  .customer-filter-form .filter-panel[open] .filter-actions .button,
  .feedback-filter-panel[open] .feedback-filter-actions .button,
  .schedule-mobile-filter-panel[open] .schedule-filter-actions .button { flex: 1; min-height: 44px; }

  .customer-filter-form .filter-panel[open] .filter-basic-grid,
  .customer-filter-form .filter-panel[open] .filter-staff-grid,
  .schedule-mobile-filter-panel[open] .schedule-quick-filters,
  .schedule-mobile-filter-panel[open] .schedule-advanced-filters,
  .feedback-filter-panel[open] .feedback-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .customer-filter-form .filter-panel[open] .filter-date-range,
  .feedback-filter-panel[open] .feedback-filter-grid label:first-child,
  .schedule-mobile-filter-panel[open] .schedule-quick-filters label:first-child { grid-column: 1 / -1; }

  .customer-filter-form .filter-panel[open] .filter-date-range > div { grid-template-columns: minmax(0, 1fr) 13px minmax(0, 1fr); }
  .customer-filter-form .filter-panel[open] .filter-date-range label { grid-template-columns: 1fr; gap: 3px; }
  .customer-filter-form .filter-panel[open] .filter-date-range label small { font-size: 10px; }
  .customer-filter-form .filter-panel[open] .staff-filter-group > summary { min-height: 34px; padding-inline: 0; pointer-events: none; }
  .customer-filter-form .filter-panel[open] .staff-filter-group > summary small,
  .customer-filter-form .filter-panel[open] .staff-filter-group > summary > svg { display: none; }
  .customer-filter-form .filter-panel[open] .staff-filter-group > summary span { font-size: 13px; }
  .customer-filter-form .filter-panel[open] .staff-filter-group[open] > .filter-staff-grid { border-top: 0; }

  .feedback-filter-panel { margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
  .feedback-filter-panel > summary { min-height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 7px; list-style: none; color: #315966; font-size: 13px; font-weight: 700; cursor: pointer; }
  .feedback-filter-panel > summary::-webkit-details-marker { display: none; }
  .feedback-filter-panel > summary svg { width: 17px; }
  .feedback-filter-panel:not([open]) .feedback-filter-grid { display: none; }
  .feedback-filter-panel[open] .feedback-filter-grid { padding: 12px; border: 0; }
  .feedback-filter-panel[open] .feedback-filter-grid .form-control { min-height: 42px; padding-inline: 9px; font-size: 12px; }
  .feedback-filter-panel[open] .feedback-filter-actions { margin: 0; }

  .schedule-mobile-filter-panel { margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
  .schedule-mobile-filter-panel > summary { min-height: 42px; padding: 0 10px; display: flex; align-items: center; gap: 7px; list-style: none; color: #315966; font-size: 13px; font-weight: 700; cursor: pointer; }
  .schedule-mobile-filter-panel > summary::-webkit-details-marker { display: none; }
  .schedule-mobile-filter-panel > summary svg { width: 17px; }
  .schedule-mobile-filter-panel:not([open]) .schedule-mobile-filter-content { display: none; }
  .schedule-mobile-filter-panel[open] .schedule-mobile-filter-content { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
  .schedule-mobile-filter-panel[open] .schedule-mobile-filter-fields { padding: 12px; }
  .schedule-mobile-filter-panel[open] .schedule-quick-filters { margin: 0 0 10px; }
  .schedule-mobile-filter-panel[open] .schedule-quick-filters label,
  .schedule-mobile-filter-panel[open] .schedule-advanced-filters label { font-size: 11px; }
  .schedule-mobile-filter-panel[open] .schedule-quick-filters .form-control,
  .schedule-mobile-filter-panel[open] .schedule-advanced-filters .form-control { min-width: 0; min-height: 42px; padding-inline: 9px; font-size: 12px; }
  .schedule-mobile-filter-panel[open] .filter-details > summary { min-height: 34px; font-size: 12px; }
  .schedule-mobile-filter-panel[open] .filter-details[open] > summary { border-bottom: 1px solid #e2eef0; }
  .schedule-mobile-filter-panel[open] .schedule-advanced-filters { padding: 9px 0 2px; margin-top: 0; }
  .schedule-mobile-filter-panel[open] .schedule-filter-actions { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Customer detail: compact information architecture from the approved mobile prototype. */
.customer-detail-nav { display: none; }
.customer-detail-shell .inventory-band {
  display: flex;
}
.customer-profile-head {
  display: none;
}
.customer-profile-head h2 { margin: 0; font-size: 17px; }
.customer-detail-shell .profile-facts {
  display: flex;
}
.customer-detail-shell .profile-facts > span {
  min-width: 0;
}
.customer-detail-shell .profile-facts strong { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .customer-detail-shell { padding-top: 10px; }
  .customer-detail-shell .customer-identity {
    min-height: 0;
    margin-bottom: 0;
    padding: 2px 0 12px;
  }
  .customer-detail-shell .identity-main { min-width: 0; align-items: flex-start; gap: 0; }
  .customer-detail-shell .identity-main > .avatar { display: none; }
  .customer-detail-shell .identity-main > div { min-width: 0; }
  .customer-detail-shell .identity-main .eyebrow { margin-bottom: 2px; font-size: 9px; }
  .customer-detail-shell .identity-title-row { min-width: 0; gap: 7px; }
  .customer-detail-shell .identity-title-row h1 { max-width: 112px; font-size: 22px; }
  .customer-detail-shell .phone-line { margin-top: 3px; font-size: 12px; }
  .customer-detail-shell .creator-line { margin-top: 4px; font-size: 9px; }
  .customer-detail-shell .customer-tag-strip { width: min(205px, calc(100vw - 190px)); }

  .customer-detail-nav {
    min-height: 40px;
    margin: 0 -14px 9px;
    padding: 0 8px;
    position: sticky;
    z-index: 35;
    top: 58px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(52px, 1fr);
    align-items: stretch;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .98);
    scrollbar-width: none;
  }
  .customer-detail-nav::-webkit-scrollbar { display: none; }
  .customer-detail-nav a {
    min-width: 0;
    padding: 0 5px;
    display: grid;
    place-items: center;
    color: #536f78;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
  }
  .customer-detail-nav a:hover,
  .customer-detail-nav a:focus-visible { color: var(--green); background: #eef8f9; }
  .customer-detail-shell #customer-overview,
  .customer-detail-shell #customer-profile,
  .customer-detail-shell #customer-feedback,
  .customer-detail-shell #customer-appointments,
  .customer-detail-shell #customer-records { scroll-margin-top: 106px; }
  .customer-detail-shell .alert { margin: 0 0 9px; }

  .customer-detail-shell .member-strip { margin-top: 0; }
  .customer-detail-shell .member-strip > div { min-height: 65px; padding: 9px 10px; gap: 4px; }
  .customer-detail-shell .member-strip small { font-size: 9px; }
  .customer-detail-shell .member-strip strong { font-size: 14px; line-height: 1.25; }
  .customer-detail-shell .customer-stats { margin-top: 7px; }
  .customer-detail-shell .customer-stats > div { min-height: 66px; padding: 8px 7px; gap: 4px; }
  .customer-detail-shell .customer-stats small { font-size: 9px; }
  .customer-detail-shell .customer-stats strong { font-size: 17px; }
  .customer-detail-shell .customer-stats .is-date strong { font-size: 11px; }
  .customer-detail-shell .customer-stats em { font-size: 9px; }

  .customer-detail-shell .detail-actions {
    margin: 8px 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }
  .customer-detail-shell .detail-actions > * { min-width: 0; }
  .customer-detail-shell .detail-actions .button,
  .customer-detail-shell .survey-link-control > summary {
    width: 100%;
    min-width: 0;
    min-height: 51px;
    padding: 5px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
  }
  .customer-detail-shell .detail-actions .button svg { width: 17px; height: 17px; }
  .customer-detail-shell .survey-link-control > div { right: 0; left: 0; }

  .customer-detail-shell .inventory-band { margin-top: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; overflow: hidden; }
  .customer-profile-head { min-height: 44px; padding: 5px 8px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
  .customer-profile-head h2 { font-size: 14px; }
  .customer-detail-shell .profile-actions { display: flex; gap: 4px; }
  .customer-detail-shell .profile-actions .button,
  .customer-detail-shell .profile-actions button {
    width: auto;
    min-height: 32px;
    padding: 0 7px;
    font-size: 9px;
  }
  .customer-detail-shell .profile-actions .button svg { width: 13px; height: 13px; }
  .customer-detail-shell .profile-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    display: grid;
    gap: 0;
  }
  .customer-detail-shell .profile-facts > span {
    min-height: 54px;
    padding: 7px 6px;
    gap: 3px;
    border-right: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
  }
  .customer-detail-shell .profile-facts > span:nth-child(3n) { border-right: 0; }
  .customer-detail-shell .profile-facts > span:nth-last-child(-n + 3) { border-bottom: 0; }
  .customer-detail-shell .profile-facts > span:nth-child(n + 4):not(.inventory-trace) { border-bottom: 0; }
  .customer-detail-shell .profile-facts small { font-size: 9px; }
  .customer-detail-shell .profile-facts strong { font-size: 11px; line-height: 1.3; }
  .customer-detail-shell .profile-facts > span.inventory-trace { min-height: 31px; padding: 7px 8px; display: flex; align-items: center; grid-column: 1 / -1; border-top: 1px solid var(--line-soft); border-right: 0; border-bottom: 0; font-size: 9px; }
  .customer-detail-shell .owner-editor { margin-top: 7px; }

  .customer-detail-shell .plain-section,
  .customer-detail-shell .customer-feedback-section,
  .customer-detail-shell .appointment-section,
  .customer-detail-shell .timeline-section { margin-top: 14px; }
  .customer-detail-shell .plain-section { padding: 12px 0; }
  .customer-detail-shell .customer-feedback-section { padding: 10px 0; }
  .customer-detail-shell .customer-feedback-section > header,
  .customer-detail-shell .appointment-section > header,
  .customer-detail-shell .timeline-section > header { min-height: 34px; margin-bottom: 7px; }
  .customer-detail-shell .customer-feedback-section h2,
  .customer-detail-shell .appointment-section h2,
  .customer-detail-shell .timeline-section h2,
  .customer-detail-shell .plain-section h2 { font-size: 15px; }
  .customer-detail-shell .appointment-empty,
  .customer-detail-shell .appointment-load-error { min-height: 52px; padding: 10px; font-size: 11px; }

  .customer-detail-shell .appointment-row {
    min-height: 0;
    padding: 9px 10px 0;
    grid-template-columns: minmax(0, 1.15fr) minmax(52px, .7fr) minmax(82px, .9fr);
    gap: 7px 8px;
  }
  .customer-detail-shell .appointment-row > span:nth-child(1) { grid-column: 1; grid-row: 1; }
  .customer-detail-shell .appointment-row > span:nth-child(2) { grid-column: 2; grid-row: 1; }
  .customer-detail-shell .appointment-row > span:nth-child(3) { grid-column: 1 / span 2; grid-row: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(4) { grid-column: 3; grid-row: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(5) { grid-column: 3; grid-row: 1; }
  .customer-detail-shell .appointment-row small { font-size: 8px; }
  .customer-detail-shell .appointment-row strong { font-size: 11px; }
  .customer-detail-shell .appointment-row .home-schedule-status { width: 100%; min-width: 0; min-height: 34px; padding-inline: 6px 18px; font-size: 10px; }
  .customer-detail-shell .appointment-row footer { margin: 2px -10px 0; padding: 8px 10px; }

  .customer-detail-shell .timeline-section { margin-inline: 0; }
  .customer-detail-shell .timeline-item { grid-template-columns: 30px minmax(0, 1fr); gap: 7px; margin-bottom: 9px; }
  .customer-detail-shell .timeline::before { left: 15px; }
  .customer-detail-shell .timeline-icon { width: 30px; height: 30px; }
  .customer-detail-shell .timeline-icon svg { width: 15px; height: 15px; }
  .customer-detail-shell .timeline-content { padding: 10px 10px 0; }
  .customer-detail-shell .timeline-content > header strong { font-size: 13px; }
  .customer-detail-shell .timeline-content p { margin-top: 7px; font-size: 11px; line-height: 1.55; }
  .customer-detail-shell .timeline-content .amount { margin-top: 7px; font-size: 19px; }
  .customer-detail-shell .visit-note-list { margin-top: 8px; gap: 6px; }
  .customer-detail-shell .visit-note-list section { padding: 8px; }
  .customer-detail-shell .attachment-grid { margin-top: 8px; gap: 5px; }
  .customer-detail-shell .attachment-empty { padding: 10px 8px; font-size: 9px; }
  .customer-detail-shell .timeline-content footer { margin: 8px -10px 0; padding: 8px 10px; }
}

@media (max-width: 360px) {
  .customer-detail-shell .identity-title-row h1 { max-width: 92px; font-size: 20px; }
  .customer-detail-shell .customer-tag-strip { width: min(174px, calc(100vw - 166px)); }
  .customer-detail-shell .detail-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .customer-detail-shell .detail-actions .button,
  .customer-detail-shell .survey-link-control > summary { min-height: 48px; }
  .customer-detail-shell .profile-facts > span { padding-inline: 4px; }
  .customer-detail-shell .profile-facts strong { font-size: 10px; }
  .customer-detail-shell .appointment-row { grid-template-columns: minmax(0, 1fr) 48px minmax(76px, .9fr); }
}

/* Customer detail refinements: keep the approved compact card hierarchy without changing data. */
.customer-detail-shell .profile-facts {
  gap: 12px 20px;
}
.customer-detail-shell .profile-facts .inventory-trace {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.customer-detail-shell .profile-facts .inventory-trace > span {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.customer-detail-shell .inventory-status-inline {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}
.customer-detail-shell .member-owner-inline {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #315966;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.customer-detail-shell .member-owner-inline svg,
.customer-detail-shell .appointment-row svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #6b8790;
  stroke-width: 1.8;
}
.customer-detail-shell .appointment-list-head,
.customer-detail-shell .appointment-row {
  grid-template-columns: minmax(115px, 1.05fr) minmax(78px, .7fr) minmax(135px, 1.1fr) minmax(100px, .8fr) minmax(82px, .65fr) minmax(92px, .72fr);
}
.customer-detail-shell .appointment-row .appointment-hospital,
.customer-detail-shell .appointment-row .appointment-inviter,
.customer-detail-shell .appointment-row .appointment-consultation {
  display: flex;
  align-items: center;
  gap: 5px;
}
.customer-detail-shell .appointment-row .appointment-hospital strong,
.customer-detail-shell .appointment-row .appointment-inviter strong,
.customer-detail-shell .appointment-row .appointment-consultation strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .customer-detail-shell .profile-facts {
    gap: 0;
  }
  .customer-detail-shell .profile-facts > span {
    min-height: 43px;
    padding: 6px 7px;
  }
  .customer-detail-shell .profile-facts > span:nth-child(4) {
    grid-column: 1 / -1;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .customer-detail-shell .profile-facts > span.inventory-trace {
    min-height: 31px;
    grid-column: 1 / -1;
    padding: 5px 8px;
    gap: 5px;
    border-top: 0;
    border-bottom: 0;
    white-space: nowrap;
  }
  .customer-detail-shell .profile-facts .inventory-trace > small {
    flex: 0 0 auto;
  }
  .customer-detail-shell .profile-facts .inventory-trace > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .customer-detail-shell .inventory-status-inline {
    font-size: 10px;
  }
  .customer-detail-shell .profile-actions {
    min-height: 40px;
    padding: 5px 8px 7px;
    flex-wrap: wrap;
    gap: 5px 8px;
    border-top: 1px solid var(--line-soft);
  }
  .customer-detail-shell .member-owner-inline {
    min-height: 32px;
    padding-inline: 2px;
    font-size: 10px;
  }
.customer-detail-shell .member-owner-inline svg {
    width: 14px;
    height: 14px;
  }

  .customer-detail-shell .appointment-list-head {
    display: none;
  }
  .customer-detail-shell .appointment-row {
    position: relative;
    grid-template-columns: minmax(0, 1.35fr) minmax(42px, .72fr) minmax(42px, .72fr) minmax(76px, 1fr);
    gap: 7px 8px;
    padding: 12px 12px 0;
  }
  .customer-detail-shell .appointment-row > span:nth-child(1) { grid-column: 1 / span 2; grid-row: 1; }
  .customer-detail-shell .appointment-row > span:nth-child(2) { grid-column: 3; grid-row: 1; }
  .customer-detail-shell .appointment-row > span:nth-child(3) { grid-column: 1 / span 2; grid-row: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(4) { grid-column: 3; grid-row: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(5) { grid-column: 4; grid-row: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(6) { grid-column: 4; grid-row: 1; }
  .customer-detail-shell .appointment-row .appointment-date,
  .customer-detail-shell .appointment-row .appointment-time,
  .customer-detail-shell .appointment-row .appointment-hospital,
  .customer-detail-shell .appointment-row .appointment-inviter,
  .customer-detail-shell .appointment-row .appointment-consultation,
  .customer-detail-shell .appointment-row .appointment-status-cell {
    min-width: 0;
  }
  .customer-detail-shell .appointment-row .appointment-date strong {
    font-size: 15px;
    letter-spacing: .01em;
  }
  .customer-detail-shell .appointment-row .appointment-time strong {
    font-size: 14px;
  }
  .customer-detail-shell .appointment-row .appointment-hospital,
  .customer-detail-shell .appointment-row .appointment-inviter,
  .customer-detail-shell .appointment-row .appointment-consultation {
    min-height: 25px;
    gap: 4px;
  }
  .customer-detail-shell .appointment-row .appointment-hospital svg,
  .customer-detail-shell .appointment-row .appointment-inviter svg,
  .customer-detail-shell .appointment-row .appointment-consultation svg {
    width: 15px;
    height: 15px;
  }
  .customer-detail-shell .appointment-row .appointment-hospital strong,
  .customer-detail-shell .appointment-row .appointment-inviter strong,
  .customer-detail-shell .appointment-row .appointment-consultation strong {
    font-size: 11px;
  }
  .customer-detail-shell .appointment-row .home-schedule-status {
    min-height: 38px;
    padding-inline: 7px 18px;
    font-size: 10px;
  }
  .customer-detail-shell .appointment-row footer {
    margin: 2px -12px 0;
    padding: 8px 12px;
  }
}

/* Final mobile alignment to the supplied customer-detail reference images. */
@media (max-width: 760px) {
  .customer-detail-shell .inventory-band {
    margin-inline: 0;
  }
  .customer-detail-shell .profile-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
  }
  .customer-detail-shell .profile-facts > span {
    min-height: 47px;
    padding: 7px 8px 6px;
    display: grid;
    align-content: center;
    gap: 2px;
    border-right: 1px solid var(--line-soft);
    border-bottom: 0;
  }
  .customer-detail-shell .profile-facts > span:nth-child(-n + 4) {
    grid-column: auto;
  }
  .customer-detail-shell .profile-facts > span:nth-child(4) {
    border-right: 0;
  }
  .customer-detail-shell .profile-facts > span.inventory-trace {
    grid-column: 1 / -1;
    min-height: 32px;
    padding: 4px 8px 5px;
    display: flex;
    align-items: baseline;
    gap: 5px;
    border-top: 1px solid var(--line-soft);
    border-right: 0;
    border-bottom: 0;
  }
  .customer-detail-shell .profile-facts .inventory-trace > span {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
  }
  .customer-detail-shell .profile-facts small {
    font-size: 9px;
    line-height: 1.15;
  }
  .customer-detail-shell .profile-facts strong {
    font-size: 11px;
    line-height: 1.2;
  }
  .customer-detail-shell .inventory-status-inline {
    font-size: 11px;
  }
  .customer-detail-shell .profile-actions {
    min-height: 43px;
    padding: 5px 8px 6px;
    gap: 5px 8px;
    border-top: 1px solid var(--line-soft);
  }

  .customer-detail-shell .appointment-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(42px, .72fr) minmax(42px, .72fr) minmax(76px, 1fr);
    gap: 7px 8px;
    padding: 12px 12px 0;
  }
  .customer-detail-shell .appointment-row > span:nth-child(1) { grid-column: 1 / span 2; grid-row: 1; }
  .customer-detail-shell .appointment-row > span:nth-child(2) { grid-column: 3; grid-row: 1; }
  .customer-detail-shell .appointment-row > span:nth-child(3) { grid-column: 1 / span 2; grid-row: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(4) { grid-column: 3; grid-row: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(5) { grid-column: 4; grid-row: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(6) { grid-column: 4; grid-row: 1; }
  .customer-detail-shell .appointment-row small {
    display: none;
  }
  .customer-detail-shell .appointment-row .appointment-inviter small {
    display: inline;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 9px;
    line-height: 1;
  }
  .customer-detail-shell .appointment-row .appointment-date strong {
    font-size: 15px;
    letter-spacing: .01em;
  }
  .customer-detail-shell .appointment-row .appointment-time strong {
    font-size: 14px;
  }
  .customer-detail-shell .appointment-row .appointment-hospital,
  .customer-detail-shell .appointment-row .appointment-inviter,
  .customer-detail-shell .appointment-row .appointment-consultation {
    min-width: 0;
    min-height: 25px;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .customer-detail-shell .appointment-row .appointment-hospital strong,
  .customer-detail-shell .appointment-row .appointment-inviter strong,
  .customer-detail-shell .appointment-row .appointment-consultation strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }
  .customer-detail-shell .appointment-row .appointment-hospital svg,
  .customer-detail-shell .appointment-row .appointment-inviter svg,
  .customer-detail-shell .appointment-row .appointment-consultation svg {
    width: 15px;
    height: 15px;
  }
  .customer-detail-shell .appointment-row .home-schedule-status {
    width: 100%;
    min-height: 38px;
    padding-inline: 7px 18px;
    font-size: 10px;
  }
  .customer-detail-shell .appointment-row footer {
    margin: 2px -12px 0;
    padding: 8px 12px;
  }
}

/* SaaS clarity layer: a stable operations shell with restrained pool-tile accents. */
:root {
  --ink: #17343e;
  --muted: #60757d;
  --line: #d3e3e7;
  --soft: #f3f8f9;
  --green: #087e92;
  --green-2: #0794a9;
  --green-soft: #e8f6f8;
  --sun: #f4d64e;
  --shadow: 0 8px 24px rgba(22, 64, 76, .08);
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; background: #f4f8f9; }
button, a, summary { touch-action: manipulation; }

/* AI pilot workspace: compact, readable, and intentionally separate from business data cards. */
.ai-workspace-heading { margin-bottom: 16px; }
.ai-customer-strip { display:flex; align-items:center; gap:10px; padding:12px 14px; border:1px solid var(--line); border-radius:8px; background:#f8fcfc; }
.ai-customer-strip > div { display:flex; flex-direction:column; gap:2px; }
.ai-customer-strip > div span { color:var(--muted); font-size:12px; }
.ai-workspace-section { margin-top:20px; }
.ai-workspace-section > .section-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.ai-workspace-section h2 { margin:0; font-size:18px; }
.ai-brief-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.ai-brief-grid article, .ai-insight-card { min-width:0; padding:14px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.ai-brief-grid article h3 { margin:0 0 8px; font-size:14px; }
.ai-brief-grid article p { margin:0; color:#466571; line-height:1.65; font-size:13px; }
.ai-brief-lead { grid-column:1/-1; background:#f5fbfc !important; }
.ai-brief-meta { display:block; margin-top:8px; color:var(--muted); font-size:12px; }
.ai-brief-wide { grid-column:1/-1; }
.ai-bullet-list { margin:0; padding-left:18px; color:#466571; font-size:13px; line-height:1.65; }
.ai-tier-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.ai-tier-list > div { display:flex; flex-direction:column; gap:4px; padding:5px 9px 9px; border-left:2px solid #69c9dc; }
.ai-tier-list strong { color:var(--green); font-size:13px; }
.ai-tier-list span, .ai-tier-list small { color:#466571; font-size:12px; line-height:1.45; }
.ai-empty, .ai-empty-state { color:var(--muted); font-size:13px; }
.ai-empty-state { display:flex; align-items:center; justify-content:center; gap:8px; min-height:90px; border:1px dashed var(--line); border-radius:8px; }
.ai-empty-state svg { width:18px; }
.ai-insight-list { display:grid; gap:10px; }
.ai-insight-card > header, .ai-insight-card > footer { display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--muted); font-size:12px; }
.ai-insight-card > header > div { display:flex; align-items:center; gap:8px; }
.ai-insight-card > header strong { color:var(--ink); font-size:14px; }
.ai-insight-card > p { margin:11px 0; color:#466571; font-size:13px; line-height:1.7; }
.ai-insight-card footer a, .ai-insight-card footer button { padding:0; border:0; background:transparent; color:var(--green-2); cursor:pointer; font:inherit; }
.ai-insight-card footer form { margin:0; }
@media (max-width:760px) {
  .ai-workspace-heading { align-items:flex-start; }
  .ai-workspace-heading .heading-actions { width:100%; }
  .ai-workspace-heading .heading-actions .button { flex:1; }
  .ai-brief-grid { grid-template-columns:1fr; }
  .ai-brief-lead, .ai-brief-wide { grid-column:auto; }
  .ai-tier-list { grid-template-columns:1fr; }
}
button:disabled { cursor: wait; opacity: .72; }
h1, h2 { text-wrap: balance; }
h1, h2, h3 { scroll-margin-top: 84px; }
table, .metric strong, .north-star > strong, .customer-value strong, .customer-stats strong { font-variant-numeric: tabular-nums; }
select.form-control { background-color: #fff; color: var(--ink); }

.skip-link {
  position: fixed;
  z-index: 200;
  top: 8px;
  left: 8px;
  padding: 9px 12px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.app-sidebar { display: none; }

.button { min-height: 44px; border-radius: 6px; box-shadow: none; transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease; }
.button.primary { background: var(--green); box-shadow: 0 4px 10px rgba(8, 126, 146, .16); }
.button.primary:hover { background: #066b7d; box-shadow: 0 6px 14px rgba(8, 126, 146, .2); }
.button.secondary:hover, .button.subtle:hover { border-color: #7fc8d4; background: #eaf6f8; color: #066b7d; }
.button.is-loading svg { animation: button-spin .8s linear infinite; }
@keyframes button-spin { to { transform: rotate(360deg); } }
.icon-button { border-color: #c9dde2; transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
.icon-button:hover { border-color: #8ccbd5; background: var(--green-soft); }

.mobile-account-button {
  width: 38px;
  height: 38px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border: 1px solid #c5dfe4;
  border-radius: 50%;
  background: #fff;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
}

.page-shell { width: min(1180px, calc(100% - 48px)); padding-top: 34px; }
.page-heading, .today-header { min-height: 64px; margin-bottom: 20px; }
.page-heading h1, .today-header h1 { position: relative; padding-bottom: 8px; }
.page-heading h1::after, .today-header h1::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--sun);
  content: "";
}
.page-heading.compact h1::after { width: 24px; }
.eyebrow { color: #6c8087; font-weight: 700; }

.search-bar { border-color: #cadfe4; box-shadow: 0 3px 10px rgba(25, 70, 82, .045); }
.search-bar:focus-within { border-color: #63b9c7; box-shadow: 0 0 0 3px rgba(244, 214, 78, .35); }
.search-bar input::placeholder { color: #8b9ba1; }
.search-bar button { background: #edf7f8; transition: background-color .16s ease, color .16s ease; }
.search-bar button:hover { background: #dff1f4; color: #056779; }
.filter-panel { border-color: #cedfe3; background: #fff; }
.filter-panel summary:hover { background: #f3f8f9; }

.action-board { gap: 18px; }
.action-section { border-color: #d2e1e5; border-left-width: 3px; box-shadow: 0 4px 14px rgba(24, 65, 76, .055); }
.action-section > header { min-height: 56px; background: #fbfdfd; }
.action-section > header > div { gap: 10px; }
.section-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: #edf5f6; color: #62818a; }
.section-icon svg { width: 17px; height: 17px; }
.tone-danger > header { background: #fffafa; }
.tone-danger .section-icon { background: #fff0ef; color: var(--coral); }
.tone-surgery { border-left-color: #4b9b78; }
.tone-surgery > header { background: #f7fcf9; }
.tone-surgery .section-icon { background: #e6f5ed; color: #267654; }
.tone-care > header, .tone-primary > header { background: #f8fcfd; }
.tone-care .section-icon, .tone-primary .section-icon { background: #e6f5f8; color: var(--green); }
.tone-warning > header { background: #fffdf5; }
.tone-warning .section-icon { background: #fff8d7; color: #806700; }
.action-section > header strong { border-radius: 6px; background: #edf4f5; font-variant-numeric: tabular-nums; }
.action-row { min-height: 72px; border-bottom-color: #e4ecee; transition: background-color .14s ease; }
.action-row:hover { background: #f7fbfc; }
.action-follow { background: #f0f7f8; }
.member-badge { border: 1px solid #f0df7b; background: #fff9d8; }
.avatar { border-color: #c8e3e8; background: #e9f7f9; }

.customer-list-meta { margin: 0 0 9px; display: flex; align-items: baseline; gap: 4px; color: var(--muted); font-size: 12px; }
.customer-list-meta strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.customer-list-meta small { margin-left: auto; color: #7a8d93; }
.customer-list-limit-hint { margin: 6px 0 0; color: #7a8d93; font-size: 11px; text-align: center; }
.deleted-customer-list { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.deleted-customer-row { min-height: 84px; padding: 11px 14px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid #e2ebed; }
.deleted-customer-row:last-child { border-bottom: 0; }
.deleted-customer-copy { min-width: 0; display: grid; gap: 3px; }
.deleted-customer-copy strong { font-size: 15px; }
.deleted-customer-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.deleted-customer-row form { margin: 0; }
.customer-list { border-color: #cedfe3; box-shadow: 0 4px 16px rgba(24, 65, 76, .055); }
.customer-list-head {
  min-height: 42px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: 42px minmax(220px, 1fr) 160px 150px 20px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #d7e4e7;
  background: #f4f8f9;
  color: #71858c;
  font-size: 11px;
  font-weight: 700;
}
.customer-row { grid-template-columns: 42px minmax(220px, 1fr) 160px 150px 20px; border-bottom-color: #e1eaec; transition: background-color .14s ease; }
.customer-row:hover { background: #f5fafb; }
.customer-last-visit { color: #4f6871; font-size: 12px; font-variant-numeric: tabular-nums; }
.customer-name-line > small { display: none; }
.risk-flag { width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--coral-soft); color: #bd4d48; }
.risk-flag { flex: 0 0 auto; }
.risk-flag svg { width: 13px; height: 13px; }
.mobile-visit-dates { display: none; }
.customer-last-visit { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: baseline; gap: 2px 7px; }
.customer-last-visit small { color: #7b8d93; font-size: 10px; }
.customer-last-visit b { color: #405a63; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.customer-value strong { color: #23434d; font-family: "Bahnschrift", "Microsoft YaHei UI", sans-serif; }

.record-form { max-width: 820px; padding: 28px 30px; border: 1px solid #cedfe3; border-top: 4px solid #21afc1; box-shadow: 0 8px 26px rgba(24, 65, 76, .07); }
.field-group { margin-bottom: 22px; }
.field-group > label, .stack-form > label { color: #294650; font-size: 13px; }
.field-group > label { display: block; }
.form-control { min-height: 48px; border-color: #c8dadd; background: #fff; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.form-control:hover { border-color: #95bec6; }
.form-control:focus { border-color: var(--green); outline: 0; box-shadow: 0 0 0 3px rgba(244, 214, 78, .4); }
.checkbox-field { margin: 4px 0 22px; }
.checkbox-label { min-height: 68px; padding: 12px 14px; display: flex !important; align-items: center; gap: 12px; border: 1px solid #c8dadd; border-radius: 6px; background: #f8fbfc; cursor: pointer; }
.checkbox-label:hover { border-color: #8cbec7; background: #f2f9fa; }
.checkbox-label:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(244, 214, 78, .4); }
.checkbox-input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--green); cursor: pointer; }
.checkbox-label > span { min-width: 0; display: grid; gap: 4px; }
.checkbox-label strong { color: var(--ink); font-size: 14px; }
.checkbox-label small { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.45; }
.form-actions { position: static; bottom: auto; margin: 8px -4px -4px; padding: 16px 4px 4px; border-top: 1px solid #e3ebed; }
.import-upload-form { max-width: 920px; }
.import-rule-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.import-rule-grid span { min-width: 0; padding: 12px 14px; border: 1px solid #d5e6e9; border-radius: 6px; background: #f7fbfc; display: grid; gap: 4px; }
.import-rule-grid strong { color: var(--ink); font-size: 13px; }
.import-rule-grid small { color: var(--muted); font-size: 12px; }
.import-file-field { margin-bottom: 18px; display: grid; gap: 8px; }
.import-file-field label { color: #294650; font-size: 13px; font-weight: 700; }
.import-file-field input[type="file"] { width: 100%; padding: 11px; border: 1px dashed #8fc4cd; border-radius: 6px; background: #f7fbfc; color: var(--ink); }
.import-file-field p { margin: 0; color: var(--muted); font-size: 12px; }
.import-error-panel { max-width: 920px; margin: 0 auto 18px; padding: 16px; border: 1px solid #edc7c3; border-left: 4px solid var(--coral); border-radius: 6px; background: #fff8f7; }
.import-error-panel header { display: flex; align-items: center; gap: 8px; color: #8e332d; }
.import-error-panel header span { margin-left: auto; color: var(--muted); font-size: 12px; }
.import-error-list { max-height: 250px; margin: 12px 0; overflow: auto; }
.import-error-list p { margin: 0; padding: 5px 0; color: #7a3e39; font-size: 12px; }
.import-preview-section { max-width: 1120px; margin: 0 auto; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.import-summary { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.import-summary h2 { margin: 0; }
.import-summary > div { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 12px; }
.import-summary b { color: var(--ink); font-variant-numeric: tabular-nums; }
.import-preview-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 5px; }
.import-preview-table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 12px; }
.import-preview-table th, .import-preview-table td { padding: 9px 10px; border-bottom: 1px solid #e0eaec; text-align: left; white-space: nowrap; }
.import-preview-table th { background: #f4f8f9; color: #63777e; font-weight: 700; }
.import-preview-table tr:last-child td { border-bottom: 0; }
.import-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.required { padding: 2px 5px; display: inline-flex; border-radius: 4px; background: #fff0ef; vertical-align: 1px; }
.inline-radio-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.inline-radio-field legend { margin-bottom: 9px; color: #294650; font-size: 13px; font-weight: 700; }
.inline-radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-radio-option { min-width: 0; min-height: 48px; padding: 9px 10px; display: flex; flex: 1 1 58px; align-items: center; justify-content: center; gap: 7px; border: 1px solid #c8dadd; border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.inline-radio-option > span { min-width: 0; overflow-wrap: anywhere; text-align: center; white-space: normal; }
.inline-radio-option:hover { border-color: #95bec6; }
.inline-radio-option:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(244, 214, 78, .4); }
.inline-radio-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.inline-radio-option:has(input:checked) { border-color: var(--green); background: #f2faf9; }

.customer-identity { min-height: 92px; }
.member-strip, .customer-stats, .inventory-band { border-color: #cedfe3; box-shadow: 0 3px 12px rgba(24, 65, 76, .04); }
.member-strip > div { background: #fff; }
.member-strip > div:nth-child(2) { background: #f8fbfc; }
.member-strip > div:nth-child(3) { background: #fffbe6; }
.member-strip .level-progress { background: #edf8fa; }
.customer-stats > div { border-right-color: #e0e9eb; }
.detail-actions .button { min-width: 138px; }
.timeline-content { border-color: #d2e1e5; box-shadow: 0 3px 12px rgba(24, 65, 76, .045); }
.timeline-content footer { border-top-color: #e3ebed; }

.north-star { background: #087b8e; box-shadow: 0 10px 24px rgba(8, 95, 111, .16); }
.metric-row, .level-overview, .data-section { border-color: #cedfe3; box-shadow: 0 4px 16px rgba(24, 65, 76, .045); }
.metric { border-right-color: #dce7e9; }
.level-card { background: #fbfdfd; }
.level-card:nth-child(2), .level-card:nth-child(5), .level-card:nth-child(8) { background: #f1f9fa; }
.level-card:nth-child(3), .level-card:nth-child(6), .level-card:nth-child(9) { background: #fffbea; }
th { background: #f4f8f9; color: #63777e; }
tbody tr:hover { background: #f7fbfc; }

.account-sheet {
  width: min(420px, calc(100% - 28px));
  max-height: min(680px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(18, 52, 62, .24);
}
.account-sheet::backdrop { background: rgba(20, 48, 56, .42); }
.account-sheet > header { min-height: 72px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.account-sheet > header p, .account-sheet > header h2 { margin-bottom: 0; }
.account-facts { padding: 18px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.account-facts span { min-height: 72px; padding: 12px; display: grid; align-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; background: #f7fafb; }
.account-facts small { color: var(--muted); font-size: 11px; }
.account-facts strong { font-size: 14px; }
.account-sheet > form { padding: 0 16px 18px; }

@media (min-width: 761px) {
  body.has-app-shell { padding-left: 244px; }
  .site-header { display: none; }
  .app-sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: 244px;
    padding: 22px 16px 16px;
    display: flex;
    flex-direction: column;
    background: #0b5263;
    color: #fff;
    border-right: 1px solid #0a4553;
    box-shadow: 5px 0 18px rgba(17, 55, 65, .09);
  }
  .sidebar-brand { min-height: 54px; padding: 0 8px; }
  .sidebar-brand strong { color: #fff; font-size: 17px; }
  .sidebar-brand small { color: #b8dce3; }
  .sidebar-brand .brand-mark { background: #fff; color: #0b5263; border-bottom-color: var(--sun); }
  .nav-label { margin: 32px 10px 10px; color: #9dcbd4; font-size: 11px; font-weight: 700; }
  .desktop-nav { height: auto; display: grid; align-content: start; gap: 6px; }
  .desktop-nav a, .desktop-nav button {
    position: relative;
    min-height: 48px;
    padding: 0 12px;
    gap: 11px;
    border: 0;
    border-radius: 6px;
    color: #d8ebef;
    font-size: 14px;
    font-weight: 650;
  }
  .desktop-nav a:hover, .desktop-nav a:focus-visible, .desktop-nav button:hover, .desktop-nav button:focus-visible { border: 0; background: rgba(255, 255, 255, .1); color: #fff; }
  .desktop-nav a.current { border: 0; background: #fff; color: #0b5263; }
  .desktop-nav .nav-placeholder:disabled:hover, .desktop-nav .nav-placeholder:disabled:focus-visible { color: #d8ebef; background: transparent; }
  .desktop-nav a.current::after { position: absolute; right: 9px; width: 4px; height: 20px; border-radius: 3px; background: var(--sun); content: ""; }
  .nav-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 5px; background: rgba(255, 255, 255, .08); }
  .nav-icon svg { width: 17px; height: 17px; }
  .desktop-nav a.current .nav-icon { background: #e5f4f6; }
  .sidebar-user { margin-top: auto; padding: 14px 8px 2px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 34px; align-items: center; gap: 10px; border-top: 1px solid rgba(255, 255, 255, .15); }
  .user-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #e8f6f8; color: #0b5263; font-weight: 800; }
  .user-copy { min-width: 0; display: grid; gap: 3px; }
  .user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-copy strong { font-size: 13px; }
  .user-copy small { color: #a9d2da; font-size: 10px; }
  .sidebar-user form { margin: 0; }
  .sidebar-logout { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .08); color: #d7ebef; cursor: pointer; }
  .sidebar-logout:hover { background: rgba(255, 255, 255, .16); color: #fff; }
  .sidebar-logout svg { width: 17px; height: 17px; }
  .page-shell { width: min(1180px, calc(100% - 56px)); }
  .toast-stack { left: 268px; right: auto; }
}

@media (max-width: 760px) {
  body { background: #f4f9fa; }
  .site-header { background: rgba(255, 255, 255, .98); border-top-color: #20afc1; box-shadow: 0 2px 12px rgba(24, 65, 76, .08); }
  .site-header .brand small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-shell { padding-top: 18px; }
  .page-heading, .today-header { min-height: 58px; }
  .page-heading { flex-wrap: wrap; }
  .page-heading .heading-actions { width: 100%; justify-content: flex-start; }
  .page-heading h1, .today-header h1 { padding-bottom: 7px; }
  .search-bar { height: 54px; margin-bottom: 16px; box-shadow: none; }
  .action-board { gap: 12px; }
  .action-section { border-left-width: 3px; box-shadow: none; }
  .action-section > header { min-height: 52px; }
  .section-icon { width: 28px; height: 28px; }
  .action-row { padding-left: 12px; }
  .customer-list-meta { padding: 0 2px; }
  .customer-list-head, .customer-last-visit { display: none; }
  .customer-row { grid-template-columns: 40px minmax(0, 1fr) auto 16px; gap: 9px; }
  .customer-row { min-height: 88px; }
  .mobile-visit-dates { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .mobile-visit-dates small { color: #357d91; font-size: 9px; }
  .customer-name-line > small { display: block; }
  .customer-list { box-shadow: none; }
  .deleted-customer-list { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .deleted-customer-row { min-height: 92px; padding-inline: 14px; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 9px; }
  .deleted-customer-row .button { width: 44px; min-width: 44px; padding: 0; font-size: 0; }
  .deleted-customer-row .button svg { width: 19px; }
  .record-form { padding-top: 20px; }
  .import-preview-section { margin-inline: -14px; padding: 14px; border-left: 0; border-right: 0; border-radius: 0; }
  .import-summary { align-items: flex-start; flex-direction: column; }
  .import-rule-grid { grid-template-columns: 1fr; }
  .import-confirm-actions { justify-content: stretch; }
  .import-confirm-actions .button { flex: 1; }
  .form-actions { margin-inline: -2px; }
  .member-strip, .customer-stats, .inventory-band { box-shadow: none; }
  .detail-actions .button { min-width: 0; }
  .north-star, .metric-row, .level-overview, .data-section { box-shadow: none; }
  .mobile-nav { grid-template-columns: repeat(5, 1fr); background: rgba(255, 255, 255, .98); box-shadow: 0 -4px 18px rgba(24, 65, 76, .09); }
  .mobile-nav > button svg { width: 21px; height: 21px; }
  .account-sheet {
    width: calc(100% - 24px);
    max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin: auto;
    border-radius: 8px;
  }
  .page-back-link { margin: -4px 0 6px; }
  .member-dialog { overscroll-behavior: contain; }
}

@media (prefers-reduced-motion: reduce) {
  .button.is-loading svg { animation: none; }
}

/* Member operations workflow */
.nav-icon-badge, .mobile-nav-badge { position: relative; }
[data-task-count][hidden] { display: none !important; }
.nav-icon-badge b, .mobile-nav-badge b {
  position: absolute;
  z-index: 2;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 10px;
  background: #e5544f;
  color: #fff;
  font-size: 9px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nav-icon-badge b { top: -8px; right: -10px; }
.mobile-nav-badge b { top: 0; left: calc(50% + 5px); }

.task-stats { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.task-stat { min-height: 90px; padding: 14px 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-top: 3px solid #63b9c7; border-radius: 6px; background: #fff; }
.task-stat:hover { border-color: #8ccbd5; background: #f8fcfd; }
.task-stat span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.task-stat span svg { width: 18px; }
.task-stat strong { color: var(--ink); font-family: "Bahnschrift", "Microsoft YaHei UI", sans-serif; font-size: 30px; }
.task-stat.danger { border-top-color: #e66a63; }
.task-stat.success { border-top-color: #4b9b78; }
.task-stat.warning { border-top-color: var(--sun); }
.upcoming-followups { min-height: 58px; margin: -7px 0 18px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; border: 1px solid #b9dfe7; border-left: 4px solid #2d9fc0; border-radius: 6px; background: #f4fbfd; }
.upcoming-followups:hover, .upcoming-followups.current { background: #e9f7fa; border-color: #8fcfdb; }
.upcoming-followups > span { min-width: 0; display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; column-gap: 8px; }
.upcoming-followups > span svg { grid-row: 1 / span 2; width: 19px; color: #248aa6; }
.upcoming-followups > span strong { font-size: 13px; }
.upcoming-followups > span small { color: var(--muted); font-size: 10px; }
.upcoming-followups > b { margin-left: auto; color: #176f88; font-size: 22px; }
.upcoming-followups > svg { width: 18px; color: #6d929d; }
.upcoming-hint { color: #287c92; font-size: 10px; }

.team-board { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.team-board > header { min-height: 66px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.team-board > header h2, .team-board > header p { margin: 0; }
.team-board > header h2 { font-size: 17px; }
.team-board > header > span { color: var(--muted); font-size: 12px; }
.team-row { min-height: 68px; padding: 9px 14px; display: grid; grid-template-columns: 40px minmax(150px, 1fr) repeat(3, 90px) 18px; align-items: center; gap: 12px; border-bottom: 1px solid #e4ecee; }
.team-row:last-child { border-bottom: 0; }
.team-row:hover, .team-row.selected { background: #f0f8fa; }
.team-name, .team-row > span:not(.avatar) { min-width: 0; display: grid; gap: 3px; }
.team-row small { color: var(--muted); font-size: 11px; }
.team-row b { font-size: 15px; font-variant-numeric: tabular-nums; }
.danger-text { color: #c94944; }

.task-filter { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.task-filter .form-control { width: auto; min-width: 150px; min-height: 42px; }
.task-type-tabs { margin-bottom: 10px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.task-type-tabs a { min-width: fit-content; min-height: 38px; padding: 0 11px; display: flex; align-items: center; gap: 7px; border: 1px solid #cbdde1; border-radius: 6px; background: #fff; color: #536d78; font-size: 12px; font-weight: 700; }
.task-type-tabs a.current { border-color: #75bdc9; background: #eaf6f8; color: #076e80; }
.task-type-tabs b { min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 4px; background: #edf3f4; font-size: 10px; font-variant-numeric: tabular-nums; }
.task-type-tabs a.current b { background: #fff; }
.segmented-control { min-height: 42px; padding: 3px; display: inline-flex; align-items: stretch; gap: 2px; border: 1px solid #cbdde1; border-radius: 6px; background: #edf4f5; }
.segmented-control a { min-width: 86px; padding: 0 13px; display: grid; place-items: center; border-radius: 4px; color: #536d78; font-size: 13px; font-weight: 700; }
.segmented-control a.current { background: #fff; color: #087e92; box-shadow: 0 1px 4px rgba(24, 65, 76, .12); }

.task-list { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.task-item { min-height: 98px; padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid #e2ebed; }
.task-item:last-child { border-bottom: 0; }
.task-item:has(.task-select) { grid-template-columns: 24px minmax(0, 1fr) auto; }
.task-item.is-overdue { border-left: 4px solid #e15b55; background: #fffafa; }
.task-item.is-completed { background: #f9fcfb; }
.task-select { width: 22px; height: 44px; display: grid; place-items: center; }
.task-select input { width: 20px; height: 20px; accent-color: var(--green); }
.task-main { min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 11px; }
.task-copy { min-width: 0; display: grid; gap: 5px; }
.task-title { display: flex; align-items: center; gap: 8px; }
.task-title strong { font-size: 15px; }
.task-type { padding: 3px 6px; border-radius: 4px; background: #e8f5f7; color: #08758a; font-size: 10px; font-style: normal; font-weight: 750; }
.task-type.type-post_surgery { background: #e8f5ee; color: #257353; }
.task-type.type-planned_followup { background: #fff7d2; color: #765f00; }
.task-copy > small { color: #506a73; font-size: 12px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 10px; color: #71858c; font-size: 11px; }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }
.task-meta svg { width: 13px; height: 13px; }
.task-action { min-width: 112px; padding-inline: 12px; background: #edf7f8; color: #076f81; }
.completion-line { color: #39785e; font-size: 11px; }
.quality-flag { width: fit-content; padding: 3px 6px; display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; background: #fff0ef; color: #b94743; font-size: 10px; }
.quality-flag svg { width: 12px; height: 12px; }
.bulk-task-bar { position: sticky; z-index: 4; bottom: 82px; margin-top: 10px; padding: 10px 12px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; border: 1px solid #bdd9df; border-radius: 6px; background: rgba(255, 255, 255, .98); box-shadow: 0 8px 24px rgba(22, 64, 76, .12); }
.bulk-task-bar > span { margin-right: auto; color: var(--muted); font-size: 12px; }
.bulk-task-bar .form-control { width: 180px; min-height: 42px; }
.pagination { min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 18px; }
.pagination a { color: var(--green); font-weight: 750; }
.pagination span { color: var(--muted); font-size: 12px; }

.page-intro { margin: -8px 0 18px; color: var(--muted); font-size: 13px; }
.inventory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inventory-card { min-height: 126px; padding: 18px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 18px; align-items: center; gap: 14px; border: 1px solid var(--line); border-top: 4px solid #26a9bc; border-radius: 6px; background: #fff; }
.inventory-card:hover { border-color: #83c3ce; background: #f9fcfd; }
.inventory-card.tone-yellow { border-top-color: var(--sun); }
.inventory-card.tone-coral { border-top-color: #e66a63; }
.inventory-card.tone-green { border-top-color: #4b9b78; }
.inventory-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 6px; background: #e7f5f7; color: #087e92; }
.tone-yellow .inventory-icon { background: #fff8d5; color: #786100; }
.tone-coral .inventory-icon { background: #fff0ef; color: #c64e49; }
.tone-green .inventory-icon { background: #e8f5ee; color: #287356; }
.inventory-copy { min-width: 0; display: grid; gap: 6px; }
.inventory-copy strong { font-size: 17px; }
.inventory-copy small { color: var(--muted); font-size: 12px; }
.inventory-count { min-width: 82px; display: grid; justify-items: end; gap: 2px; }
.inventory-count b { color: var(--green); font-size: 31px; font-variant-numeric: tabular-nums; }
.inventory-count small { color: var(--muted); font-size: 11px; }
.inventory-placeholder { min-height: 70px; padding: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed #bcd3d8; border-radius: 6px; color: #789097; font-size: 12px; }
.inventory-placeholder svg { width: 17px; }
.heading-count { color: var(--green); font-size: 16px; font-weight: 800; }
.page-heading h1 > svg { width: 23px; vertical-align: -4px; }
.inventory-customer-list, .risk-list { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.inventory-customer-row { min-height: 80px; padding: 10px 14px; display: grid; grid-template-columns: 42px minmax(180px, 1fr) 64px 170px 18px; align-items: center; gap: 12px; border-bottom: 1px solid #e2ebed; }
.inventory-customer-row:last-child { border-bottom: 0; }
.inventory-customer-row > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.inventory-customer-row > span:nth-child(2) small, .last-date { color: var(--muted); font-size: 11px; }

.risk-toolbar { margin-bottom: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.risk-toolbar .search-bar { margin: 0; }
.risk-list-meta { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.risk-list-meta strong { margin-right: 4px; color: var(--ink); font-size: 16px; }
.risk-row { min-height: 82px; padding: 10px 14px; display: grid; grid-template-columns: 36px minmax(110px, .8fr) 112px minmax(120px, 1fr) minmax(150px, 1.2fr) 68px 18px; align-items: center; gap: 12px; border-bottom: 1px solid #e2ebed; }
.risk-row:last-child { border-bottom: 0; }
.risk-level { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: #fff1ef; color: #d1544e; }
.risk-level.level-attention { background: #fff8d5; color: #806700; }
.risk-level svg { width: 18px; }
.risk-customer, .risk-date, .risk-category, .risk-summary { min-width: 0; display: grid; gap: 4px; }
.risk-row small { color: var(--muted); font-size: 10px; }
.risk-row b { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { padding: 4px 7px; border-radius: 4px; background: #fff3d0; color: #765f00; font-size: 10px; font-weight: 750; text-align: center; }
.status-badge.status-resolved { background: #e8f5ee; color: #267354; }

.account-links { padding: 0 16px 14px; display: grid; }
.account-links a { min-height: 50px; display: grid; grid-template-columns: 24px minmax(0, 1fr) 18px; align-items: center; gap: 9px; border-top: 1px solid var(--line); color: var(--ink); font-size: 13px; }
.account-links a > svg { width: 18px; color: var(--green); }
.account-links a > svg:last-child { color: var(--muted); }
.account-links a[aria-disabled="true"] { pointer-events: none; }
.account-title { display: flex; align-items: center; gap: 10px; }
.account-avatar, .user-avatar, .user-avatar img { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; }
.account-avatar { background: #e8f6f8; color: #0b5263; font-weight: 800; }
.account-avatar img, .user-avatar img, [data-account-avatar-preview] img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.account-avatar-actions { padding: 0 16px 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-avatar-actions form { min-width: 0; display: flex; align-items: center; gap: 7px; margin: 0; flex-wrap: wrap; }
.avatar-file-button { min-height: 32px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-soft); background: #fff; font-size: 11px; font-weight: 750; cursor: pointer; }
.avatar-file-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.avatar-preview-error { flex: 1 1 100%; color: #ad423b; font-size: 10px; line-height: 1.4; }
.avatar-preview-error[hidden] { display: none; }

/* 经营战绩：严格沿用已确认的方案一赛事台原型。 */
.performance-shell { width: min(1180px, calc(100% - 56px)); }
.performance-page { min-width: 0; display: grid; gap: 14px; }
.performance-header { min-height: 54px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.performance-header h1 { margin: 0; color: var(--ink); font-size: 25px; }
.performance-header p { margin: 0 0 4px; color: var(--green); font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.performance-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.performance-segment { min-height: 32px; padding: 2px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(46px, 1fr); border: 1px solid var(--line); border-radius: 5px; background: var(--soft); }
.performance-segment a { min-height: 26px; padding: 0 9px; display: grid; place-items: center; border-radius: 3px; color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.performance-segment a.current { color: #fff; background: var(--green); }
.performance-segment.consult a.current { color: #9b5c1f; background: #fff0de; }
.performance-error { padding: 9px 12px; border: 1px solid #e8b6b0; border-radius: 5px; color: #a94438; background: #fff6f4; font-size: 11px; }
.performance-arena { min-width: 0; }
.performance-arena-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.performance-arena-head h2 { margin: 0; font-size: 16px; }
.performance-arena-head small { color: var(--muted); font-size: 10px; }
.performance-tabs { display: flex; align-items: center; gap: 5px; }
.performance-tabs a { min-height: 32px; padding: 0 10px; display: inline-flex; align-items: center; border: 1px solid transparent; border-radius: 4px; color: var(--muted); font-size: 10px; font-weight: 800; }
.performance-tabs a.current { border-color: var(--line); color: var(--green); background: #fff; box-shadow: 0 2px 7px rgba(8, 126, 154, .08); }
.performance-broadcast-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, .75fr); gap: 14px; }
.performance-podium-panel, .performance-duel-panel { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.performance-podium-panel { padding: 16px; }
.performance-podium-stage { height: 216px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 10px; }
.performance-podium-person { min-width: 0; text-align: center; }
.performance-podium-person.place-1 { grid-column: 2; grid-row: 1; }
.performance-podium-person.place-2 { grid-column: 1; grid-row: 1; }
.performance-podium-person.place-3 { grid-column: 3; grid-row: 1; }
.performance-avatar { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: #fff; background: var(--green); font-size: 15px; font-weight: 850; }
.performance-avatar img { width: 100%; height: 100%; object-fit: cover; }
.performance-avatar.tone-blue { background: #2b65d9; }
.performance-avatar.tone-orange { background: #e69545; }
.performance-podium-person .performance-avatar { width: 50px; height: 50px; margin: 0 auto 7px; border: 4px solid #fff; box-shadow: 0 0 0 2px var(--line); }
.performance-podium-person.place-1 .performance-avatar { width: 62px; height: 62px; box-shadow: 0 0 0 3px #f1c45e, 0 9px 20px rgba(211, 154, 37, .22); }
.performance-podium-person > strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.performance-podium-score { margin: 4px 0 8px; display: block; overflow: hidden; font-family: "DIN Alternate", sans-serif; font-size: 22px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.performance-podium-block { min-height: 54px; padding-top: 10px; display: block; color: #fff; background: #7aaeb9; font-size: 14px; font-weight: 900; }
.performance-podium-person.place-1 .performance-podium-block { min-height: 88px; background: var(--green); }
.performance-podium-person.place-3 .performance-podium-block { min-height: 42px; background: #97aeb4; }
.performance-duel-panel { padding: 16px; position: relative; overflow: hidden; }
.performance-duel-panel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(43, 101, 217, .06) 0 49.7%, transparent 50.2% 51%, rgba(230, 149, 69, .08) 51.5%); pointer-events: none; }
.performance-duel-title { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.performance-duel-title h2 { margin: 0; font-size: 13px; }
.performance-pk-metric-select, .performance-pair-select, .performance-config select { min-width: 126px; height: 34px; padding: 0 28px 0 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-soft); background: #fff; font: inherit; font-size: 10px; font-weight: 750; }
.performance-versus { position: relative; min-height: 188px; display: grid; grid-template-columns: 1fr 52px 1fr; align-items: center; }
.performance-fighter { min-width: 0; text-align: center; }
.performance-fighter .performance-avatar { width: 58px; height: 58px; margin: 0 auto 8px; font-size: 18px; }
.performance-fighter strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.performance-fight-score { margin-top: 6px; display: block; overflow: hidden; font-family: "DIN Alternate", sans-serif; font-size: 30px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.performance-fighter small { color: var(--muted); font-size: 9px; }
.performance-vs-mark { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: #fff; background: var(--ink); font-size: 13px; font-weight: 900; box-shadow: 0 7px 16px rgba(23, 59, 74, .18); }
.performance-duel-progress { position: relative; height: 12px; overflow: hidden; border: 1px solid rgba(94, 126, 137, .3); border-radius: 6px; background: #e69545; }
.performance-duel-progress progress { width: 100%; height: 100%; display: block; overflow: hidden; appearance: none; -webkit-appearance: none; border: 0; border-radius: inherit; background: #e69545; color: #2b65d9; }
.performance-duel-progress progress::-webkit-progress-bar { background: #e69545; }
.performance-duel-progress progress::-webkit-progress-value { background: #2b65d9; }
.performance-duel-progress progress::-moz-progress-bar { background: #2b65d9; }
.performance-duel-progress.is-empty, .performance-duel-progress.is-empty progress, .performance-duel-progress.is-empty progress::-webkit-progress-bar { background: #e8eff1; }
.performance-duel-progress.is-empty progress { opacity: 0; }
.performance-duel-progress.is-empty::after { content: ""; position: absolute; inset: 2px auto 2px 50%; width: 1px; background: #9bb1b7; }
.performance-duel-actions { position: relative; margin-top: 13px; display: flex; justify-content: center; }
.performance-pair-select { min-width: 168px; color: var(--green); font-weight: 850; text-align: center; }
.performance-rank-strip { margin-top: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.performance-rank-strip-row { min-width: 0; min-height: 69px; padding: 10px 12px; display: grid; grid-template-columns: 24px 32px minmax(0, 1fr) auto; align-items: center; gap: 7px; border-right: 1px solid var(--line-soft); }
.performance-rank-strip-row:last-child { border-right: 0; }
.performance-rank-strip-row .performance-avatar { width: 30px; height: 30px; font-size: 10px; }
.performance-rank-no { color: var(--muted); font-size: 11px; font-weight: 900; }
.performance-rank-name, .performance-rank-value { min-width: 0; }
.performance-rank-name strong, .performance-rank-name small, .performance-rank-value strong, .performance-rank-value small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-rank-name strong { font-size: 12px; }
.performance-rank-name small, .performance-rank-value small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.performance-rank-value { text-align: right; }
.performance-rank-value strong { font-family: "DIN Alternate", sans-serif; font-size: 18px; }
.performance-config-body { padding: 0 13px 13px; }
.performance-config-row { display: grid; grid-template-columns: 26px 1fr 1fr; gap: 6px; align-items: center; margin-top: 6px; }
.performance-config-row > span { color: var(--muted); font-size: 10px; }
.performance-config-dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; }
.performance-config-dialog::backdrop { background: rgba(20, 48, 56, .42); }
.performance-config-dialog > header { min-height: 68px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.performance-config-dialog > header p, .performance-config-dialog > header h2 { margin: 0; }
.performance-config-dialog > form > .performance-config-body { padding-top: 10px; }
.performance-config-dialog footer { padding: 10px 13px 13px; display: flex; justify-content: flex-end; gap: 7px; border-top: 1px solid var(--line); }
.performance-empty { min-height: 145px; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
@media (max-width: 840px) {
  .performance-shell { width: min(100% - 24px, 600px); }
  .performance-header { display: grid; gap: 8px; }
  .performance-broadcast-grid { grid-template-columns: 1fr; }
  .performance-filters { justify-content: flex-start; }
  .performance-rank-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-rank-strip-row:nth-child(2n) { border-right: 0; }
  .performance-rank-strip-row:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 420px) {
  .performance-shell { width: calc(100% - 18px); }
  .performance-header h1 { font-size: 21px; }
  .performance-filters { display: grid; grid-template-columns: 1fr; }
  .performance-segment { width: 100%; }
  .performance-segment a { padding: 0 4px; }
  .performance-arena-head { align-items: flex-end; }
  .performance-tabs { gap: 2px; }
  .performance-tabs a { padding-inline: 7px; }
  .performance-podium-panel, .performance-duel-panel { padding: 12px; }
  .performance-podium-stage { height: 202px; gap: 5px; }
  .performance-podium-person .performance-avatar { width: 42px; height: 42px; }
  .performance-podium-person.place-1 .performance-avatar { width: 52px; height: 52px; }
  .performance-podium-score { font-size: 17px; }
  .performance-podium-person > strong { font-size: 11px; }
  .performance-versus { grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); }
  .performance-fighter .performance-avatar { width: 52px; height: 52px; }
  .performance-fight-score { font-size: 24px; }
  .performance-vs-mark { width: 40px; height: 40px; }
  .performance-rank-strip { grid-template-columns: 1fr; }
  .performance-rank-strip-row { min-height: 58px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .performance-rank-strip-row:last-child { border-bottom: 0; }
}

/* 经营战绩二次校准：排行榜指标与焦点 PK 共用，移动端先完成完整排名再显示 PK。 */
.performance-ranking-column { min-width: 0; display: grid; gap: 14px; }
.performance-arena-title h2 { display: flex; align-items: center; gap: 4px; }
.performance-refresh { width: 26px; height: 26px; min-height: 26px; margin-left: 2px; vertical-align: middle; }
.performance-refresh svg { width: 14px; height: 14px; }
.performance-config-trigger { min-height: 32px; padding: 0 8px; gap: 4px; font-size: 10px; white-space: nowrap; }
.performance-config-trigger svg { width: 14px; height: 14px; }
.performance-rank-bars { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.performance-rank-bar-row { min-width: 0; min-height: 68px; padding: 9px 12px; display: grid; grid-template-columns: 24px 32px minmax(74px, 110px) minmax(80px, 1fr) auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-soft); }
.performance-rank-bar-row:last-child { border-bottom: 0; }
.performance-rank-bar-row .performance-avatar { width: 30px; height: 30px; font-size: 10px; }
.performance-rank-track { width: 100%; min-width: 0; height: 12px; display: block; overflow: hidden; appearance: none; -webkit-appearance: none; border: 0; border-radius: 3px; background: #e8eff1; color: var(--green); }
.performance-rank-track::-webkit-progress-bar { border-radius: inherit; background: #e8eff1; }
.performance-rank-track::-webkit-progress-value { border-radius: inherit; background: var(--green); }
.performance-rank-track::-moz-progress-bar { border-radius: inherit; background: var(--green); }
.performance-rank-value { min-width: 54px; text-align: right; }
.performance-rank-value strong, .performance-rank-value small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-rank-value strong { font-family: "DIN Alternate", sans-serif; font-size: 18px; }
.performance-rank-value small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.performance-rank-name strong, .performance-rank-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-rank-name strong { font-size: 12px; }
.performance-rank-name small { margin-top: 3px; color: var(--muted); font-size: 9px; }

@media (max-width: 760px) {
  .performance-header { display: grid; gap: 8px; }
  .performance-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 6px; }
  .performance-segment { min-width: 0; width: auto; grid-auto-columns: minmax(0, 1fr); }
  .performance-segment a { min-width: 0; padding-inline: 6px; }
  .performance-config-trigger { min-width: 62px; padding-inline: 6px; }
  .performance-config-trigger span { overflow: hidden; text-overflow: ellipsis; }
  .performance-arena-head { display: grid; align-items: end; gap: 8px; }
  .performance-tabs { justify-content: space-between; }
  .performance-tabs a { flex: 1; justify-content: center; }
  .performance-broadcast-grid { grid-template-columns: 1fr; }
  .performance-duel-panel { order: -1; }
  .performance-rank-bars { margin-top: 0; }
}

@media (max-width: 420px) {
  .performance-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .performance-config-trigger { min-height: 30px; font-size: 9px; }
  .performance-config-trigger svg { width: 13px; height: 13px; }
  .performance-rank-bar-row { min-height: 60px; padding-inline: 8px; grid-template-columns: 20px 30px minmax(54px, .8fr) minmax(42px, 1fr) auto; gap: 5px; }
  .performance-rank-bar-row .performance-avatar { width: 28px; height: 28px; }
  .performance-rank-name strong { font-size: 11px; }
  .performance-rank-name small, .performance-rank-value small { font-size: 8px; }
  .performance-rank-value { min-width: 34px; }
  .performance-rank-value strong { font-size: 15px; }
}
.account-navigation-feedback { position: fixed; z-index: 120; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); min-height: 46px; max-width: min(360px, calc(100vw - 32px)); padding: 10px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid #9bcbd3; border-radius: 6px; background: #f5fbfc; color: var(--ink); box-shadow: 0 12px 34px rgba(18, 52, 62, .2); font-size: 13px; font-weight: 700; }
.account-navigation-feedback[hidden] { display: none; }
.account-navigation-spinner { width: 17px; height: 17px; flex: 0 0 auto; border: 2px solid #b8d9de; border-top-color: var(--green); border-radius: 50%; animation: button-spin .75s linear infinite; }
.account-navigation-feedback.is-error { border-color: #dfaaa5; background: #fff7f6; color: #873d36; }
.account-navigation-feedback.is-error .account-navigation-spinner { display: none; }
.account-navigation-feedback button { min-height: 32px; margin-left: auto; padding: 5px 10px; border: 1px solid currentColor; border-radius: 5px; background: #fff; color: inherit; font: inherit; cursor: pointer; }

/* Homepage demo */
.home-shell { width: min(1180px, calc(100% - 56px)); }
.home-layout { min-height: calc(100vh - 112px); display: grid; align-content: start; gap: 24px; }
.home-zone { min-width: 0; padding-top: 18px; border-top: 1px solid #b7dce4; }
.home-zone:first-child { padding-top: 0; border-top: 0; }
.home-zone-heading { min-height: 54px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.home-zone-heading.compact { min-height: 44px; }
.home-zone-heading h1, .home-zone-heading h2 { margin: 0; }
.home-demo-tag { padding: 5px 8px; border: 1px solid #b8dce3; border-radius: 4px; background: #f4fafb; color: #5f7782; font-size: 11px; font-weight: 700; }
.home-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.home-metric-placeholder { min-width: 0; min-height: 82px; padding: 12px 14px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid #c5e1e7; border-radius: 6px; background: #fff; }
.home-metric-placeholder svg { width: 20px; color: #087e9a; }
.home-metric-placeholder span { overflow: hidden; color: #5f7782; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.home-metric-placeholder strong { color: #173b4a; font-size: 21px; font-variant-numeric: tabular-nums; }
.home-workbench-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(72px, 1fr)); gap: 10px; }
.home-workbench-item, .home-workbench-slot { min-width: 0; min-height: 72px; border-radius: 6px; }
.home-workbench-item { padding: 10px 6px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1px solid #acd7df; background: #fff; color: #235665; font-size: 12px; font-weight: 750; text-align: center; }
.home-workbench-item:hover, .home-workbench-item:focus-visible { border-color: #087e9a; background: #eaf7fa; color: #087e9a; }
.home-workbench-item svg { width: 23px; height: 23px; color: #087e9a; }
.home-workbench-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-workbench-slot { border: 1px dashed #d0e2e6; background: rgba(255, 255, 255, .38); }
.home-schedule-tabs { width: fit-content; min-height: 40px; padding: 3px; display: grid; grid-template-columns: repeat(2, minmax(96px, 1fr)); border: 1px solid #b7dce4; border-radius: 6px; background: #e8f5f7; }
.home-schedule-tabs button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 4px; background: transparent; color: #58727c; font-size: 13px; font-weight: 750; cursor: pointer; }
.home-schedule-tabs button[aria-selected="true"] { background: #fff; color: #087e9a; box-shadow: 0 2px 7px rgba(8, 126, 154, .12); }
.home-schedule-panel { min-width: 0; min-height: 150px; color: #738a92; }
.home-schedule-panel[hidden] { display: none; }
.home-schedule-panel-heading { min-height: 36px; padding: 8px 2px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #315964; }
.home-schedule-panel-heading > strong { font-size: 12px; font-weight: 750; }
.home-schedule-panel-heading > span { color: #087e9a; font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.home-schedule-list { display: grid; gap: 7px; }
.home-schedule-row { position: relative; min-width: 0; min-height: 54px; padding: 8px 10px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.05fr) 82px minmax(76px, .9fr) 17px; align-items: center; gap: 9px; border: 1px solid #c5e1e7; border-radius: 6px; background: #fff; color: var(--ink); }
.home-schedule-row:hover, .home-schedule-row:has(.home-schedule-link:focus-visible) { border-color: #087e9a; background: #f4fbfc; }
.home-schedule-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.home-schedule-link:focus-visible { outline: 2px solid #087e9a; outline-offset: -2px; }
.home-schedule-row > span { min-width: 0; display: grid; align-content: center; gap: 3px; }
.home-schedule-row strong, .home-schedule-row small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-schedule-customer strong, .home-schedule-value strong { color: var(--ink); font-size: 13px; }
.home-schedule-row small { color: #69818a; font-size: 10px; font-variant-numeric: tabular-nums; }
.home-schedule-name-line, .home-schedule-phone-line { min-width: 0; display: flex; align-items: center; gap: 4px; }
.home-schedule-name-line strong, .home-schedule-phone-line small { flex: 1 1 auto; }
.home-schedule-name-line em, .home-schedule-phone-line em { flex: 0 0 auto; font-style: normal; font-weight: 800; white-space: nowrap; }
.home-schedule-consultation { font-size: 10px; }
.home-schedule-consultation.consultation-new { color: #2B65D9; }
.home-schedule-consultation.consultation-returning { color: #E69545; }
.home-schedule-inventory { color: #47717b; font-size: 9px; }
.home-schedule-inventory.inventory-completed { color: #247c45; }
.home-schedule-inventory.inventory-reviewing { color: #816600; }
.home-schedule-location strong { color: #466b75; font-size: 11px; font-weight: 650; }
.home-schedule-state { position: relative; z-index: 2; display: flex !important; min-width: 0; align-items: center; }
.home-schedule-status { width: 82px; min-width: 0; max-width: 100%; min-height: 32px; padding: 5px 18px 5px 7px; border: 0; border-radius: 4px; font: inherit; font-size: 10px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.home-schedule-status.status-scheduled { background: #e8f7fa; color: #087e9a; }
.home-schedule-status.status-arrived { background: #eef8ef; color: #247c45; }
.home-schedule-status.status-deal { background: #fff7cf; color: #816600; }
.home-schedule-status.status-canceled { background: #f1f3f4; color: #73838a; }
.home-schedule-value { justify-items: end; text-align: right; }
.home-schedule-value strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.home-schedule-row > svg { width: 16px; height: 16px; color: #85aab3; }
.home-schedule-empty { min-height: 112px; display: grid; place-items: center; align-content: center; gap: 8px; color: #738a92; }
.home-schedule-empty svg { width: 27px; height: 27px; color: #8fb7c0; }
.home-schedule-empty strong { font-size: 13px; font-weight: 650; }
.home-schedule-error { min-height: 112px; padding: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #f0c9c4; border-radius: 6px; background: #fff6f4; color: #a94438; }
.home-schedule-error > svg { width: 22px; height: 22px; }
.home-schedule-error .button { margin-left: 5px; }

@media (max-width: 760px) {
  .account-navigation-feedback { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; max-width: none; }
  .home-shell { width: 100%; padding-top: 10px; }
  .home-layout { height: auto; min-height: calc(100dvh - 58px - 96px); grid-template-rows: 25dvh 25dvh auto; gap: 9px; }
  .home-zone { min-height: 0; padding-top: 8px; overflow: hidden; }
  .home-zone-heading { min-height: 39px; align-items: center; }
  .home-zone-heading.compact { min-height: 32px; }
  .home-zone-heading h1 { font-size: 21px; }
  .home-zone-heading h2 { font-size: 15px; }
  .home-zone-heading .eyebrow { margin-bottom: 1px; font-size: 10px; }
  .home-demo-tag { padding: 4px 6px; font-size: 9px; }
  .home-metric-grid { height: calc(100% - 39px); gap: 6px; }
  .home-metric-placeholder { min-height: 0; height: 100%; padding: 7px 3px; grid-template-columns: 1fr; grid-template-rows: 20px auto 18px; justify-items: center; gap: 1px; text-align: center; }
  .home-metric-placeholder svg { width: 18px; height: 18px; }
  .home-metric-placeholder span { width: 100%; font-size: 9px; }
  .home-metric-placeholder strong { font-size: 15px; }
  .home-workbench-grid { height: calc(100% - 32px); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .home-workbench-item, .home-workbench-slot { min-height: 0; height: 100%; border-radius: 5px; }
  .home-workbench-item { padding: 3px 2px; gap: 3px; font-size: 10px; }
  .home-workbench-item svg { width: 20px; height: 20px; }
  .home-schedule { display: flex; flex-direction: column; overflow: visible; }
  .home-schedule > .home-zone-heading, .home-schedule-tabs { flex: 0 0 auto; }
  .home-schedule-tabs { width: 100%; min-height: 36px; grid-template-columns: repeat(2, 1fr); }
  .home-schedule-tabs button { min-height: 30px; padding: 0 8px; font-size: 12px; }
  .home-schedule-panel { min-height: 0; flex: 0 0 auto; overflow-y: visible; overscroll-behavior: auto; }
  .home-schedule-error { flex: 0 0 auto; }
  .home-schedule-panel-heading { min-height: 30px; padding: 5px 1px; }
  .home-schedule-row { min-height: 62px; padding: 7px 8px; grid-template-columns: minmax(86px, 1.35fr) minmax(45px, .75fr) 72px minmax(48px, .65fr) 13px; gap: 4px; }
  .home-schedule-customer strong, .home-schedule-value strong { font-size: 11px; }
  .home-schedule-location strong { font-size: 10px; }
  .home-schedule-row small { font-size: 9px; }
  .home-schedule-name-line, .home-schedule-phone-line { gap: 3px; }
  .home-schedule-consultation { font-size: 9px; }
  .home-schedule-inventory { font-size: 8px; }
  .home-schedule-status { width: 72px; min-height: 34px; padding: 6px 16px 6px 6px; font-size: 9px; }
  .home-schedule-row > svg { width: 14px; height: 14px; }
  .home-schedule-empty, .home-schedule-error { min-height: 90px; }
  .home-schedule-empty svg, .home-schedule-error > svg { width: 23px; height: 23px; }
  .home-schedule-empty strong, .home-schedule-error strong { font-size: 12px; }
  .home-schedule-error { padding: 12px 8px; gap: 7px; }
  .home-schedule-error .button { min-height: 30px; padding: 4px 8px; font-size: 11px; }
}

.task-checkboxes ul { margin: 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.task-checkboxes label { min-height: 52px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; border: 1px solid #cbdde1; border-radius: 6px; background: #f7fbfc; font-size: 13px; }
.task-checkboxes input { width: 20px; height: 20px; accent-color: var(--green); }
.suture-hint { width: fit-content; margin-top: 2px; padding: 5px 7px; display: inline-flex; align-items: center; gap: 5px; border-radius: 4px; background: #fff8d5; color: #725d00; font-size: 11px; font-weight: 700; }
.suture-hint svg { width: 14px; height: 14px; }
.owner-editor { margin: -8px 0 22px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.owner-editor summary { min-height: 46px; padding: 0 14px; display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 13px; font-weight: 750; cursor: pointer; }
.owner-editor summary svg { width: 17px; }
.owner-editor form { padding: 12px 14px; display: flex; gap: 10px; border-top: 1px solid var(--line); }
.owner-editor .form-control { flex: 1; }

.rule-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(260px, 340px); align-items: start; gap: 18px; }
.rule-form { max-width: none; }
.rule-preview { margin: 0 0 20px; padding: 14px; border: 1px solid #cfe2e6; border-radius: 6px; background: #f5fafb; }
.rule-preview > small { color: var(--muted); font-size: 11px; }
.rule-preview > div { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 7px; }
.rule-preview span { padding: 6px 9px; border-radius: 4px; background: #e4f3f5; color: #076f82; font-size: 12px; font-weight: 750; }
.rule-note { padding: 12px; display: flex; gap: 9px; border-left: 3px solid var(--sun); background: #fffbe8; }
.rule-note svg { width: 18px; flex: 0 0 auto; }
.rule-note p { margin: 0; color: #5f5b40; font-size: 12px; line-height: 1.6; }
.rule-forecast { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.rule-forecast > header { min-height: 68px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.rule-forecast > header > svg { color: var(--green); }
.rule-forecast h2, .rule-forecast small { margin: 0; }
.rule-forecast h2 { font-size: 16px; }
.rule-forecast small, .rule-forecast > p { color: var(--muted); font-size: 10px; }
.rule-forecast dl { margin: 0; padding: 8px 14px; }
.rule-forecast dl > div { min-height: 44px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e5edef; }
.rule-forecast dt { color: var(--muted); font-size: 12px; }
.rule-forecast dd { margin: 0; font-weight: 800; }
.rule-forecast .forecast-total dd { color: var(--green); font-size: 20px; }
.rule-forecast > p { margin: 0; padding: 10px 14px 14px; }

.routing-summary { margin-bottom: 14px; padding: 11px 14px; display: flex; gap: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.routing-summary span { display: grid; gap: 2px; }
.routing-summary small { color: var(--muted); font-size: 11px; }
.routing-summary strong { color: var(--green); font-size: 20px; }
.routing-layout { display: grid; grid-template-columns: minmax(300px, 420px) minmax(360px, 1fr); align-items: start; gap: 18px; }
.city-route-list { border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.city-route-list a { min-height: 64px; padding: 9px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); color: var(--ink); }
.city-route-list a:last-child { border-bottom: 0; }
.city-route-list a:hover, .city-route-list a.current { background: #eef9fb; }
.city-route-list a.current { box-shadow: inset 3px 0 var(--green); }
.city-route-list a > span { min-width: 0; display: grid; gap: 4px; }
.city-route-list strong { font-size: 13px; }
.city-route-list small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.city-route-list b { color: var(--green); font-size: 12px; }
.city-route-list svg { width: 16px; color: var(--muted); }
.routing-form { max-width: none; }
.routing-form > header { margin-bottom: 14px; }
.routing-form > header h2 { margin: 2px 0 0; font-size: 21px; }
.routing-form .rule-note { margin-bottom: 18px; }
.routing-employees ul { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; }
.routing-employees label { min-height: 48px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; border: 1px solid #cbdde1; border-radius: 6px; background: #f7fbfc; font-size: 13px; font-weight: 700; cursor: pointer; }
.routing-employees label:has(input:checked) { border-color: #75bdc9; background: #eaf6f8; color: #076e80; }
.routing-employees input { width: 20px; height: 20px; accent-color: var(--green); }
.routing-empty { min-height: 112px; padding: 18px; display: grid; place-items: center; gap: 5px; border: 1px dashed #b9d3d9; border-radius: 6px; background: #f7fbfc; text-align: center; }
.routing-empty svg { width: 25px; color: var(--green); }
.routing-empty strong { font-size: 14px; }
.routing-empty span { color: var(--muted); font-size: 11px; }
.branding-settings-layout { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: 260px minmax(0,1fr); align-items: start; gap: 16px; }
.branding-preview { padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #f7fcfd; }
.brand-preview-line { margin: 12px 0 16px; display: flex; align-items: center; gap: 10px; }
.brand-preview-line > span:last-child { min-width: 0; display: grid; gap: 2px; }
.brand-preview-line strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.brand-preview-line small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.branding-preview > p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.branding-form { margin: 0; }

@media (max-width: 760px) {
  .filter-body { padding: 10px 10px 3px; }
  .filter-basic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .filter-date-range { grid-column: 1 / -1; }
  .filter-staff-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .filter-basic-grid .form-control, .filter-staff-grid .form-control { min-width: 0; min-height: 42px; padding-inline: 9px; font-size: 12px; }
  .filter-date-range label { grid-template-columns: 16px minmax(0,1fr); }
  .active-filter-chips { margin-inline: -1px; padding-bottom: 2px; }
  .upcoming-followups { margin-top: -4px; padding-inline: 11px; }
  .upcoming-followups > span small { white-space: normal; }
  .existing-attachments-readonly > div { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .existing-attachments-readonly .attachment-action-trigger { position: absolute; z-index: 2; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.9); border-radius: 50%; background: rgba(255,255,255,.9); color: #286779; box-shadow: 0 2px 6px rgba(20,64,73,.2); cursor: pointer; touch-action: manipulation; }
  .existing-attachments-readonly .attachment-action-trigger:focus-visible { outline: 2px solid rgba(240,207,53,.85); outline-offset: 2px; }
  .existing-attachments-readonly .attachment-action-trigger svg { width: 14px; height: 14px; stroke-width: 2.4; }
  .existing-attachments-readonly .attachment-delete-button { display: none; width: 24px; height: 24px; top: 4px; right: 4px; }
  .existing-attachments-readonly .attachment-delete-button svg { width: 13px; height: 13px; stroke-width: 2.4; }
  .existing-attachments-readonly .attachment-item.attachment-actions-open .attachment-action-trigger { display: none; }
  .existing-attachments-readonly .attachment-item.attachment-actions-open .attachment-delete-button { display: grid; }
  .branding-settings-layout { grid-template-columns: 1fr; }
  .branding-preview { padding: 14px; }
  .branding-form { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .roster-dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: min(82dvh, 700px); margin: 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 8px 8px 0 0; }
  .roster-dialog > header { min-height: 66px; }
  .roster-dialog-body { padding: 10px 12px; }
  .task-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-stat { min-height: 78px; padding: 10px; display: grid; align-content: center; gap: 5px; }
  .task-stat span { font-size: 11px; }
  .task-stat strong { font-size: 25px; }
  .task-stat.warning { grid-column: 1 / -1; min-height: 58px; display: flex; }
  .team-board { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .team-board > header { padding-inline: 14px; }
  .team-board > header > span { display: none; }
  .team-scroll { overflow-x: auto; }
  .team-row { min-width: 560px; }
  .task-filter { align-items: stretch; flex-wrap: wrap; }
  .segmented-control { flex: 1 1 100%; }
  .segmented-control a { flex: 1; }
  .task-filter .form-control { flex: 1; min-width: 0; font-size: 14px; }
  .task-type-tabs { margin-inline: -14px; padding: 0 14px 2px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
  .task-type-tabs a { min-width: 0; justify-content: space-between; }
  .task-list .empty-page { min-height: 170px; padding-top: 8px; place-content: start center; }
  .task-list .empty-page svg { width: 28px; height: 28px; margin-bottom: 6px; }
  .task-list .empty-page h2 { margin-bottom: 4px; font-size: 17px; }
  .task-list .empty-page p { font-size: 11px; }
  .task-list { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .task-item, .task-item:has(.task-select) { padding: 13px 14px; grid-template-columns: minmax(0, 1fr) auto; }
  .task-item:has(.task-select) .task-select { display: none; }
  .task-main { grid-template-columns: 38px minmax(0, 1fr); }
  .task-action { width: 44px; min-width: 44px; padding: 0; font-size: 0; }
  .task-action svg { width: 19px; }
  .bulk-task-bar { display: none; }
  .inventory-grid { grid-template-columns: 1fr; gap: 10px; }
  .inventory-card { min-height: 105px; padding: 14px; grid-template-columns: 42px minmax(0, 1fr) auto 16px; gap: 10px; }
  .inventory-icon { width: 42px; height: 42px; }
  .inventory-copy strong { font-size: 15px; }
  .inventory-count { min-width: 64px; }
  .inventory-count b { font-size: 27px; }
  .inventory-placeholder { min-height: 58px; }
  .inventory-customer-list, .risk-list { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .inventory-customer-row { min-height: 88px; padding-inline: 14px; grid-template-columns: 40px minmax(0, 1fr) auto 16px; gap: 9px; }
  .inventory-customer-row .last-date { grid-column: 2 / 4; }
  .risk-toolbar { grid-template-columns: 1fr; }
  .risk-toolbar .segmented-control { min-height: 44px; }
  .risk-row { min-height: 136px; padding-inline: 14px; grid-template-columns: 34px minmax(0, 1fr) auto 16px; gap: 7px 8px; }
  .risk-date { display: grid; grid-column: 2 / 4; grid-row: 2; }
  .risk-category { grid-column: 2 / 4; grid-row: 3; }
  .risk-summary { grid-column: 2 / 4; grid-row: 4; }
  .risk-date small, .risk-category small, .risk-summary small { white-space: normal; }
  .risk-row > .status-badge { grid-column: 3; grid-row: 1; }
  .risk-row > svg { grid-column: 4; grid-row: 1 / 5; }
  .owner-editor { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .owner-editor form { flex-direction: column; }
  .rule-layout { grid-template-columns: 1fr; }
  .rule-layout .record-form { margin-bottom: 0; }
  .rule-forecast { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .routing-summary { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .routing-layout { grid-template-columns: 1fr; }
  .city-route-list { margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .city-route-list a { padding-inline: 14px; }
  .routing-form { order: -1; margin-inline: -14px; border-left: 0; border-right: 0; border-radius: 0; }
  .routing-employees ul { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .filter-date-range > div { grid-template-columns: 1fr; gap: 6px; }
  .filter-date-range > div > svg { display: none; }
  .filter-date-range label { grid-template-columns: 18px minmax(0,1fr); }
  .staff-filter-group > summary small { display: none; }
  .staff-filter-group > summary span { min-width: 0; }
  .filter-actions .button { white-space: nowrap; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Keep the homepage metrics area visible when the mobile schedule remains naturally scrollable. */
.home-metrics-zone { overflow: visible; }
@media (max-width: 760px) {
  .home-layout { grid-template-rows: auto 25dvh auto; }
  .home-metrics-zone { overflow: visible; }
}

/* Schedule center */
.schedule-shell { max-width: 1280px; }
.schedule-heading { align-items: center; }
.schedule-filter-panel { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.schedule-filter-panel .search-bar { margin-bottom: 12px; }
.schedule-quick-filters { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; }
.schedule-quick-filters label, .schedule-advanced-filters label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.schedule-filter-panel .filter-details { margin-top: 10px; }
.schedule-filter-panel .filter-details summary { width: fit-content; min-height: 32px; display: flex; align-items: center; gap: 6px; color: #426772; font-size: 11px; font-weight: 750; cursor: pointer; }
.schedule-filter-panel .filter-details summary svg { width: 15px; }
.schedule-advanced-filters { margin-top: 8px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.schedule-filter-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }
.schedule-week-nav { margin-bottom: 14px; padding: 9px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; border: 1px solid #c5e1e7; border-radius: 6px; background: #edf8fa; }
.schedule-week-actions { display: flex; align-items: center; gap: 5px; }
.schedule-week-actions a { min-width: 32px; height: 32px; padding: 0 8px; display: grid; place-items: center; border: 1px solid #b9dce3; border-radius: 4px; background: #fff; color: #315d68; font-size: 10px; font-weight: 750; }
.schedule-week-actions svg { width: 15px; }
.schedule-week-days { min-width: 0; display: grid; grid-template-columns: repeat(7, minmax(62px, 1fr)); gap: 5px; }
.schedule-week-days a { min-width: 0; min-height: 54px; padding: 6px 4px; display: grid; justify-items: center; align-content: center; gap: 1px; border: 1px solid transparent; border-radius: 5px; color: #466873; background: rgba(255,255,255,.72); }
.schedule-week-days a.selected { border-color: #087e9a; color: #fff; background: #087e9a; }
.schedule-week-days small, .schedule-week-days span { font-size: 9px; }
.schedule-week-days strong { font-size: 11px; font-variant-numeric: tabular-nums; }
.schedule-results > header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.schedule-results > header h2 { margin: 1px 0 0; font-size: 19px; }
.schedule-results > header > strong { color: #087e9a; font-size: 14px; }
.schedule-date-heading { margin: 12px 0 6px; display: flex; align-items: center; justify-content: space-between; color: #315d68; font-size: 13px; }
.schedule-date-heading span { color: var(--muted); font-size: 10px; }
.schedule-card-list { display: grid; gap: 7px; }
.schedule-card { min-width: 0; padding: 11px 13px 0; border: 1px solid #c8e0e5; border-radius: 6px; background: #fff; }
.schedule-card-customer { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto auto 82px; align-items: center; gap: 7px; }
.schedule-card-customer > a { min-width: 0; display: flex; align-items: center; gap: 4px; color: var(--ink); }
.schedule-card-customer > a strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.schedule-card-customer > a svg { width: 15px; color: #84a5ae; }
.schedule-card-customer > em { font-style: normal; font-weight: 800; }
.schedule-card-grid { margin-top: 9px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 7px; }
.schedule-card-grid span { min-width: 0; display: grid; gap: 2px; }
.schedule-card-grid small { color: var(--muted); font-size: 9px; }
.schedule-card-grid strong { overflow: hidden; color: #315d68; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.schedule-card-note { margin: 8px 0 0; overflow: hidden; color: #58727c; font-size: 10px; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.schedule-card > footer { min-height: 34px; margin-top: 8px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid #e0ecef; }
.schedule-card > footer > span { margin-right: auto; color: var(--muted); font-size: 9px; }
.schedule-card > footer a, .schedule-card > footer button { padding: 0; border: 0; color: #087e9a; background: transparent; font-size: 10px; cursor: pointer; }
.schedule-card > footer button { color: #b34a40; }
.schedule-customer-search { margin-bottom: 14px; }
.schedule-customer-results { display: grid; gap: 7px; }
.schedule-customer-results > a { min-height: 62px; padding: 8px 11px; display: grid; grid-template-columns: 36px minmax(0, 1fr) 20px; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.schedule-customer-results > a > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.schedule-customer-results strong, .schedule-customer-results small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-customer-results small { color: var(--muted); font-size: 10px; }
.schedule-customer-results svg { width: 17px; color: #087e9a; }

@media (max-width: 760px) {
  .schedule-filter-panel { padding: 10px; }
  .schedule-quick-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .schedule-quick-filters label:first-child { grid-column: 1 / -1; }
  .schedule-advanced-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-week-nav { padding: 7px; grid-template-columns: 1fr; }
  .schedule-week-actions { justify-content: center; }
  .schedule-week-days { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .schedule-week-days a { min-height: 49px; padding: 4px 1px; }
  .schedule-week-days small, .schedule-week-days span { font-size: 8px; }
  .schedule-week-days strong { font-size: 9px; }
  .schedule-card { padding: 9px 9px 0; }
  .schedule-card-customer { grid-template-columns: minmax(0, 1fr) auto auto 72px; gap: 5px; }
  .schedule-card-customer > a strong { font-size: 13px; }
  .schedule-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 9px; }
  .schedule-card-grid small { font-size: 8px; }
  .schedule-card-grid strong { font-size: 10px; }
  .schedule-card-note { font-size: 9px; }
}

/* Meeting operations: compact operational reporting, consistent with the existing workspace. */
.meeting-shell { max-width: 1280px; }
.meeting-heading { align-items: center; }
.meeting-heading > div:first-child { min-width: 0; }
.meeting-heading h1, .meeting-subtitle { overflow-wrap: anywhere; }
.meeting-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.meeting-filter { margin-bottom: 12px; display: flex; align-items: end; gap: 7px; }
.meeting-filter label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.meeting-filter .form-control { width: 150px; min-height: 36px; font-size: 11px; }
.meeting-filter .button { min-height: 36px; }
.meeting-list { display: grid; gap: 7px; }
.meeting-row { min-width: 0; min-height: 70px; padding: 9px 10px; display: grid; grid-template-columns: 52px minmax(0, 1fr) 58px 34px; align-items: center; gap: 10px; border: 1px solid #c8e0e5; border-radius: 6px; background: #fff; }
.meeting-row:hover { border-color: #78bdc8; background: #fbfeff; }
.meeting-row.is-canceled { opacity: .72; }
.meeting-row > time { height: 49px; display: grid; place-content: center; justify-items: center; border-right: 1px solid #dcebed; font-variant-numeric: tabular-nums; }
.meeting-row > time strong { color: #0b6578; font-size: 17px; line-height: 1; }
.meeting-row > time small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.meeting-row-main { min-width: 0; display: grid; gap: 5px; color: var(--ink); }
.meeting-row-main > span { min-width: 0; display: flex; align-items: center; gap: 7px; }
.meeting-row-main strong, .meeting-row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meeting-row-main strong { font-size: 14px; }
.meeting-row-main small { color: var(--muted); font-size: 10px; }
.meeting-row-main em, .meeting-appointment-badge { min-height: 21px; padding: 2px 6px; display: inline-flex; align-items: center; border: 1px solid #9acbd4; border-radius: 4px; color: #176579; background: #e7f5f7; font-size: 9px; font-style: normal; font-weight: 800; white-space: nowrap; }
.meeting-row.is-canceled .meeting-row-main em { border-color: #ccd4d7; color: #6f7f84; background: #f1f3f4; }
.meeting-appointment-badge { border-color: #ddb873; color: #875716; background: #fff5df; }
.meeting-appointment-badge.is-normal { border-color: #cedde0; color: #60777e; background: #f4f7f8; }
.meeting-row-count { display: grid; justify-items: end; gap: 2px; }
.meeting-row-count strong { color: var(--ink); font-size: 19px; font-variant-numeric: tabular-nums; }
.meeting-row-count small { color: var(--muted); font-size: 9px; }
.meeting-summary { margin-bottom: 15px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.meeting-summary article { min-width: 0; min-height: 86px; padding: 12px 14px; display: grid; align-content: center; gap: 4px; border-right: 1px solid #dcebed; }
.meeting-summary article:last-child { border-right: 0; }
.meeting-summary small, .meeting-summary span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.meeting-summary strong { overflow: hidden; color: var(--ink); font-size: 25px; line-height: 1; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.meeting-summary article:nth-child(2) strong { color: #23794b; }
.meeting-summary article:nth-child(3) strong { color: #956218; }
.meeting-summary article:nth-child(4) strong { color: #245e9c; }
.meeting-split, .meeting-owner-section, .meeting-customer-section { margin-top: 15px; }
.meeting-split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.meeting-split-grid article { min-width: 0; min-height: 90px; padding: 14px 16px; display: grid; grid-template-columns: 54px repeat(4, minmax(0, 1fr)); align-items: center; gap: 9px; }
.meeting-split-grid article + article { border-left: 1px solid var(--line); }
.meeting-split-grid article > strong { color: #2b65d9; font-size: 14px; }
.meeting-split-grid article + article > strong { color: #b96a22; }
.meeting-split-grid span { min-width: 0; display: grid; gap: 2px; }
.meeting-split-grid b { overflow: hidden; color: var(--ink); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meeting-split-grid small { color: var(--muted); font-size: 9px; }
.meeting-table { width: 100%; border-collapse: collapse; }
.meeting-table th, .meeting-table td { padding: 10px 12px; border-bottom: 1px solid #e2edef; text-align: left; white-space: nowrap; }
.meeting-table th { color: var(--muted); background: #f6fafb; font-size: 9px; }
.meeting-table td { color: #315d68; font-size: 11px; font-variant-numeric: tabular-nums; }
.meeting-table tbody tr:last-child td { border-bottom: 0; }
.meeting-customer-list { display: grid; gap: 5px; padding: 7px; }
.meeting-customer-list article { min-width: 0; min-height: 62px; padding: 8px 10px; display: grid; grid-template-columns: minmax(190px, 1.4fr) repeat(3, minmax(85px, .7fr)); align-items: center; gap: 10px; border: 1px solid #d5e6e9; border-radius: 6px; background: #fff; }
.meeting-customer-list article > a { min-width: 0; display: flex; align-items: center; gap: 8px; }
.meeting-customer-list article > a > span:last-child, .meeting-customer-list article > span { min-width: 0; display: grid; gap: 2px; }
.meeting-customer-list strong, .meeting-customer-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meeting-customer-list strong { color: var(--ink); font-size: 11px; }
.meeting-customer-list small { color: var(--muted); font-size: 9px; }
.meeting-cancel { margin-top: 16px; display: flex; justify-content: flex-end; }
.meeting-target-form { padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.meeting-target-table input { width: 112px; min-height: 38px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; font: inherit; font-size: 11px; }
.meeting-target-table td:first-child { min-width: 120px; }
.meeting-correction-field { max-width: 620px; margin-top: 15px; display: grid; gap: 5px; }
.meeting-correction-field label { color: #294650; font-size: 12px; font-weight: 750; }
.meeting-correction-field textarea { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 5px; font: inherit; resize: vertical; }
.meeting-correction-field > small:not(.field-error) { color: var(--muted); font-size: 9px; }
.record-form [data-field-name="meeting"][hidden] { display: none; }
.record-form .meeting-field-locked { opacity: .82; }
.record-form .meeting-field-locked input, .record-form .meeting-field-locked [data-inline-choice-control] { pointer-events: none; background: #f1f5f6; }
.meeting-venue-hint { display: block; margin-top: 5px; color: #7d5a22; font-size: 10px; }

@media (max-width: 900px) {
  .schedule-quick-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .schedule-week-nav { grid-template-columns: 1fr; }
  .schedule-week-actions { justify-content: center; }
  .schedule-week-days { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .operations-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "customer actions" "stage actions" "next actions" "tags actions"; align-items: center; min-height: 92px; }
  .operations-actions { flex-direction: column; }
  .meeting-heading { align-items: flex-start; flex-direction: column; }
  .meeting-heading .heading-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meeting-heading .heading-actions .button:last-child:nth-child(3) { grid-column: 1 / -1; }
  .meeting-split-grid { grid-template-columns: 1fr; }
  .meeting-split-grid article + article { border-top: 1px solid var(--line); border-left: 0; }
  .meeting-customer-list article { grid-template-columns: minmax(170px, 1.2fr) repeat(3, minmax(70px, .7fr)); }
}

@media (max-width: 760px) {
  .schedule-quick-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meeting-heading { align-items: flex-start; }
  .meeting-heading .heading-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meeting-heading .heading-actions .button:last-child:nth-child(3) { grid-column: 1 / -1; }
  .meeting-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
  .meeting-filter label, .meeting-filter .form-control { width: 100%; }
  .meeting-row { min-height: 66px; padding: 7px 8px; grid-template-columns: 45px minmax(0, 1fr) 42px 28px; gap: 6px; }
  .meeting-row > time { height: 44px; }
  .meeting-row > time strong { font-size: 14px; }
  .meeting-row-main strong { font-size: 12px; }
  .meeting-row-main small { font-size: 9px; }
  .meeting-row-count strong { font-size: 16px; }
  .meeting-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meeting-summary article { min-height: 70px; padding: 9px 10px; border-bottom: 1px solid #dcebed; }
  .meeting-summary article:nth-child(2) { border-right: 0; }
  .meeting-summary article:nth-last-child(-n+2) { border-bottom: 0; }
  .meeting-summary strong { font-size: 20px; }
  .meeting-split, .meeting-owner-section, .meeting-customer-section { margin-inline: -14px; border-right: 0; border-left: 0; border-radius: 0; }
  .meeting-split-grid { grid-template-columns: 1fr; }
  .meeting-split-grid article { min-height: 76px; padding: 10px 14px; grid-template-columns: 42px repeat(4, minmax(0, 1fr)); gap: 5px; }
  .meeting-split-grid article + article { border-top: 1px solid var(--line); border-left: 0; }
  .meeting-split-grid b { font-size: 12px; }
  .meeting-customer-list article { min-height: 72px; grid-template-columns: minmax(0, 1fr) repeat(3, minmax(53px, .55fr)); gap: 5px; }
  .meeting-customer-list .avatar { width: 30px; height: 30px; }
  .meeting-customer-list strong { font-size: 10px; }
  .meeting-customer-list small { font-size: 8px; }
  .meeting-target-form { margin-inline: -8px; padding: 9px; }
  .meeting-target-table input { width: 90px; }
}

/* Customer feedback and survey */
.identity-title-row { min-width: 0; display: flex; align-items: center; gap: 8px; }
.identity-title-row h1 { flex: 0 0 auto; }
.customer-tag-strip { width: 260px; min-height: 27px; padding: 2px 0; display: flex; align-items: center; gap: 5px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.customer-tag { min-height: 23px; padding: 3px 7px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 1px solid currentColor; border-radius: 5px; font-size: 10px; font-style: normal; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.customer-tag.is-automatic.tag-red { color: #9e3737; border-color: #e6a5a1; background: #f7d8d5; }
.customer-tag.is-automatic.tag-orange { color: #8b571f; border-color: #edc38d; background: #f9e5ca; }
.customer-tag.is-automatic.tag-purple { color: #69498f; border-color: #cbb8df; background: #e9dff2; }
.customer-tag.is-automatic.tag-green { color: #176a58; border-color: #91cdbd; background: #d4eee6; }
.customer-tag.is-automatic.tag-blue { color: #285b9e; border-color: #a9c3e4; background: #dce9f7; }
.customer-tag.is-automatic.tag-teal { color: #176579; border-color: #9fcbd5; background: #d9edf1; }
.customer-tag.is-manual { background: #fff; }
.customer-tag.is-manual.tag-red { color: #b5524d; border-color: #e5aaa6; }
.customer-tag.is-manual.tag-orange { color: #9b681f; border-color: #e7c185; }
.customer-tag.is-manual.tag-purple { color: #76579a; border-color: #c5b3d8; }
.customer-tag.is-manual.tag-green { color: #287361; border-color: #8fc9b9; }
.customer-tag.is-manual.tag-blue { color: #3565a0; border-color: #9fbce0; }
.customer-tag.is-manual.tag-teal { color: #287084; border-color: #96c5d0; }

.customer-tag-picker { position: relative; flex: 0 0 auto; }
.customer-tag-picker > summary { list-style: none; }
.customer-tag-picker > summary::-webkit-details-marker { display: none; }
.customer-tag-picker > div { position: absolute; z-index: 35; top: calc(100% + 6px); left: 0; width: 230px; padding: 8px; border: 1px solid #badbe2; border-radius: 6px; background: #fff; box-shadow: 0 12px 30px rgba(23,59,74,.16); }
.customer-tag-picker input { width: 100%; min-height: 36px; padding: 0 9px; border: 1px solid #bdd6dc; border-radius: 5px; color: var(--ink); }
.customer-tag-picker [data-tag-options] { max-height: 220px; margin-top: 7px; display: grid; gap: 3px; overflow-y: auto; }
.customer-tag-picker [data-tag-toggle] { min-height: 34px; padding: 3px 5px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.customer-tag-picker [data-tag-toggle]:hover { background: #edf8fa; }
.customer-tag-picker [data-tag-toggle] svg { width: 15px; opacity: 0; color: var(--green); }
.customer-tag-picker [data-tag-toggle].is-selected svg { opacity: 1; }
.customer-tag-picker [data-tag-empty] { margin: 8px 0 2px; color: var(--muted); font-size: 11px; text-align: center; }

.detail-actions { position: relative; }
.survey-link-control { position: relative; }
.survey-link-control > summary { list-style: none; }
.survey-link-control > summary::-webkit-details-marker { display: none; }
.survey-link-control > div { position: absolute; z-index: 32; top: calc(100% + 7px); right: 0; width: min(430px, calc(100vw - 34px)); padding: 12px; display: grid; gap: 8px; border: 1px solid #b8dce3; border-radius: 7px; background: #fff; box-shadow: 0 14px 34px rgba(23,59,74,.16); }
.survey-link-control input { width: 100%; min-height: 38px; padding: 0 9px; border: 1px solid #c0d8de; border-radius: 5px; color: #315d68; font-size: 11px; }
.survey-link-control [data-survey-link-expiry] { color: var(--muted); font-size: 10px; }
.survey-link-control [data-survey-link-message] { min-height: 16px; margin: 0; color: #18735f; font-size: 11px; }
.survey-link-control [data-survey-link-message].is-error { color: #b74640; }
.survey-link-control > div > div { display: flex; flex-wrap: wrap; gap: 6px; }

.customer-feedback-section { margin-top: 20px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.customer-feedback-section > header, .feedback-list-section > header, .tag-library section > header { min-height: 38px; display: flex; align-items: center; justify-content: space-between; }
.customer-feedback-section > header > span, .feedback-list-section > header > span, .tag-library section > header > span { color: var(--muted); font-size: 11px; }
.customer-feedback-list { display: grid; gap: 7px; }
.customer-feedback-item { border: 1px solid #c5dfe4; border-radius: 6px; background: #fff; scroll-margin-top: 88px; }
.customer-feedback-item.is-invalid { opacity: .7; }
.customer-feedback-item > summary { min-height: 56px; padding: 8px 11px; display: grid; grid-template-columns: 130px 56px minmax(0,1fr) auto 18px; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.customer-feedback-item > summary::-webkit-details-marker { display: none; }
.customer-feedback-item > summary time { color: #456670; font-size: 11px; font-weight: 700; }
.customer-feedback-item > summary > svg { width: 17px; transition: transform .18s ease; }
.customer-feedback-item[open] > summary > svg { transform: rotate(180deg); }
.feedback-score { display: flex; align-items: baseline; gap: 3px; color: #087e9a; }
.feedback-score strong { font-size: 18px; }
.feedback-score small { color: var(--muted); font-size: 9px; }
.feedback-item-tags, .feedback-row-tags { min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.feedback-validity { padding: 3px 6px; border-radius: 4px; background: #dff2ec; color: #1d715d; font-size: 9px; font-weight: 750; }
.feedback-validity.is-invalid { background: #f2eeee; color: #816d6d; }
.feedback-answer-list { padding: 3px 12px 10px; display: grid; gap: 0; border-top: 1px solid #e3edef; }
.feedback-answer-list dl { margin: 0; padding: 9px 0; display: grid; grid-template-columns: 118px minmax(0,1fr); gap: 10px; border-bottom: 1px solid #edf2f3; }
.feedback-answer-list dt { color: var(--muted); font-size: 10px; font-weight: 700; }
.feedback-answer-list dd { margin: 0; color: #315966; font-size: 12px; line-height: 1.6; }
.feedback-answer-list dd p { margin: 4px 0 0; color: #58727c; }
.feedback-status-form { padding: 10px 12px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; background: #f7fbfc; }
.feedback-status-form label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }

.feedback-filters { margin-bottom: 14px; padding: 12px; border: 1px solid #c7dfe4; border-radius: 7px; background: #fff; }
.feedback-period-tabs { margin-bottom: 10px; display: flex; gap: 2px; border-bottom: 1px solid #dce9ec; }
.feedback-period-tabs button { min-height: 36px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #56727c; font-size: 12px; font-weight: 750; cursor: pointer; }
.feedback-period-tabs button.current { color: #087e9a; border-bottom-color: #087e9a; }
.feedback-filter-grid { display: grid; grid-template-columns: 1.5fr repeat(7,minmax(92px,1fr)) auto; align-items: end; gap: 7px; }
.feedback-filter-grid label { min-width: 0; display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.feedback-filter-grid .form-control { min-width: 0; min-height: 38px; padding-inline: 8px; font-size: 10px; }
.feedback-filter-grid .button { min-height: 38px; padding-inline: 10px; font-size: 11px; }
.feedback-summary { margin-bottom: 15px; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); border-top: 1px solid #b9dce3; border-bottom: 1px solid #b9dce3; background: rgba(255,255,255,.55); }
.feedback-summary > span { min-width: 0; min-height: 68px; padding: 10px; display: grid; align-content: center; gap: 3px; border-right: 1px solid #d6e7ea; }
.feedback-summary > span:last-child { border-right: 0; }
.feedback-summary small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.feedback-summary strong { color: #173b4a; font-size: 21px; font-variant-numeric: tabular-nums; }
.feedback-list { display: grid; gap: 6px; }
.feedback-row { min-height: 62px; padding: 8px 10px; display: grid; grid-template-columns: minmax(130px,1fr) 120px 62px minmax(180px,1.5fr) 42px 18px; align-items: center; gap: 9px; border: 1px solid #c7dfe4; border-radius: 6px; background: #fff; }
.feedback-row:hover { border-color: #79c6d5; background: #f8fcfd; }
.feedback-customer { min-width: 0; display: grid; gap: 2px; }
.feedback-customer strong, .feedback-customer small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedback-customer small, .feedback-row time, .feedback-row-tags > small { color: var(--muted); font-size: 10px; }
.feedback-nps { display: flex; align-items: baseline; gap: 3px; }
.feedback-nps strong { color: #087e9a; font-size: 18px; }
.feedback-nps small { color: var(--muted); font-size: 8px; }
.feedback-row > svg { width: 17px; color: #7d9aa3; }

.tag-settings-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); align-items: start; gap: 18px; }
.tag-editor { padding: 15px; display: grid; gap: 13px; border: 1px solid #bfdde3; border-radius: 7px; background: #fff; }
.tag-editor > label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.tag-editor input[type="text"] { min-height: 42px; padding: 0 10px; border: 1px solid #bdd5dc; border-radius: 5px; }
.tag-editor fieldset { padding: 0; border: 0; }
.tag-editor legend { margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.tag-color-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.tag-color-options label { cursor: pointer; }
.tag-color-options input { position: absolute; opacity: 0; }
.tag-color-options span { min-height: 34px; display: grid; place-items: center; border: 1px solid #c5d8dd; border-radius: 5px; background: #f8fbfc; font-size: 10px; }
.tag-color-red span { border-color: #e5aaa6; background: #fff0ef; color: #9e3737; }
.tag-color-orange span { border-color: #e7c185; background: #fff6e9; color: #8b571f; }
.tag-color-purple span { border-color: #c5b3d8; background: #f5effa; color: #69498f; }
.tag-color-green span { border-color: #8fc9b9; background: #edf9f5; color: #176a58; }
.tag-color-blue span { border-color: #9fbce0; background: #eef5fd; color: #285b9e; }
.tag-color-teal span { border-color: #96c5d0; background: #edf8fa; color: #176579; }
.tag-color-options input:checked + span { outline: 2px solid #087e9a; outline-offset: 1px; }
.tag-editor-actions { display: flex; gap: 7px; }
.tag-library { display: grid; gap: 14px; }
.tag-library section { padding: 12px 14px; border: 1px solid #c6dfe4; border-radius: 7px; background: #fff; }
.tag-library-list { display: grid; gap: 4px; }
.tag-library-list > div { min-height: 42px; padding: 5px 3px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #e5eef0; }
.tag-library-list > div.is-disabled { opacity: .55; }
.tag-library-list > div > small { color: var(--muted); font-size: 10px; }
.failure-reason-row > span:first-child { min-width: 0; }
.failure-reason-row > span:first-child strong { display: block; overflow-wrap: anywhere; }
.failure-reason-row > span:first-child small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-row-actions { margin-left: auto; display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.tag-row-actions form { display: contents; }
.tag-row-actions a, .tag-row-actions button { padding: 0; border: 0; background: transparent; color: #087e9a; font-size: 10px; cursor: pointer; }

@media (max-width: 900px) {
  .tag-settings-layout { grid-template-columns: 1fr; }
}

.survey-public-page { min-height: 100dvh; background: #eef8fa; }
.survey-public-page::before { content: ""; position: fixed; inset: 0 0 auto; height: 7px; background: linear-gradient(90deg,#087e9a 0 44%,#f4d64e 44% 56%,#d95f5b 56% 100%); }
.survey-public-shell { width: min(680px,calc(100% - 28px)); margin: 0 auto; padding: 30px 0 56px; }
.survey-brand { width: fit-content; min-height: 44px; display: inline-flex; align-items: center; gap: 9px; }
.survey-brand .brand-mark { width: 38px; height: 38px; }
.survey-brand strong { font-size: 14px; }
.survey-intro { padding: 36px 0 25px; border-bottom: 1px solid #a9d7df; }
.survey-intro h1 { max-width: 520px; color: #113b49; font-size: 34px; line-height: 1.2; }
.survey-intro p { max-width: 570px; margin: 12px 0 0; color: #4d6e78; font-size: 14px; line-height: 1.8; }
.survey-form { background: #fff; border-bottom: 4px solid #f4d64e; box-shadow: 0 14px 42px rgba(8,126,154,.09); }
.survey-question { margin: 0; padding: 26px 28px; border: 0; border-bottom: 1px solid #dcebee; }
.survey-question legend, .survey-text-question > label { width: 100%; margin-bottom: 15px; display: flex; align-items: flex-start; gap: 10px; color: #173b4a; font-size: 16px; font-weight: 750; line-height: 1.55; }
.survey-question legend b, .survey-text-question > label b { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #087e9a; color: #fff; font-size: 12px; }
.survey-text-question > label em { margin-left: auto; color: #7a8f97; font-size: 10px; font-style: normal; font-weight: 600; }
.survey-option-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.survey-option-grid label { min-width: 0; cursor: pointer; }
.survey-option-grid input { position: absolute; opacity: 0; }
.survey-option-grid span { min-height: 48px; padding: 8px; display: grid; place-items: center; border: 1px solid #bed8de; border-radius: 6px; background: #f8fcfd; color: #365b67; font-size: 13px; font-weight: 700; text-align: center; transition: border-color .15s ease,background .15s ease,color .15s ease,transform .15s ease; }
.survey-option-grid input:checked + span { border-color: #087e9a; background: #087e9a; color: #fff; box-shadow: inset 0 -3px 0 rgba(244,214,78,.85); }
.survey-option-grid input:focus-visible + span { outline: 3px solid rgba(244,214,78,.6); outline-offset: 2px; }
.survey-conditional { position: relative; margin-top: 10px; padding: 10px; border-left: 3px solid #e69545; background: #fff9ef; }
.survey-conditional label { display: block; margin-bottom: 5px; color: #72552e; font-size: 11px; font-weight: 700; }
.survey-form textarea { width: 100%; min-height: 72px; padding: 10px 11px 22px; resize: none; border: 1px solid #bcd5db; border-radius: 5px; color: #173b4a; line-height: 1.65; }
.survey-form textarea:focus { border-color: #087e9a; outline: 3px solid rgba(8,126,154,.12); }
.survey-character-count { display: block; margin: -20px 8px 0 0; position: relative; color: #7b929a; font-size: 9px; text-align: right; pointer-events: none; }
.survey-score-readout { min-height: 48px; display: flex; align-items: baseline; justify-content: center; gap: 3px; color: #087e9a; }
.survey-score-readout strong { font-size: 38px; font-variant-numeric: tabular-nums; }
.survey-score-readout span { color: var(--muted); font-size: 12px; }
.survey-nps-slider { width: 100%; height: 44px; margin: 5px 0 0; appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
.survey-nps-slider::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg,#d95f5b,#f4d64e 58%,#087e9a); }
.survey-nps-slider::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg,#d95f5b,#f4d64e 58%,#087e9a); }
.survey-nps-slider::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -10px; appearance: none; border: 4px solid #fff; border-radius: 50%; background: #173b4a; box-shadow: 0 2px 8px rgba(23,59,74,.32); }
.survey-nps-slider::-moz-range-thumb { width: 22px; height: 22px; border: 4px solid #fff; border-radius: 50%; background: #173b4a; box-shadow: 0 2px 8px rgba(23,59,74,.32); }
.survey-nps-slider:not(.is-touched) { opacity: .45; }
.survey-nps-ticks { display: grid; grid-template-columns: repeat(11,1fr); color: #647d86; font-size: 9px; text-align: center; }
.survey-field-error { margin: 7px 0 0; color: #b74640; font-size: 11px; font-weight: 700; }
.survey-error-banner { margin: 12px 0; padding: 11px 13px; border: 1px solid #e2aaa7; border-radius: 6px; background: #fff3f2; color: #9b3f3b; font-size: 12px; }
.survey-consent { margin: 22px 28px 14px; display: flex; align-items: flex-start; gap: 9px; color: #536e78; font-size: 11px; line-height: 1.65; cursor: pointer; }
.survey-consent input { width: 19px; height: 19px; margin: 0; flex: 0 0 auto; accent-color: #087e9a; }
.survey-submit { width: calc(100% - 56px); min-height: 52px; margin: 0 28px 28px; border: 0; border-radius: 7px; background: #087e9a; color: #fff; box-shadow: 0 7px 18px rgba(8,126,154,.2); font-size: 15px; font-weight: 800; cursor: pointer; }
.survey-submit:disabled { opacity: .65; cursor: wait; }
.survey-result { min-height: 360px; padding: 72px 20px; display: grid; justify-items: center; align-content: center; text-align: center; }
.survey-result > span { width: 62px; height: 62px; display: grid; place-items: center; border: 2px solid #9ccbd4; border-radius: 50%; color: #5f7e87; font-size: 32px; }
.survey-result.success > span { border-color: #65b8a3; color: #18735f; }
.survey-result h1 { margin-top: 20px; }
.survey-result p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 980px) {
  .feedback-filter-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .feedback-filter-grid label:first-child { grid-column: span 2; }
  .feedback-row { grid-template-columns: minmax(120px,1fr) 105px 55px minmax(140px,1.3fr) 42px 16px; }
}

@media (max-width: 760px) {
  .identity-title-row { flex-wrap: nowrap; }
  .identity-title-row h1 { max-width: 105px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .customer-tag-strip { width: min(205px,calc(100vw - 205px)); }
  .customer-tag-picker > div { right: 0; left: auto; }
  .survey-link-control { position: static; }
  .survey-link-control > div { top: auto; right: 0; left: 0; margin-top: 7px; }
  .customer-feedback-item > summary { grid-template-columns: 92px 44px minmax(0,1fr) auto 16px; gap: 5px; }
  .customer-feedback-item > summary time { font-size: 9px; }
  .feedback-item-tags .customer-tag:nth-child(n+3) { display: none; }
  .feedback-answer-list dl { grid-template-columns: 88px minmax(0,1fr); gap: 7px; }
  .feedback-status-form { grid-template-columns: 1fr; }
  .feedback-period-tabs button { flex: 1; padding-inline: 5px; }
  .feedback-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .feedback-filter-grid label:first-child, .feedback-filter-grid .button { grid-column: 1 / -1; }
  .feedback-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .feedback-summary > span { min-height: 58px; border-bottom: 1px solid #d6e7ea; }
  .feedback-row { min-height: 78px; padding: 8px; grid-template-columns: minmax(0,1fr) 70px 40px 16px; grid-template-areas: "customer nps valid icon" "time tags tags tags"; gap: 4px 7px; }
  .feedback-customer { grid-area: customer; }
  .feedback-row time { grid-area: time; }
  .feedback-nps { grid-area: nps; }
  .feedback-row-tags { grid-area: tags; }
  .feedback-row > .feedback-validity { grid-area: valid; }
  .feedback-row > svg { grid-area: icon; }
  .tag-settings-layout { grid-template-columns: 1fr; }
  .survey-public-shell { width: min(100% - 20px,680px); padding-top: 22px; }
  .survey-intro { padding: 28px 5px 20px; }
  .survey-intro h1 { font-size: 27px; }
  .survey-intro p { font-size: 12px; }
  .survey-question { padding: 30px 16px 22px; }
  .survey-question legend, .survey-text-question > label { font-size: 14px; }
  .survey-option-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .survey-option-grid:not(.compact) label:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .survey-option-grid span { min-height: 50px; font-size: 12px; }
  .survey-consent { margin-inline: 16px; }
  .survey-submit { width: calc(100% - 32px); margin-inline: 16px; }
}

@media (max-width: 360px) {
  .identity-main .avatar.large { display: none; }
  .customer-tag-strip { width: min(190px,calc(100vw - 170px)); }
  .customer-feedback-item > summary { grid-template-columns: 84px 40px minmax(0,1fr) auto; }
  .customer-feedback-item > summary > svg { display: none; }
  .feedback-item-tags .customer-tag:nth-child(n+2) { display: none; }
  .survey-option-grid { gap: 6px; }
  .survey-option-grid span { padding-inline: 4px; font-size: 11px; }
}

/* Final mobile density pass: preserve every field while keeping short values on one line. */
@media (max-width: 760px) {
  .customer-detail-shell .profile-facts {
    grid-template-columns: 1.15fr .78fr .78fr 1.12fr;
  }
  .customer-detail-shell .profile-facts > span {
    min-height: 42px;
    padding: 5px 6px;
  }
  .customer-detail-shell .profile-facts > span small,
  .customer-detail-shell .profile-facts > span strong {
    white-space: nowrap;
  }
  .customer-detail-shell .profile-facts > span.inventory-trace {
    min-height: 27px;
    padding: 3px 7px;
    gap: 4px;
  }
  .customer-detail-shell .profile-facts .inventory-trace > span { gap: 4px; }
  .customer-detail-shell .inventory-status-inline { font-size: 10px; }
  .customer-detail-shell .profile-actions {
    min-height: 37px;
    padding: 3px 7px 4px;
    gap: 4px 7px;
  }
  .customer-detail-shell .profile-actions .button,
  .customer-detail-shell .profile-actions button { min-height: 29px; }

  .customer-detail-shell .appointment-row {
    grid-template-columns: minmax(0, 1.45fr) minmax(54px, .82fr) minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 6px;
  }
  .customer-detail-shell .appointment-row > span:nth-child(1) { grid-column: 1; }
  .customer-detail-shell .appointment-row > span:nth-child(2) { grid-column: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(3) { grid-column: 1 / span 2; }
  .customer-detail-shell .appointment-row > span:nth-child(4) { grid-column: 3; }
  .customer-detail-shell .appointment-row > span:nth-child(5) { grid-column: 4; }
  .customer-detail-shell .appointment-row .appointment-hospital,
  .customer-detail-shell .appointment-row .appointment-inviter,
  .customer-detail-shell .appointment-row .appointment-consultation { gap: 3px; }
  .customer-detail-shell .appointment-row .appointment-hospital svg,
  .customer-detail-shell .appointment-row .appointment-inviter svg,
  .customer-detail-shell .appointment-row .appointment-consultation svg { width: 13px; height: 13px; }
  .customer-detail-shell .appointment-row .appointment-hospital strong,
  .customer-detail-shell .appointment-row .appointment-inviter strong,
  .customer-detail-shell .appointment-row .appointment-consultation strong { font-size: 10px; }

  .customer-detail-shell .survey-link-control > div {
    left: 50%;
    right: auto;
    width: min(320px, calc(100vw - 28px));
    padding: 8px;
    gap: 5px;
    transform: translateX(-50%);
  }
  .customer-detail-shell .survey-link-control [data-survey-link-expiry] { font-size: 9px; }
  .customer-detail-shell .survey-link-control [data-survey-link-message] { min-height: 12px; font-size: 10px; }
  .customer-detail-shell .survey-link-control > div > div { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .customer-detail-shell .survey-link-control > div > div button:first-child { grid-column: 1 / -1; }
  .customer-detail-shell .survey-link-control > div > div .button { min-height: 32px; padding: 4px 6px; font-size: 10px; }
}

/* The appointment status choices are compact only on appointment forms. */
.record-form .field-group:has(input[name="status"]) .inline-radio-option {
  min-height: 44px;
  padding: 7px 6px;
  gap: 4px;
  font-size: 13px;
}
.record-form .field-group:has(input[name="status"]) .inline-radio-option input { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .record-form .field-group:has(input[name="status"]) .inline-radio-group { gap: 5px; }
  .record-form .field-group:has(input[name="status"]) .inline-radio-option {
    min-height: 42px;
    padding-inline: 4px;
    gap: 3px;
    font-size: 12px;
  }
  .record-form .field-group:has(input[name="status"]) .inline-radio-option input { width: 15px; height: 15px; }
}

/* Mobile visual correction: keep the approved compact hierarchy while making the
   question, profile, and appointment rows visibly match the reference layout. */
@media (max-width: 760px) {
  .survey-public-page .survey-question {
    padding: 30px 16px 22px;
  }
  .survey-public-page .survey-question legend,
  .survey-public-page .survey-text-question > label {
    margin-top: 0;
    margin-bottom: 15px;
  }
  .survey-public-page fieldset.survey-question > legend {
    position: relative;
    top: 24px;
    margin-bottom: 39px;
    padding-top: 0;
  }

  .customer-detail-shell .profile-facts > span.inventory-trace {
    min-height: 25px;
    padding: 2px 7px 3px;
    line-height: 1.15;
  }
  .customer-detail-shell .profile-actions {
    min-height: 31px;
    padding: 1px 7px 2px;
    align-items: center;
    flex-wrap: nowrap;
    gap: 3px 7px;
  }
  .customer-detail-shell .profile-actions .button,
  .customer-detail-shell .profile-actions button {
    min-height: 27px;
    padding-block: 0;
  }
  .customer-detail-shell .profile-actions .member-owner-inline {
    min-height: 27px;
    padding-inline: 0;
  }

  .customer-detail-shell .appointment-row {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 0;
  }
  .customer-detail-shell .appointment-row > span:nth-child(1) { grid-column: 1 / 5; grid-row: 1; }
  .customer-detail-shell .appointment-row > span:nth-child(2) { grid-column: 5 / 8; grid-row: 1; }
  .customer-detail-shell .appointment-row > span:nth-child(3) { grid-column: 1 / 5; grid-row: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(4) { grid-column: 5 / 10; grid-row: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(5) { grid-column: 10 / 13; grid-row: 2; }
  .customer-detail-shell .appointment-row > span:nth-child(6) { grid-column: 9 / 13; grid-row: 1; }
  .customer-detail-shell .appointment-row > span:not(.appointment-status-cell) {
    padding-right: 6px;
  }
}
