:root {
  color-scheme: light;
  --paper: #f8f4ef;
  --surface: #fffdfa;
  --surface-2: #f2ebe4;
  --ink: #28221f;
  --muted: #82756d;
  --line: #e7ddd4;
  --rose: #b9344e;
  --rose-dark: #8f263d;
  --rose-pale: #f8e9ec;
  --jade: #397662;
  --gold: #9a743b;
  --night: #29211e;
  --shadow: 0 12px 36px -28px rgb(57 37 29 / 38%);
  --sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "SimSun", Georgia, serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgb(185 52 78 / 22%); outline-offset: 2px;
}
.boot-screen, .auth-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; padding: 24px; }
.boot-screen p { color: var(--muted); }
.brand-mark {
  display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px;
  color: #fff9f5; background: var(--rose); font: 600 21px var(--serif);
}
.auth-card { width: min(100%, 430px); padding: clamp(24px, 5vw, 42px); border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth-brand strong { display: block; font: 600 19px var(--serif); }
.auth-brand small, .eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
.auth-card h1 { margin-bottom: 8px; font: 600 27px var(--serif); }
.auth-card > p { margin-bottom: 23px; color: var(--muted); font-size: 13px; }
.field { display: grid; gap: 7px; margin: 14px 0; }
.field label { font-size: 12px; font-weight: 650; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 11px; color: var(--ink); background: #fffefa;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.65; }
.hint, .help { color: var(--muted); font-size: 12px; line-height: 1.55; }
.paged-list { min-width: 0; }
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.list-toolbar .list-query { flex: 1 1 180px; min-width: 0; }
.page-size-label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.page-size-label .select { width: 72px; padding-inline: 8px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; }
.page-summary { color: var(--muted); font-size: 12px; }
.pagination-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pagination .btn { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.pagination .list-jump { width: 64px; min-height: 36px; padding: 7px; }
.paged-list[aria-busy="true"] { opacity: .7; }
.form-grid > .paged-list { grid-column: 1 / -1; }
.field-error { color: #92293d; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.input[aria-invalid="true"] { border-color: #b92d4d; }
.form-error { margin: 14px 0; padding: 10px 12px; border: 1px solid #efd2d8; border-radius: 10px; color: #92293d; background: #fff2f4; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.btn {
  display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border: 1px solid transparent; border-radius: 999px; background: transparent;
  font-size: 12px; font-weight: 650; transition: background .16s ease, transform .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: white; background: var(--rose); }
.btn-primary:hover { background: var(--rose-dark); }
.btn-soft { color: var(--rose-dark); border-color: #efd2d8; background: var(--rose-pale); }
.btn-outline { border-color: var(--line); background: var(--surface); }
.btn-danger { color: #92293d; border-color: #efd2d8; }
.btn-block { width: 100%; margin-top: 7px; }
.link-button { padding: 8px 0; border: 0; color: var(--rose-dark); background: none; font-size: 12px; }
.auth-switch { display: flex; justify-content: center; gap: 6px; margin: 17px 0 0; color: var(--muted); }
.notice { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #faf5ef; color: var(--muted); font-size: 12px; line-height: 1.6; }
.notice.rose { border-color: #efd2d8; background: var(--rose-pale); color: var(--rose-dark); }
.shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.rail { position: sticky; top: 0; display: flex; height: 100vh; height: 100dvh; min-height: 0; flex-direction: column; padding: 24px 17px 18px; color: #f1e5de; background: var(--night); }
.rail-brand { display: flex; flex: none; align-items: center; gap: 11px; padding: 2px 8px 22px; }
.rail-brand .brand-mark { width: 37px; height: 37px; }
.rail-brand strong { display: block; font: 600 17px var(--serif); }
.rail-brand small { color: #a9988e; font-size: 9px; letter-spacing: .12em; }
.rail-caption { padding: 0 10px 9px; color: #94837a; font-size: 10px; letter-spacing: .15em; }
.nav { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 20px; overflow-y: auto; padding: 5px 3px 18px; scrollbar-width: thin; scrollbar-color: #76655d transparent; overscroll-behavior: contain; }
.nav-group { flex: none; }
.nav-group-title { margin: 0 0 6px; padding: 0 11px; color: #ae9a90; font: 500 10px/1.6 var(--sans); letter-spacing: .08em; }
.nav-group-items { display: grid; gap: 3px; }
.nav button { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 0; border-radius: 9px; color: #cfbeb5; background: transparent; text-align: left; font-size: 12px; }
.nav button:hover { color: white; background: rgb(255 255 255 / 6%); }
.nav button[aria-current="page"] { color: #fff9f5; background: rgb(185 52 78 / 30%); font-weight: 650; }
.nav-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #76655d; }
.nav button[aria-current="page"] .nav-dot { background: #e16b81; }
.rail-user { display: flex; flex: none; align-items: center; gap: 10px; padding: 16px 5px 4px; border-top: 1px solid rgb(255 255 255 / 10%); }
.menu-toggle, .menu-close, .nav-backdrop { display: none; }
.avatar { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 50%; color: #f4e7de; background: #51403a; font-size: 12px; }
.rail-user strong { display: block; max-width: 132px; overflow: hidden; color: #f1e5de; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.rail-user small { color: #aa988f; font-size: 10px; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; min-height: 66px; align-items: center; gap: 14px; padding: 10px clamp(18px, 3vw, 42px); border-bottom: 1px solid var(--line); background: rgb(248 244 239 / 95%); }
.topbar-title { color: var(--muted); font-size: 11px; }
.topbar-title b { color: var(--ink); font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.connection { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); }
.content { width: min(100%, 1520px); margin: 0 auto; padding: clamp(20px, 3vw, 42px); padding-bottom: 80px; }
.page-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 23px; }
.page-head h1 { margin: 3px 0 6px; font: 600 clamp(25px, 3vw, 37px)/1.15 var(--serif); }
.page-head p { max-width: 70ch; margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.dashboard-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0 0 24px; padding: 6px 0 18px; border-bottom: 1px solid var(--line); }
.workflow-link { display: flex; min-width: 0; min-height: 76px; align-items: center; gap: 12px; padding: 14px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.workflow-link:hover { background: var(--surface-2); }
.workflow-link strong { display: block; font-size: 13px; font-weight: 650; }
.workflow-link small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.workflow-step { flex: none; color: var(--gold); font: 500 19px var(--serif); }
.workflow-arrow { margin-left: auto; color: var(--rose); }
.dashboard-next, .agent-entry { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dashboard-next { margin-bottom: 18px; padding: 16px 18px; border: 1px solid #efd2d8; border-radius: 12px; background: var(--rose-pale); }
.dashboard-next strong, .agent-entry strong { font-size: 13px; }
.dashboard-next p, .agent-entry p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.dashboard-next .btn, .agent-entry .btn { flex: none; }
.agent-entry { padding: 3px 4px; }
.home-management { margin-top: 30px; }
.home-management h2 { margin: 0 0 10px; font: 600 18px var(--serif); }
.admin-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; }
.admin-shortcuts .workflow-link { border-bottom: 1px solid var(--line); border-radius: 0; }
.home-service-notes { margin-top: 28px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.7; }
.home-service-notes summary { width: fit-content; cursor: pointer; }
.home-service-notes .notice-list { margin-top: 12px; }
.home-service-notes p { margin-bottom: 6px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 17px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 17px 19px 13px; }
.panel-head h2, .panel-head h3 { margin: 0; font: 600 16px var(--serif); }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-body { padding: 0 19px 19px; }
.divider { height: 1px; margin-bottom: 14px; background: var(--line); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; align-content: start; gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, .85fr); align-items: start; gap: 17px; }
.cards-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 17px; }
.cards-layout > .panel + .panel { margin-top: 0; }
.cards-layout > div { min-width: 0; }
.card-create-form { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.card-plan-field { min-width: 0; }
.card-plan-field .field { margin: 0; }
.card-plan-field .pagination { padding-top: 10px; gap: 8px; }
.card-plan-field .pagination-buttons { gap: 4px; }
.card-plan-field .pagination .btn { min-height: 32px; padding: 6px 9px; font-size: 11px; }
.card-create-settings { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; }
.card-create-settings .field { min-width: 0; margin: 0; }
.card-create-submit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.card-details table { min-width: 1000px; }
.card-details td { white-space: nowrap; vertical-align: middle; }
.card-details td:nth-child(2) { min-width: 240px; }
.card-details td:nth-child(3) { min-width: 180px; max-width: 230px; white-space: normal; overflow-wrap: anywhere; }
.card-details td .help { display: block; }
.card-details td:nth-child(2) .help { margin-bottom: 8px; }
.card-details .btn { white-space: nowrap; }
.card-code-actions { display: flex; align-items: center; gap: 12px; }
.card-code { font-family: Consolas, monospace; font-size: 13px; letter-spacing: .06em; white-space: nowrap; user-select: all; }
.devices-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 17px; }
.devices-layout > div { min-width: 0; }
.devices-layout > .stack { order: -1; }
#device-form { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; }
#device-form .field { min-width: 180px; flex: 0 1 300px; margin: 0; }
.device-details table { min-width: 850px; }
.device-details td { vertical-align: middle; white-space: nowrap; }
.device-details td:nth-child(2) { min-width: 170px; max-width: 230px; white-space: normal; overflow-wrap: anywhere; }
.device-details .btn { white-space: nowrap; }
.stat { padding: 17px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stat span { display: block; color: var(--muted); font-size: 11px; }
.stat strong { display: block; margin-top: 9px; font: 600 clamp(22px, 2.8vw, 31px) var(--serif); font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font: 11px var(--sans); }
.list { display: grid; }
.list-row { display: flex; min-height: 58px; align-items: center; gap: 14px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-main { min-width: 0; flex: 1; }
.list-main strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.list-main small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.account-entry + .account-entry { border-top: 1px solid var(--line); }
.login-preview { padding: 12px 0; }
.login-preview summary { cursor: pointer; color: var(--rose-dark); font-size: 12px; font-weight: 650; }
.login-preview img { display: block; width: 100%; max-width: 640px; height: auto; border: 1px solid var(--line); border-radius: 12px; }
.account-login { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 12px; padding: 18px 0 22px; }
.account-login strong { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.account-login.bound { padding: 10px 0 18px; gap: 4px; }
.account-login.bound strong { color: var(--jade); }
.binding-copy { min-width: 0; }
.qr-display { display: grid; justify-items: start; gap: 10px; max-width: 100%; }
.qr-display[hidden] { display: none; }
.qr-display img { width: min(240px, 100%); height: auto; aspect-ratio: 1; object-fit: contain; background: #fff; padding: 12px; border: 1px solid var(--line); }
.qr-display .help { margin: 0; }
.qr-display a.btn { color: var(--ink); text-decoration: none; }
.account-login .btn { min-height: 44px; white-space: normal; }
.account-entry { min-width: 0; }
.pill { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 9px; border-radius: 999px; color: var(--jade); background: #eaf3ee; font-size: 10px; white-space: nowrap; }
.pill.warn { color: var(--gold); background: #f6f0e4; }
.pill.off { color: var(--muted); background: var(--surface-2); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 10px 9px; color: var(--muted); font-size: 10px; font-weight: 600; text-align: left; white-space: nowrap; }
td { padding: 12px 9px; border-top: 1px solid var(--line); vertical-align: top; }
td .btn { min-height: 32px; padding: 6px 10px; font-size: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 15px; }
.form-grid .wide { grid-column: 1 / -1; }
.schedule-item { min-width: 0; margin: 0 0 18px; padding: 14px 0 16px; border: 0; border-bottom: 1px solid var(--line); }
.schedule-item legend { max-width: 100%; color: var(--jade); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 20px; margin-top: 20px; }
.settings-layout > *, .config-module-head > div { min-width: 0; }
.config-module { margin: 0; }
.settings-layout > .panel + .panel { margin-top: 0; }
.settings-layout > [data-config-module="ai"] { grid-column: 1 / -1; }
.ai-settings-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ai-settings-layout > section { min-width: 0; }
.ai-settings-layout h3 { margin: 0; font-size: 14px; }
.config-module-head { align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding-block: 20px; }
.config-module-head h2 { font-size: 19px; }
.config-module .config-save { min-height: 46px; padding-inline: 20px; font-size: 13px; white-space: nowrap; }
.config-module-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 19px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 17px 17px; }
.config-feedback { flex: 1 1 180px; min-width: 0; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.config-module [data-kind="dirty"] { color: var(--gold); }
.config-module [data-kind="success"] { color: var(--jade); }
.config-module [data-kind="error"] { color: var(--rose-dark); }
.config-subsection { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.config-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.config-section-head h3 { margin: 0; font-size: 14px; }
.config-section-head h3 small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 400; }
.schedule-times { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.schedule-time-row { display: flex; align-items: end; gap: 8px; flex: 0 1 240px; min-width: 0; }
.schedule-time-field { display: grid; flex: 1; min-width: 0; gap: 6px; font-size: 12px; }
.schedule-time-field .input { min-width: 0; min-height: 46px; font-size: 16px; font-variant-numeric: tabular-nums; }
.schedule-time-row .btn { min-height: 46px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 14px; }
.inline-form .field { min-width: 130px; flex: 1; margin: 0; }
.inline-form .field.compact { max-width: 180px; }
.code-output { margin: 11px 0 0; padding: 12px; border-radius: 10px; color: #f7ece6; background: var(--night); font: 11px/1.7 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { padding: 24px 12px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; }
.empty b { display: block; margin-bottom: 5px; color: var(--ink); }
.notice-list { display: grid; gap: 10px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.toolbar .field { min-width: 190px; flex: 1; margin: 0; }
.checkbox-line { display: flex; align-items: center; gap: 9px; min-height: 44px; color: var(--ink); font-size: 12px; }
.checkbox-line input { accent-color: var(--rose); width: 17px; height: 17px; }
.customer-search-box { position: relative; min-width: 0; }
.customer-search-results:not([hidden]) {
  position: absolute; z-index: 10; top: calc(100% + 5px); left: 0; right: 0;
  display: grid; max-height: 260px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow);
}
.customer-result {
  display: flex; min-height: 44px; width: 100%; align-items: center; justify-content: space-between;
  gap: 12px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; text-align: left; font-size: 12px; overflow-wrap: anywhere;
}
.customer-result:last-child { border-bottom: 0; }
.customer-result:hover, .customer-result:focus-visible { background: var(--rose-pale); }
.customer-result small, .customer-search-feedback { color: var(--muted); font-size: 11px; }
.customer-result > small { flex: none; }
.customer-selected { color: var(--jade); font-size: 12px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.footnote { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 20; max-width: min(420px, calc(100vw - 36px)); padding: 12px 16px; border-radius: 12px; color: #fff8f4; background: var(--night); box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: none; }
.mobile-brand { display: none; }
.sms-verification { display: grid; gap: 10px; width: 100%; margin: 14px 0; max-width: 680px; }
.sms-verification > label { font-weight: 600; }
.sms-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sms-actions .input { flex: 1 1 180px; min-width: 0; max-width: 280px; }
.sms-actions .btn { min-height: 44px; }
.sms-verification .form-error { color: var(--rose); min-height: 1.5em; }
.sms-verification .form-error:empty { display: none; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 210px minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .card-create-form { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 720px) {
  .shell { display: block; }
  body.nav-open { overflow: hidden; }
  .rail { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(300px, calc(100vw - 56px)); height: 100vh; height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 15px max(16px, env(safe-area-inset-bottom)); visibility: hidden; transform: translateX(-100%); transition: transform .18s ease, visibility .18s; }
  .menu-open .rail { visibility: visible; transform: none; }
  .rail-brand { padding-bottom: 20px; }
  .rail-caption { padding-bottom: 12px; }
  .menu-close { display: grid; width: 44px; height: 44px; flex: none; margin-left: auto; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #f1e5de; font-size: 26px; }
  .menu-close:hover { background: rgb(255 255 255 / 6%); }
  .menu-toggle { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .menu-open .nav-backdrop { display: block; position: fixed; z-index: 29; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: rgb(25 18 15 / 42%); cursor: pointer; }
  .topbar { min-height: 62px; gap: 10px; padding: 8px 12px; }
  .topbar-title { min-width: 0; color: var(--ink); }
  .topbar-title b, .topbar-divider { display: none; }
  .topbar-page { display: block; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
  .topbar-actions { flex: none; gap: 5px; }
  .dashboard-shortcuts { grid-template-columns: minmax(0, 1fr); padding: 0 0 14px; margin-bottom: 20px; }
  .workflow-link { min-height: 68px; padding: 12px 8px; }
  .dashboard-next, .agent-entry { align-items: flex-start; flex-direction: column; gap: 10px; }
  .admin-shortcuts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .content { padding: 20px 15px 45px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-head .actions { margin-left: 0; }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .panel-head { padding: 15px 15px 11px; }
  .panel-body { padding: 0 15px 15px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .wide { grid-column: auto; }
  .ai-settings-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .config-module-head { padding: 18px 15px; }
  .config-module-footer { padding: 16px 15px; }
  .config-module-footer .config-save { width: 100%; }
  .schedule-time-row { flex-basis: 100%; }
  .stat { padding: 14px; }
  .connection { display: none; }
  .account-entry .list-row { flex-wrap: wrap; }
  .sms-actions .input { flex-basis: 100%; max-width: none; }
}
@media (max-width: 420px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .topbar-title { font-size: 10px; }
  .topbar-actions .btn { min-height: 37px; padding: 7px 11px; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .inline-form .field, .inline-form .field.compact { max-width: none; min-width: 0; width: 100%; }
  td, th { padding-right: 7px; padding-left: 7px; }
  .card-create-settings { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
/* Agent finance shares the existing warm, restrained workbench tokens. */
.agent-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 20px; }
.wallet-stats { margin-bottom:24px; }
.finance-body { gap:20px; }
.finance-date-filter { display:flex; flex-wrap:wrap; align-items:end; gap:14px; margin:12px 0 18px; }
.finance-date-filter .field { flex:0 1 240px; margin:0; }
.finance-date-filter button { min-height:44px; }
.finance-reference { max-width:230px; overflow-wrap:anywhere; font-size:12px; }
.invite-details { padding-bottom:20px; margin-bottom:20px; border-bottom:1px solid var(--line,#e8e0d6); }
.invite-link { overflow-wrap:anywhere; line-height:1.8; }
.payment-layout { display:grid; grid-template-columns:minmax(0,1fr) 240px; gap:28px; align-items:center; }
.payment-layout:not(:has(.payment-qr)) { grid-template-columns:1fr; }
.payment-qr { text-align:center; }
.payment-qr img { display:block; max-width:100%; height:auto; margin:auto; }
.payment-layout .actions { flex-wrap:wrap; margin:16px 0; }
.recipient-info { white-space:pre-wrap; overflow-wrap:anywhere; min-width:180px; max-width:340px; }
.finance-body .panel,.finance-body .panel-body { min-width:0; }
.finance-body table { min-width:760px; }
.finance-body form>.btn { margin-top:12px; }
@media(max-width:680px) {
  .agent-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .agent-tabs .btn { white-space:normal; min-height:44px; }
  .wallet-stats { grid-template-columns:1fr; }
  .finance-date-filter .field { flex:1 1 100%; }
  .finance-date-filter button { width:100%; }
  .payment-layout { grid-template-columns:1fr; gap:20px; }
  .payment-qr { order:-1; }
  .finance-body .actions { flex-wrap:wrap; }
  .finance-body form>.btn { width:100%; min-height:44px; }
}
