:root {
  --brand: #bc2435;
  --brand-hover: #a41d2c;
  --brand-soft: #fcf0f2;
  --ink: #243447;
  --muted: #6b7889;
  --subtle: #8994a3;
  --line: #e8ecf1;
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --green: #26775e;
  --green-soft: #edf7f1;
  --amber: #99651a;
  --amber-soft: #fff6e7;
  --blue: #3e668c;
  --blue-soft: #edf3f9;
  --radius: 10px;
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
body.overlay-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, input, select, textarea { outline: none; }
:focus-visible { outline: 3px solid #a6bfd7; outline-offset: 3px; }
input:focus, select:focus, textarea:focus { border-color: #8ea6bf; box-shadow: 0 0 0 3px #eaf0f6; }
svg { flex-shrink: 0; vertical-align: middle; }
button svg { width: 18px; height: 18px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
strong { font-weight: 600; }
::selection { background: #f5d4d9; color: #6a1721; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { display: grid; grid-template-columns: 220px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 31px 17px 20px; background: #fff; border-right: 1px solid var(--line); z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 14px 36px; text-decoration: none; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 33px; height: 36px; border-radius: 5px; color: #fff; background: var(--brand); font-size: 23px; font-weight: 700; line-height: 1; }
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { color: var(--brand); font-size: 24px; font-weight: 750; letter-spacing: -.8px; line-height: 1.05; }
.brand-caption { display: block; margin-top: 5px; color: var(--subtle); font-size: 10px; letter-spacing: 1.1px; line-height: 1.4; }
.workspace-label { margin: 0 14px 14px; color: var(--subtle); font-size: 11px; font-weight: 600; line-height: 1.5; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-button { position: relative; width: 100%; min-height: 47px; display: flex; align-items: center; gap: 11px; padding: 11px 13px; color: #637184; background: transparent; border: 1px solid transparent; border-radius: 7px; text-align: left; font-size: 13px; transition: background .15s, color .15s; }
.nav-button:hover { color: var(--ink); background: #f6f8fa; }
.nav-button.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.nav-button.active::before { content: ""; position: absolute; left: -17px; height: 22px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-icon { display: inline-flex; width: 19px; align-items: center; justify-content: center; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-count { margin-left: auto; min-width: 23px; padding: 2px 6px; border-radius: 5px; color: #7b8796; background: #f0f3f6; text-align: center; font-size: 11px; line-height: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.active .nav-count { color: var(--brand); background: #f4dce1; }
.sidebar-bottom { margin-top: auto; padding-top: 34px; }
.sidebar-bottom > .text-button { width: 100%; justify-content: flex-start; padding: 10px 14px; color: var(--muted); }
.profile { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 21px 10px 0; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; flex-shrink: 0; border-radius: 50%; color: #586c82; background: #e9eef4; font-size: 12px; font-weight: 650; }
.profile-name { font-size: 12px; font-weight: 600; line-height: 1.5; }
.profile-caption { margin-top: 2px; color: var(--subtle); font-size: 11px; }
.main { min-width: 0; padding: 0 38px 27px; }
.topbar { min-height: 81px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e6eaf0; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-left { color: var(--muted); font-size: 12px; }
.topbar-left > span:not(.demo-badge) { line-height: 1.6; }
.demo-badge { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 4px 8px; color: #7b8490; background: #e9edf2; border-radius: 5px; font-size: 10px; font-weight: 600; line-height: 1.5; }
.select-control { max-width: 205px; min-width: 0; padding: 8px 26px 8px 10px; border: 1px solid #dfe5ec; border-radius: 6px; background: #fff; color: #56667a; font-size: 12px; }
.lang-switch { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 6px; border: 1px solid #dfe5ec; background: #fff; }
.lang-switch button { min-width: 30px; padding: 4px 5px; border: 0; border-radius: 4px; color: #8993a0; background: transparent; font-size: 11px; line-height: 1.5; }
.lang-switch button.active, .lang-switch button[aria-pressed="true"] { color: var(--ink); background: #edf1f5; font-weight: 650; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: 7px; color: #7b8796; background: transparent; }
.icon-button:hover { color: var(--ink); background: #e9edf2; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 32px 0 24px; }
.page-title { margin: 0 0 8px; color: #26364a; font-size: 30px; font-weight: 650; letter-spacing: -.9px; line-height: 1.3; }
.page-description { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.primary-button, .secondary-button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 10px 17px; border: 1px solid transparent; border-radius: 7px; font-weight: 600; font-size: 12px; line-height: 1.5; text-decoration: none; transition: background .15s, border-color .15s; }
.primary-button { color: #fff; background: var(--brand); border-color: var(--brand); }
.primary-button:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.secondary-button { background: #fff; border-color: #dce3eb; color: #536579; }
.secondary-button:hover { background: #f5f7fa; border-color: #bdc9d5; }
.text-button { min-height: 32px; padding: 6px 8px; background: transparent; color: #6a788b; font-weight: 500; }
.text-button:hover { color: var(--brand); background: #fcf0f2; }
.summary-strip { display: flex; align-items: center; gap: 0; margin-bottom: 26px; padding: 0; }
.summary-item { display: flex; align-items: baseline; gap: 10px; min-width: 130px; padding-right: 29px; color: var(--ink); text-decoration: none; background: none; border: 0; text-align: left; }
button.summary-item:hover .summary-label { color: var(--brand); }
.summary-value { font-size: 27px; line-height: 1.2; font-weight: 600; letter-spacing: -.9px; font-variant-numeric: tabular-nums; }
.summary-item.overdue .summary-value { color: var(--brand); }
.summary-item.help .summary-value { color: var(--amber); }
.summary-label { color: var(--muted); font-size: 12px; line-height: 1.5; }
.summary-divider { width: 1px; height: 26px; margin-right: 29px; background: #dfe5ec; }
.workspace-card { overflow: hidden; border: 1px solid #e2e7ed; border-radius: 11px; background: #fff; box-shadow: 0 3px 10px #24344703; }
.table-toolbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 23px; border-bottom: 1px solid var(--line); }
.view-heading { margin: 0; color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.6; }
.view-heading small { margin-left: 8px; color: var(--subtle); font-size: 11px; font-weight: 400; }
.table-toolbar > div { display: flex; align-items: center; gap: 10px; }
.search-box { position: relative; display: flex; align-items: center; gap: 8px; width: 235px; max-width: 100%; min-width: 0; height: 35px; padding: 0 10px; border: 1px solid #e2e7ed; border-radius: 6px; background: #fafbfd; color: #9aa4b0; }
.search-box:focus-within { border-color: #8ea6bf; box-shadow: 0 0 0 3px #eaf0f6; }
.search-box svg { width: 16px; height: 16px; }
.search-box input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; box-shadow: none; color: var(--ink); background: transparent; font-size: 12px; }
input::placeholder, textarea::placeholder { color: #99a3b0; opacity: 1; }
.filter-select { max-width: 180px; min-width: 0; height: 35px; padding: 5px 9px; border: 1px solid #e2e7ed; border-radius: 6px; background: #fff; color: #788597; font-size: 11px; }
.table-wrap { width: 100%; overflow-x: auto; }
.client-table { border-collapse: collapse; width: 100%; text-align: left; font-size: 12px; }
.client-table thead { background: #fafbfc; }
.client-table th { padding: 13px 13px; border-bottom: 1px solid var(--line); color: #8a95a3; font-size: 10px; font-weight: 500; white-space: nowrap; }
.client-table td { padding: 21px 13px; border-bottom: 1px solid #edf0f4; color: #69788a; vertical-align: middle; }
.client-table th:first-child, .client-table td:first-child { padding-left: 24px; }
.client-table th:last-child, .client-table td:last-child { padding-right: 23px; text-align: right; }
.client-table tbody tr:last-child td { border-bottom: 0; }
.client-table tbody tr { transition: background .15s; }
.client-table tbody tr:hover { background: #fbfcfe; }
.client-main { display: flex; align-items: center; gap: 12px; min-width: 175px; max-width: 100%; border: 0; padding: 0; text-align: left; background: transparent; }
.client-main:hover .client-name { color: var(--brand); }
.client-avatar { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 40px; border: 1px solid #e4eaf1; border-radius: 8px; background: #eef2f7; color: #657d96; font-size: 12px; font-weight: 650; }
.client-table tbody tr:nth-child(3n+2) .client-avatar { background: #f4f0eb; color: #97856e; border-color: #ebe4da; }
.client-table tbody tr:nth-child(3n) .client-avatar { background: #edf3f1; color: #6b8f82; border-color: #e0eae5; }
.client-name { display: inline; margin: 0; padding: 0; border: 0; background: transparent; color: #35475b; font-size: 12px; font-weight: 650; line-height: 1.55; text-align: left; text-decoration: none; overflow-wrap: anywhere; }
button.client-name:hover, a.client-name:hover { color: var(--brand); }
.client-meta { display: block; margin-top: 4px; color: #96a0ac; font-size: 10px; line-height: 1.5; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 8px; border-radius: 4px; background: #f0f3f6; color: #788696; font-size: 10px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.status-badge::before { content: ""; width: 4px; height: 4px; flex-shrink: 0; border-radius: 50%; background: currentColor; opacity: .75; }
.status-badge.considering { color: #9b772f; background: #fbf5e8; }
.status-badge.interested { color: #397f66; background: #edf6f0; }
.status-badge.won { color: #447765; background: #e9f3ef; }
.status-badge.rejected, .status-badge.dnc { color: #8b909b; background: #f0f1f4; }
.last-note { max-width: 245px; color: #758296; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.last-note .date-caption { margin-top: 4px; }
.next-date { color: #62748a; font-size: 11px; font-weight: 500; line-height: 1.6; white-space: nowrap; }
.next-date.overdue { color: var(--brand); }
.next-date.today { color: #4c6a8b; }
.date-caption { display: block; color: #a0a9b4; font-size: 10px; font-weight: 400; line-height: 1.5; }
.next-date.overdue .date-caption { color: #c97680; }
.row-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 31px; padding: 6px 10px; color: #718095; background: #fff; border: 1px solid #e1e6ed; border-radius: 5px; font-size: 10px; line-height: 1.5; white-space: nowrap; }
.row-action:hover { color: var(--brand); border-color: #e7b8bf; background: #fff9fa; }
.row-action svg { width: 13px; height: 13px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 49px; padding: 12px 24px; border-top: 1px solid var(--line); color: #a0a9b5; font-size: 10px; line-height: 1.6; }
.help-strip { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 10px 24px; border-bottom: 1px solid #f3e8d4; background: #fffaf0; color: #9a7a3e; font-size: 11px; line-height: 1.65; }
.help-strip button { margin-left: auto; padding: 0; border: 0; background: transparent; color: #886529; font-size: 11px; font-weight: 600; }
.help-dot { width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: #bd903e; }
.empty-state { padding: 64px 24px; text-align: center; color: #8a97a7; font-size: 13px; line-height: 1.8; }
.empty-state svg { display: block; width: 40px; height: 40px; margin: 0 auto 16px; color: #b2bdc9; }
.empty-state strong { display: block; margin-bottom: 7px; color: #5b6c80; font-size: 16px; }
.empty-state .primary-button, .empty-state .secondary-button { margin-top: 16px; }
.mobile-customer-label { display: none; }
.demo-note { display: flex; align-items: flex-start; gap: 7px; margin: 18px 1px 0; color: #97a2af; font-size: 10px; line-height: 1.8; }
.demo-note svg { width: 13px; height: 13px; margin-top: 3px; }
.demo-note a { color: #7e8d9f; }

.toast { position: fixed; z-index: 120; left: calc(50% + 110px); bottom: 28px; transform: translateX(-50%); max-width: min(560px, calc(100% - 32px)); display: flex; align-items: center; gap: 10px; padding: 14px 21px; color: #fff; background: #344b59; border-radius: 8px; box-shadow: 0 7px 28px #24344726; font-size: 13px; line-height: 1.6; }
.toast.error { background: #9f3441; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: #24344740; backdrop-filter: blur(1px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(540px,100%); display: flex; flex-direction: column; background: #fff; box-shadow: -8px 0 45px #2434471a; animation: drawer-in .2s ease-out; }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 27px 28px 23px; border-bottom: 1px solid var(--line); }
.drawer-header .icon-button { margin: -4px -6px 0 0; }
.drawer-title { margin: 0 0 8px; color: var(--ink); font-size: 22px; font-weight: 650; letter-spacing: -.4px; line-height: 1.4; overflow-wrap: anywhere; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 25px 28px 30px; }
.drawer-body > .client-meta { margin-bottom: 20px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 22px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.detail-item { min-width: 0; }
.detail-item.full { grid-column: 1/-1; }
.detail-label { display: block; margin-bottom: 6px; color: #94a0ae; font-size: 11px; }
.detail-value { display: block; color: #53667c; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.detail-tag, .audit-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 4px; color: #8e743f; background: #fff4df; font-size: 10px; line-height: 1.5; }
.detail-tag { margin-top: 5px; }
.audit-tag { margin: 7px 4px 0 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 25px 0 20px; color: #40566d; font-size: 14px; font-weight: 650; }
.section-title small { color: #96a1ae; font-size: 11px; font-weight: 400; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline-item { position: relative; padding: 0 0 25px 22px; margin: 0; border-left: 1px solid #e5eaf0; }
.timeline-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline-marker { position: absolute; width: 7px; height: 7px; border: 2px solid #fff; box-sizing: content-box; border-radius: 50%; left: -6px; top: 4px; background: #c2cdda; }
.timeline-item:first-child .timeline-marker { background: var(--brand); }
.timeline-top { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 10px; margin-bottom: 7px; }
.timeline-kind { color: #52657b; font-size: 12px; font-weight: 600; }
.timeline-date { color: #a1aab5; font-size: 10px; }
.timeline-note { margin: 0 0 6px; color: #738194; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline-meta { color: #9aa5b2; font-size: 10px; line-height: 1.7; }
.callout { margin: 18px 0; padding: 13px 15px; border-radius: 6px; border: 1px solid #e2e9f1; color: #6e8197; background: #f6f8fb; font-size: 11px; line-height: 1.8; }
.callout p:last-child { margin-bottom: 0; }
.callout.warning { color: #98753b; border-color: #efe2c7; background: #fff9ed; }
.callout.info { color: #6b7f95; border-color: #e0e8f0; background: #f5f8fb; }
.help-reason { color: #8e6e35; font-size: 12px; line-height: 1.7; }
.drawer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 19px 28px; border-top: 1px solid var(--line); background: #fff; }
.drawer-actions .primary-button { flex: 1; }
.drawer-actions .secondary-button, .drawer-actions .text-button { padding-left: 12px; padding-right: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; overflow-y: auto; padding: 28px 20px; background: #2434475c; backdrop-filter: blur(2px); }
.modal { width: min(550px, 100%); max-height: min(88vh, 860px); display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 18px 90px #24344733; animation: modal-in .15s ease-out; }
.modal.wide { width: min(630px,100%); }
.modal > form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 25px 27px 20px; border-bottom: 1px solid var(--line); }
.modal-header h2, .modal-header h3 { margin: 0 0 5px; color: var(--ink); font-size: 20px; font-weight: 650; line-height: 1.5; }
.modal-header p { margin: 0; color: #92a0b0; font-size: 11px; line-height: 1.7; }
.modal-header .icon-button { margin: -3px -7px 0 0; }
.modal-body { min-height: 0; padding: 23px 27px; overflow-y: auto; overscroll-behavior: contain; }
.modal-body > form { margin: 0; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 17px 27px; border-top: 1px solid var(--line); background: #fbfcfd; }
.modal-footer > small { flex: 1; color: #9aa5b2; font-size: 10px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field-label { display: block; margin-bottom: 8px; color: #566a80; font-size: 12px; font-weight: 600; line-height: 1.5; }
.required { margin-left: 3px; color: var(--brand); }
.input, .textarea { display: block; width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #dce3eb; border-radius: 6px; background: #fff; color: #40566d; font-size: 12px; line-height: 1.65; transition: border-color .15s, box-shadow .15s; }
.input { min-height: 41px; }
select.input { padding-right: 26px; }
.textarea { min-height: 96px; resize: vertical; }
.input[readonly] { background: #f7f9fb; color: #8896a6; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: #cc8390; background: #fffafb; }
.field-hint { display: block; margin: 6px 0 0; color: #9aa5b3; font-size: 10px; line-height: 1.7; }
.field-error { display: block; margin-top: 6px; color: var(--brand); font-size: 11px; line-height: 1.6; }
.form-error { margin: 0 0 16px; padding: 10px 12px; color: #ad4050; background: #fff3f5; border: 1px solid #f3d7dd; border-radius: 6px; font-size: 12px; line-height: 1.7; }
.radio-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.result-option { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 40px; padding: 8px; border: 1px solid #dfe5ec; border-radius: 6px; color: #8090a3; background: #fff; text-align: center; font-size: 11px; line-height: 1.5; cursor: pointer; }
.result-option input { accent-color: var(--brand); }
.result-option:hover { color: #556d86; border-color: #aebdcd; }
.result-option.selected, .result-option:has(input:checked), .result-option[aria-pressed="true"] { color: var(--brand); border-color: #dba1aa; background: #fff5f7; }
.date-shortcuts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip-button { min-height: 27px; padding: 5px 9px; color: #8794a4; background: #f6f8fa; border: 1px solid #e8edf2; border-radius: 5px; font-size: 10px; line-height: 1.4; }
.chip-button:hover { border-color: #bfcedc; color: #4e6985; }
.chip-button.active { border-color: #dba1aa; background: #fff5f7; color: var(--brand); }
.check-row { display: flex; align-items: flex-start; gap: 9px; padding: 12px 0 3px; color: #738398; font-size: 12px; line-height: 1.7; }
.check-row input { width: 15px; height: 15px; margin: 3px 0 0; flex-shrink: 0; accent-color: var(--brand); }
.help-fields { margin-top: 11px; padding: 14px; border: 1px solid #eee3cb; border-radius: 7px; background: #fffbf2; }
.settings-section + .settings-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.settings-section h3 { margin: 0 0 8px; color: #5b7087; font-size: 13px; }
.settings-section p { color: #8a99ab; font-size: 12px; line-height: 1.8; }
.settings-section .secondary-button { margin: 5px 6px 0 0; }
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: guide; }
.guide-step { position: relative; padding: 0 0 23px 38px; counter-increment: guide; color: #8896a7; font-size: 12px; line-height: 1.8; }
.guide-step::before { content: counter(guide); position: absolute; top: 1px; left: 0; width: 24px; height: 24px; display: grid; place-items: center; color: #9b5b67; background: #fcf0f2; border-radius: 6px; font-size: 11px; font-weight: 600; }
.guide-step strong { display: block; margin-bottom: 4px; color: #576b83; font-size: 13px; }
.guide-step:last-child { padding-bottom: 0; }
.mobile-nav { display: none; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .7; } to { transform: translateX(0); opacity: 1; } }
@keyframes modal-in { from { transform: translateY(6px); opacity: .7; } to { transform: translateY(0); opacity: 1; } }

@media (min-width: 1600px) {
  .main { padding-left: 58px; padding-right: 58px; }
  .client-table td { padding-top: 24px; padding-bottom: 24px; }
  .client-name { font-size: 13px; }
  .client-meta, .client-table th, .status-badge, .date-caption, .row-action { font-size: 11px; }
  .last-note, .next-date { font-size: 12px; }
}
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 190px minmax(0,1fr); }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .brand { padding-left: 10px; padding-right: 5px; }
  .brand-name { font-size: 22px; }
  .nav-button { gap: 8px; padding-left: 10px; padding-right: 10px; font-size: 12px; }
  .nav-button.active::before { left: -12px; }
  .main { padding-left: 25px; padding-right: 25px; }
  .topbar-left { gap: 8px; }
  .topbar-right { gap: 8px; }
  .topbar-left > span:not(.demo-badge) { font-size: 10px; }
  .client-table td, .client-table th { padding-left: 9px; padding-right: 9px; }
  .client-table td:first-child, .client-table th:first-child { padding-left: 18px; }
  .client-table td:last-child, .client-table th:last-child { padding-right: 18px; }
  .client-main { min-width: 145px; gap: 9px; }
  .client-avatar { width: 32px; height: 35px; font-size: 10px; }
  .last-note { max-width: 180px; }
  .table-toolbar { padding-left: 18px; padding-right: 18px; gap: 10px; }
  .table-toolbar > div { gap: 8px; }
  .search-box { width: 190px; }
  .filter-select { max-width: 130px; }
  .toast { left: calc(50% + 95px); }
}
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 176px minmax(0,1fr); }
  .main { padding-left: 20px; padding-right: 20px; }
  .brand { padding-left: 8px; }
  .brand-mark { width: 29px; height: 33px; }
  .brand-caption { font-size: 9px; letter-spacing: .7px; }
  .topbar-left > span:not(.demo-badge) { display: none; }
  .topbar { min-height: 73px; }
  .page-title { font-size: 27px; }
  .page-description { font-size: 12px; }
  .summary-item { min-width: 110px; padding-right: 17px; gap: 7px; }
  .summary-divider { margin-right: 17px; }
  .summary-value { font-size: 25px; }
  .summary-label { font-size: 11px; }
  .table-toolbar { flex-wrap: wrap; }
  .table-toolbar > div { flex-wrap: wrap; }
  .client-table th, .client-table td { padding-left: 7px; padding-right: 7px; }
  .client-avatar { display: none; }
  .client-main { min-width: 115px; }
  .client-name { font-size: 11px; }
  .last-note { max-width: 150px; font-size: 10px; }
  .status-badge { padding-left: 6px; padding-right: 6px; font-size: 9px; }
  .row-action { padding-left: 7px; padding-right: 7px; font-size: 9px; }
  .row-action svg { display: none; }
  .toast { left: calc(50% + 88px); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: relative; height: auto; padding: 18px 18px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { width: fit-content; gap: 8px; padding: 0 0 20px; }
  .brand-mark { width: 26px; height: 29px; font-size: 20px; }
  .brand-name { font-size: 22px; }
  .brand-caption { font-size: 8px; margin-top: 3px; letter-spacing: .6px; }
  .workspace-label, .sidebar-bottom { display: none; }
  .side-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
  .nav-button { min-height: 43px; padding: 8px 6px; justify-content: center; flex-wrap: wrap; gap: 3px 5px; font-size: 11px; text-align: center; }
  .nav-icon { display: none; }
  .nav-count { margin-left: 0; min-width: 18px; padding: 0 4px; line-height: 17px; font-size: 10px; }
  .nav-button.active::before { display: none; }
  .main { padding: 0 20px 24px; }
  .topbar { min-height: 64px; gap: 8px; }
  .topbar-left > span:not(.demo-badge) { display: inline; }
  .topbar-right { margin-left: auto; }
  .select-control { max-width: 170px; }
  .page-header { align-items: flex-start; padding-top: 25px; padding-bottom: 21px; gap: 14px; }
  .page-title { font-size: 27px; }
  .page-description { font-size: 12px; }
  .page-header .primary-button { flex-shrink: 0; margin-top: 4px; padding: 8px 12px; min-height: 36px; font-size: 11px; }
  .summary-strip { margin-bottom: 21px; }
  .summary-item { min-width: 120px; }
  .workspace-card { border-radius: 9px; }
  .table-toolbar { min-height: 70px; }
  .client-avatar { display: grid; }
  .client-table { display: block; }
  .client-table thead { display: none; }
  .client-table tbody { display: block; }
  .client-table tbody tr { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 19px 18px; border-bottom: 1px solid var(--line); column-gap: 17px; row-gap: 12px; }
  .client-table tbody tr:last-child { border-bottom: 0; }
  .client-table td { display: block; border: 0; padding: 0 !important; text-align: left !important; min-width: 0; }
  .client-table td:first-child { grid-column: 1/-1; padding-right: 95px !important; }
  .client-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: #a0a9b5; font-size: 10px; line-height: 1.4; }
  .client-table td:first-child::before, .client-table td:last-child::before { display: none; }
  .client-table td:last-child { position: absolute; top: 21px; right: 18px; }
  .client-table td:nth-child(3) { grid-column: 1/-1; grid-row: 3; }
  .client-table td:nth-child(4) { grid-column: 2; grid-row: 2; }
  .client-main { gap: 11px; }
  .client-name { font-size: 13px; }
  .client-meta { font-size: 10px; }
  .client-avatar { width: 35px; height: 38px; }
  .last-note { max-width: none; font-size: 11px; }
  .next-date { font-size: 12px; }
  .date-caption { font-size: 10px; }
  .status-badge { font-size: 10px; padding: 4px 7px; }
  .row-action { padding: 6px 9px; font-size: 10px; }
  .table-footer { min-height: 45px; padding-left: 18px; padding-right: 18px; font-size: 10px; }
  .help-strip { padding-left: 18px; padding-right: 18px; }
  .demo-note { font-size: 10px; }
  .toast { left: 50%; bottom: 18px; }
  .modal-backdrop { padding: 20px 15px; }
  .modal { max-height: calc(100dvh - 40px); }
  .drawer { max-height: 100dvh; }
}
@media (max-width: 480px) {
  .sidebar { padding: 16px 13px 10px; }
  .brand { padding-bottom: 17px; }
  .nav-button { font-size: 10px; min-height: 41px; padding: 7px 4px; }
  .nav-count { font-size: 9px; min-width: 16px; }
  .main { padding: 0 14px 22px; }
  .topbar { min-height: 58px; flex-wrap: wrap; padding: 10px 0; row-gap: 6px; }
  .topbar-left { font-size: 10px; gap: 6px; }
  .topbar-left > span:not(.demo-badge) { display: none; }
  .topbar-right { gap: 6px; }
  .select-control { max-width: 138px; font-size: 10px; padding: 7px 17px 7px 7px; }
  .lang-switch { padding: 2px; }
  .lang-switch button { min-width: 25px; font-size: 10px; }
  .topbar .icon-button { width: 29px; height: 29px; }
  .topbar .icon-button svg { width: 16px; height: 16px; }
  .page-header { padding-top: 22px; gap: 10px; }
  .page-title { margin-bottom: 7px; font-size: 25px; }
  .page-description { max-width: 200px; font-size: 11px; }
  .page-header .primary-button { margin-top: 2px; font-size: 10px; min-height: 34px; padding: 8px 10px; max-width: 125px; }
  .page-header .primary-button svg { width: 15px; height: 15px; }
  .summary-strip { justify-content: space-between; margin-bottom: 19px; }
  .summary-item { min-width: 0; flex-direction: column; align-items: flex-start; gap: 5px; padding-right: 8px; }
  .summary-value { font-size: 26px; }
  .summary-label { font-size: 10px; }
  .summary-divider { margin-right: 9px; height: 28px; }
  .table-toolbar { padding: 14px; gap: 11px; }
  .table-toolbar > div { width: 100%; gap: 7px; }
  .view-heading { font-size: 14px; }
  .search-box { flex: 1; width: auto; min-width: 120px; }
  .filter-select { max-width: 120px; font-size: 10px; }
  .client-table tbody tr { padding: 17px 14px; column-gap: 13px; row-gap: 11px; }
  .client-table td:first-child { padding-right: 78px !important; }
  .client-table td:last-child { right: 14px; top: 19px; }
  .client-name { font-size: 12px; }
  .client-main { gap: 9px; min-width: 0; }
  .client-avatar { width: 31px; height: 34px; font-size: 9px; }
  .row-action { font-size: 9px; padding: 5px 7px; min-height: 29px; max-width: 86px; white-space: normal; }
  .table-footer { padding: 11px 14px; align-items: flex-start; gap: 10px; }
  .help-strip { padding: 10px 14px; font-size: 10px; }
  .help-strip button { font-size: 10px; }
  .modal-backdrop { padding: 12px; }
  .modal { max-height: calc(100dvh - 24px); border-radius: 10px; }
  .modal-header { padding: 19px 19px 16px; }
  .modal-header h2, .modal-header h3 { font-size: 18px; }
  .modal-body { padding: 19px; }
  .modal-footer { padding: 14px 19px; gap: 8px; }
  .modal-footer > small { flex-basis: 100%; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .field.full { grid-column: auto; }
  .radio-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .result-option { font-size: 11px; min-height: 40px; }
  .input, .textarea { font-size: 13px; }
  .drawer-header { padding: 22px 20px 19px; }
  .drawer-title { font-size: 21px; }
  .drawer-body { padding: 20px; }
  .drawer-actions { padding: 15px 20px; gap: 8px; }
  .drawer-actions .primary-button, .drawer-actions .secondary-button { font-size: 11px; }
  .detail-grid { gap: 17px; }
  .timeline-top { gap: 5px; }
  .timeline-date { font-size: 9px; }
  .toast { font-size: 12px; padding: 12px 16px; }
}
@media (max-width: 359px) {
  .main { padding-left: 11px; padding-right: 11px; }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .nav-button { font-size: 9px; gap: 2px 3px; }
  .nav-count { min-width: 14px; font-size: 8px; padding: 0 3px; }
  .topbar-right { gap: 4px; }
  .select-control { max-width: 117px; }
  .page-title { font-size: 23px; }
  .page-header .primary-button { max-width: 106px; padding-left: 8px; padding-right: 8px; }
  .page-description { max-width: 170px; font-size: 10px; }
  .summary-label { font-size: 9px; }
  .client-avatar { display: none; }
  .client-table td:first-child { padding-right: 76px !important; }
  .filter-select { max-width: 102px; }
  .modal-header, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-footer { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .page-header > button, .summary-strip, .table-toolbar, .row-action, .drawer-backdrop, .drawer, .modal-backdrop, .toast, .demo-note { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; }
  .workspace-card { border: 0; box-shadow: none; }
  .client-table td, .client-table th { color: #243447; }
  body { background: #fff; }
}

/* Final integration: actual GRACE identity, bilingual controls, and form structure. */
.brand { gap: 5px; padding: 0 0 27px; }
.brand-logo { width: 76px; height: 76px; object-fit: contain; flex-shrink: 0; }
.brand-copy { min-width: 0; }
.brand-product { display: block; color: var(--ink); font-size: 13px; font-weight: 650; line-height: 1.65; }
.brand-caption { letter-spacing: 0; font-size: 10px; }
.brand-photo { margin: 0 0 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.brand-photo img { display: block; width: 100%; height: auto; border-radius: 5px; }
.brand-photo figcaption { margin-top: 6px; color: var(--muted); font-size: 11px; }
.page-date { display: flex; align-items: center; gap: 7px; color: #778698; font-size: 11px; margin-bottom: 10px; }
.page-date svg { width: 15px; height: 15px; }
.profile-name, .profile-caption { display: block; }
.lang-switch button { min-height: 29px; padding: 5px 7px; }
.mobile-settings { display: none; }
.summary-item { align-items: center; gap: 15px; padding: 0 25px; border-right: 1px solid #dce3eb; }
.summary-item:first-child { padding-left: 0; }
.summary-item:last-child { border-right: 0; }
.summary-label { display: flex; align-items: center; gap: 6px; }
.summary-label svg { width: 16px; height: 16px; }
.summary-value { display: flex; align-items: center; gap: 7px; }
.summary-chevron svg { width: 14px; height: 14px; color: #9ba7b5; }
.client-table .help-reason { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 10px; }
.help-reason svg { width: 13px; height: 13px; }
.client-name { font-size: 13px; }
.last-note { font-size: 12px; }
.table-footer > span:last-child { display: inline-flex; align-items: center; gap: 5px; }
.table-footer svg { width: 15px; height: 15px; }
.demo-note { display: flex; align-items: flex-start; gap: 7px; line-height: 1.7; }
.demo-note svg { width: 15px; height: 15px; margin-top: 1px; }
.history-stats { display: flex; gap: 25px; margin: 20px 0 0; color: var(--muted); font-size: 12px; }
.history-stats strong { color: var(--ink); margin-left: 5px; }
.section-title { margin-bottom: 8px; }
.section-title h3 { margin: 0; font-size: 15px; }
.timeline { margin-top: 22px; }
.timeline-marker svg { display: none; }
.timeline-marker.amended { background: #ba944f; }
.drawer .callout { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.source-detail { margin: 15px 0 0; font-size: 12px; color: var(--muted); }
.help-strip p { margin: 6px 0 0; line-height: 1.7; }
.result-fieldset { margin: 18px 0; padding: 0; border: 0; }
.additional-fields summary { color: #6d7d90; cursor: pointer; font-size: 12px; }
.additional-fields > .form-grid { margin-top: 15px; }
.help-fields { display: block; }
.guide-number { display: none; }
.guide-step h3 { font-size: 14px; color: var(--ink); margin: 0 0 4px; }
.guide-step p { margin: 0; }
.form-error { margin-top: 14px; margin-bottom: 0; }
.danger { color: var(--brand); }
.date-caption, .field-hint { color: #758294; }
.field-hint { font-size: 11px; }
@media(max-width:760px) {
  .brand { padding: 0 0 15px; gap: 8px; }
  .brand-logo { width: 54px; height: 54px; }
  .brand-product { font-size: 15px; }
  .brand-caption { font-size: 10px; }
  .mobile-settings { display: inline-flex; }
  .summary-item { flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: 7px; padding: 0 13px; }
  .summary-label { font-size: 11px; }
  .summary-value { font-size: 25px; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; min-height: 36px; flex: auto; }
  .table-filters { width: 100%; display: flex; }
  .filter-select { flex: 1; width: 50%; max-width: none; }
  .client-table td:first-child { padding-right: 0 !important; }
  .client-table td:last-child { position: static; grid-column: 1/-1; grid-row: 4; }
  .row-action { width: 100%; max-width: none; min-height: 42px; font-size: 12px; }
  .client-name { font-size: 14px; }
  .client-avatar { display: grid; }
  .client-meta { font-size: 11px; }
  .last-note { font-size: 12px; }
  .page-header { flex-wrap: wrap; }
  .page-header > div { flex: 1 1 220px; }
  .page-description { max-width: none; }
  .page-title { font-size: 26px; }
  .page-header .primary-button { max-width: none; font-size: 12px; }
  .topbar-right { flex-wrap: wrap; }
  .lang-switch button { min-height: 30px; font-size: 11px; }
  .nav-button { font-size: 11px; }
  .summary-label svg { display: none; }
  .demo-note { font-size: 11px; }
}
@media(max-width:359px) {
  .page-title { font-size: 23px; }
  .topbar { align-items: flex-start; }
  .topbar-right { margin-left: 0; }
  .nav-button { font-size: 10px; }
  .summary-label { font-size: 10px; }
  .summary-item { padding-right: 8px; padding-left: 8px; }
}

/* Demo sign-in and automatically recorded dates. */
.login-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 42px 24px; background: var(--canvas); }
.login-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0 16px; width: min(474px,100%); padding: 31px 34px 29px; border: 1px solid #e1e7ee; border-top: 3px solid var(--brand); border-radius: 12px; background: #fff; box-shadow: 0 14px 50px #2434470b; }
.login-card > h2, .login-card > .login-description, .login-card > .login-form, .login-card > .login-demo-accounts, .login-card > .field-hint { grid-column: 1/-1; }
.login-brand { display: flex; align-items: center; gap: 12px; min-width: 0; margin-bottom: 30px; }
.login-brand img { display: block; flex-shrink: 0; width: 65px; height: 65px; object-fit: contain; }
.login-brand > div { min-width: 0; }
.login-brand h1 { margin: 0 0 4px; color: var(--ink); font-size: 19px; font-weight: 650; letter-spacing: -.3px; line-height: 1.4; overflow-wrap: anywhere; }
.login-brand p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.login-language { display: flex; justify-content: flex-end; align-items: flex-start; padding-top: 6px; }
.login-language .lang-switch { flex-shrink: 0; }
.login-card > h2 { margin: 0 0 8px; color: #2c4056; font-size: 23px; font-weight: 650; letter-spacing: -.4px; line-height: 1.4; }
.login-description { margin: 0 0 24px; color: #778597; font-size: 12px; line-height: 1.8; }
.login-form { display: flex; flex-direction: column; gap: 17px; margin: 0; }
.login-form .field-label { color: #5a6c80; font-size: 12px; }
.login-form .input { min-height: 44px; padding-top: 11px; padding-bottom: 11px; font-size: 13px; }
.login-form .primary-button { width: 100%; min-height: 44px; margin-top: 3px; font-size: 13px; }
.login-form .form-error { margin: -2px 0 0; }
.login-demo-accounts { margin-top: 24px; padding: 15px 16px; border: 1px solid #e8edf2; border-radius: 7px; background: #f7f9fb; color: #708094; font-size: 12px; line-height: 1.8; }
.login-demo-accounts > strong { display: block; margin-bottom: 5px; color: #5d7189; font-size: 12px; font-weight: 650; }
.login-demo-accounts p { margin: 2px 0; overflow-wrap: anywhere; }
.login-card > .field-hint { margin-top: 16px; margin-bottom: 0; color: #7b899a; font-size: 11px; line-height: 1.8; }
.account-label { display: inline-block; min-width: 0; max-width: 210px; color: #607187; font-size: 12px; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.topbar-right > .text-button[data-action="logout"] { flex-shrink: 0; min-height: 32px; padding: 6px 8px; color: #7d8998; font-size: 11px; }
.topbar-right > .text-button[data-action="logout"]:hover { color: var(--brand); }
.record-dates { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 21px 0; padding: 15px 16px; border: 1px solid #e8edf2; border-radius: 7px; background: #f8fafc; }
.record-dates > div { min-width: 0; }
.record-dates .detail-label { margin-bottom: 7px; color: #7b8a9d; font-size: 10px; line-height: 1.6; }
.record-dates strong { display: block; color: #546c86; font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.7; overflow-wrap: anywhere; }
.guide-section { color: #718196; font-size: 12px; line-height: 1.85; }
.guide-section + .guide-section { margin-top: 23px; padding-top: 21px; border-top: 1px solid var(--line); }
.guide-section h3 { margin: 0 0 10px; color: #445d77; font-size: 14px; font-weight: 650; line-height: 1.6; }
.guide-section p { margin: 0 0 10px; overflow-wrap: anywhere; }
.guide-section p:last-child { margin-bottom: 0; }
.guide-section ol { margin: 0; padding-left: 22px; }
.guide-section li { padding-left: 3px; margin-bottom: 9px; overflow-wrap: anywhere; }
.guide-section li:last-child { margin-bottom: 0; }
.guide-section li::marker { color: #a25765; font-size: 11px; font-weight: 600; }
.guide-section strong { color: #556c84; }
.guide-date-list { margin: 12px 0 0; padding: 15px 16px; border: 1px solid #e5ebf1; border-radius: 7px; background: #f8fafc; }
dl.guide-date-list, .guide-date-list dl { display: grid; grid-template-columns: minmax(90px,.7fr) minmax(0,1.7fr); gap: 10px 15px; }
.guide-date-list dl { margin: 0; }
.guide-date-list dt { margin: 0; color: #61768f; font-size: 11px; font-weight: 600; line-height: 1.75; overflow-wrap: anywhere; }
.guide-date-list dd { margin: 0; color: #7d8c9e; font-size: 11px; line-height: 1.75; overflow-wrap: anywhere; }
.guide-date-list > div + div { margin-top: 12px; }
.guide-date-list > div > dt { margin-bottom: 4px; }

@media(max-width:760px) {
  .topbar-right { justify-content: flex-end; }
  .account-label { max-width: 190px; font-size: 11px; }
  .topbar-right > .text-button[data-action="logout"] { font-size: 11px; padding-left: 6px; padding-right: 6px; }
}
@media(max-width:480px) {
  .login-shell { padding: 23px 15px; }
  .login-card { gap: 0 10px; padding: 24px 23px; border-radius: 10px; }
  .login-brand { gap: 9px; margin-bottom: 25px; }
  .login-brand img { width: 52px; height: 52px; }
  .login-brand h1 { font-size: 17px; }
  .login-brand p { font-size: 10px; }
  .login-language { padding-top: 2px; }
  .login-language .lang-switch button { font-size: 10px; min-width: 24px; padding-left: 5px; padding-right: 5px; }
  .login-card > h2 { font-size: 22px; }
  .login-description { margin-bottom: 21px; font-size: 12px; }
  .login-form { gap: 16px; }
  .login-form .input { min-height: 45px; font-size: 14px; }
  .login-demo-accounts { margin-top: 22px; padding: 13px 14px; }
  .account-label { max-width: 160px; font-size: 10px; }
  .topbar-right { flex: 1 1 220px; margin-left: 0; justify-content: flex-end; }
  .record-dates { grid-template-columns: 1fr; gap: 12px; padding: 14px 15px; }
  .record-dates > div { display: grid; grid-template-columns: minmax(80px,.8fr) minmax(0,1.2fr); gap: 12px; align-items: baseline; }
  .record-dates .detail-label { margin: 0; font-size: 11px; }
  .record-dates strong { font-size: 11px; text-align: right; }
  .guide-section { font-size: 12px; }
  .guide-section h3 { font-size: 14px; }
  dl.guide-date-list, .guide-date-list dl { grid-template-columns: 1fr; row-gap: 5px; }
  .guide-date-list dt:not(:first-child) { margin-top: 8px; }
  .guide-date-list dd { padding-bottom: 4px; }
}
@media(max-width:359px) {
  .login-shell { padding: 17px 12px; }
  .login-card { padding: 22px 19px; gap: 0 7px; }
  .login-brand { gap: 7px; }
  .login-brand img { width: 45px; height: 45px; }
  .login-brand h1 { font-size: 15px; }
  .login-brand p { font-size: 9px; }
  .login-card > h2 { font-size: 20px; }
  .account-label { max-width: 150px; }
  .topbar-right { flex-basis: 100%; justify-content: flex-start; }
}
@media print {
  .login-shell { min-height: auto; padding: 0; background: #fff; }
  .login-card { box-shadow: none; }
  .login-language { display: none; }
}

/* Production account controls and touch targets. */
.empty-state h2 { margin: 0 0 10px; color: #52677f; font-size: 20px; font-weight: 600; line-height: 1.5; }
.empty-state p { max-width: 42ch; margin: 0 auto; color: #7b8b9e; line-height: 1.8; overflow-wrap: anywhere; }
.empty-state .primary-button, .empty-state .secondary-button { min-height: 44px; max-width: 100%; white-space: normal; }
.login-card > button { grid-column: 1/-1; justify-self: start; margin-top: 10px; }
.login-form .field { min-width: 0; }
.login-form .input { max-width: 100%; }

@media (max-width: 760px) {
  .topbar { display: block; min-height: 0; padding: 12px 0; }
  .topbar-left { display: flex; width: 100%; margin-bottom: 6px; }
  .topbar-left > span:not(.demo-badge) { display: inline; color: #7e8c9e; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
  .topbar-right { display: grid; grid-template-columns: minmax(0,1fr) auto auto; column-gap: 8px; row-gap: 4px; align-items: center; width: 100%; margin: 0; padding: 0; }
  .topbar-right > .account-label { grid-column: 1/3; grid-row: 1; max-width: none; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
  .topbar-right > .text-button[data-action="logout"] { grid-column: 3; grid-row: 1; justify-self: end; min-height: 44px; min-width: 44px; padding: 10px 8px; font-size: 12px; line-height: 1.5; white-space: normal; }
  .topbar-right > .lang-switch { grid-column: 1; grid-row: 2; justify-self: start; min-width: 0; max-width: 100%; padding: 2px; }
  .topbar-right > .icon-button[data-action="guide"] { grid-column: 2; grid-row: 2; }
  .topbar-right > .icon-button[data-action="settings"] { grid-column: 3; grid-row: 2; justify-self: end; }
  .topbar-right > .icon-button { display: inline-flex; width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-color: #e1e7ee; background: #fff; }
  .topbar-right > .icon-button:hover { background: #edf2f7; }
  .topbar-right > .icon-button svg { width: 18px; height: 18px; }
  .lang-switch button, .login-language .lang-switch button { min-width: 44px; min-height: 44px; padding: 10px 7px; font-size: 12px; line-height: 1.5; }
  .nav-button { min-height: 44px; }
  .primary-button, .secondary-button, .text-button, .row-action, .chip-button, .result-option { min-height: 44px; }
  .page-header .primary-button, .drawer-actions .primary-button, .drawer-actions .secondary-button, .modal-footer .primary-button, .modal-footer .secondary-button { min-height: 44px; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .drawer-actions > button { min-width: 0; }
  .drawer-header .icon-button, .modal-header .icon-button { flex-shrink: 0; width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .search-box, .filter-select { min-height: 44px; height: auto; }
  .search-box input { min-height: 42px; font-size: 16px; }
  .input, .textarea, .login-form .input { min-height: 44px; font-size: 16px; }
  .check-row { min-height: 44px; }
  .login-card { grid-template-columns: minmax(0,1fr) auto; }
  .login-language { min-width: 0; padding-top: 0; }
  .login-language .lang-switch { min-width: 0; max-width: 100%; }
  .login-form .primary-button { min-height: 46px; }
}
@media (max-width: 480px) {
  .topbar-right > .account-label { font-size: 11px; }
  .topbar-right > .text-button[data-action="logout"] { font-size: 11px; }
  .login-card { padding: 24px 22px; column-gap: 10px; }
  .login-brand { align-items: flex-start; gap: 8px; }
  .login-brand img { width: 48px; height: 48px; }
  .login-brand h1 { font-size: 17px; }
  .login-language .lang-switch button { padding: 10px 6px; font-size: 11px; }
  .login-brand p { font-size: 11px; }
}
@media (max-width: 359px) {
  .topbar-right { column-gap: 6px; }
  .topbar-right > .account-label { max-width: none; }
  .login-card { padding: 22px 18px; column-gap: 7px; }
  .login-brand img { width: 40px; height: 40px; }
  .login-brand h1 { font-size: 15px; }
  .login-brand p { font-size: 10px; }
  .login-language .lang-switch button { padding-left: 5px; padding-right: 5px; }
}
/* A pending assistance request is read-only; new information is appended separately. */
.help-existing { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 10rem; overflow-y: auto; }
#form-error .secondary-button { margin-top: 12px; white-space: normal; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) { .page-actions { width: 100%; } .page-actions > button { flex: 1 1 auto; min-height: 44px; white-space: normal; } }

/* Concise hints complement visible labels and accessible button names. */
.has-tooltip { position: relative; }
.has-tooltip[data-tooltip]:not([data-tooltip=""])::after { content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 9px); z-index: 130; display: block; width: max-content; max-width: min(270px,calc(100vw - 32px)); padding: 9px 12px; border: 1px solid #344c62; border-radius: 6px; color: #fff; background: #344c62; box-shadow: 0 4px 14px #2434471f; font-size: 12px; font-weight: 400; line-height: 1.65; text-align: left; white-space: normal; overflow-wrap: anywhere; pointer-events: none; opacity: 0; visibility: hidden; transform: translateX(-50%); transition: opacity .12s ease-out, visibility .12s ease-out; }
.has-tooltip[data-tooltip]:not([data-tooltip=""]):focus-visible::after { opacity: 1; visibility: visible; }
.topbar-right .has-tooltip[data-tooltip]::after, .page-actions .has-tooltip[data-tooltip]::after, .modal-footer .has-tooltip[data-tooltip]::after, .drawer-actions .has-tooltip[data-tooltip]::after { left: auto; right: 0; transform: none; }
.sidebar .has-tooltip[data-tooltip]::after { left: 0; right: auto; transform: none; }
.modal-header .has-tooltip[data-tooltip]::after, .drawer-header .has-tooltip[data-tooltip]::after { left: auto; right: 0; top: calc(100% + 8px); bottom: auto; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .has-tooltip[data-tooltip]:not([data-tooltip=""]):hover::after { opacity: 1; visibility: visible; transition-delay: .18s; }
}

/* The confirmation stays beside the pending form action, inside its dialog. */
.modal { position: relative; }
.confirm-popover { position: absolute; z-index: 110; right: 24px; bottom: 80px; width: 340px; max-width: calc(100% - 48px); max-height: calc(100% - 104px); overflow-y: auto; overscroll-behavior: contain; padding: 19px 20px 17px; border: 1px solid #ced8e3; border-radius: 9px; color: #526a82; background: #fff; box-shadow: 0 8px 35px #24344729; text-align: left; }
.confirm-popover h3 { margin: 0 0 8px; color: #344e68; font-size: 15px; font-weight: 650; line-height: 1.55; overflow-wrap: anywhere; }
.confirm-popover p { margin: 0 0 17px; color: #6d7e91; font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
.confirm-actions { display: flex; align-items: stretch; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.confirm-actions > button { flex: 1 1 105px; min-width: 0; min-height: 44px; max-width: 100%; padding: 10px 12px; font-size: 12px; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.confirm-popover [data-action="confirm-proceed"] { color: #fff; border-color: #3f5e78; background: #3f5e78; }
.confirm-popover [data-action="confirm-proceed"]:hover { border-color: #314e68; background: #314e68; }
.confirm-popover.is-danger [data-action="confirm-proceed"], .confirm-popover [data-action="confirm-proceed"].is-danger { color: #fff; border-color: #b32638; background: #b32638; }
.confirm-popover.is-danger [data-action="confirm-proceed"]:hover, .confirm-popover [data-action="confirm-proceed"].is-danger:hover { border-color: #982032; background: #982032; }
.confirm-popover:focus-visible { outline: 3px solid #a6bfd7; outline-offset: -3px; }
.toast { overflow-wrap: anywhere; border: 1px solid #ffffff1a; }
.toast.error { color: #fff; background: #983443; }

@media (max-width: 480px) {
  .confirm-popover { left: 16px; right: 16px; bottom: 80px; width: auto; max-width: none; max-height: calc(100% - 104px); padding: 17px 16px 15px; }
  .confirm-popover h3 { font-size: 14px; }
  .confirm-popover p { font-size: 12px; margin-bottom: 15px; }
  .confirm-actions { gap: 7px; }
  .confirm-actions > button { flex-basis: 95px; padding: 10px 9px; font-size: 12px; }
  .has-tooltip[data-tooltip]:not([data-tooltip=""])::after { max-width: min(240px,calc(100vw - 32px)); }
}
@media (prefers-reduced-motion: reduce) {
  .has-tooltip[data-tooltip]::after { transition: none; }
}
@media print {
  .has-tooltip[data-tooltip]::after, .confirm-popover { display: none !important; }
}

/* Match the surface to the task: longer customer forms open beside the list. */
.modal.size-400 { width: min(400px,100%); }
.modal.size-520 { width: min(520px,100%); }
.modal.size-720 { width: min(720px,100%); }
.modal > .modal-header, .modal > .modal-footer, .modal > form > .modal-footer { flex: 0 0 auto; }
.modal > form { flex: 1 1 auto; min-height: 0; }
.modal > .modal-body, .modal > form > .modal-body { flex: 1 1 auto; min-height: 0; }
.modal-backdrop.form-drawer-backdrop { display: block; padding: 0; overflow: hidden; background: #24344738; backdrop-filter: none; }
.modal.form-drawer { position: fixed; top: 0; right: 0; bottom: 0; left: auto; width: min(560px,100vw); height: 100vh; height: 100dvh; max-width: 100vw; max-height: none; margin: 0; border-radius: 0; display: flex; flex-direction: column; overflow: hidden; box-shadow: -9px 0 38px #24344726; animation: drawer-in .2s ease-out; }
.modal.form-drawer > .modal-header { flex: 0 0 auto; padding-top: max(25px,env(safe-area-inset-top)); }
.modal.form-drawer > form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
.modal.form-drawer .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 28px; }
.modal.form-drawer .modal-footer { flex: 0 0 auto; padding-bottom: max(17px,env(safe-area-inset-bottom)); background: #fff; }
.modal.form-drawer .modal-footer .primary-button, .modal.form-drawer .modal-footer .secondary-button { min-height: 44px; }

/* Only a pending discard confirmation blocks the current form, not the page. */
.confirm-layer { position: absolute; inset: 0; z-index: 105; overflow: hidden; background: #f4f7fa80; cursor: default; }
.confirm-layer .confirm-popover { z-index: 1; }
.draft-status { display: inline-flex; align-items: center; gap: 6px; min-height: 18px; margin: 0; color: #8090a2; font-size: 11px; font-weight: 400; line-height: 1.65; overflow-wrap: anywhere; }
.draft-status::before { content: ""; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: #a3afbd; }
.draft-status:empty { display: none; }
.draft-status.is-saving, .draft-status[data-state="saving"] { color: #947b50; }
.draft-status.is-saving::before, .draft-status[data-state="saving"]::before { background: #b39a69; }
.draft-status.is-saved, .draft-status[data-state="saved"] { color: #6f8a7e; }
.draft-status.is-saved::before, .draft-status[data-state="saved"]::before { background: #7b9b8d; }
.modal-header .draft-status { margin-top: 8px; }
.modal > .draft-status { flex: 0 0 auto; padding: 0 27px 12px; }
.modal-body > .draft-status { margin-bottom: 15px; }

@media (max-width: 480px) {
  .modal.form-drawer { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
  .modal.form-drawer > .modal-header { padding-top: max(21px,env(safe-area-inset-top)); }
  .modal.form-drawer .modal-footer { padding-bottom: max(15px,env(safe-area-inset-bottom)); }
  .modal.form-drawer .modal-footer > button { flex: 1 1 105px; min-width: 0; white-space: normal; }
  .modal > .draft-status { padding-left: 19px; padding-right: 19px; }
  .draft-status { font-size: 11px; }
}
@media (max-width: 359px) {
  .modal > .draft-status { padding-left: 16px; padding-right: 16px; }
}
@media print {
  .confirm-layer, .draft-status { display: none !important; }
}
.modal-header > div { min-width: 0; }
.modal-header h2, .modal-header p { overflow-wrap: anywhere; }
