/* ════════════════════════════════════════════════════════════
   Orçamento Familiar — design system v2 (iOS-inspired, phone + computer)
   ════════════════════════════════════════════════════════════ */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #F2F2F7; --bg2: #FFFFFF; --bg3: #F2F2F7; --fill: rgba(118,118,128,.12); --fill2: rgba(118,118,128,.08);
  --text: #000; --text2: rgba(60,60,67,.62); --text3: rgba(60,60,67,.32); --sep: rgba(60,60,67,.14);
  --accent: #5E5CE6; --accent2: #7D5BF0; --green: #30C759; --red: #FF3B30; --orange: #FF9500;
  --inc: #30C759; --exp: #FF375F;
  --card-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --radius: 20px; --radius-sm: 14px;
  --glass: rgba(249,249,251,.78);
  --hero: linear-gradient(135deg, #4F46E5 0%, #7C3AED 55%, #C026D3 100%);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --side-w: 248px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #000; --bg2: #1C1C1E; --bg3: #2C2C2E; --fill: rgba(118,118,128,.24); --fill2: rgba(118,118,128,.16);
  --text: #fff; --text2: rgba(235,235,245,.6); --text3: rgba(235,235,245,.3); --sep: rgba(84,84,88,.55);
  --accent: #7D7AFF; --green: #30D158; --red: #FF453A; --inc: #30D158; --exp: #FF375F;
  --card-shadow: none; --glass: rgba(22,22,24,.78);
  --hero: linear-gradient(135deg, #3730A3 0%, #6D28D9 55%, #A21CAF 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:active { opacity: .7; }
h1, h2, h3, p { margin: 0; }
small { font-size: 13px; }
.muted { color: var(--text2); } .small { font-size: 14px; }
.pos { color: var(--green); } .neg { color: var(--red); }
.ic { flex: none; display: block; }
.flag { flex: none; display: block; border-radius: 3px; box-shadow: 0 0 0 .5px rgba(0,0,0,.15); }
[hidden] { display: none !important; }

/* ── splash ───────────────────────────────────────── */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 5; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--fill); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── auth ─────────────────────────────────────────── */
.auth { min-height: 100dvh; position: relative; overflow: hidden; display: flex; justify-content: center;
  background: #0B0B1A; color: #fff; padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 20px); }
.auth-bg { position: absolute; inset: 0; overflow: hidden; }
.auth-bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .75; animation: float 14s ease-in-out infinite alternate; }
.auth-bg .b1 { width: 380px; height: 380px; background: #5B5BF6; top: -120px; left: -100px; }
.auth-bg .b2 { width: 320px; height: 320px; background: #C03BE8; top: 30%; right: -140px; animation-delay: -4s; }
.auth-bg .b3 { width: 300px; height: 300px; background: #1FB6FF; bottom: -120px; left: 10%; opacity: .45; animation-delay: -8s; }
@keyframes float { to { transform: translate(30px, 40px) scale(1.12); } }
.auth-wrap { position: relative; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 4px 0; }
.brand .logo { width: 52px; height: 52px; border-radius: 13px; box-shadow: 0 8px 24px rgba(91,91,246,.45); flex: none; }
.brand strong { display: block; font-size: 20px; letter-spacing: -.3px; }
.brand span { font-size: 13px; color: rgba(255,255,255,.6); }
.brand.dark span { color: var(--text2); }
.auth-card { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 28px; padding: 26px 22px 22px;
  backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%); box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.auth-card h1 { font-size: 28px; font-weight: 700; letter-spacing: -.6px; }
.auth-card > .muted { color: rgba(255,255,255,.66); margin: 6px 0 20px; font-size: 15px; line-height: 1.4; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card .inp { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
.auth-card .inp::placeholder { color: rgba(255,255,255,.5); }
.auth-card .inp:focus { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); }
.auth-card .pwd-eye { color: rgba(255,255,255,.6); }
.auth-card .field-hint { color: rgba(255,255,255,.6); }
.auth-card .link-btn { color: #C7C6FF; }
.auth-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: rgba(255,255,255,.14); margin-bottom: 16px; }
.auth-icon.ok { background: rgba(48,209,88,.25); color: #7CF29C; }
.inp-icon { position: relative; }
.inp-icon > .ic { position: absolute; left: 14px; top: 15px; opacity: .6; z-index: 1; pointer-events: none; }
.inp-icon .inp { padding-left: 44px; }
.form-err { color: #FF8A80; font-size: 14px; text-align: center; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: rgba(255,255,255,.5); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.18); }
.demo-hint { text-align: center; font-size: 12px; color: rgba(255,255,255,.5); margin-top: 8px; }
.switch-line { text-align: center; margin-top: 18px; font-size: 15px; color: rgba(255,255,255,.7); }
.auth-foot { text-align: center; font-size: 12px; color: rgba(255,255,255,.4); display: flex; gap: 6px; justify-content: center; align-items: center; }
.link-btn.subtle { color: rgba(255,255,255,.55) !important; font-size: 12px; padding: 4px; }
.pick-label { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.75); margin: 6px 0 -4px 4px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.mail-preview { background: rgba(255,255,255,.95); color: #111; border-radius: 18px; padding: 16px; margin: 4px 0 18px; font-size: 14px; line-height: 1.5; }
.mail-tag { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: #5E5CE6; background: #EEF; padding: 4px 10px; border-radius: 99px; margin-bottom: 10px; }
.mail-meta { color: #555; font-size: 13px; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 10px; }
.temp-pwd { font: 700 24px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 2px; text-align: center; background: #F2F2F7; border-radius: 12px; padding: 14px; margin: 10px 0; user-select: all; }
.mail-preview small { display: block; margin-top: 8px; color: #777; }

/* flags (language / currency pickers) */
.lang-top { display: flex; justify-content: center; }
.flag-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.flag-opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 16px; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.14); font-size: 13px; font-weight: 600; color: rgba(255,255,255,.85); transition: all .2s; text-align: center; }
.flag-opt input { position: absolute; opacity: 0; pointer-events: none; }
.flag-opt small { font-size: 11px; font-weight: 500; opacity: .7; line-height: 1.2; }
.flag-opt.on { background: rgba(255,255,255,.2); border-color: #A5A4FF; box-shadow: 0 0 0 3px rgba(165,164,255,.25); color: #fff; }
.flag-opt:active { transform: scale(.96); }
.flag-pick.light .flag-opt { background: var(--bg2); border-color: var(--sep); color: var(--text); }
.flag-pick.light .flag-opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.flag-mini { display: flex; gap: 6px; } .flag-mini button { padding: 4px; border-radius: 8px; opacity: .55; } .flag-mini button.on { opacity: 1; background: var(--fill); }

.banner { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 14px; background: rgba(255,214,10,.18); color: #FFD60A; font-size: 14px; font-weight: 500; }
.app-banner { margin: calc(var(--safe-t) + 8px) 16px 0; color: #9A6B00; background: rgba(255,204,0,.18); }
[data-theme="dark"] .app-banner { color: #FFD60A; }

/* ── buttons & inputs ─────────────────────────────── */
.btn { height: 52px; border-radius: 16px; font-weight: 600; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; transition: transform .12s, opacity .2s; white-space: nowrap; }
.btn.sm { height: 40px; font-size: 15px; border-radius: 12px; padding: 0 14px; }
.btn:active { transform: scale(.98); }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; box-shadow: 0 10px 24px rgba(99,102,241,.3); }
.btn-primary:disabled { opacity: .6; }
.btn-primary.loading { color: transparent; position: relative; }
.btn-primary.loading::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-glass { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.btn-soft { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.btn-danger-soft { background: rgba(255,59,48,.1); color: var(--red); margin-top: 8px; }
.link-btn { color: var(--accent); font-size: 16px; padding: 8px 4px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn.strong { font-weight: 600; }
.link-btn.center { align-self: center; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fill2); color: var(--accent); flex: none; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.ghost { background: none; color: var(--text3); } .icon-btn.ghost:hover { color: var(--red); background: rgba(255,59,48,.08); }

.inp { width: 100%; height: 50px; border-radius: 14px; border: 1.5px solid transparent; background: var(--fill2); color: var(--text);
  font: inherit; font-size: 17px; padding: 0 14px; outline: none; transition: border-color .2s, background .2s; -webkit-appearance: none; appearance: none; }
textarea.inp { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.4; }
.inp:focus { border-color: var(--accent); background: var(--bg2); }
.sel-wrap { position: relative; } .sel-wrap .ic { position: absolute; right: 14px; top: 17px; pointer-events: none; color: var(--text2); }
.sel-wrap select.inp { padding-right: 36px; }
.pwd-wrap { position: relative; } .pwd-wrap .inp { padding-right: 48px; }
.pwd-eye { position: absolute; right: 6px; top: 5px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--text2); }
.pwd-eye.on { color: var(--accent); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form.inner { padding-top: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .3px; padding-left: 4px; }
p.field-label { margin-bottom: -6px; }
.field-hint { color: var(--text2); padding-left: 4px; font-size: 13px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-toggle { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; font-size: 17px; gap: 12px; }
.row-toggle + .row-toggle { border-top: .5px solid var(--sep); }
.switch { -webkit-appearance: none; appearance: none; width: 51px; height: 31px; border-radius: 99px; background: var(--fill); position: relative; transition: background .25s; flex: none; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .25s cubic-bezier(.3,.7,.4,1.2); }
.switch:checked { background: var(--green); } .switch:checked::after { transform: translateX(20px); }
.freq-field { display: flex; flex-direction: column; gap: 8px; }
.add-line { display: flex; gap: 8px; } .add-line .btn { height: 50px; flex: none; }
.danger-box { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: rgba(255,59,48,.1); color: var(--red); line-height: 1.4; font-size: 15px; }

/* segmented (forms) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 10px; padding: 2px; margin-bottom: 12px; }
.seg button, .seg label { height: 32px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text); transition: background .2s; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; padding: 0 6px; text-align: center; line-height: 1.1; }
.seg button.on, .seg label.on { background: var(--bg2); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.04); }
[data-theme="dark"] .seg button.on, [data-theme="dark"] .seg label.on { background: #636366; }
.seg-form { margin: 0; } .seg-form label { min-height: 38px; height: auto; padding: 4px 6px; } .seg-form input { display: none; }

/* icon & color pickers */
.icon-picker { position: relative; }
.ip-current { display: flex; align-items: center; gap: 10px; text-align: left; color: var(--text); cursor: pointer; }
.ip-current > .ic:first-child { color: var(--c); } .ip-current span { flex: 1; text-transform: capitalize; } .ip-current > .ic:last-child { color: var(--text2); }
.ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; padding: 10px; margin-top: 8px; background: var(--bg2); border-radius: 14px; box-shadow: var(--card-shadow); max-height: 260px; overflow-y: auto; border: .5px solid var(--sep); }
.ip-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 12px; color: var(--c); }
.ip-opt small { font-size: 10.5px; color: var(--text2); } .ip-opt.on { background: color-mix(in srgb, var(--c) 16%, transparent); } .ip-opt:hover { background: var(--fill2); }
.color-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.color-picker label { cursor: pointer; } .color-picker input { display: none; }
.color-picker span { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); transition: transform .15s; }
.color-picker input:checked + span { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--c); transform: scale(1.05); }

/* ── shell / layout ───────────────────────────────── */
.view { max-width: 720px; margin: 0 auto; padding: calc(var(--safe-t) + 12px) 16px 0; }
.view.enter { animation: viewIn .32s cubic-bezier(.2,.8,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.bottom-space { height: calc(110px + var(--safe-b)); }
.lg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 4px 12px; }
.lg-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -.8px; line-height: 1.1; }
.eyebrow { font-size: 15px; color: var(--text2); font-weight: 500; margin-bottom: 2px; }
.lg-head-right { display: flex; gap: 8px; padding-bottom: 4px; align-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--hero); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 17px; flex: none; }
.avatar.xl { width: 60px; height: 60px; font-size: 26px; } .avatar.sm { width: 34px; height: 34px; font-size: 15px; }
button.avatar { box-shadow: 0 4px 12px rgba(99,60,230,.3); }
.sidebar { display: none; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  padding: 6px 6px calc(6px + var(--safe-b)); background: var(--glass); border-top: .5px solid var(--sep);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); }
.tab { flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--text3); font-size: 10.5px; font-weight: 600; }
.tab.on { color: var(--accent); }
.tab:active { opacity: 1; transform: scale(.92); }

/* ── computer layout: sidebar + full-width content ── */
body.desktop .tabbar { display: none; }
body.desktop .sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side-w); padding: 22px 14px 16px; z-index: 20;
  background: var(--bg2); border-right: .5px solid var(--sep); }
body.desktop .main-col { margin-left: var(--side-w); min-height: 100vh; }
body.desktop .view { max-width: none; padding: 20px 36px 0; }
body.desktop .bottom-space { height: 60px; }
body.desktop .app-banner { margin: 16px 36px 0; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.side-brand .logo { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.side-brand strong { display: block; font-size: 16px; letter-spacing: -.2px; } .side-brand span { font-size: 12px; color: var(--text2); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-link { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--text2); text-align: left; }
.side-link:hover { background: var(--fill2); color: var(--text); }
.side-link.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: .5px solid var(--sep); }
.side-user div { flex: 1; min-width: 0; } .side-user b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { color: var(--text2); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.desktop .pills { margin: 0 0 16px; padding: 2px 0 6px; flex-wrap: wrap; overflow: visible; }
body.desktop .lg-head h1 { font-size: 30px; }
body.desktop .dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 0 28px; align-items: start; }
body.desktop .cat-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
body.desktop .goals-grid, body.desktop .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-items: start; }
body.desktop .fab { right: 36px; bottom: 32px; }
body.desktop .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, 92vw); max-height: 86vh; border-radius: 22px; transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .28s cubic-bezier(.2,.9,.25,1), opacity .2s; }
body.desktop .sheet-root.open .sheet { transform: translate(-50%, -50%); opacity: 1; }
body.desktop .sheet-tall { height: auto; } body.desktop .sheet-grab { display: none; } body.desktop .sheet-head { padding-top: 12px; }
body.desktop .sheet.chat-sheet { left: auto; right: 16px; top: 16px; bottom: 16px; width: 440px; max-height: none; height: auto; transform: translateX(30px); }
body.desktop .sheet-root.open .sheet.chat-sheet { transform: none; }

/* month pills */
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 14px; margin: 0 -16px; padding-left: 20px; padding-right: 20px; scrollbar-width: none; scroll-snap-type: x proximity; }
.pills::-webkit-scrollbar, .chips::-webkit-scrollbar, .chart-scroll::-webkit-scrollbar { display: none; }
.pill { flex: none; scroll-snap-align: center; height: 38px; padding: 0 16px; border-radius: 99px; background: var(--bg2); color: var(--text); font-weight: 600; font-size: 15px; box-shadow: var(--card-shadow); display: flex; align-items: baseline; gap: 4px; line-height: 38px; }
.pill small { font-size: 11px; color: var(--text2); font-weight: 500; }
.pill.on { background: var(--text); color: var(--bg); } .pill.on small { color: var(--bg); opacity: .6; }

/* hero */
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 22px 20px 18px; color: #fff; background: var(--hero); box-shadow: 0 18px 40px rgba(99,60,230,.28); margin-bottom: 14px; }
.hero::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.25), transparent 70%); top: -120px; right: -80px; }
.hero-red { background: linear-gradient(135deg, #E11D48, #9F1239); box-shadow: 0 18px 40px rgba(225,29,72,.25); }
.hero-top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hero-lbl { font-size: 14px; font-weight: 600; opacity: .8; }
.hero-amt { font-size: 38px; font-weight: 800; letter-spacing: -1px; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.hero-amt small, .money small { font-size: .6em; opacity: .75; }
.hero-amt.neg { color: #FFD1D6; }
.hero-sub { font-size: 14px; opacity: .78; margin-top: 4px; }
.hero-ring { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; opacity: .95; text-align: center; max-width: 96px; }
.hero .ring-bg { stroke: rgba(255,255,255,.22); } .hero .ring-fg { stroke: #fff; } .hero .ring text { fill: #fff; }
.hero .ring.over .ring-fg { stroke: #FFB4BE; }
.hero-split { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.hero-split > div { background: rgba(255,255,255,.14); border-radius: 16px; padding: 12px; backdrop-filter: blur(8px); }
.hero-split p { font-size: 13px; opacity: .8; display: inline; margin-left: 4px; }
.hero-split b { display: block; font-size: 18px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hero-split small { opacity: .7; font-size: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot.inc { background: #6EE7A0; } .dot.exp { background: #FF8FA8; }
.legend .dot { margin: 0 4px 0 10px; } .legend .dot.inc { background: var(--inc); } .legend .dot.exp { background: var(--exp); }
.line-key { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--accent); margin: 0 4px 2px 10px; }
.hero .bar.on-dark { background: rgba(255,255,255,.22); margin-top: 14px; } .hero .bar.on-dark i { background: #fff; }

.ring { display: block; } .ring-bg { stroke: var(--fill); } .ring-fg { stroke: var(--c, var(--accent)); transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.ring text { font-size: 17px; font-weight: 700; fill: var(--text); font-family: var(--font); }
.ring.over .ring-fg { stroke: var(--red); }

/* quick cards / kpis */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.quick-card { background: var(--bg2); border-radius: var(--radius); padding: 14px; display: flex; align-items: center; gap: 12px; text-align: left; box-shadow: var(--card-shadow); }
.quick-card b { display: block; font-size: 17px; } .quick-card small { color: var(--text2); }
.qc-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--c); flex: none; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--bg2); border-radius: 18px; padding: 14px 16px; box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi small { color: var(--text2); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }
.kpi b { font-size: 22px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi > span { color: var(--text2); font-size: 13px; } .kpi .bar { margin-top: 6px; }
.kpi-hero { background: var(--hero); color: #fff; } .kpi-hero small, .kpi-hero > span { color: rgba(255,255,255,.8); } .kpi-hero b .pos, .kpi-hero b .neg { color: #fff; }
.kpi-warn b { color: var(--orange); }
.mobile .kpi-row { grid-template-columns: 1fr 1fr; } .mobile .kpi-row .kpi-hero { grid-column: 1 / -1; } .mobile .kpi b { font-size: 18px; }

/* cards & lists */
.card { background: var(--bg2); border-radius: var(--radius); box-shadow: var(--card-shadow); margin-bottom: 14px; }
.card.inset { box-shadow: none; background: var(--fill2); }
.sec-title { font-size: 20px; font-weight: 700; letter-spacing: -.4px; display: flex; align-items: center; gap: 8px; }
.sec-title.out { padding: 14px 4px 10px; }
.sec-title.small-title { font-size: 16px; padding: 14px 16px 4px; }
.sec-title small { font-size: 13px; font-weight: 500; color: var(--text2); margin-left: auto; display: flex; align-items: center; }
.sec-title .link-btn, .sec-title .icon-btn { margin-left: auto; font-size: 15px; }
.list-card { overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; position: relative; width: 100%; text-align: left; }
.li + .li::before { content: ""; position: absolute; top: 0; right: 0; left: 62px; height: .5px; background: var(--sep); }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li-main.wrap { white-space: pre-line; line-height: 1.35; }
.li-title { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main small { color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-amt { text-align: right; display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.li-amt b { font-size: 16px; font-weight: 600; } .li-amt small { color: var(--text2); }
button.li:active, .li[role=button]:active { background: var(--fill2); opacity: 1; }
.bubble { flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.bubble.sq { border-radius: 8px; background: var(--c); color: #fff; }
.note-snip { display: flex; gap: 4px; align-items: center; color: var(--accent) !important; }
.link-badge { align-self: flex-start; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); margin-top: 2px; }
.type-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.type-pill.income { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.type-pill.expense { color: var(--exp); background: color-mix(in srgb, var(--exp) 12%, transparent); }

.alert-card { padding: 14px 16px 6px; }
.alert-card .sec-title { font-size: 16px; color: var(--orange); margin-bottom: 6px; }
.alert-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 0; text-align: left; }
.alert-row span:not(.bubble) { flex: 1; font-weight: 500; } .alert-row b { color: var(--red); font-variant-numeric: tabular-nums; }

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-card { background: var(--bg2); border-radius: var(--radius); padding: 14px; text-align: left; box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 2px; transition: transform .15s; }
.cat-card:active { transform: scale(.97); opacity: 1; }
.cat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cat-pct { font-size: 13px; font-weight: 700; color: var(--text2); background: var(--fill2); padding: 3px 8px; border-radius: 99px; }
.cat-pct.over { color: var(--red); background: rgba(255,59,48,.12); }
.cat-name { font-size: 14px; color: var(--text2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-amt { font-size: 19px; font-weight: 700; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.cat-card small { color: var(--text2); font-size: 12px; margin-bottom: 8px; }
.bar { display: block; height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--accent)); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.bar.over i { background: var(--red); }

.chart-card { padding: 10px 6px 4px; }
.chart-scroll { overflow-x: auto; scrollbar-width: none; }
.trend { display: block; margin: 0 auto; }
.tc-hit { fill: transparent; } .tc-col { cursor: pointer; } .tc-col.sel .tc-hit { fill: var(--fill2); }
.tc-inc { fill: var(--inc); } .tc-exp { fill: var(--exp); }
.tc-col:not(.sel) rect.tc-inc, .tc-col:not(.sel) rect.tc-exp { opacity: .55; }
.tc-lbl { font-size: 12px; fill: var(--text2); font-family: var(--font); font-weight: 600; }
.tc-col.sel .tc-lbl { fill: var(--text); }
.tc-pos { fill: var(--green); } .tc-neg { fill: var(--red); }
.notes-card .note-row { cursor: pointer; } .notes-card .note-row > .ic { color: var(--accent); }

/* items (phone) */
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--fill); color: var(--text2); margin-bottom: 12px; }
.search input { flex: 1; border: 0; background: none; outline: none; font: inherit; font-size: 17px; color: var(--text); min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 20px; scrollbar-width: none; scroll-behavior: smooth; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 99px; background: var(--bg2); font-size: 14px; font-weight: 600; color: var(--text2); box-shadow: var(--card-shadow); }
.chip.on { background: var(--accent); color: #fff; }
.filter-banner { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 14px; margin-bottom: 12px; background: color-mix(in srgb, var(--c) 12%, var(--bg2)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.filter-banner span:not(.bubble) { flex: 1; font-size: 15px; }
.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg2); border-radius: var(--radius); box-shadow: var(--card-shadow); margin-bottom: 8px; }
.summary-strip > div { padding: 12px; display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; min-width: 0; }
.summary-strip > div + div { border-left: .5px solid var(--sep); }
.summary-strip small { color: var(--text2); font-size: 12px; } .summary-strip b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-head { display: flex; align-items: center; gap: 8px; padding: 16px 4px 8px; font-weight: 700; font-size: 15px; }
.group-head small { margin-left: auto; color: var(--text2); font-weight: 500; font-variant-numeric: tabular-nums; }
.group .card { margin-bottom: 4px; }
.chk { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--text3); display: grid; place-items: center; color: transparent; flex: none; transition: all .2s; }
.chk.on { background: var(--green); border-color: var(--green); color: #fff; animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.18); } }
.item-row.is-paid .li-title { color: var(--text2); }
.muted-list { opacity: .7; }
.empty { text-align: center; padding: 50px 20px; color: var(--text3); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { color: var(--text2); }

/* items (computer grid) */
.grid-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.grid-toolbar .search { flex: 1 1 260px; margin: 0; height: 42px; }
.grid-toolbar .seg { margin: 0; flex: 0 0 300px; }
.grid-toolbar .cat-filter { flex: 0 0 240px; } .grid-toolbar .cat-filter .inp { height: 42px; font-size: 15px; }
.grid-wrap { overflow: auto; max-height: calc(100vh - 330px); min-height: 280px; padding: 0; }
.grid { display: grid; min-width: 980px; }
.g-row { display: grid; grid-template-columns: var(--tpl); align-items: stretch; border-bottom: .5px solid var(--sep); }
.g-cell { display: flex; align-items: center; min-width: 0; padding: 0 4px; font-size: 14px; }
.g-cell.num { justify-content: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
.g-head { position: sticky; top: 0; z-index: 2; background: var(--bg2); border-bottom: 1px solid var(--sep); }
.g-head .g-cell { height: 44px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--text2); padding: 0 10px; cursor: pointer; gap: 4px; user-select: none; }
.g-head .g-cell.sorted { color: var(--accent); }
.g-foot { position: sticky; bottom: 0; z-index: 2; background: var(--bg2); border-top: 1px solid var(--sep); border-bottom: 0; }
.g-foot .g-cell { padding: 10px 6px; font-size: 13px; line-height: 1.5; display: block; white-space: nowrap; }
.g-foot .g-cell.num { text-align: right; }
.g-body .g-row { min-height: 44px; transition: background .15s; }
.g-body .g-row:hover { background: var(--fill2); }
.g-body .g-row:focus-within { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.g-body .g-row.is-paid .gi[data-f=name] { color: var(--text2); }
.g-body .g-cell:first-child { justify-content: center; }
.cat-mark { border-left: 3px solid var(--c); }
.gi { width: 100%; height: 36px; border: 1px solid transparent; border-radius: 8px; background: none; font: inherit; font-size: 14px; color: var(--text); padding: 0 8px; outline: none; -webkit-appearance: none; appearance: none; text-overflow: ellipsis; }
.gi:hover { border-color: var(--sep); } .gi:focus { border-color: var(--accent); background: var(--bg2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.gi.num { text-align: right; font-variant-numeric: tabular-nums; }
.g-cell .sel-wrap { width: 100%; } .g-cell .sel-wrap .ic { top: 11px; right: 8px; opacity: 0; } .g-cell:hover .sel-wrap .ic { opacity: 1; }
select.gi { padding-right: 22px; cursor: pointer; }
.g-cell .chk { width: 24px; height: 24px; }
.g-cell.diff { padding-right: 12px; font-size: 13.5px; }
.g-empty { grid-column: 1 / -1; }

.fab { position: fixed; right: max(20px, calc(50% - 340px)); bottom: calc(84px + var(--safe-b)); z-index: 15; width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #A855F7); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 28px rgba(99,102,241,.45); transition: transform .15s; }
.fab:active { transform: scale(.92); opacity: 1; }
.fab-sage { background: linear-gradient(135deg, #B7791F, #7C4A12); box-shadow: 0 12px 28px rgba(183,121,31,.45); width: 62px; height: 62px; }

/* goals & notes */
.goal-list { display: flex; flex-direction: column; gap: 10px; }
.goal-card { display: flex; align-items: center; gap: 14px; background: var(--bg2); border-radius: var(--radius); padding: 12px 14px; text-align: left; box-shadow: var(--card-shadow); width: 100%; color: var(--text); }
.goal-card .ring text { font-size: 14px; } .goal-card > .ic { color: var(--text3); }
.goal-main { flex: 1; display: flex; flex-direction: column; gap: 3px; } .goal-main b { font-size: 17px; } .goal-main small { color: var(--text2); display: flex; gap: 4px; align-items: center; }
.goal-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--hero); color: #fff; }
.goal-total b { font-size: 22px; font-variant-numeric: tabular-nums; }
.add-move summary { list-style: none; cursor: pointer; } .add-move summary::-webkit-details-marker { display: none; }
.qa-list { display: flex; flex-direction: column; gap: 10px; }
.qa { padding: 14px 16px 8px; display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; margin: 0; cursor: pointer; }
.qa-q { display: flex; gap: 8px; line-height: 1.4; } .qa-q .ic { color: var(--accent); margin-top: 2px; }
.qa-foot { display: flex; justify-content: space-between; align-items: center; padding-left: 26px; }

/* simulation */
.sim-controls { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.sim-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.sim-grid { display: grid; gap: 14px; } body.desktop .sim-grid { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
.sim-grid .card { margin: 0; }
.simchart { display: block; } .sc-pos { fill: var(--inc); opacity: .75; } .sc-neg { fill: var(--exp); opacity: .8; }
.sc-line { stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; } .sc-dot { fill: var(--bg2); stroke: var(--accent); stroke-width: 2; } .sc-zero { stroke: var(--sep); stroke-dasharray: 4 4; }
.insights { padding-bottom: 8px; }
.ins { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px; font-size: 14.5px; line-height: 1.4; }
.ins + .ins { border-top: .5px solid var(--sep); }
.sim-table-wrap { max-height: none; }
.sim-table { border-collapse: separate; border-spacing: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; min-width: 100%; }
.sim-table th, .sim-table td { padding: 0 4px; height: 38px; border-bottom: .5px solid var(--sep); white-space: nowrap; text-align: right; }
.sim-table thead th { position: sticky; top: 0; background: var(--bg2); z-index: 1; font-size: 12px; text-transform: uppercase; color: var(--text2); padding: 0 10px; height: 42px; }
.sim-table .stick { position: sticky; left: 0; background: var(--bg2); z-index: 2; text-align: left; padding: 0 12px; font-weight: 600; min-width: 210px; }
.sim-table .stick .bubble { display: inline-grid; vertical-align: middle; margin-right: 6px; }
.sim-table td input { width: 100px; height: 30px; border: 1px solid transparent; border-radius: 7px; background: none; text-align: right; font: inherit; color: var(--text); padding: 0 6px; outline: none; }
.sim-table td input:hover { border-color: var(--sep); } .sim-table td input:focus { border-color: var(--accent); background: var(--bg2); }
.sim-table td.edited input { background: color-mix(in srgb, var(--orange) 14%, transparent); font-weight: 600; }
.sim-table tr.inc-row td input { color: var(--green); }
.sim-table tfoot td, .sim-table tfoot th { padding: 0 12px; } .sim-table tfoot tr.cum td, .sim-table tfoot tr.cum th { background: var(--fill2); }
.sim-months { display: flex; flex-direction: column; gap: 10px; }
.sim-month { margin: 0; overflow: hidden; }
.sim-month summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; }
.sim-month summary::-webkit-details-marker { display: none; }
.sim-month summary > span { flex: 1; display: flex; flex-direction: column; gap: 2px; } .sim-month summary small { color: var(--text2); }
.sim-month[open] summary > .ic { transform: rotate(180deg); }
.sim-li { min-height: 52px; } .sim-li.edited .sm-inp { background: color-mix(in srgb, var(--orange) 14%, transparent); }
.sm-inp { width: 120px; height: 40px; text-align: right; font-size: 16px; flex: none; }

/* settings */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; }
.profile-card b { font-size: 20px; display: block; } .profile-card small { color: var(--text2); font-size: 14px; }
.set-row { color: var(--text); } .set-row > .ic:last-child { color: var(--text3); }
.set-val { color: var(--text2); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; display: flex; align-items: center; gap: 6px; }
.set-row.danger { color: var(--red); justify-content: center; } .set-row.danger .li-main { flex: none; }
.list-card .li .li-main.muted { flex-direction: row; align-items: center; gap: 6px; }
.members .li-title small { color: var(--text2); font-weight: 400; }

/* admin */
.admin-root { min-height: 100dvh; background: var(--bg); }
.admin { max-width: 1180px; margin: 0 auto; padding: calc(var(--safe-t) + 20px) 20px 40px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-head .brand strong { color: var(--text); }
.admin-actions { display: flex; gap: 12px; align-items: center; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; align-items: start; }
.admin-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; margin: 0; }
.admin-card.wide { grid-column: 1 / -1; }
.ai-cfg { display: flex; flex-direction: column; gap: 14px; }

/* ── sheets & dialogs ─────────────────────────────── */
.sheet-root { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); opacity: 0; transition: opacity .3s; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 640px; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .38s cubic-bezier(.2,.9,.25,1); box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
.sheet-tall { height: 92dvh; }
.sheet-root.open .sheet { transform: translateY(0); }
.sheet-grab { padding: 8px 0 2px; display: flex; justify-content: center; } .sheet-grab span { width: 38px; height: 5px; border-radius: 99px; background: var(--text3); }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 12px 8px; }
.sheet-head h3 { font-size: 17px; font-weight: 600; text-align: center; max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .link-btn:first-child { justify-self: start; } .sheet-head .link-btn:last-child, .sheet-head .sp { justify-self: end; }
.sheet-body { overflow-y: auto; padding: 8px 16px calc(24px + var(--safe-b)); -webkit-overflow-scrolling: touch; flex: 1; }
.sheet-body .card { margin: 0; }

.action-root .action-sheet { position: absolute; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; transform: translateY(120%); transition: transform .32s cubic-bezier(.2,.9,.25,1); }
.action-root.open .action-sheet { transform: none; }
body.desktop .action-root .action-sheet { bottom: 50%; transform: translateY(60%) scale(.96); opacity: 0; transition: all .25s; max-width: 420px; }
body.desktop .action-root.open .action-sheet { transform: translateY(50%); opacity: 1; }
.action-group, .action-cancel { background: var(--glass); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border-radius: 14px; overflow: hidden; }
.action-msg { padding: 14px 16px; text-align: center; font-size: 14px; color: var(--text2); border-bottom: .5px solid var(--sep); line-height: 1.4; }
.action-btn { width: 100%; height: 56px; font-size: 18px; color: var(--accent); display: flex; align-items: center; justify-content: center; gap: 8px; }
.action-btn + .action-btn { border-top: .5px solid var(--sep); }
.action-btn.danger { color: var(--red); } .action-btn.strong { font-weight: 600; } .action-cancel { font-weight: 600; }
[data-theme="light"] .action-group, [data-theme="light"] .action-cancel { background: rgba(255,255,255,.94); }
.dialog-root .dialog { position: absolute; left: 50%; top: 50%; width: min(360px, 88vw); transform: translate(-50%, -46%) scale(.95); opacity: 0; transition: all .22s; background: var(--bg2); border-radius: 22px; padding: 24px 20px 18px; text-align: center; box-shadow: 0 30px 60px rgba(0,0,0,.25); }
.dialog-root.open .dialog { transform: translate(-50%, -50%); opacity: 1; }
.dialog-ic { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,149,0,.15); color: var(--orange); }
.dialog h3 { font-size: 19px; margin-bottom: 8px; } .dialog p { color: var(--text2); line-height: 1.45; font-size: 15px; }
.dialog-btns { display: flex; gap: 10px; margin-top: 18px; } .dialog-btns .btn { flex: 1; height: 46px; font-size: 16px; }

/* chat */
.chat-sheet .sheet-body { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.msg-user { align-self: flex-end; } .msg-bot { align-self: flex-start; }
.msg-b { padding: 10px 14px; border-radius: 20px; font-size: 15.5px; line-height: 1.42; }
.msg-user .msg-b { background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; border-bottom-right-radius: 6px; }
.msg-bot .msg-b { background: var(--bg2); box-shadow: var(--card-shadow); border-bottom-left-radius: 6px; }
.alli-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, #6366F1, #C026D3); }
.alli-av.sage { background: linear-gradient(135deg, #B7791F, #7C4A12); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.chat-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px 10px; scrollbar-width: none; }
.chat-chips .chip { font-size: 13.5px; color: var(--accent); }
.chat-bar { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(10px + var(--safe-b)); border-top: .5px solid var(--sep); background: var(--glass); backdrop-filter: blur(20px); }
.chat-inp { flex: 1; min-height: 42px; height: 42px; max-height: 120px; padding: 10px 14px; border-radius: 21px; font-size: 16px; resize: none; }
.chat-bar .icon-btn { width: 42px; height: 42px; }
.chat-bar .send { background: var(--accent); color: #fff; }
.chat-bar .spk { color: var(--text3); } .chat-bar .spk.on { color: var(--accent); }
.chat-bar .mic.rec { background: var(--red); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,59,48,.5); } 100% { box-shadow: 0 0 0 14px rgba(255,59,48,0); } }
.proposal { display: flex; flex-direction: column; gap: 10px; min-width: 260px; }
.prop-title { font-weight: 700; display: flex; gap: 6px; align-items: center; color: var(--accent); }
.prop-item { border-radius: 14px; background: var(--fill2); padding: 10px; border-left: 4px solid var(--accent); }
.prop-add { border-left-color: var(--green); } .prop-delete { border-left-color: var(--red); } .prop-update { border-left-color: var(--orange); }
.prop-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.prop-op { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 2px 8px; border-radius: 99px; background: var(--bg2); }
.prop-add .prop-op { color: var(--green); } .prop-delete .prop-op { color: var(--red); } .prop-update .prop-op { color: var(--orange); }
.prop-item table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prop-item th { text-align: left; font-size: 11px; color: var(--text2); font-weight: 600; text-transform: uppercase; padding: 2px 4px; }
.prop-item td { padding: 3px 4px; border-top: .5px solid var(--sep); } .prop-item td:first-child { color: var(--text2); }
.prop-item td.bf { color: var(--text2); text-decoration: line-through; text-decoration-color: var(--text3); }
.prop-add td.bf, .prop-delete td.af { text-decoration: none; }
.prop-item td.af { font-weight: 600; }
.prop-btns { display: flex; gap: 8px; } .prop-btns .btn { flex: 1; height: 42px; font-size: 15px; }
.prop-done { display: flex; gap: 6px; align-items: center; color: var(--text2); font-weight: 600; font-size: 14px; } .prop-done.ok { color: var(--green); }

/* toasts */
.toasts { position: fixed; top: calc(var(--safe-t) + 10px); left: 0; right: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 99px; background: var(--glass); color: var(--text); font-size: 15px; font-weight: 500;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 10px 30px rgba(0,0,0,.15); transform: translateY(-30px) scale(.95); opacity: 0; transition: all .35s cubic-bezier(.2,.9,.3,1.2); max-width: 92vw; }
.toast.in { transform: none; opacity: 1; }
.toast-ok .ic { color: var(--green); } .toast-err .ic { color: var(--red); } .toast-info .ic { color: var(--accent); }

@media (hover: hover) { button.li:hover, .cat-card:hover, .quick-card:hover, .goal-card:hover, .qa:hover { filter: brightness(.98); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* layout guards (keep wide charts/tables scrolling inside their card) */
.sim-grid { grid-template-columns: minmax(0, 1fr); }
.sim-grid > *, .chart-card, .dash-main, .dash-side, .grid-wrap { min-width: 0; }
.view { overflow-x: clip; }
.msg-bot { max-width: 100%; } .msg-b { min-width: 0; overflow-wrap: anywhere; } .proposal { min-width: 0; }

/* ════════════════════════════════════════════════════════════
   v2.1 additions
   ════════════════════════════════════════════════════════════ */
.center { text-align: center; justify-content: center; }
.g-cell.center { justify-content: center; }
.eyebrow.center { margin: -2px 0 10px; }

/* ── line-item entries (#5) ─────────────────────────── */
.entry-btn { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); transition: transform .12s, background .2s; }
.entry-btn:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.entry-btn:active { transform: scale(.9); }
.entry-btn.has { background: var(--accent); color: #fff; }
.entry-badge { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; font-size: 11px; font-weight: 700;
  line-height: 18px; text-align: center; background: var(--bg2); color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent); }
.item-row .entry-btn { margin-left: 2px; }
.entries { display: flex; flex-direction: column; gap: 12px; }
.entry-sum { background: var(--bg2); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.entry-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.entry-tiles div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.entry-tiles small { color: var(--text2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.entry-tiles b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-form { padding: 14px; margin: 0; }
.entry-form .seg { margin-bottom: 0; }
.entry-row .entry-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry-list .li.muted .li-title { color: var(--text2); }

/* ── trend drill-down (#6) ──────────────────────────── */
.trend-card { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.trend-card .chart-card { margin: 0; }
.trend-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 2px; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0; font-size: 14px; }
.crumb { padding: 4px 10px; border-radius: 99px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb.on { color: var(--text); background: var(--fill2); }
span.crumb.on { cursor: default; }
.crumbs .sep { color: var(--text3); }
.trend-head .legend { color: var(--text2); font-size: 12.5px; display: flex; align-items: center; flex-wrap: wrap; }
.dot.plan, .legend .dot.plan { background: var(--text3); }
.tc-axis { stroke: var(--sep); }
.tc-val { font-size: 10.5px; font-family: var(--font); fill: var(--text2); font-variant-numeric: tabular-nums; }
.tc-val.pos { fill: var(--green); } .tc-val.exp { fill: var(--exp); } .tc-val.neg { fill: var(--red); }
.tc-val.strong { font-weight: 700; fill: var(--text); } .tc-val.strong.pos { fill: var(--green); } .tc-val.strong.neg { fill: var(--red); }
.tc-val.muted { fill: var(--text3); }
.tc-plan { fill: var(--text3); opacity: .55; } .tc-act { fill: var(--accent); }
.tc-col:not(.sel) rect.tc-act { opacity: .6; }
.drill-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: .5px solid var(--sep); margin: 6px 4px 0; }
.drill-stats span { display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 8px; min-width: 0; }
.drill-stats span + span { border-left: .5px solid var(--sep); }
.drill-stats small { color: var(--text2); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.drill-stats b { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drill-lbl { display: flex; align-items: center; gap: 6px; color: var(--text2); font-size: 12.5px; font-weight: 600; padding: 4px 4px 0; }
.drill-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.drill-chips::-webkit-scrollbar { display: none; }
.dchip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; background: var(--bg2); box-shadow: var(--card-shadow); font-size: 13.5px; font-weight: 600; }
.dchip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.dchip small { color: var(--text2); font-weight: 500; font-size: 12px; }
.dchip:hover { box-shadow: 0 0 0 1.5px var(--c), var(--card-shadow); }
body.desktop .drill-chips { flex-wrap: wrap; overflow: visible; }

/* ── Alli: files & review card (#4) ─────────────────── */
.chat-sheet .sheet-body { position: relative; }
.chat-bar .clip { color: var(--text2); }
.chat-chips .chip-file { color: #fff; background: var(--accent); }
.chat-drop { position: absolute; inset: 8px; z-index: 5; border-radius: 18px; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--bg) 88%, var(--accent));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--accent); pointer-events: none; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; } .file-chip small { opacity: .75; font-weight: 500; }
.msg-wide { max-width: 100% !important; width: 100%; } .msg-wide .msg-b { flex: 1; padding: 10px; }
.imp { display: flex; flex-direction: column; gap: 10px; }
.imp-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--accent); }
.imp-head b { color: var(--text); overflow-wrap: anywhere; } .imp-type { color: var(--text2); font-size: 13px; margin-left: auto; }
.imp-acc { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); } .imp-acc span { flex: none; } .imp-acc .sel-wrap { flex: 1; }
.inp.sm { height: 36px; font-size: 14px; border-radius: 10px; padding: 0 10px; }
.sel-wrap .inp.sm { padding-right: 30px; } .sel-wrap:has(.inp.sm) .ic { top: 10px; right: 10px; }
.imp-tools { display: flex; gap: 12px; } .imp-tools .link-btn { font-size: 14px; padding: 2px; }
.imp-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.imp-row { display: flex; gap: 10px; padding: 10px; border-radius: 14px; background: var(--fill2); border: 1px solid transparent; transition: opacity .2s; }
.imp-row.off { opacity: .55; }
.imp-row.off .imp-l3 { display: none; }
.imp-chk { flex: none; cursor: pointer; padding-top: 1px; } .imp-chk input { position: absolute; opacity: 0; pointer-events: none; }
.imp-chk span { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--text3); display: grid; place-items: center; color: transparent; transition: all .15s; }
.imp-chk input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.imp-chk input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.imp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.imp-l1 { display: flex; gap: 8px; align-items: baseline; } .imp-desc { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.imp-amt { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14.5px; }
.imp-l2 { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .imp-l2 small { color: var(--text2); }
.imp-badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--bg2); color: var(--text2); }
.imp-badge.info { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.imp-badge.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.imp-badge.new { color: #AF52DE; background: color-mix(in srgb, #AF52DE 13%, transparent); }
.imp-badge.bad { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.imp-badge.warn { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.imp-l3 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 6px; }
.imp-l3 .imp-sel:only-child { grid-column: 1 / -1; }
.imp-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; border-top: .5px solid var(--sep); padding-top: 10px; }
.imp-sum { color: var(--text2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.imp-foot .btn { height: 44px; font-size: 15px; } .imp-foot .btn:disabled { opacity: .45; }

/* ── admin: translated catalogs (#3) ───────────────── */
.ctab-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px 4px; }
.ctab { display: flex; flex-direction: column; gap: 6px; min-width: 640px; }
.ctab-row { display: grid; align-items: center; gap: 8px; }
.ctab-freq .ctab-row { grid-template-columns: repeat(3, minmax(140px, 1fr)) 34px; }
.ctab-cat .ctab-row { grid-template-columns: 70px 46px 118px repeat(3, minmax(120px, 1fr)) 64px 34px; min-width: 860px; }
.ctab-head { padding: 0 2px; }
.ctab-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .3px; }
.ctab .inp.sm { width: 100%; }
.ctab-color { width: 44px; height: 36px; padding: 2px; border: 0; border-radius: 10px; background: var(--fill2); cursor: pointer; }
.ctab .icon-picker .ip-current { height: 36px; padding: 0 8px; gap: 4px; } .ctab .icon-picker .ip-current span { display: none; }
.ctab .icon-picker .ip-grid { position: absolute; z-index: 30; width: 330px; left: 0; top: 40px; }
.mini-chk { display: grid; place-items: center; cursor: pointer; } .mini-chk input { position: absolute; opacity: 0; pointer-events: none; }
.mini-chk span { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--text3); display: grid; place-items: center; color: transparent; }
.mini-chk input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.ctab-actions { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.admin-card .sec-title .link-btn { margin-left: auto; font-size: 14px; }

/* ── settings: category translations ───────────────── */
.tr-grid { display: flex; flex-direction: column; gap: 8px; }
.tr-row { display: flex; align-items: center; gap: 10px; } .tr-row .inp { flex: 1; }
.prop-entry { border-left-color: var(--accent); } .prop-entry .prop-op { color: var(--accent); }
.trend.fluid { display: block; height: auto; margin: 0 auto; }
.crumbs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .crumbs::-webkit-scrollbar { display: none; }
.crumb { flex: none; }
.trend-head .legend.below { flex-basis: 100%; justify-content: flex-end; margin-top: -2px; }
