:root {
    color-scheme: light;
    --ink: #182b25;
    --muted: #566a60;
    --line: #dce3da;
    --paper: #fffefa;
    --accent: #245b49;
    --soft: #ecf2eb;
    font: 16px/1.55 "DM Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #f7f7f2; -webkit-text-size-adjust: 100%; }
button, input, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 3px solid #a5751a; outline-offset: 2px; }
.shell { width: min(100%, 640px); margin: auto; padding: 0 18px 40px; padding-bottom: max(40px, env(safe-area-inset-bottom)); }
.mast, .brand, .section-head, .page-title, .ticket-head, .balance-foot, .ledger-row, .contact-link { display: flex; align-items: center; }
.mast, .section-head, .ticket-head, .balance-foot, .ledger-row, .page-title, .contact-link { justify-content: space-between; gap: 12px; }
.mast { padding: 18px 0; min-height: 68px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.brand { gap: 10px; font-size: 16px; font-weight: 700; letter-spacing: .03em; }
.brand-mark { display: inline-flex; align-items: end; justify-content: center; gap: 3px; width: 28px; height: 28px; border-radius: 9px; padding: 7px; background: var(--accent); }
.brand-mark i { display: block; width: 5px; height: 9px; background: #d7eab8; border-radius: 2px 2px 0 0; }
.brand-mark i + i { height: 14px; background: #fffefa; }
h1, h2, h3, p { margin: 0; }
h1 { margin: 0 0 18px; font-size: clamp(28px, 6.3vw, 36px); font-weight: 720; line-height: 1.25; letter-spacing: -.025em; }
h2 { font-size: 18px; line-height: 1.4; }
h3 { font-size: 15px; }
.page-title { align-items: baseline; margin-bottom: 18px; }
.page-title h1 { flex-shrink: 0; margin: 0; }
.account-name { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.panel, .balance, .consult-ticket { margin-bottom: 14px; border-radius: 18px; padding: 20px; }
.panel { background: var(--paper); border: 1px solid var(--line); }
.section-head { margin-bottom: 12px; }
.section-head:has(+ .ledger-row), .section-head:has(+ .empty) { margin-bottom: 4px; }
.lede, .subtle, .empty, .hint, .speaker { color: var(--muted); }
.lede, .empty, .subtle { font-size: 14px; }
.lede { margin: 8px 0 16px; }
.hint { margin-top: 7px; font-size: 12px; }
.empty, .subtle { margin: 12px 0 2px; }
input, textarea { -webkit-appearance: none; appearance: none; display: block; padding: 10px 12px; width: 100%; min-width: 0; border: 1px solid #c8d2c8; border-radius: 9px; color: var(--ink); background: white; }
input.copy-field { -webkit-user-select: text; user-select: text; background: #f5f7f2; }
textarea { resize: vertical; }
.btn, .text-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 620; border-radius: 10px; }
.btn { padding: 8px 15px; border: 1px solid transparent; }
.btn.primary { width: 100%; background: var(--accent); color: white; }
.btn.primary:disabled { background: #e9ede7; color: #59675d; }
.btn.secondary, .btn.mini { min-height: 40px; font-size: 14px; color: var(--accent); background: var(--soft); border-color: #d3dfd3; }
.text-btn { padding: 0 4px; color: var(--accent); background: none; border: 0; font-size: 14px; }
.btn:active:not(:disabled), .text-btn:active, .ledger-row[href]:active { opacity: .76; }
.balance { background: #244a3e; color: white; }
.balance-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.balance-grid > div + div { border-left: 1px solid #587268; padding-left: 16px; }
.balance h2 { font-size: 14px; color: #d4e5db; font-weight: 550; }
.amount { font-variant-numeric: tabular-nums; margin: 6px 0 5px; font-size: clamp(24px, 5.8vw, 36px); line-height: 1.25; font-weight: 660; overflow-wrap: anywhere; }
.amount small { font-size: .55em; margin-right: 3px; }
.balance-foot { flex-wrap: wrap; margin-top: 16px; border-top: 1px solid #587268; padding-top: 12px; font-size: 13px; color: #d9e7dd; }
.balance-foot strong { color: white; font-variant-numeric: tabular-nums; }
.ledger-row { padding: 13px 0; color: var(--ink); border-bottom: 1px solid var(--line); }
.ledger-row:last-child { padding-bottom: 0; border-bottom: 0; }
.ledger-title { min-width: 0; }
.ledger-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.ledger-title b { display: block; font-size: 15px; overflow-wrap: anywhere; font-weight: 600; }
.ledger-end { text-align: right; flex-shrink: 0; max-width: 55%; overflow-wrap: anywhere; }
.ledger-end strong { color: var(--accent); font-size: 17px; font-variant-numeric: tabular-nums; }
.chip { border-radius: 6px; background: var(--soft); color: var(--accent); font-size: 12px; padding: 4px 8px; }
.subhead { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-list { margin: 7px 0 0; }
.detail-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border: 0; padding-bottom: 0; }
.detail-list dt { color: var(--muted); flex-shrink: 0; font-size: 14px; }
.detail-list dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.formula { margin-top: 16px; background: var(--soft); padding: 10px 12px; border-radius: 8px; color: var(--accent); font-size: 13px; }
.consult-ticket { border: 1px solid #cbdcc6; background: #eaf1e2; }
.ticket-head h2 { color: #35543e; font-size: 15px; }
.ticket-head .btn { background: #f7faf1; }
input.ticket-code { display: inline-block; font: 700 28px/1.25 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .06em; padding: 0; margin: 8px 0; border: 0; border-radius: 0; color: #244a3e; background: transparent; }
.consult-ticket p { font-size: 13px; color: #405641; }
.copy-row { display: flex; gap: 8px; }
.copy-row .btn { flex-shrink: 0; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.contact-link { margin-top: 12px; padding: 9px 12px; min-height: 44px; background: #fbf4dc; border-radius: 8px; color: #62491d; font-weight: 600; font-size: 14px; }
.contact-link span { font-size: 20px; }
.conversation { margin: 12px 0 18px; max-height: min(55vh, 460px); overflow-y: auto; }
.message { margin: 8px 0 12px; max-width: 90%; }
.message.self { margin-left: auto; text-align: right; }
.speaker { display: block; font-size: 12px; margin-bottom: 3px; }
.message p { display: inline-block; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; padding: 9px 13px; background: #f1f3ed; border-radius: 4px 12px 12px; font-size: 15px; }
.message.self p { background: #dfeddb; border-radius: 12px 4px 12px 12px; }
.login { margin-top: 28px; }
.login h1 { margin-bottom: 8px; }
.form-stack { display: grid; gap: 7px; }
.form-stack label { font-size: 14px; font-weight: 600; }
.form-stack label:not(:first-of-type), .form-stack .btn { margin-top: 8px; }
.notice { padding: 12px 14px; margin-bottom: 12px; color: #234f38; border-radius: 10px; background: #e4f1df; }
.notice.error { color: #753823; background: #f8e9df; }
.js-only { display: none; }
.js-ready .btn.js-only { display: inline-flex; }
.toast { position: fixed; z-index: 1; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); border-radius: 12px; padding: 10px 14px; background: #182b25; color: white; font-size: 14px; text-align: center; width: max-content; max-width: 90%; pointer-events: none; }
.toast:empty { display: none; }
@media (max-width: 360px) {
    .shell { padding-left: 12px; padding-right: 12px; }
    .panel, .balance, .consult-ticket { padding: 15px; }
    .balance-foot { gap: 4px 10px; }
}
@media (min-width: 700px) {
    .mast { margin-bottom: 32px; }
    .panel, .balance, .consult-ticket { padding: 24px; }
}
