:root {
  color-scheme: light;
  --brand: #159a66;
  --brand-dark: #0d7850;
  --brand-deep: #123c30;
  --brand-soft: #e9f7f0;
  --accent: #dff3e9;
  --ink: #17241f;
  --muted: #6f7d77;
  --line: #e5ebe8;
  --surface: #ffffff;
  --canvas: #f5f7f6;
  --danger: #c84444;
  --danger-soft: #fff0ef;
  --warning: #9b6815;
  --warning-soft: #fff6df;
  --shadow: 0 18px 60px rgba(21, 55, 42, .14);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #e9eeeb; color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
input, textarea, select { min-width: 0; }
input::placeholder, textarea::placeholder { color: #a1aca7; }
.hidden { display: none !important; }
.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; }
.muted { color: var(--muted); }

.phone-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 540px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--canvas);
}

.boot-screen, .login-screen, .app-shell { position: absolute; inset: 0; }
.boot-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--surface); }
.boot-screen p { margin: 0; color: var(--brand-deep); font-size: 25px; font-weight: 800; letter-spacing: .14em; }
.spinner { width: 23px; height: 23px; border: 2px solid var(--accent); border-top-color: var(--brand); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand-mark { position: relative; flex: 0 0 auto; width: 31px; height: 31px; }
.brand-mark span { position: absolute; width: 22px; height: 22px; border: 3px solid var(--brand); border-radius: 50%; }
.brand-mark span:first-child { top: 0; left: 0; }
.brand-mark span:last-child { right: 0; bottom: 0; border-color: var(--brand-deep); background: rgba(255,255,255,.45); }
.brand-mark-large { width: 60px; height: 60px; }
.brand-mark-large span { width: 43px; height: 43px; border-width: 5px; }

.login-screen { overflow-y: auto; padding: max(42px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); background: linear-gradient(155deg, #f0faf5 0%, #fff 47%, #f7f9f8 100%); }
.login-hero { display: flex; flex-direction: column; align-items: flex-start; padding: 18px 4px 25px; }
.login-hero .brand-mark { margin-bottom: 30px; }
.eyebrow { margin: 0 0 6px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.login-hero h1, .view-heading h1 { margin: 0; color: var(--brand-deep); font-size: 28px; line-height: 1.22; letter-spacing: -.03em; }
.login-hero > .muted { margin: 12px 0 0; font-size: 14px; line-height: 1.65; }
.account-options { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; border: 0; }
.account-options legend { margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.account-option { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 1.5px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.9); cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.account-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.account-option:active { transform: scale(.99); }
.account-option input { position: absolute; opacity: 0; pointer-events: none; }
.account-avatar { display: grid; flex: 0 0 auto; width: 41px; height: 41px; place-items: center; border-radius: 13px; background: #edf1ef; color: var(--brand-deep); font-weight: 800; }
.account-option:has(input:checked) .account-avatar { background: var(--brand); color: white; }
.account-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; }
.account-copy strong { font-size: 14px; }
.account-copy small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.radio-dot { width: 18px; height: 18px; border: 1.5px solid #c4cec9; border-radius: 50%; }
.account-option:has(input:checked) .radio-dot { border: 5px solid var(--brand); background: white; }
.login-footnote { margin: 22px 0 0; color: #97a29d; font-size: 11px; text-align: center; }
.server-entry { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; font-size: 12px; }
.link-button { background: none; border: 0; color: var(--brand); cursor: pointer; font-size: 12px; padding: 0; text-decoration: underline; }

.button { min-height: 44px; padding: 11px 17px; border: 0; border-radius: 13px; font-weight: 750; font-size: 14px; line-height: 1.3; transition: transform .15s, background .15s; }
.button:active { transform: scale(.98); }
.button-primary { background: var(--brand); color: white; box-shadow: 0 6px 16px rgba(21,154,102,.18); }
.button-primary:hover { background: var(--brand-dark); }
.button-soft { background: var(--brand-soft); color: var(--brand-dark); }
.button-text { min-height: 36px; background: transparent; color: var(--muted); }
.button-danger-soft { background: var(--danger-soft); color: var(--danger); }
.button-block { width: 100%; }
.button-small { min-height: 36px; padding: 8px 13px; border-radius: 11px; font-size: 12px; }
.form-error { margin: 10px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }

.app-shell { display: flex; flex-direction: column; background: var(--canvas); }
.app-header { z-index: 3; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 20px 0; border-bottom: 1px solid rgba(229,235,232,.7); background: rgba(255,255,255,.96); }
.brand-lockup { display: flex; align-items: center; gap: 9px; }
.brand-lockup strong { color: var(--brand-deep); font-size: 20px; letter-spacing: .06em; }
.connection-pill { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 20px; background: var(--canvas); color: var(--muted); font-size: 10px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #c1c9c5; }
.status-dot.online { background: var(--brand); box-shadow: 0 0 0 3px rgba(21,154,102,.12); }
.app-content { flex: 1; min-height: 0; overflow: hidden; }
.view { height: 100%; overflow-x: hidden; overflow-y: auto; padding: 22px 18px 28px; scrollbar-width: thin; }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.view-heading h1 { font-size: 26px; }
.heading-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.search-box { display: flex; align-items: center; gap: 9px; height: 43px; padding: 0 13px; border: 1px solid transparent; border-radius: 13px; background: #eaeFEC; transition: border .2s, background .2s; }
.search-box:focus-within { border-color: rgba(21,154,102,.35); background: white; }
.search-box svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: #85928c; stroke-width: 1.8; stroke-linecap: round; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.filter-chips { display: flex; gap: 8px; margin: 15px -18px 0; padding: 0 18px 5px; overflow-x: auto; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; min-height: 31px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; background: white; color: var(--muted); font-size: 11px; white-space: nowrap; }
.filter-chip.active { border-color: var(--brand); background: var(--brand); color: white; }
.color-dot { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.list-meta { display: flex; justify-content: space-between; margin: 17px 2px 9px; color: #8a9690; font-size: 10px; }
.group-list { display: grid; gap: 9px; }
.group-card { display: flex; width: 100%; min-width: 0; align-items: center; gap: 12px; padding: 14px 12px; border: 1px solid rgba(229,235,232,.75); border-radius: 17px; background: white; text-align: left; box-shadow: 0 3px 12px rgba(26,63,48,.025); }
.group-card:active { background: #f9fbfa; }
.avatar { display: grid; flex: 0 0 auto; width: 48px; height: 48px; place-items: center; border-radius: 16px; background: var(--brand-soft); color: var(--brand-dark); font-size: 17px; font-weight: 800; }
.avatar-large { width: 58px; height: 58px; border-radius: 19px; font-size: 20px; }
.group-main { flex: 1; min-width: 0; }
.group-topline, .group-preview { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; }
.group-topline strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.group-topline time { flex: 0 0 auto; color: #9aa59f; font-size: 10px; }
.group-preview { margin-top: 6px; }
.group-preview p { overflow: hidden; margin: 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.unread-badge { display: grid; flex: 0 0 auto; min-width: 18px; height: 18px; padding: 0 5px; place-items: center; border-radius: 10px; background: var(--brand); color: white; font-size: 9px; font-weight: 800; }
.group-category { display: block; overflow: hidden; margin-top: 7px; color: #96a19b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 42px 20px; color: var(--muted); text-align: center; }
.empty-state .empty-symbol { display: grid; width: 54px; height: 54px; margin: 0 auto 14px; place-items: center; border-radius: 18px; background: #e9efeb; color: var(--brand); font-size: 24px; font-weight: 300; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 14px; }
.empty-state p { margin: 0; font-size: 12px; line-height: 1.6; }

.bottom-nav { z-index: 4; display: grid; flex: 0 0 auto; grid-template-columns: repeat(4, 1fr); padding: 7px 12px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); }
.nav-item { display: flex; min-height: 49px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: #8b9791; font-size: 10px; }
.nav-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { color: var(--brand); font-weight: 800; }

.claim-card, .info-card, .profile-card, .menu-card, .stats-row { border: 1px solid rgba(229,235,232,.85); border-radius: 20px; background: white; }
.claim-card { padding: 24px 20px 20px; text-align: center; }
.section-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 14px; place-items: center; border-radius: 16px; }
.section-icon-green { background: var(--brand-soft); color: var(--brand); }
.section-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.claim-card h2 { margin: 0; font-size: 19px; }
.claim-card > .muted { margin: 9px 0 20px; font-size: 12px; line-height: 1.7; }
.claim-form { text-align: left; }
.claim-form label, .sheet-form > label:not(.check-row), .category-create-form label, .invite-form label, .inline-setting-form > label { display: block; margin: 0 0 7px; font-size: 11px; font-weight: 700; }
input, textarea, select { border: 1px solid #dfe6e2; border-radius: 12px; outline: none; background: white; color: var(--ink); transition: border-color .18s, box-shadow .18s; }
input, select { width: 100%; height: 44px; padding: 0 12px; font-size: 13px; }
textarea { padding: 11px 12px; font-size: 13px; resize: none; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,154,102,.1); }
.claim-form input { margin-bottom: 12px; text-align: center; font-weight: 750; letter-spacing: .08em; }
.claim-result { margin-top: 13px; }
.result-card { padding: 17px; border: 1px solid #eee2bd; border-radius: 16px; background: var(--warning-soft); }
.result-card.approved { border-color: #cde9dc; background: var(--brand-soft); }
.result-card h3 { margin: 0 0 7px; font-size: 15px; }
.result-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.result-card .button { margin-top: 13px; }
.info-card { margin-top: 14px; padding: 18px; }
.info-card strong { font-size: 13px; }
.info-card ol { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 11px; line-height: 2; }

.profile-card { display: flex; min-width: 0; align-items: center; gap: 13px; padding: 19px 16px; }
.profile-copy { flex: 1; min-width: 0; }
.profile-copy h2 { overflow: hidden; margin: 0 0 5px; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy p { margin: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.profile-badge, .admin-badge { flex: 0 0 auto; padding: 4px 7px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-dark); font-size: 9px; font-weight: 750; }
.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 12px; padding: 17px 0; }
.stats-row > div { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.stats-row > div + div { border-left: 1px solid var(--line); }
.stats-row strong { color: var(--brand-deep); font-size: 22px; }
.stats-row span { color: var(--muted); font-size: 10px; }
.menu-card { margin: 12px 0 18px; padding: 0 15px; }
.menu-card button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border: 0; background: transparent; text-align: left; }
.menu-card button + button { border-top: 1px solid var(--line); }
.menu-card button > span:first-child { display: flex; flex-direction: column; gap: 5px; }
.menu-card strong { font-size: 13px; }
.menu-card small { color: var(--muted); font-size: 10px; }
.menu-card button > span:last-child { color: #9ca7a1; font-size: 25px; font-weight: 300; }
.version-note { margin: 24px 0 0; color: #a2aca7; font-size: 10px; text-align: center; }
.profile-subscription { margin: 10px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-deep); font-size: 12px; line-height: 1.6; }
.profile-subscription.expired { background: #fde8e8; color: #c53030; }
.customer-list { display: grid; gap: 12px; }
.customer-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: white; border: 1px solid rgba(229,235,232,.85); }
.customer-card-top { display: flex; align-items: center; gap: 12px; }
.customer-card-top .avatar { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-dark); font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.customer-card-info { flex: 1; min-width: 0; }
.customer-card-info strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-card-info small { color: var(--muted); font-size: 10px; }
.customer-card-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.customer-card-meta > div { text-align: center; }
.customer-card-meta strong { display: block; font-size: 13px; color: var(--brand-deep); }
.customer-card-meta span { font-size: 9px; color: var(--muted); }
.customer-card-badges { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.badge-active { background: var(--brand-soft); color: var(--brand); }
.badge-expired { background: #fde8e8; color: #c53030; }
.badge-warning { background: #fff7e6; color: #a86400; }
.customer-card-actions { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.customer-manage-summary { padding: 14px; border-radius: 14px; background: var(--brand-soft); margin-bottom: 16px; font-size: 12px; line-height: 1.7; color: var(--brand-deep); }

.chat-screen { z-index: 20; display: flex; position: absolute; inset: 0; flex-direction: column; background: #f1f5f2; }
.chat-header { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; padding: max(10px, env(safe-area-inset-top)) 12px 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.icon-button, .close-button { display: grid; flex: 0 0 auto; width: 39px; height: 39px; place-items: center; border: 0; border-radius: 12px; background: transparent; }
.icon-button:hover { background: var(--canvas); }
.icon-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-heading { flex: 1; min-width: 0; text-align: center; }
.chat-heading h1 { overflow: hidden; margin: 0; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.chat-heading p { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.message-list { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 15px; overflow-x: hidden; overflow-y: auto; padding: 20px 14px; }
.message-row { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; }
.message-row.own { align-items: flex-end; }
.message-sender { margin: 0 0 5px 4px; color: var(--muted); font-size: 10px; }
.message-bubble { max-width: 82%; padding: 11px 13px; border: 1px solid #e3e9e6; border-radius: 5px 16px 16px 16px; background: white; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 2px 6px rgba(20,52,39,.025); }
.message-row.own .message-bubble { border-color: var(--brand); border-radius: 16px 5px 16px 16px; background: var(--brand); color: white; }
.message-time { margin: 5px 4px 0; color: #99a49e; font-size: 9px; }
.chat-error { flex: 0 0 auto; margin: 0 12px 6px; }
.composer { display: flex; flex: 0 0 auto; align-items: flex-end; gap: 6px; padding: 10px 12px max(11px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: white; }
.composer textarea { flex: 1; max-height: 112px; line-height: 1.45; }
.composer-icon { flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 12px; background: var(--muted-soft); font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.composer-icon:active { background: var(--line); }
.send-button { display: grid; flex: 0 0 auto; width: 43px; height: 43px; place-items: center; border: 0; border-radius: 13px; background: var(--brand); color: white; cursor: pointer; }
.send-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.recording-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 9999; }
.recording-card { padding: 24px 32px; background: white; border-radius: 20px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.recording-wave { width: 80px; height: 80px; margin: 0 auto 12px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; font-size: 32px; animation: pulse 1.2s ease-in-out infinite; }
.recording-text { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.recording-timer { font-size: 24px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.recording-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.recording-overlay.cancel .recording-card { background: #fff0f0; }
.recording-overlay.cancel .recording-wave { background: #fde8e8; }
.recording-overlay.cancel .recording-wave::before { content: '✕'; }
.recording-overlay.cancel .recording-text { color: #c53030; }
.recording-overlay.click-mode .recording-text { color: var(--brand-deep); font-weight: 500; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.message-attachment { margin-top: 8px; }
.message-attachment.voice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--brand-soft); border-radius: 12px; min-width: 120px; cursor: pointer; flex-wrap: wrap; }
.message-attachment.voice .voice-play { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: white; border: 0; display: grid; place-items: center; font-size: 14px; cursor: pointer; flex: 0 0 auto; }
.message-attachment.voice .voice-duration { font-size: 12px; color: var(--brand-deep); font-variant-numeric: tabular-nums; flex: 1; }
.voice-transcript-btn { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px; background: rgba(255,255,255,.7); border: 1px solid var(--brand); color: var(--brand-deep); font-size: 12px; font-weight: 600; cursor: pointer; display: grid; place-items: center; padding: 0; }
.voice-transcript-btn:hover { background: white; }
.message-attachment.image { max-width: 200px; border-radius: 10px; overflow: hidden; }
.message-attachment.image img { display: block; max-width: 100%; height: auto; border-radius: 10px; }
.message-attachment.file { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f3f5f4; border-radius: 12px; text-decoration: none; color: inherit; min-width: 160px; }
.message-attachment.file .file-icon { font-size: 24px; }
.message-attachment.file .file-info { flex: 1; min-width: 0; }
.message-attachment.file .file-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.message-attachment.file .file-size { font-size: 10px; color: var(--muted); }
.message-attachment audio { display: none; }

.sheet { width: min(100%, 430px); max-width: 100%; max-height: min(88dvh, 820px); margin: auto auto 0; padding: 8px 20px max(24px, env(safe-area-inset-bottom)); overflow-x: hidden; overflow-y: auto; border: 0; border-radius: 24px 24px 0 0; background: white; color: var(--ink); box-shadow: var(--shadow); }
.sheet::backdrop { background: rgba(10,28,21,.44); backdrop-filter: blur(2px); }
.sheet[open] { animation: sheet-in .2s ease-out; }
@keyframes sheet-in { from { transform: translateY(20px); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle { width: 38px; height: 4px; margin: 1px auto 10px; border-radius: 3px; background: #dbe2de; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.sheet-header h2 { margin: 0; font-size: 21px; }
.close-button { background: var(--canvas); color: var(--muted); font-size: 24px; font-weight: 300; }
.sheet-form > input { margin-bottom: 17px; }
.check-row { display: flex; align-items: flex-start; gap: 11px; margin: 3px 0 20px; cursor: pointer; }
.check-row input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); }
.check-row span { display: flex; flex-direction: column; gap: 5px; }
.check-row strong { font-size: 12px; }
.check-row small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.category-create-form { display: grid; grid-template-columns: minmax(0, 1fr) 58px auto; align-items: end; gap: 9px; }
.category-create-form input[type="color"] { padding: 5px; cursor: pointer; }
.category-create-form .button { min-height: 44px; padding: 10px 13px; }
.section-label { margin: 24px 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; }
.category-list { display: grid; gap: 8px; }
.category-item { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.category-item .color-dot { width: 11px; height: 11px; }
.category-item strong { flex: 1; min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.category-item small { color: var(--muted); font-size: 10px; }
.category-item button { padding: 6px; border: 0; background: transparent; color: var(--danger); font-size: 11px; }
.sheet-note { margin: 18px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.settings-group-summary { display: flex; align-items: center; gap: 13px; padding: 15px; border-radius: 16px; background: var(--canvas); }
.settings-group-summary > div:last-child { min-width: 0; }
.settings-group-summary h3 { margin: 0 0 6px; font-size: 16px; overflow-wrap: anywhere; }
.settings-group-summary p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.inline-setting-form { margin: 18px 0; }
.inline-setting-form > div { display: flex; gap: 8px; }
.inline-setting-form select { flex: 1; }
.inline-setting-form .button { flex: 0 0 auto; }
.settings-section { padding-top: 17px; border-top: 1px solid var(--line); }
.settings-section + .settings-section { margin-top: 18px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-title-row h3 { margin: 0; font-size: 14px; }
.section-title-row > span:not(.admin-badge) { color: var(--muted); font-size: 10px; }
.member-list { display: grid; gap: 12px; }
.member-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member-avatar { display: grid; flex: 0 0 auto; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11px; font-weight: 800; }
.member-main { flex: 1; min-width: 0; }
.member-main strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.member-authorization { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.member-role { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.member-event-list { display: grid; gap: 10px; }
.member-event { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.member-event:last-child { padding-bottom: 0; border-bottom: 0; }
.member-event-copy { min-width: 0; }
.member-event-copy strong { display: block; font-size: 11px; }
.member-event-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.member-event time { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.invite-form { padding: 13px; border-radius: 14px; background: var(--canvas); }
.split-fields { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 9px; }
.generated-invite { margin-top: 12px; padding: 14px; border: 1px dashed #8bcbb0; border-radius: 13px; background: var(--brand-soft); text-align: center; }
.generated-invite > span { display: block; color: var(--muted); font-size: 10px; }
.generated-invite strong { display: block; margin: 7px 0; color: var(--brand-dark); font-size: 20px; letter-spacing: .08em; overflow-wrap: anywhere; }
.generated-invite p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.subsection { margin-top: 20px; }
.subsection h4 { margin: 0 0 10px; font-size: 12px; }
.approval-list, .invite-list { display: grid; gap: 9px; }
.approval-card, .invite-card { padding: 12px; border: 1px solid var(--line); border-radius: 13px; }
.approval-card p, .invite-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.approval-card strong, .invite-card strong { display: block; margin-bottom: 4px; font-size: 11px; overflow-wrap: anywhere; }
.approval-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.approval-actions .button { min-height: 34px; padding: 7px 10px; font-size: 11px; }
.status-text { display: inline-block; margin-top: 6px; padding: 3px 6px; border-radius: 6px; background: var(--canvas); color: var(--muted); font-size: 9px; }
.status-text.pending { background: var(--warning-soft); color: var(--warning); }
.status-text.approved { background: var(--brand-soft); color: var(--brand-dark); }
.status-text.rejected { background: var(--danger-soft); color: var(--danger); }
.inline-empty { padding: 12px 0; color: var(--muted); font-size: 10px; text-align: center; }
.toast { z-index: 100; position: absolute; right: 20px; bottom: 88px; left: 20px; width: fit-content; max-width: calc(100% - 40px); margin: auto; padding: 11px 16px; border-radius: 12px; background: rgba(18,44,34,.94); color: white; font-size: 12px; line-height: 1.5; text-align: center; box-shadow: 0 8px 30px rgba(12,36,26,.2); overflow-wrap: anywhere; }

.login-form { display: grid; gap: 15px; }
.form-field label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.login-form .form-error { margin: 0; }
.contact-list, .account-list { display: grid; gap: 9px; }
.contact-card { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 13px 12px; border: 1px solid rgba(229,235,232,.85); border-radius: 16px; background: white; }
.contact-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 5px; }
.contact-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.contact-copy span { color: var(--muted); font-size: 11px; }
.role-badge { flex: 0 0 auto; padding: 4px 7px; border-radius: 7px; background: var(--canvas); color: var(--muted); font-size: 9px; font-weight: 750; }
.role-badge.admin { background: var(--brand-soft); color: var(--brand-dark); }
.contact-info p { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.contact-picker { display: grid; max-height: 290px; gap: 7px; margin-bottom: 16px; overflow-y: auto; }
.picker-item { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.picker-item:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.picker-item > input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--brand); }
.picker-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; }
.picker-copy strong { font-size: 12px; }
.picker-copy small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.sheet-form > select { margin-bottom: 17px; }
.account-card { padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.account-summary { display: flex; min-width: 0; align-items: center; gap: 10px; }
.account-summary .account-copy { flex: 1; }
.account-copy small { color: var(--muted); font-size: 10px; }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.account-permissions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.account-permissions .check-row { margin: 0; align-items: center; }
.account-permissions .check-row span { display: block; font-size: 11px; }
.account-permissions-save { grid-column: 1 / -1; }
.member-add-form { display: flex; gap: 8px; margin-bottom: 14px; }
.member-add-form select { flex: 1; }
.member-add-form .button { flex: 0 0 auto; }
.member-item .member-remove { flex: 0 0 auto; padding: 5px; border: 0; background: transparent; color: var(--danger); font-size: 10px; }
.contact-card .button { flex: 0 0 auto; }
.role-badge.super_admin { background: #eee9ff; color: #6543aa; }
.credentials-card { padding: 20px 15px; border-radius: 17px; background: var(--brand-soft); text-align: center; }
.credentials-card .avatar { margin: 0 auto 10px; background: white; }
.credentials-card h3 { margin: 0 0 5px; font-size: 17px; }
.credentials-card p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.credentials-card > span { display: block; color: var(--muted); font-size: 11px; }
.credentials-card > strong { display: block; margin-top: 7px; color: var(--brand-dark); font-size: 30px; letter-spacing: .14em; }
.credentials-note { margin-bottom: 18px; }

@media (min-width: 560px) {
  body { display: grid; min-height: 100dvh; place-items: center; padding: 18px; background: radial-gradient(circle at 25% 10%, #f4faf6, transparent 35%), #e6ece8; }
  .phone-shell { width: 430px; height: min(900px, calc(100dvh - 36px)); min-height: min(620px, calc(100dvh - 36px)); border: 7px solid #18362b; border-radius: 40px; box-shadow: 0 28px 90px rgba(22,56,42,.2); }
  .sheet { width: 416px; margin-bottom: 18px; border-radius: 24px; }
  .toast { bottom: 100px; }
}

@media (max-width: 350px) {
  .view { padding-right: 13px; padding-left: 13px; }
  .filter-chips { margin-right: -13px; margin-left: -13px; padding-right: 13px; padding-left: 13px; }
  .view-heading h1 { font-size: 23px; }
  .heading-actions { gap: 5px; }
  .button-small { padding-right: 10px; padding-left: 10px; }
  .profile-badge { display: none; }
  .sheet { padding-right: 15px; padding-left: 15px; }
  .split-fields { grid-template-columns: 92px minmax(0, 1fr); }
}

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

/* == 中老年友好字号增强 2026-11-03（追加在文件末尾以覆盖上方同名规则） == */
input, select { font-size: 16px !important; }
textarea { font-size: 16px !important; }
.composer textarea { font-size: 16px !important; }
.button { font-size: 16px !important; }
.button-small { font-size: 14px !important; }
.message-bubble { font-size: 16px !important; line-height: 1.65 !important; }
.message-sender { font-size: 12px !important; }
.message-time { font-size: 11px !important; }
.chat-heading h1 { font-size: 17px !important; }
.chat-heading p { font-size: 12px !important; }
.group-topline strong { font-size: 16px !important; }
.group-topline time { font-size: 12px !important; }
.group-preview p { font-size: 13px !important; }
.search-box input { font-size: 15px !important; }
.filter-chip { font-size: 13px !important; }
.list-meta { font-size: 12px !important; }
.nav-item { font-size: 12px !important; }
.contact-copy strong { font-size: 16px !important; }
.contact-copy span { font-size: 13px !important; }
.customer-card-info strong { font-size: 15px !important; }
.customer-card-info small { font-size: 12px !important; }
.customer-card-meta strong { font-size: 15px !important; }
.toast { font-size: 14px !important; }
.form-field label, .sheet-form > label:not(.check-row) { font-size: 13px !important; }
.empty-state strong { font-size: 15px !important; }
.empty-state p { font-size: 13px !important; }
.message-attachment.file .file-name { font-size: 14px !important; }
.message-attachment.file .file-size { font-size: 12px !important; }
.message-attachment.voice .voice-duration { font-size: 13px !important; }
.check-row strong { font-size: 13px !important; }
.check-row small { font-size: 12px !important; }
.member-main strong { font-size: 13px !important; }
.pw-toggle { font-size: 16px !important; }
