:root {
  color-scheme: light;
  -webkit-tap-highlight-color: transparent;
  --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-color .12s ease-out;
}
.btn:not(:disabled):not([aria-disabled="true"]):active { background-color: var(--surface-2); }
.btn[aria-busy="true"] { opacity: .72; cursor: progress; }
.action-feedback { display: inline-block; margin: 0 8px; color: var(--muted); font-size: 12px; }
.btn-primary { color: white; background: var(--rose); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:not(:disabled):not([aria-disabled="true"]):hover { background: var(--rose-dark); }
}
.btn-primary:not(:disabled):not([aria-disabled="true"]):active { background-color: 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; }
.customer-detail-link { max-width: 100%; min-height: 44px; padding: 3px 0; border: 0; background: none; color: var(--rose-dark); font-weight: 650; text-align: left; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.customer-detail-link:hover { color: var(--rose); }
.customer-detail-link:disabled { opacity: .6; cursor: wait; }
.customer-detail-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 18px 24px; margin: 16px 0 0; }
.customer-detail-fields dt { color: var(--muted); font-size: 12px; }
.customer-detail-fields dd { margin: 7px 0 0; font-size: 14px; line-height: 1.6; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.customer-detail-fields .customer-detail-link { min-height: 30px; }
.customer-detail-view .grid > .panel + .panel { margin-top: 0; }
.customer-record-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.customer-records table { min-width: 660px; }
.customer-records td { max-width: 280px; overflow-wrap: anywhere; }
.customer-record-id { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .customer-detail-fields { gap: 16px; }
  .customer-record-tabs .btn { min-height: 44px; }
  .customer-detail-fields .customer-detail-link { min-height: 44px; }
}
.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 button:not(:disabled):active { color: #fff9f5; background-color: rgb(185 52 78 / 40%); }
.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; }
.mobile-nav, .mobile-account, .mobile-rail-actions, .mobile-filter-toggle, .mobile-row-toggle { 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; flex-wrap: wrap; 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 { flex: 1; min-width: 180px; color: var(--muted); font-size: 11px; }
.topbar-title b { color: var(--ink); font-weight: 650; }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; margin-left: auto; }
.topbar-actions .btn { white-space: nowrap; }
.member-level { padding: 8px 10px; border-radius: 8px; background: var(--surface); color: var(--rose-dark); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.member-upgrade { min-height: 42px; }
.topbar-support { color: var(--rose-dark); border-color: var(--rose); }
.recharge-options { display: grid; gap: 14px; padding-top: 20px; }
.support-contact { display: grid; gap: 16px; padding-top: 12px; }
.support-contact > .btn { justify-self: start; }
.support-contact-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.support-contact-row > div { min-width: 0; }
.support-contact-row small { display: block; color: var(--muted); margin-bottom: 4px; }
.support-contact-row strong { overflow-wrap: anywhere; }
.support-contact-row .btn { flex: none; }
.support-qr { margin: 0; text-align: center; }
.support-qr img { display: block; width: min(100%, 240px); height: auto; margin: 0 auto 12px; }
.support-qr figcaption { color: var(--muted); font-size: 12px; }
.support-qr-preview { display: block; max-width: min(100%, 220px); max-height: 260px; object-fit: contain; margin: 12px 0; }
.topbar-notice { position: relative; display: grid; width: 42px; height: 42px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 19px; }
.notice-badge { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: #cc2645; box-shadow: 0 0 0 2px var(--surface); }
.notice-badge[hidden] { display: none; }
body.notice-open { overflow: hidden; }
.notice-overlay { position: fixed; z-index: 45; inset: 0; display: grid; place-items: center; padding: 18px; }
.notice-backdrop { position: absolute; inset: 0; border: 0; background: rgb(25 18 15 / 55%); }
.notice-dialog { position: relative; display: flex; width: min(100%, 620px); max-height: min(85dvh, 800px); flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 18px 60px rgb(35 25 20 / 20%); }
.notice-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.notice-dialog h2 { margin: 0; font-size: 18px; }
.notice-close { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border: 0; border-radius: 6px; background: var(--surface-2); font-size: 22px; }
.notice-dialog-body { min-height: 0; overflow-y: auto; padding: 0 22px 20px; overscroll-behavior: contain; }
.notice-dialog-footer { flex: none; display: grid; gap: 12px; padding: 14px 22px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.notice-dialog-actions { display: flex; gap: 10px; }
.notice-dialog-actions .btn { flex: 1; min-height: 44px; }
.announcement-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.announcement-item:last-child { border-bottom: 0; }
.announcement-heading { display: flex; align-items: center; gap: 9px; }
.announcement-heading h3 { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.announcement-new { flex: none; color: var(--rose-dark); font-size: 11px; font-weight: 650; }
.announcement-item time { display: block; margin: 5px 0 10px; color: var(--muted); font-size: 11px; }
.announcement-item p { margin: 0 0 13px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice-pages { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.tutorial-dialog { width: min(100%, 1060px); height: min(90dvh, 820px); max-height: none; }
.tutorial-dialog .notice-dialog-body { flex: 1; padding: 0; overflow: hidden; }
.tutorial-layout { display: grid; grid-template-columns: minmax(210px, 260px) minmax(0, 1fr); height: 100%; min-height: 0; }
.tutorial-player { grid-column: 2; grid-row: 1; display: flex; min-width: 0; min-height: 0; flex-direction: column; padding: 20px 22px 24px; }
.tutorial-current-title { margin: 0 0 14px; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.tutorial-stage { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; overflow: hidden; border-radius: 6px; background: var(--night); }
.tutorial-video { display: block; width: 100%; height: 100%; object-fit: contain; }
.tutorial-list { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto; padding: 20px 12px; border-right: 1px solid var(--line); overscroll-behavior: contain; }
.tutorial-choice { display: flex; flex: none; align-items: flex-start; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.tutorial-choice.is-current { border-color: #416d63; background: #eef5f1; }
.tutorial-choice:hover, .tutorial-choice:focus-visible { background: var(--surface-2); }
.tutorial-choice.is-current:hover, .tutorial-choice.is-current:focus-visible { background: #eef5f1; }
.tutorial-choice span { flex: none; color: #537368; font-variant-numeric: tabular-nums; }
.tutorial-choice strong { min-width: 0; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .tutorial-dialog { height: auto; max-height: 90dvh; }
  .tutorial-dialog .notice-dialog-body { overflow-y: auto; }
  .tutorial-layout { display: flex; height: auto; flex-direction: column; }
  .tutorial-player { padding: 16px 16px 0; }
  .tutorial-stage { flex: none; height: min(46dvh, 420px); min-height: 150px; }
  .tutorial-list { flex: none; overflow: visible; margin-top: 14px; padding: 0 16px 16px; border-right: 0; }
  .tutorial-choice { border-color: var(--line); }
}
.tutorial-admin-list { margin-top: 22px; }
.tutorial-admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #d9dfe1; }
@media (max-width: 600px) { .tutorial-admin-row { align-items: flex-start; flex-direction: column; } }
.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); }
.publication-global { width: min(100%, 1520px); margin: 0 auto; padding: 0 clamp(20px, 3vw, 42px); }
.publication-compact:empty { display: none; }
.publication-compact-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; }
.publication-compact-row p { margin: 0; font-size: 13px; overflow-wrap: anywhere; min-width: 0; }
.publication-compact-row small { display: block; margin-top: 4px; }
.publication-compact-row .btn { flex-shrink: 0; min-height: 44px; }
.publication-status { margin-block: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.publication-global .publication-status { margin-block: 0; }
.publication-status-heading, .publication-status-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.publication-status-heading > strong { font-size: 14px; }
.publication-status-list { list-style: none; margin: 0; padding: 0; }
.publication-status-list li { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.publication-status-list li > div { min-width: 0; display: grid; gap: 4px; overflow-wrap: anywhere; }
.publication-status-list span, .publication-status-list small { font-size: 13px; }
.publication-status .btn { flex-shrink: 0; min-height: 44px; }
.publication-dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); overflow-y: auto; overscroll-behavior: contain; }
.publication-dialog::backdrop { background: rgb(41 33 30 / 42%); }
.publication-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.publication-dialog h2 { margin: 0; font-size: 18px; }
.publication-dialog-body { padding: 0 20px max(20px, env(safe-area-inset-bottom)); overflow-wrap: anywhere; }
.publication-dialog dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; }
.publication-dialog dt { color: var(--muted); }
.publication-dialog dd { margin: 0; }
.publication-dialog .input { margin-top: 8px; font-size: 18px; }
.publication-dialog .btn { min-height: 44px; }
.publication-dialog [hidden] { display: none !important; }
.publication-dialog .actions { flex-wrap: wrap; }
.account-entry [data-publication-probe-status]:not(:empty) { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; }
.publication-probe-message { flex: 1 1 220px; margin: 0; overflow-wrap: anywhere; }
.account-entry [data-publication-action="probe"] { min-height: 44px; }
.publication-dialog [data-publication-countdown] { font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .publication-global { padding-inline: 15px; }
  .publication-compact-row { flex-wrap: wrap; gap: 8px; }
  .publication-status-list li { flex-wrap: wrap; gap: 8px; }
  .publication-dialog header { padding-inline: 15px; }
  .publication-dialog-body { padding-inline: 15px; }
  .publication-dialog .actions .btn { flex: 1 1 140px; }
}
.content { width: min(100%, 1520px); margin: 0 auto; padding: clamp(20px, 3vw, 42px); padding-bottom: 80px; }
.page-loading { display: flex; align-items: center; gap: 10px; min-height: 80px; color: var(--muted); font-size: 13px; }
.loading-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--rose); animation: loading-pulse .8s ease-in-out infinite alternate; }
@keyframes loading-pulse { to { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .loading-dot { animation: none; } }
.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; }
#announcement-form { scroll-margin-top: 88px; }
.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; }
.plan-benefits { margin: 14px 0 10px; padding-left: 19px; font-size: 12px; line-height: 1.9; }
.list-main small.account-quota { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.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 { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 19px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 94%, transparent); border-radius: 0 0 17px 17px; box-shadow: 0 -6px 14px color-mix(in srgb, var(--ink) 8%, transparent); }
.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; }
.comment-settings { display: grid; gap: 20px; }
.comment-settings > .checkbox-line { min-height: 48px; padding-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 650; }
.comment-interval-section { padding: 2px 0 4px; }
.comment-interval-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.comment-interval-heading h3 { margin: 0; font-size: 15px; }
.comment-interval-heading span { color: var(--muted); font-size: 12px; }
.comment-interval-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.comment-interval-row .field { margin: 0; }
.comment-interval-row .field label { font-size: 13px; }
.comment-interval-row .input { min-height: 54px; padding-inline: 14px; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.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: 1 0 100%; gap: 5px; justify-content: flex-start; }
  .topbar-actions > .btn[data-action="refresh"] { display: none; }
  .topbar-tutorial { padding-inline: 9px; }
  .topbar-notice { width: 40px; height: 40px; }
  .notice-overlay { padding: 10px; }
  .notice-dialog { max-height: 90dvh; }
  .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%; }
  .comment-interval-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .comment-interval-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .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; }
  .topbar { flex-wrap: nowrap; min-height: 58px; padding: 7px 15px; }
  .topbar-title { font-size: 14px; }
  .topbar-page { font-size: 14px; }
  .topbar-actions { flex: none; margin-left: 0; }
  .topbar-actions > :not(.topbar-notice):not(.topbar-agent-recruitment) { display: none; }
  .topbar-notice { width: 44px; height: 44px; }
  .mobile-account { display: flex; align-items: center; gap: 8px; min-height: 49px; padding: 6px 15px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .mobile-member-level { flex: 1; min-width: 0; color: var(--rose-dark); font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .mobile-account button { flex: none; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 12px; font-weight: 650; }
  .mobile-account button:last-child { color: white; background: var(--rose); border-color: var(--rose); }
  .mobile-nav { position: fixed; z-index: 15; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: 58px; padding: 5px 6px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
  .mobile-nav button { min-width: 0; min-height: 48px; padding: 4px 1px; border: 0; border-radius: 6px; background: transparent; font-size: 12px; font-weight: 650; }
  .mobile-nav button[aria-current="page"] { color: var(--rose-dark); background: var(--rose-pale); }
  .mobile-rail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: none; gap: 6px; padding: 12px 3px; border-top: 1px solid rgb(255 255 255 / 12%); }
  .mobile-rail-actions button { min-height: 44px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 6px; background: transparent; color: #f1e5de; font-size: 12px; }
  .content { padding: 16px 15px calc(90px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 22px; }
  .mobile-filter-toggle { display: flex; width: 100%; min-height: 44px; align-items: center; padding: 8px 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 13px; text-align: left; overflow-wrap: anywhere; }
  .list-toolbar { display: none; }
  .list-toolbar.filters-open { display: flex; }
  .list-toolbar .list-query { flex-basis: 100%; font-size: 16px; }
  .list-toolbar .page-size-label { margin-left: auto; }
  .pagination { align-items: center; flex-wrap: wrap; }
  .pagination-buttons { margin-left: auto; }
  .pagination .list-boundary, .pagination [data-action="list-jump"], .pagination .list-jump { display: none; }
  .pagination .btn { min-width: 44px; min-height: 44px; }
  .table-wrap { overflow-x: visible; }
  .table-wrap table, .table-wrap tbody { display: block; width: 100%; min-width: 0; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .table-wrap tbody tr[data-mobile-ready] { display: grid; gap: 4px; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .table-wrap tbody tr[data-mobile-ready] td { display: none; min-width: 0; max-width: none; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; }
  .table-wrap tbody tr[data-mobile-ready] td:nth-child(-n+2),
  .table-wrap tbody tr[data-mobile-ready] td[data-mobile-key],
  .table-wrap tbody tr.mobile-expanded td { display: block; }
  .table-wrap tbody tr[data-mobile-ready] td:first-child { color: var(--ink); font-weight: 650; }
  .table-wrap tbody tr[data-mobile-ready] td[data-mobile-key]:not(:nth-child(-n+2))::before { content: attr(data-mobile-label) " · "; color: var(--muted); font-weight: 400; }
  .table-wrap tbody tr.mobile-expanded td:nth-child(n+3)::before { content: attr(data-mobile-label) " · "; color: var(--muted); font-weight: 400; }
  .table-wrap tbody tr:not([data-mobile-ready]) { display: block; }
  .table-wrap tbody tr:not([data-mobile-ready]) td { display: block; border: 0; }
  .mobile-row-toggle { display: inline-flex; min-height: 44px; align-items: center; padding: 4px 8px; margin-left: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--rose-dark); font-size: 12px; font-weight: 650; }
  .table-wrap td .btn { min-height: 44px; padding: 8px 12px; font-size: 12px; margin: 3px 5px 3px 0; }
  .table-wrap :is(.card-code-actions, .actions) { flex-wrap: wrap; }
  .customer-records table, .card-details table, .device-details table, .finance-body table { min-width: 0; }
  .customer-record-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; }
  .customer-record-tabs .btn { flex: none; }
  .mobile-admin-section { min-width: 0; }
  .mobile-admin-section > summary { display: flex; align-items: center; min-height: 52px; padding: 10px 15px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: 14px; font-weight: 650; cursor: pointer; }
  .mobile-admin-section > summary::after { content: "展开"; margin-left: auto; color: var(--rose-dark); font-size: 12px; }
  .mobile-admin-section[open] > summary::after { content: "收起"; }
  .mobile-admin-section .panel { margin: 0 0 12px; }
  .panel, .panel-body, .paged-list, .table-wrap { min-width: 0; }
  .form-grid .btn, .content form > .btn { min-height: 44px; }
  .config-module-footer { bottom: calc(58px + env(safe-area-inset-bottom)); padding: 10px 15px max(10px, env(safe-area-inset-bottom)); }
  .config-feedback { font-size: 11px; }
  .notice-overlay { align-items: end; padding: 0; }
  .notice-dialog { width: 100%; max-height: calc(100dvh - max(12px, env(safe-area-inset-top))); border-radius: 8px 8px 0 0; }
  .notice-dialog header { padding: 12px 15px; }
  .notice-close { width: 44px; height: 44px; }
  .notice-dialog-body { padding: 0 15px 14px; }
  .notice-dialog-footer { padding-inline: 15px; }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .shell[data-current-page="checkout"] .mobile-nav, .shell[data-current-page="checkout"] .mobile-account,
  body.mobile-keyboard .mobile-nav { display: none; }
  body.mobile-keyboard .config-module-footer { bottom: 0; }
  .input, .select, .textarea { font-size: 16px; }
  [id$="-panel"]:not([hidden]) { scroll-margin-top: 72px; }
}
@media (max-width: 420px) {
  .member-level { flex: 1 0 100%; font-size: 13px; }
  .topbar-actions .member-upgrade { min-height: 44px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-title { font-size: 10px; }
  .topbar-actions .btn { min-height: 37px; padding: 7px 11px; }
  .topbar-actions > .btn[data-action="logout"] { padding-inline: 8px; }
  .topbar-actions .topbar-tutorial { padding-inline: 7px; font-size: 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; }
}
/* Keep press feedback inside each control's rounded background. */
:is(.workflow-link, .topbar-notice, .notice-close, .menu-toggle, .customer-result, .ai-spec-option):not(:disabled):active,
.ai-quantity-control button:not(:disabled):active { background-color: var(--rose-pale); }
.menu-close:not(:disabled):active { background-color: rgb(185 52 78 / 40%); }
.link-button:not(:disabled):active, .customer-detail-link:not(:disabled):active,
.checkout-back:not(:disabled):active { color: var(--rose); }
/* 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; }
.checkout-page { width: min(100%, 960px); margin: 0 auto; padding: 10px 0 64px; }
.checkout-back { display: inline-flex; min-height: 44px; align-items: center; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; }
.checkout-back:hover { color: var(--ink); }
.checkout-heading { padding: 34px 0 26px; border-bottom: 1px solid var(--line); }
.checkout-step { color: var(--jade); font-size: 12px; font-weight: 700; }
.checkout-heading h1 { margin: 9px 0 7px; font: 600 30px var(--serif); }
.checkout-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 310px); gap: 48px; padding-top: 34px; }
.checkout-main { display: flex; min-width: 0; flex-direction: column; align-items: center; text-align: center; }
.checkout-qr { display: grid; place-items: center; padding: 14px; background: white; border: 1px solid var(--line); }
.checkout-qr img { display: block; width: min(280px, 100%); height: auto; aspect-ratio: 1; }
.checkout-amount { display: grid; gap: 5px; margin-top: 19px; }
.checkout-amount span { color: var(--muted); font-size: 13px; }
.checkout-amount strong { color: var(--ink); font-size: 32px; font-weight: 750; font-variant-numeric: tabular-nums; }
.checkout-channel { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; font-size: 13px; font-weight: 650; }
.payment-method-mark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #fff; background: #20763f; }
.payment-method-mark.alipay { background: #1677ff; }
.checkout-status { margin: 16px 0 0; color: var(--jade); font-size: 13px; line-height: 1.6; }
.checkout-instruction { max-width: 320px; margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.checkout-save { margin-top: 16px; }
.checkout-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.checkout-actions .btn { min-height: 44px; }
.checkout-state-icon { display: grid; width: 110px; height: 110px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--jade); font-size: 48px; }
.checkout-order { min-width: 0; padding: 6px 0 0 32px; border-left: 1px solid var(--line); }
.checkout-order h2 { margin: 0 0 28px; font: 600 18px var(--serif); }
.checkout-order dl { margin: 0; }
.checkout-order dl > div { display: grid; gap: 6px; margin-bottom: 23px; }
.checkout-order dt { color: var(--muted); font-size: 12px; }
.checkout-order dd { margin: 0; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.checkout-order-id { font-size: 12px !important; font-weight: 400 !important; font-variant-numeric: tabular-nums; }
.checkout-order > p { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.8; }
.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%; }
  .checkout-page { padding-bottom: 40px; }
  .checkout-heading { padding: 18px 0 20px; }
  .checkout-heading h1 { font-size: 24px; }
  .checkout-layout { grid-template-columns: 1fr; gap: 36px; padding-top: 24px; }
  .checkout-qr img { width: min(240px, calc(100vw - 98px)); }
  .checkout-amount strong { font-size: 29px; }
  .checkout-order { padding: 26px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .checkout-order h2 { margin-bottom: 20px; }
  .checkout-order dl > div { margin-bottom: 15px; }
  .checkout-actions { width: 100%; }
  .checkout-actions .btn, .checkout-save { min-height: 44px; }
  .finance-body .actions { flex-wrap:wrap; }
  .finance-body form>.btn { width:100%; min-height:44px; }
}
/* Read-only teacher suggestion: preserve the existing warm, utility-first UI. */
.dm-image { margin: 12px 0; max-width: 100%; }
.dm-image img { display: block; width: 160px; height: 160px; max-width: 100%; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.dm-image figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); }
.dm-preview { margin-top: 16px; overflow-wrap: anywhere; }
.dm-cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.dm-cover-option { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface-2); font-size: 12px; }
.dm-cover-option:has(input:checked) { outline: 2px solid var(--rose-dark); }
.dm-cover-option img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.dm-cover-option .actions { display: grid; gap: 5px; }
.dm-cover-option .btn { white-space: normal; min-height: 38px; }
.dm-preview summary, #dm-config-form details > summary { min-height: 44px; cursor: pointer; padding: 12px 0; }
.dm-conversation { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
#dm-config-form, #dm-card-form { min-width: 0; }
#dm-config-form input, #dm-card-form input { max-width: 100%; }
@media (max-width: 720px) {
  .dm-conversation { flex-direction: column; gap: 4px; }
  #dm-config-form .actions .btn, #dm-card-form .actions .btn { width: 100%; min-height: 44px; }
}
.teacher-area { margin-top: 18px; }
.teacher-recommendation { display: grid; gap: 18px; }
.teacher-header, .teacher-admin-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.teacher-header strong, .teacher-admin-row strong { display: block; font: 600 18px var(--serif); }
.teacher-header small, .teacher-admin-row small { display: block; color: var(--muted); font-size: 12px; }
.teacher-portrait { flex: none; width: 54px; height: 54px; border-radius: 50%; object-fit: cover; }
.teacher-portrait-default { display: grid; place-items: center; background: var(--rose-pale); color: var(--rose-dark); font: 600 22px var(--serif); }
.teacher-message { padding: 14px 18px; margin: 0; border-radius: 12px; background: var(--surface-2); line-height: 1.7; overflow-wrap: anywhere; }
.teacher-note { display: flex; gap: 18px; align-items: flex-start; min-width: 0; }
.teacher-note img { width: 120px; aspect-ratio: 3 / 4; flex: none; border-radius: 10px; object-fit: cover; }
.teacher-note > div { min-width: 0; overflow-wrap: anywhere; }
.teacher-note strong { font: 600 18px var(--serif); }
.teacher-note p { margin: 8px 0; color: var(--muted); font-size: 13px; }
.teacher-admin-row { padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.teacher-admin-row > div { flex: 1; min-width: 125px; }
@media (max-width: 720px) {
  .teacher-note img { width: 86px; }
  .teacher-admin-row .btn { min-height: 40px; }
}
.registration-consent { margin: 16px 0 12px; }
.registration-consent .checkbox-line { align-items: flex-start; line-height: 1.8; }
.registration-consent .checkbox-line input { flex: 0 0 18px; margin-top: 3px; }
.registration-consent a { color: var(--rose); text-decoration: underline; text-underline-offset: 3px; }
.registration-consent a[aria-disabled="true"] { pointer-events: none; opacity: .6; }
.registration-consent .help { margin: 6px 0 0 27px; overflow-wrap: anywhere; }

.ai-plan-day > .ai-schedule-day-head { grid-template-columns: minmax(0, 1fr) auto; }
.ai-plan-day > .ai-schedule-day-head > .btn { min-height: 44px; }
.ai-plan-list { display: grid; gap: 12px; margin-top: 14px; }
.ai-plan-card { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.ai-plan-card-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; }
.ai-plan-card-heading strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.ai-plan-summary { margin: 10px 0 6px; line-height: 1.6; overflow-wrap: anywhere; }
.ai-plan-card .help { margin: 0 0 12px; overflow-wrap: anywhere; }
.ai-plan-actions, .ai-plan-drafts { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-plan-actions .btn, .ai-plan-drafts .btn { min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
.ai-plan-drafts { margin-top: 12px; }
.ai-plan-immediate { display: flex; align-items: center; gap: 9px; min-height: 44px; margin-bottom: 10px; cursor: pointer; }
.ai-plan-immediate input { width: 18px; height: 18px; accent-color: var(--rose); }
.ai-plan-account-label { min-width: 0; overflow-wrap: anywhere; }
.ai-plan-account-label small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.ai-generation-target[id] { scroll-margin-top: 80px; }
.ai-generation-target[id]:target { background: var(--rose-pale); }
@media (max-width: 600px) {
  .ai-plan-card { padding: 12px; }
  .ai-plan-card-heading { align-items: flex-start; flex-direction: column; }
  .ai-plan-card .ai-schedule-status { text-align: left; }
  .ai-plan-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-plan-actions .btn { width: 100%; }
}

.topbar-agent-recruitment { white-space: nowrap; }
@media (max-width: 720px) { .topbar-actions .topbar-agent-recruitment { min-height: 44px; padding-inline: 10px; } }
