:root {
  --bg: #fff8f1;
  --card: rgba(255, 255, 255, .94);
  --text: #24133f;
  --muted: #7c6d89;
  --primary: #8b5cf6;
  --primary-2: #ec4899;
  --accent: #f97316;
  --mint: #10b981;
  --income: #10b981;
  --expense: #f97316;
  --danger: #ef4444;
  --line: #eadff5;
  --shadow: 0 18px 42px rgba(108, 61, 145, .13);
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; background: radial-gradient(circle at top left, #fff1dd 0, transparent 30%), radial-gradient(circle at top right, #f3e8ff 0, transparent 34%), radial-gradient(circle at 80% 55%, #dcfce7 0, transparent 22%), var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; max-width: 100%; min-width: 0; }
button { border: 0; cursor: pointer; min-width: 0; }
.app-shell { width: min(100%, 720px); margin: 0 auto; padding: env(safe-area-inset-top) 14px calc(82px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 2px 12px; backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.45); }
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.user-chip { max-width: 170px; min-height: 40px; display: flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.78); border: 1px solid rgba(139,92,246,.18); color: var(--text); box-shadow: 0 8px 20px rgba(108,61,145,.08); }
.user-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 800; }
.user-chip b { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; background: #f6efff; color: var(--primary); font-size: 11px; }
.eyebrow { margin: 0 0 2px; color: var(--accent); font-size: 11px; letter-spacing: 1px; font-weight: 800; }
h1 { margin: 0; font-size: 21px; line-height: 1.2; overflow-wrap: anywhere; }
.short-title { display: none; }
h2, h3, p { margin-top: 0; }
.page { display: none; animation: fade .18s ease-out; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hero-card, .panel, .stat-card { background: var(--card); border: 1px solid rgba(255,255,255,.72); border-radius: var(--radius); box-shadow: var(--shadow); }
.brand-image-card { margin: clamp(4px, 1.2vw, 10px) 0 clamp(14px, 2.2vw, 22px); aspect-ratio: 16 / 9; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.8); background: #fff7ed; }
.brand-image-card img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; }
.hero-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px; background: linear-gradient(135deg, rgba(124,58,237,.95), rgba(168,85,247,.86)); color: #fff; overflow: hidden; position: relative; }
.hero-card::after { content: ""; position: absolute; width: 150px; height: 150px; right: -60px; top: -70px; border-radius: 50%; background: rgba(255,255,255,.16); }
.hero-card h2 { margin: 4px 0 6px; font-size: 30px; }
.hero-card p { margin-bottom: 0; color: rgba(255,255,255,.86); font-size: 13px; }
.muted { color: var(--muted); }
.workbench-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.workbench-card { min-height: 82px; padding: 12px; border-radius: 18px; background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(255,250,246,.9)); border: 1px solid rgba(255,255,255,.78); box-shadow: var(--shadow); color: var(--text); text-align: left; }
.workbench-card span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.workbench-card strong { display: block; color: var(--primary); font-size: 16px; line-height: 1.2; }
.workbench-card.primary-action { background: linear-gradient(135deg, rgba(139,92,246,.96), rgba(236,72,153,.88)); color: #fff; }
.workbench-card.primary-action span, .workbench-card.primary-action strong { color: #fff; }
.workbench-card:nth-child(3n) strong { color: var(--mint); }
.workbench-card:nth-child(4n) strong { color: var(--accent); }
.plan-reminder { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin: 8px 0 14px; padding: 13px 14px; border-radius: 20px; background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,244,232,.9)); border: 1px solid rgba(255,255,255,.78); box-shadow: var(--shadow); }
.plan-reminder p { margin: 0 0 5px; color: var(--accent); font-size: 12px; font-weight: 900; }
.plan-reminder strong { display: block; margin-bottom: 4px; font-size: 16px; }
.plan-reminder span { display: block; color: var(--muted); font-size: 12px; }
.plan-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; margin: 10px 0 14px; border-radius: var(--radius); background: linear-gradient(135deg, #fff7ed, #f6efff 58%, #ecfdf5); border: 1px solid rgba(255,255,255,.78); box-shadow: var(--shadow); }
.plan-hero h2 { margin: 4px 0 6px; font-size: 27px; }
.plan-hero p { margin-bottom: 0; font-size: 13px; }
.calendar-panel { padding-top: 13px; }
.calendar-toolbar { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-bottom: 12px; }
.calendar-toolbar strong { text-align: center; font-size: 17px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.calendar-weekdays { margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 900; text-align: center; }
.calendar-day { min-height: 62px; padding: 8px 6px; border-radius: 15px; background: #fff; color: var(--text); border: 1px solid var(--line); text-align: left; }
.calendar-day span { display: block; font-size: 14px; font-weight: 900; }
.calendar-day em { display: inline-flex; margin-top: 8px; padding: 3px 6px; border-radius: 999px; background: #f6efff; color: var(--primary); font-size: 11px; font-style: normal; font-weight: 900; }
.calendar-day.today { border-color: rgba(249,115,22,.45); box-shadow: inset 0 0 0 1px rgba(249,115,22,.18); }
.calendar-day.active { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; }
.calendar-day.active em { color: var(--primary); background: #fff; }
.calendar-day.muted-day { opacity: 0; pointer-events: none; }
.plan-list { display: grid; gap: 10px; }
.plan-card { display: grid; grid-template-columns: 1fr auto; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.plan-card.done { opacity: .66; }
.plan-card-title { font-weight: 900; margin-bottom: 5px; }
.dashboard-panel { margin-top: 12px; }
.today-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.today-mini-grid div { padding: 12px; border-radius: 16px; background: #f8f5ff; border: 1px solid var(--line); min-width: 0; }
.today-mini-grid span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.today-mini-grid strong { display: block; font-size: 19px; line-height: 1.1; word-break: break-all; }
.income-text { color: var(--income); }
.expense-text { color: var(--expense); }
.dashboard-list { display: grid; gap: 8px; }
.dashboard-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 11px 12px; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.dashboard-item strong { font-size: 14px; }
.dashboard-item span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.dashboard-item .status-pill { justify-self: end; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0; }
.stat-card { padding: 14px; min-height: 86px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { font-size: 21px; line-height: 1.1; word-break: break-all; }
.stat-card.income strong { color: var(--income); }
.stat-card.expense strong { color: var(--expense); }
.stat-card.balance strong { color: var(--primary); }
.stat-card.rate strong { color: #0ea5e9; }
.wallet-combined { grid-column: 1 / -1; gap: 12px; }
.wallet-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wallet-pair div { min-width: 0; padding: 11px 12px; border-radius: 16px; background: #f8f5ff; border: 1px solid var(--line); }
.wallet-pair em { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-style: normal; }
.wallet-pair strong { display: block; font-size: 21px; line-height: 1.1; word-break: break-all; }
.wallet-pair div:first-child strong { color: #14b8a6; }
.wallet-pair div:last-child strong { color: #1677ff; }
.panel { padding: 16px; margin: 14px 0; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-title h3 { margin: 0; font-size: 17px; }
.primary, .secondary, .ghost, .icon-btn, .file-btn { border-radius: 14px; padding: 11px 14px; font-weight: 700; }
.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 12px 20px rgba(139,92,246,.2); }
.secondary { background: #fff4e8; color: var(--primary); border: 1px solid var(--line); }
.ghost { background: #f6efff; color: var(--primary); padding: 8px 11px; font-size: 13px; }
.icon-btn { background: rgba(255,255,255,.72); color: var(--primary); border: 1px solid rgba(124,58,237,.18); }
.small { padding: 9px 12px; font-size: 13px; white-space: nowrap; }
.full { width: 100%; margin-top: 10px; }
.danger, .danger-text { color: var(--danger) !important; }
.danger { background: #fff1f2; border-color: #fecdd3; }
.hidden { display: none !important; }
form label, .field-label { display: block; min-width: 0; font-size: 13px; color: var(--muted); margin: 12px 0 7px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 15px; background: #fff; color: var(--text); outline: 0; padding: 12px 13px; margin-top: 7px; line-height: 1.35; transition: .15s; }
input[type="date"], input[type="time"], input[type="number"] { min-height: 48px; line-height: normal; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(124,58,237,.1); }
.check-row { display: flex; align-items: center; gap: 9px; margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
.check-row input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.remember-row span { line-height: 1.45; }
.field-grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-grid.two > label { min-width: 0; }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; background: #fff3e8; padding: 5px; border-radius: 17px; }
.segmented label { margin: 0; }
.segmented input { display: none; }
.segmented span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; border-radius: 13px; padding: 11px; color: var(--muted); font-weight: 800; }
.segmented input:checked + span { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 8px 14px rgba(124,58,237,.18); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; }
.filters input, .filters select { margin-top: 0; }
.filters input[type="search"] { grid-column: 1 / -1; }
.date-range { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.date-range label { margin: 0; font-size: 12px; color: var(--muted); }
.date-range input { margin-top: 6px; }
.range-shortcuts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.range-shortcuts button { min-height: 38px; border-radius: 13px; background: #f4edff; color: var(--primary); border: 1px solid var(--line); font-size: 13px; font-weight: 800; }
.range-shortcuts button.active { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 8px 14px rgba(124,58,237,.16); }
.range-summary { margin: 12px 0; padding: 14px; border-radius: 18px; background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,248,241,.94)); border: 1px solid rgba(234,223,245,.9); box-shadow: 0 12px 28px rgba(108,61,145,.08); }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.summary-head span { font-size: 15px; font-weight: 900; color: var(--text); }
.summary-head strong { flex: 0 0 auto; min-height: 28px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 999px; background: #f6efff; color: var(--primary); font-size: 12px; }
.summary-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.summary-metrics div { min-width: 0; padding: 10px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.summary-metrics em { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-style: normal; }
.summary-metrics strong { display: block; font-size: 17px; line-height: 1.15; word-break: break-all; color: var(--primary); }
.record-list { display: grid; gap: 10px; }
.record-card { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.record-title { font-weight: 800; margin-bottom: 4px; }
.record-meta { color: var(--muted); font-size: 12px; line-height: 1.6; }
.record-amount { text-align: right; font-weight: 900; font-size: 18px; }
.record-amount.income { color: var(--income); }
.record-amount.expense { color: var(--expense); }
.record-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.record-actions button { padding: 7px 10px; border-radius: 11px; background: #f7f2ff; color: var(--primary); font-size: 12px; }
.record-actions button:last-child { background: #fff1f2; color: var(--danger); }
.empty-list:empty::before { content: "暂无数据"; display: block; text-align: center; color: var(--muted); padding: 22px; border: 1px dashed var(--line); border-radius: 18px; background: rgba(255,255,255,.6); }
.inventory-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; margin-bottom: 14px; border-radius: var(--radius); background: linear-gradient(135deg, #fffaf5, #f5edff 58%, #ecfdf5); border: 1px solid rgba(255,255,255,.78); box-shadow: var(--shadow); }
.inventory-hero h2 { margin: 4px 0 6px; font-size: 28px; }
.inventory-hero p { margin-bottom: 0; font-size: 13px; }
.inventory-stat-grid { margin-top: 0; }
.inventory-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; padding: 5px; border-radius: 17px; background: #fff3e8; }
.inventory-tabs button { min-width: 0; padding: 10px 4px; border-radius: 13px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; }
.inventory-tabs button.active { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 8px 14px rgba(124,58,237,.18); }
.inventory-view { display: none; }
.inventory-view.active { display: block; }
.image-preview { min-height: 138px; display: grid; place-items: center; margin-top: 10px; border-radius: 18px; border: 1px dashed var(--line); background: #fff; color: var(--muted); font-size: 13px; overflow: hidden; }
.image-preview img { width: 100%; height: 180px; object-fit: cover; display: block; }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-actions .file-btn { min-height: 46px; margin: 0; position: relative; overflow: hidden; }
.native-file-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; border: 0; cursor: pointer; }
.file-btn.disabled { cursor: not-allowed; opacity: .55; }
.file-btn.disabled .native-file-input { pointer-events: none; }
.product-list, .price-list, .movement-list { display: grid; gap: 10px; }
.product-card, .price-card, .movement-card { border: 1px solid var(--line); border-radius: 18px; background: #fff; overflow: hidden; }
.product-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; }
.product-thumb, .price-thumb { width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; background: #f4edff; object-fit: cover; display: block; }
.product-placeholder, .price-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.product-info { min-width: 0; }
.product-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.product-title { font-weight: 900; margin-bottom: 4px; }
.product-price { color: var(--primary); font-weight: 900; white-space: nowrap; }
.product-meta, .movement-meta { color: var(--muted); font-size: 12px; line-height: 1.65; }
.status-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #f6f1ff; color: var(--primary); }
.status-pill.warn { background: #fff7ed; color: #f97316; }
.status-pill.danger { background: #fff1f2; color: var(--danger) !important; }
.status-pill.ok { background: #ecfdf5; color: #10b981; }
.product-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.product-actions button { padding: 7px 10px; border-radius: 11px; background: #f7f2ff; color: var(--primary); font-size: 12px; font-weight: 800; }
.product-actions button:last-child { background: #fff1f2; color: var(--danger); }
.price-card { display: grid; grid-template-columns: 82px 1fr auto; gap: 12px; align-items: center; padding: 12px; }
.price-main { min-width: 0; }
.price-main strong { display: block; margin-bottom: 4px; }
.price-amount { color: var(--primary); font-size: 20px; font-weight: 900; white-space: nowrap; }
.movement-card { padding: 12px; display: grid; gap: 6px; }
.movement-card strong { font-size: 15px; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: center; }
.inline-form input { margin: 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.account-tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: #f6f1ff; color: var(--primary); padding: 8px 10px; font-size: 13px; font-weight: 700; }
.account-tag button { width: 20px; height: 20px; border-radius: 50%; color: #fff; background: var(--primary-2); line-height: 1; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.file-btn { display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
.tip, .help-list { color: var(--muted); font-size: 13px; line-height: 1.7; }
.help-list { padding-left: 18px; margin-bottom: 0; }
.donut-panel { text-align: center; }
.center-note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
canvas { width: 100%; max-width: 100%; display: block; }
#trendChart { height: 230px; }
#incomeAccountChart, #expenseAccountChart { height: 220px; }
#rateDonut { width: min(260px, 100%); height: 260px; margin: 0 auto; }
.cloud-panel { margin-top: 10px; }
.cloud-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: #ede9fe; color: var(--primary); font-size: 12px; font-weight: 900; white-space: nowrap; }
.auth-switch { margin: 14px 0 4px; }
.cloud-form { margin-top: 12px; }
.divider { height: 1px; background: var(--line); margin: 16px 0 6px; }
.cloud-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin: 0 0 14px; padding: 9px 10px; border-radius: 18px; background: rgba(255,255,255,.66); border: 1px solid rgba(234,223,245,.78); box-shadow: 0 10px 24px rgba(108,61,145,.07); backdrop-filter: blur(14px); }
.cloud-bar label { margin: 0; }
.book-switch { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
.book-switch span { color: var(--muted); font-size: 12px; font-weight: 900; white-space: nowrap; }
.book-switch select { min-width: 0; margin: 0; padding: 9px 12px; border-radius: 13px; background: rgba(255,255,255,.9); }
.tiny { margin: 0 0 4px; font-size: 11px; }
.invite-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-list { display: grid; gap: 8px; }
.member-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.66); }
.member-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row strong { color: var(--primary); white-space: nowrap; }
.member-card { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.7); }
.member-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.member-head strong { display: block; color: var(--text); font-size: 15px; }
.member-head span { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; margin-top: 4px; }
.member-head em { flex: 0 0 auto; border-radius: 999px; padding: 6px 10px; background: #ede9fe; color: var(--primary); font-size: 12px; font-style: normal; font-weight: 900; }
.member-controls { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.member-controls label { margin: 0; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.permission-check { display: flex; align-items: center; gap: 7px; min-width: 0; margin: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--text); font-size: 12px; font-weight: 800; }
.permission-check input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }
.permission-grid.readonly { opacity: .86; }
.member-save-btn { justify-self: end; }
.account-tag.disabled-tag { opacity: .62; }
button:disabled, input:disabled { cursor: not-allowed; opacity: .55; }
.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 720px); z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.9); border-top: 1px solid rgba(234,223,245,.86); backdrop-filter: blur(18px); box-shadow: 0 -12px 32px rgba(108,61,145,.08); }
.bottom-nav button { border-radius: 16px; padding: 9px 4px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; }
.bottom-nav button.active { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.toast { position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 20; color: #fff; background: rgba(32,21,61,.92); border-radius: 999px; padding: 10px 16px; font-size: 13px; transition: .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 380px) {
  .field-grid.two, .filters, .action-grid, .date-range, .photo-actions, .member-controls, .permission-grid, .plan-reminder { grid-template-columns: 1fr; }
  .workbench-grid { grid-template-columns: repeat(2, 1fr); }
  .inventory-tabs { grid-template-columns: repeat(2, 1fr); }
  .range-shortcuts { grid-template-columns: repeat(2, 1fr); }
  .hero-card { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 18px; }
  .calendar-day { min-height: 52px; padding: 7px 5px; }
  .calendar-day em { font-size: 10px; padding: 2px 5px; }
}
@media (max-width: 640px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .field-grid.two { grid-template-columns: 1fr; }
  .money-grid, .plan-time-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
  .money-grid input, .plan-time-grid input { min-height: 46px; padding: 10px 9px; font-size: 16px; text-align: center; }
  .workbench-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-mini-grid { grid-template-columns: 1fr; }
  .inventory-hero { align-items: flex-start; flex-direction: column; }
  .product-card { grid-template-columns: 84px 1fr; }
  .price-card { grid-template-columns: 72px 1fr; }
  .price-amount { grid-column: 2; }
  #trendChart, #incomeAccountChart, #expenseAccountChart { height: 210px; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 0 8px; }
  .eyebrow { font-size: 10px; letter-spacing: .6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  h1 { font-size: 22px; white-space: nowrap; }
  .full-title { display: none; }
  .short-title { display: inline; }
  .top-actions { flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
  .icon-btn { min-height: 40px; padding: 9px 11px; border-radius: 15px; }
  .user-chip { max-width: 116px; min-height: 40px; padding: 5px 7px; }
  .user-chip span { max-width: 52px; font-size: 12px; }
  .user-chip b { padding: 4px 6px; font-size: 10px; }
  .cloud-bar { grid-template-columns: 1fr auto; align-items: stretch; }
  .cloud-bar .book-switch { grid-column: 1 / -1; }
  .invite-box { min-width: 0; }
  .invite-box .ghost { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-weekdays, .calendar-grid { gap: 5px; }
  .plan-hero { align-items: flex-start; flex-direction: column; }
  .invite-box { justify-content: space-between; }
}
@media (min-width: 900px) {
  .brand-image-card { aspect-ratio: 16 / 9; }
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #181226; --card: rgba(37, 27, 59, .92); --text: #f7f1ff; --muted: #c5b8db; --line: #42345f; --shadow: 0 18px 40px rgba(0,0,0,.24); }
  input, select, textarea, .record-card, .product-card, .price-card, .movement-card, .image-preview, .dashboard-item, .plan-card, .calendar-day { background: #211832; color: var(--text); }
  .range-summary { background: #211832; }
  .summary-metrics div { background: #181226; }
  .wallet-pair div, .inventory-tabs { background: #211832; }
  .cloud-bar, .user-chip, .plan-reminder, .plan-hero { background: rgba(37,27,59,.86); }
  .workbench-card, .today-mini-grid div { background: #211832; }
  .member-card, .permission-check { background: #211832; }
  .range-shortcuts button { background: #211832; }
  .bottom-nav, .topbar { background: rgba(24,18,38,.82); }
}
