/* Approved identity colors; semantic tokens provide contrast in each theme. */
:root {
  --sm-leaf: #45BA4B;
  --sm-fresh: #12B969;
  --sm-emerald: #078D71;
  --sm-forest: #075B54;
  --sm-ink: #082B2B;
  --sm-mint: #EAF8F0;
  --sm-gradient: linear-gradient(145deg, #45BA4B 0%, #12B969 37%, #078D71 70%, #075B54 100%);
  --ink: #082B2B;
  --muted: #526A64;
  --line: #D3E2DA;
  --bg: #F7FAF8;
  --surface: #FFFFFF;
  --surface-soft: #EAF8F0;
  --green: #078D71;
  --green-deep: #075B54;
  --green-bright: #12B969;
  --accent: #078D71;
  --positive: #06735C;
  --negative: #AB4336;
  --danger-soft: #FFF0EC;
  --on-brand: #FFFFFF;
  --white: var(--surface);
  --light: var(--surface-soft);
  --grad: var(--sm-gradient);
  --action-gradient: linear-gradient(145deg, #078D71, #075B54);
  --soft-gradient: linear-gradient(145deg, #EAF8F0, #F7FAF8);
  --avatar-gradient: linear-gradient(145deg, #EAF8F0, #C2EAD5);
  --header-bg: rgba(247, 250, 248, .96);
  --overlay: rgba(8, 43, 43, .58);
  --toast-bg: #075B54;
  --shadow: 0 14px 40px rgba(8, 43, 43, .065);
  --radius: 22px;
  color-scheme: light;
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  font-synthesis: none;
}
:root[data-theme="dark"] {
  --ink: #EAF8F0;
  --muted: #ADC6BC;
  --line: #335653;
  --bg: #082B2B;
  --surface: #103635;
  --surface-soft: #174440;
  --green: #62DAA0;
  --green-deep: #86E6B6;
  --green-bright: #62DAA0;
  --accent: #62DAA0;
  --positive: #72E1AE;
  --negative: #FFAD9C;
  --danger-soft: #492F30;
  --soft-gradient: linear-gradient(145deg, #174440, #103635);
  --avatar-gradient: linear-gradient(145deg, #21564A, #174440);
  --header-bg: rgba(8, 43, 43, .96);
  --overlay: rgba(0, 15, 15, .76);
  --toast-bg: #075B54;
  --shadow: 0 14px 40px rgba(0, 12, 12, .24);
  color-scheme: dark;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-width:320px;background:var(--bg)}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
a{color:inherit;text-decoration:none}
button:disabled{opacity:.45;cursor:not-allowed}
input,select,textarea{outline:none}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
::selection{background:var(--surface-soft);color:var(--positive)}
::-webkit-scrollbar{width:7px;height:7px}
::-webkit-scrollbar-thumb{background:var(--surface-soft);border-radius:9px}
.hidden{display:none!important}
.boot{min-height:100dvh;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:15px;color:var(--muted)}
.boot-mark{height:64px;width:64px;border-radius:21px;background:var(--grad);color:white;display:grid;place-items:center;font-size:32px;font-weight:800;box-shadow:0 16px 35px #1fb17f44}

.icon{width:19px;height:19px;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;fill:none;flex-shrink:0}
.icon.sm{width:16px;height:16px}
.icon.lg{width:24px;height:24px}
.icon.xl{width:29px;height:29px}

.logo{display:flex;align-items:center;gap:11px;min-width:0}
.logo-icon{width:41px;height:41px;flex-shrink:0;border-radius:13px;background:var(--grad);display:grid;place-items:center;box-shadow:0 8px 19px #13a27125;color:var(--on-brand)}
.logo-icon svg{width:27px;height:27px}
.logo-name{font-family:Manrope,sans-serif;font-weight:800;letter-spacing:-1.1px;font-size:23px;line-height:1}
.logo-name .subtle{color:var(--positive)}
.logo-tag{font-size:10px;color:var(--muted);margin-top:5px;letter-spacing:.4px;font-weight:600}
.side{width:255px;background:var(--surface);position:fixed;inset:0 auto 0 0;z-index:20;display:flex;flex-direction:column;padding:30px 17px 22px;border-right:1px solid var(--line);overflow:auto}
.side-logo{padding:0 14px 37px}
.nav-section{padding:0 13px;margin:18px 0 9px;color:var(--muted);font-weight:800;letter-spacing:1.15px;font-size:10px;text-transform:uppercase}
.nav-list{display:flex;flex-direction:column;gap:5px}
.nav-item{width:100%;display:flex;align-items:center;gap:12px;padding:12px 13px;border:0;background:transparent;color:var(--muted);font-weight:700;text-align:left;border-radius:13px;transition:all .18s}
.nav-item:hover{color:var(--green-deep);background:var(--surface-soft)}
.nav-item.active{color:var(--positive);background:var(--surface-soft)}
.nav-item.active .icon{stroke-width:2.3}
.nav-item .nav-count{margin-left:auto;color:var(--positive);font-size:11px;border-radius:8px;background:var(--surface-soft);padding:3px 7px}
.side-groups{max-height:280px;overflow:auto}
.side-group{display:flex;gap:10px;align-items:center;padding:9px 12px;border-radius:12px;border:0;width:100%;background:none;text-align:left;color:var(--muted);font-weight:650;font-size:13px}
.side-group:hover,.side-group.active{background:var(--surface-soft);color:var(--green-deep)}
.side-group .emoji{font-size:17px}
.sidebar-spacer{flex:1;min-height:12px}
.mini-link{border:0;background:none;color:var(--positive);font-weight:800;padding:0;font-size:12px;position:relative;z-index:1}
.side-account{display:flex;align-items:center;gap:10px;width:100%;margin-top:21px;background:none;border:0;border-top:1px solid var(--line);padding:18px 3px 1px;text-align:left}
.avatar{width:38px;height:38px;border-radius:13px;background:var(--avatar-gradient);color:var(--positive);display:grid;place-items:center;font-weight:800;font-size:13px;flex-shrink:0}
.avatar.dark{background:var(--toast-bg);color:var(--muted)}
.avatar.soft{background:var(--surface-soft);color:var(--positive)}
.avatar.stack{border:3px solid white;width:36px;height:36px;margin-left:-10px;border-radius:50%;font-size:11px}
.account-meta{flex:1;min-width:0}
.account-meta strong,.account-meta small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.account-meta strong{font-size:12px}
.account-meta small{font-size:10px;color:var(--muted);margin-top:3px}

.workspace{margin-left:255px;min-height:100dvh}
.topbar{position:sticky;top:0;height:82px;background:var(--header-bg);backdrop-filter:blur(18px);z-index:15;display:flex;align-items:center;justify-content:space-between;padding:0 42px;border-bottom:1px solid var(--line)}
.bread{font-size:12px;color:var(--muted);font-weight:650}
.bread strong{color:var(--positive)}
.top-actions{display:flex;gap:12px;align-items:center}
.icon-btn{height:42px;width:42px;border:1px solid var(--line);border-radius:13px;display:grid;place-items:center;background:var(--surface);color:var(--positive);position:relative}
.icon-btn:hover{color:var(--green);border-color:var(--line)}
.dot-indicator{position:absolute;right:9px;top:8px;width:7px;height:7px;border-radius:50%;background:var(--surface-soft);border:2px solid white}
.small-avatar{border-radius:50%;height:40px;width:40px;border:3px solid white;box-shadow:0 3px 12px #114a2514}
.mobile-header{display:none}
.content{max-width:1410px;margin:auto;padding:35px 42px 100px}
.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:28px}
.eyebrow{font-size:11px;font-weight:800;letter-spacing:1.6px;text-transform:uppercase;color:var(--positive);margin-bottom:9px}
.page-head h1,.section-title{font-family:Manrope,sans-serif;letter-spacing:-1.3px}
.page-head h1{font-size:30px;margin:0 0 8px;font-weight:800}
.page-head p{font-size:13px;color:var(--muted);margin:0;line-height:1.6}
.head-actions{display:flex;gap:9px;align-items:center}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap;border:1px solid transparent;border-radius:12px;padding:11px 17px;font-size:12px;font-weight:800;min-height:43px;transition:transform .16s,box-shadow .16s}
.btn:active{transform:scale(.975)}
.btn.primary{background:var(--grad);color:white;box-shadow:0 10px 25px #049e692c}
.btn.primary:hover{box-shadow:0 12px 27px #05986d54;transform:translateY(-1px)}
.btn.secondary{background:var(--surface);border-color:var(--line);color:var(--positive)}
.btn.secondary:hover{border-color:var(--accent)}
.btn.ghost{background:var(--surface-soft);color:var(--positive)}
.btn.danger{background:var(--danger-soft);color:var(--negative)}
.btn.tiny{min-height:33px;padding:7px 11px;font-size:11px}
.btn.full{width:100%}
.btn .icon{width:17px;height:17px}
.cards3{display:grid;grid-template-columns:1.38fr 1fr 1fr;gap:18px}
.hero-balance{background:var(--grad);color:white;border-radius:23px;position:relative;overflow:hidden;padding:27px 28px;min-height:205px;box-shadow:0 20px 42px #0d9d6e29}
.hero-balance:after,.hero-balance:before{position:absolute;content:'';border:1px solid #ffffff35;border-radius:50%;width:220px;height:220px;top:-110px;right:-55px}
.hero-balance:before{width:300px;height:300px;top:-145px;right:-130px;background:#ffffff08}
.hero-balance .card-kicker{color:var(--muted);position:relative;z-index:1}
.card-kicker{font-size:12px;color:var(--muted);font-weight:750;display:flex;align-items:center;justify-content:space-between;gap:8px}
.card-kicker .icon{color:var(--muted)}
.hero-value{font-family:Manrope,sans-serif;font-size:35px;font-weight:800;letter-spacing:-1.7px;margin:27px 0 7px;position:relative;z-index:1}
.hero-note{font-size:12px;color:var(--muted);position:relative;z-index:1}
.hero-bottom{display:flex;gap:9px;margin-top:20px;position:relative;z-index:1}
.hero-chip{border:1px solid #ffffff65;background:#ffffff23;padding:7px 10px;border-radius:9px;color:white;font-size:10px;font-weight:750}
.stat-card{background:var(--surface);border:1px solid var(--line);border-radius:23px;padding:25px 24px;min-height:205px;box-shadow:var(--shadow);display:flex;flex-direction:column;justify-content:space-between}
.stat-icon{width:43px;height:43px;background:var(--surface-soft);border-radius:15px;display:grid;place-items:center;color:var(--positive)}
.stat-icon.debt{background:var(--danger-soft);color:var(--negative)}
.stat-value{font-family:Manrope,sans-serif;font-size:27px;font-weight:800;letter-spacing:-1.1px;margin:11px 0 2px}
.stat-note{color:var(--muted);font-size:11px}
.arrow-trend{font-size:11px;color:var(--positive);font-weight:800}
.section-row{display:flex;justify-content:space-between;align-items:center;margin:31px 0 15px;gap:10px}
.section-title{font-size:18px;font-weight:800;margin:0}
.section-subtitle{margin-top:3px;color:var(--muted);font-size:11px}
.section-link{font-weight:800;font-size:12px;color:var(--positive);border:0;background:none}
.main-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(290px,1fr);gap:21px}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:21px;box-shadow:var(--shadow);overflow:hidden}
.panel-pad{padding:24px}
.panel-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.panel-top h3{margin:0;font-size:16px;letter-spacing:-.4px}
.panel-top small{font-size:11px;color:var(--muted)}
.group-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.group-card{display:flex;flex-direction:column;justify-content:space-between;border:1px solid var(--line);background:var(--surface);padding:18px;border-radius:17px;min-height:164px;text-align:left;transition:all .2s;cursor:pointer;position:relative;overflow:hidden}
.group-card:hover{border-color:var(--accent);transform:translateY(-2px);box-shadow:0 10px 25px #124c2d0b}
.group-emoji{height:44px;width:44px;display:grid;place-items:center;background:var(--surface-soft);border-radius:14px;font-size:24px}
.group-card h4{font-size:14px;margin:13px 0 4px;font-weight:800}
.group-meta{color:var(--muted);font-size:11px}
.group-bottom{display:flex;align-items:flex-end;justify-content:space-between;gap:10px}
.amount-owed{color:var(--positive);font-weight:850;font-size:13px}
.amount-debt{color:var(--negative);font-weight:850;font-size:13px}
.amount-clear{color:var(--muted);font-weight:800;font-size:12px}
.group-avatars{display:flex;align-items:center;justify-content:flex-end;padding-left:10px}
.group-avatars .avatar:first-child{margin-left:0}
.activity-list{display:flex;flex-direction:column}
.activity-item{display:flex;align-items:center;gap:13px;padding:14px 0;border-bottom:1px solid var(--line);min-width:0}
.activity-item:last-child{border-bottom:0}
.activity-ico{height:43px;width:43px;flex-shrink:0;display:grid;place-items:center;background:var(--surface-soft);border-radius:14px;font-size:20px}
.activity-info{min-width:0;flex:1}
.activity-info h4{font-size:12px;font-weight:800;margin:0 0 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.activity-info small{display:block;color:var(--muted);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.activity-money{text-align:right;flex-shrink:0;font-size:12px;font-weight:850}
.activity-money small{font-size:10px;color:var(--muted);font-weight:650;display:block;margin-top:4px}
.quick-add{display:flex;align-items:center;gap:11px;background:var(--soft-gradient);padding:17px;border-radius:16px;border:1px solid var(--line)}
.quick-add h4{font-size:13px;margin:0 0 3px}
.quick-add p{font-size:10px;color:var(--muted);margin:0}
.quick-add .btn{margin-left:auto}
.chart-bars{height:175px;display:flex;align-items:flex-end;gap:9px;margin:18px 0 2px}
.chart-col{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:9px;height:100%;justify-content:flex-end}
.chart-bar{width:min(100%,34px);min-height:3px;border-radius:8px 8px 4px 4px;background:var(--surface-soft);transition:height .4s}
.chart-bar.selected{background:var(--grad)}
.chart-col small{font-size:10px;font-weight:650;color:var(--muted)}
.chart-desc{font-size:12px;color:var(--muted);margin:15px 0 0}
.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:45px 18px;color:var(--muted)}
.empty .empty-icon{height:60px;width:60px;border-radius:19px;display:grid;place-items:center;background:var(--surface-soft);color:var(--positive);margin-bottom:13px}
.empty strong{font-size:14px;color:var(--positive)}
.empty p{font-size:12px;max-width:275px;line-height:1.7;margin:9px 0 18px}
.member-avatars{display:flex;align-items:center;padding-left:11px}
.member-avatars .avatar{margin-left:-11px}
.pill{background:var(--surface-soft);color:var(--positive);font-size:10px;font-weight:800;padding:6px 10px;border-radius:8px;display:inline-flex;align-items:center;gap:6px}
.pill.neutral{background:var(--surface-soft);color:var(--muted)}
.group-detail-hero{padding:24px;display:flex;justify-content:space-between;align-items:flex-start;gap:17px}
.group-title-line{display:flex;align-items:center;gap:14px}
.group-big-emoji{width:64px;height:64px;border-radius:20px;background:var(--surface-soft);display:grid;place-items:center;font-size:31px}
.group-detail-hero h2{margin:2px 0 7px;font-size:20px;font-weight:850;letter-spacing:-.4px}
.group-detail-hero p{font-size:11px;color:var(--muted);margin:0}
.group-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.group-summary{display:grid;grid-template-columns:repeat(3,1fr);border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:0 24px;padding:19px 0}
.summary-value{font-size:18px;font-weight:850;margin:6px 0}
.summary-label{color:var(--muted);font-size:10px}
.group-summary>div:not(:first-child){padding-left:21px;border-left:1px solid var(--line)}
.tabs{display:flex;gap:22px;border-bottom:1px solid var(--line);padding:0 24px}
.tab{border:none;background:none;color:var(--muted);font-size:12px;font-weight:800;padding:16px 0;position:relative}
.tab.active{color:var(--positive)}
.tab.active:after{position:absolute;content:'';height:3px;left:0;right:0;bottom:-1px;background:var(--surface-soft);border-radius:5px}
.expense-row{display:flex;align-items:center;gap:15px;padding:16px 24px;border-bottom:1px solid var(--line);transition:background .15s;cursor:pointer}
.expense-row:hover{background:var(--surface)}
.expense-row:last-child{border-bottom:0}
.expense-date{min-width:35px;display:flex;flex-direction:column;align-items:center;color:var(--muted);gap:1px}
.expense-date strong{font-size:17px;color:var(--muted)}
.expense-date small{font-size:10px;font-weight:800;text-transform:uppercase}
.expense-symbol{width:44px;height:44px;border-radius:14px;background:var(--surface-soft);display:grid;place-items:center;font-size:21px}
.expense-text{flex:1;min-width:0}
.expense-text strong,.expense-text small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.expense-text strong{font-size:12px;margin-bottom:6px}
.expense-text small{font-size:10px;color:var(--muted)}
.expense-right{text-align:right;min-width:85px}
.expense-right strong{font-size:12px}
.expense-right small{display:block;font-size:10px;color:var(--muted);margin-top:4px}
.expense-right .plus{color:var(--positive)}
.expense-right .minus{color:var(--negative)}
.mini-balance{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:13px 0;align-items:center}
.mini-balance:last-child{border:0}
.mini-balance .member{display:flex;align-items:center;gap:11px;min-width:0}
.mini-balance strong{font-size:12px}
.mini-balance small{display:block;font-size:10px;color:var(--muted);margin-top:4px}
.settle-flow{display:flex;align-items:center;gap:8px;justify-content:space-between;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid var(--line)}
.settle-flow:last-child{border:0}
.settle-flow .avatars-flow{display:flex;align-items:center;gap:8px}
.settle-flow .desc{font-size:11px;color:var(--muted)}
.settle-flow .value{color:var(--positive);font-size:12px;font-weight:850}
.searchbar{display:flex;align-items:center;gap:10px;border:1px solid var(--line);background:var(--surface);border-radius:13px;padding:0 14px;color:var(--muted);height:45px;min-width:235px}
.searchbar input{border:0;outline:0;background:none;width:100%;font-size:12px;color:var(--positive)}
.searchbar input::placeholder{color:var(--muted)}
.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:15px}
.select-mini{height:44px;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:0 14px;color:var(--positive);font-weight:700;font-size:12px}
.full-panel{padding:24px}
.report-layout{display:grid;grid-template-columns:1.5fr 1fr;gap:18px}
.report-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.report-metric{border:1px solid var(--line);border-radius:17px;padding:18px;background:var(--surface)}
.report-metric span{font-size:11px;color:var(--muted)}
.report-metric strong{display:block;margin:12px 0 5px;font-size:22px;letter-spacing:-.8px}
.category-row{padding:10px 0}
.category-top{display:flex;justify-content:space-between;font-size:11px;margin-bottom:8px;font-weight:750}
.progress-track{height:7px;background:var(--surface-soft);border-radius:9px;overflow:hidden}
.progress-fill{height:100%;background:var(--grad);border-radius:9px}
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:19px}
.setting-block{padding:24px}
.setting-block h3{font-size:15px;margin:0 0 7px}
.setting-block p{font-size:11px;color:var(--muted);line-height:1.7;margin:0 0 20px}
.field{display:flex;flex-direction:column;gap:7px;margin-bottom:14px}
.field label,.field>span{font-size:11px;color:var(--positive);font-weight:800}
.field input,.field select,.field textarea{width:100%;border:1px solid var(--line);border-radius:12px;min-height:45px;padding:11px 13px;background:var(--surface);color:var(--positive);font-size:13px;transition:border-color .2s}
.field textarea{min-height:78px;resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px #20c9891c}
.field-hint{font-size:10px;color:var(--muted)}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.field-grid .field{min-width:0}
.checkbox-row{display:flex;gap:9px;align-items:center;font-size:12px;color:var(--muted)}
.checkbox-row input{accent-color:var(--positive);width:16px;height:16px}
.setting-line{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:13px 0;border-bottom:1px solid var(--line)}
.setting-line strong{font-size:12px}
.setting-line small{font-size:10px;color:var(--muted)}
.hr{height:1px;background:var(--line);margin:16px 0}
.muted{color:var(--muted)}
.text-green{color:var(--positive)}
.text-red{color:var(--negative)}
.text-right{text-align:right}
.w-full{width:100%}
.my-10{margin:10px 0}
.mt-15{margin-top:15px}
.mb-15{margin-bottom:15px}
.flex{display:flex;align-items:center;gap:10px}
.flex-between{display:flex;align-items:center;justify-content:space-between;gap:10px}
.wrap{flex-wrap:wrap}
.filter-chips{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.filter-chip{border:1px solid var(--line);background:var(--surface);color:var(--muted);font-size:11px;font-weight:800;padding:8px 12px;border-radius:10px}
.filter-chip.active{color:var(--positive);border-color:var(--accent);background:var(--surface-soft)}
.members-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.member-tile{display:flex;align-items:center;gap:12px;border:1px solid var(--line);padding:14px;border-radius:15px}
.member-tile strong{font-size:12px}
.member-tile small{display:block;font-size:10px;color:var(--muted);margin-top:3px}
.invite-code{display:flex;align-items:center;gap:8px;background:var(--surface-soft);border:1px dashed var(--accent);border-radius:13px;padding:10px;color:var(--positive);font-size:12px;font-weight:800;word-break:break-all}
.split-preview{display:flex;justify-content:space-between;align-items:center;padding:9px 0;border-bottom:1px solid var(--line)}
.split-preview:last-child{border:0}
.split-preview .who{display:flex;align-items:center;gap:9px;font-weight:750;font-size:11px}
.split-preview input{width:110px;border:1px solid var(--line);border-radius:8px;padding:7px 10px;font-size:12px;text-align:right;color:var(--positive)}
.split-preview input[type=checkbox]{width:16px;height:16px;accent-color:var(--positive)}
.share-help{font-size:10px;color:var(--muted);line-height:1.6}
.error-box{background:var(--danger-soft);border:1px solid var(--line);color:var(--negative);border-radius:11px;padding:11px 12px;font-size:11px;margin-bottom:12px}
.toast{position:fixed;right:25px;bottom:25px;z-index:200;background:var(--toast-bg);color:white;padding:14px 18px;border-radius:13px;box-shadow:0 16px 35px #002e1b35;font-size:12px;font-weight:700;display:flex;align-items:center;gap:10px;animation:toast-in .25s}
.toast.bad{background:var(--toast-bg)}
@keyframes toast-in{from{opacity:0;transform:translateY(15px)}
to{opacity:1;transform:translateY(0)}
}

/* dialogs */
.overlay{position:fixed;inset:0;z-index:70;background:var(--overlay);backdrop-filter:blur(5px);display:flex;justify-content:center;align-items:center;padding:17px;animation:fade-in .2s}
@keyframes fade-in{from{opacity:0}
to{opacity:1}
}
.dialog{max-height:min(91dvh,850px);width:min(100%,540px);overflow:auto;border-radius:24px;background:var(--surface);box-shadow:0 35px 100px #0b2d1e50;animation:dialog-in .23s}
.dialog.wide{width:min(100%,660px)}
@keyframes dialog-in{from{opacity:0;transform:translateY(10px) scale(.98)}
to{opacity:1;transform:translateY(0) scale(1)}
}
.dialog-head{padding:24px 26px 16px;display:flex;justify-content:space-between;align-items:flex-start;gap:10px;border-bottom:1px solid var(--line)}
.dialog-head h2{font-size:19px;letter-spacing:-.6px;margin:0 0 5px}
.dialog-head p{font-size:11px;color:var(--muted);margin:0}
.close-x{width:32px;height:32px;border:0;border-radius:11px;background:var(--surface-soft);color:var(--muted);display:grid;place-items:center}
.dialog-body{padding:22px 26px 10px}
.dialog-foot{padding:16px 26px 25px;display:flex;justify-content:flex-end;gap:9px;background:var(--surface)}
.emoji-picker{display:flex;gap:9px;flex-wrap:wrap}
.emoji-option{width:44px;height:44px;border:1px solid var(--line);background:var(--surface);border-radius:12px;font-size:22px}
.emoji-option.active{border-color:var(--accent);background:var(--surface-soft)}
.split-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;background:var(--surface-soft);padding:5px;border-radius:13px;margin:6px 0 14px}
.split-tabs button{border:0;border-radius:9px;background:none;color:var(--muted);font-weight:800;font-size:11px;padding:9px 5px}
.split-tabs button.active{background:var(--surface);color:var(--positive);box-shadow:0 3px 10px #164c2210}
.receipt-upload{border:1px dashed var(--accent);background:var(--surface-soft);border-radius:13px;display:flex;align-items:center;gap:10px;padding:12px;cursor:pointer;font-size:11px;color:var(--positive)}
.receipt-upload input{display:none}
.comment{border-bottom:1px solid var(--line);padding:11px 0;display:flex;gap:10px}
.comment strong{font-size:11px}
.comment p{font-size:11px;margin:4px 0 0;line-height:1.5;color:var(--positive)}

/* auth */
.auth-layout{min-height:100dvh;display:grid;grid-template-columns:1fr 1fr;background:var(--surface)}
.auth-art{background:var(--grad);padding:52px clamp(32px,6.5vw,110px);color:white;position:relative;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden}
.auth-art:before{content:'';position:absolute;width:740px;height:740px;top:8%;left:35%;border-radius:50%;border:1px solid #ffffff36;box-shadow:0 0 0 70px #ffffff08,0 0 0 150px #ffffff06,0 0 0 250px #ffffff04}
.auth-art .logo{position:relative;z-index:2}
.auth-art .logo-icon{background:#ffffff2a;box-shadow:none;border:1px solid #ffffff55}
.auth-art .logo-name,.auth-art .logo-name .subtle{color:white}
.auth-headline{position:relative;z-index:2}
.auth-headline h1{font:800 clamp(35px,4vw,58px)/1.13 Manrope,sans-serif;letter-spacing:-3.1px;max-width:500px;margin:0 0 19px}
.auth-headline p{font-size:15px;color:var(--muted);line-height:1.75;max-width:410px}
.auth-showcase{margin-top:40px;background:#fffffffa;color:var(--positive);padding:23px;border-radius:22px;max-width:410px;box-shadow:0 30px 60px #03452f3d;transform:rotate(-4deg)}
.showcase-top{display:flex;align-items:center;justify-content:space-between}
.showcase-top strong{font-size:12px}
.showcase-top small{color:var(--muted);font-size:10px}
.showcase-amount{font:800 33px Manrope,sans-serif;letter-spacing:-1.1px;margin:16px 0 3px;color:var(--positive)}
.showcase-small{font-size:11px;color:var(--muted)}
.showcase-divider{height:1px;background:var(--surface-soft);margin:19px 0 13px}
.showcase-person{display:flex;gap:10px;align-items:center;margin:11px 0}
.showcase-person strong{font-size:11px}
.showcase-person small{display:block;font-size:10px;color:var(--muted);margin-top:3px}
.showcase-person b{margin-left:auto;color:var(--positive);font-size:12px}
.auth-foot{position:relative;z-index:2;font-size:11px;color:var(--muted)}
.auth-right{display:flex;justify-content:center;align-items:center;padding:42px 34px}
.auth-form-area{width:100%;max-width:410px}
.auth-badge{display:inline-flex;gap:8px;align-items:center;background:var(--surface-soft);color:var(--positive);border-radius:20px;padding:8px 11px;font-weight:800;font-size:10px}
.auth-form-area h2{font:800 29px Manrope,sans-serif;letter-spacing:-1.1px;margin:20px 0 8px}
.auth-form-area>p{font-size:12px;color:var(--muted);line-height:1.8;margin:0 0 28px}
.auth-form-area .field label{font-size:12px}
.auth-form-area .field input{min-height:49px}
.auth-form-area .btn{min-height:50px}
.auth-switch{text-align:center;font-size:12px;color:var(--muted);margin:20px 0}
.auth-switch button{background:none;border:0;color:var(--positive);font-weight:800;padding:0}
.auth-mini{margin-top:35px;text-align:center;font-size:10px;color:var(--muted)}
.auth-mobile-logo{display:none}
.demo-link{width:100%;background:none;border:none;font-size:11px;font-weight:800;color:var(--positive);padding:12px;margin-top:4px}
.auth-divider{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:10px;margin:18px 0}
.auth-divider:before,.auth-divider:after{content:'';height:1px;background:var(--surface-soft);flex:1}

/* responsive */
.mobile-nav{display:none}
.floating-add{display:none}
.mobile-only{display:none}
.desktop-only{display:block}

@media(max-width:1170px){.side{width:225px}
.workspace{margin-left:225px}
.topbar{padding:0 26px}
.content{padding:28px 26px 90px}
.cards3{grid-template-columns:1.15fr 1fr 1fr;gap:12px}
.stat-card,.hero-balance{padding:20px}
.hero-value{font-size:29px}
.group-list{grid-template-columns:1fr 1fr}
.main-grid{grid-template-columns:1.35fr 1fr;gap:13px}
}

@media(max-width:960px){.side{width:75px;padding:23px 11px}
.side-logo{padding:0 6px 28px}
.side-logo .logo-name,.side-logo .logo-tag,.side-logo .logo-icon+div,.nav-section,.nav-item>span,.side-groups,.account-meta,.side-account .icon{display:none}
.side-logo .logo-icon{width:40px}
.nav-item{justify-content:center}
.nav-item .nav-count{display:none}
.side-account{justify-content:center}
.workspace{margin-left:75px}
.cards3{grid-template-columns:1fr 1fr 1fr}
.hero-value{font-size:25px}
.stat-value{font-size:23px}
.main-grid,.report-layout{grid-template-columns:1fr}
.auth-art{padding:39px 32px}
.auth-headline h1{font-size:40px;letter-spacing:-1.7px}
}

@media(max-width:690px){body{background:var(--surface-soft)}
.side,.topbar{display:none}
.workspace{margin-left:0}
.mobile-header{height:71px;display:flex;justify-content:space-between;align-items:center;padding:12px 20px;background:var(--surface);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:15}
.mobile-header .logo-icon{width:35px;height:35px;border-radius:11px}
.mobile-header .logo-icon svg{width:23px}
.mobile-header .logo-name{font-size:21px}
.mobile-header .icon-btn{height:36px;width:36px}
.mobile-header .top-actions{gap:8px}
.content{padding:25px 18px 112px}
.page-head{margin-bottom:20px}
.page-head h1{font-size:24px;letter-spacing:-.8px}
.page-head p{font-size:11px}
.eyebrow{font-size:10px}
.page-head .head-actions .btn{padding:9px 12px;font-size:11px}
.cards3{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.hero-balance{grid-column:1/-1;min-height:172px;padding:23px}
.hero-value{font-size:34px;margin:18px 0 4px}
.hero-bottom{margin-top:16px}
.stat-card{min-height:151px;padding:17px}
.stat-value{font-size:21px}
.stat-icon{height:37px;width:37px;border-radius:12px}
.stat-note{font-size:10px}
.card-kicker{font-size:10px}
.section-row{margin:26px 0 13px}
.section-title{font-size:16px}
.main-grid{gap:13px}
.panel-pad{padding:19px}
.group-list{gap:10px}
.group-card{padding:14px;min-height:155px}
.group-emoji{height:38px;width:38px;font-size:19px}
.group-card h4{font-size:12px}
.group-meta{font-size:10px}
.group-avatars .avatar{width:27px;height:27px;font-size:9px}
.amount-owed,.amount-debt{font-size:11px}
.mobile-nav{display:flex;position:fixed;bottom:0;left:0;right:0;align-items:center;justify-content:space-around;z-index:30;background:var(--header-bg);backdrop-filter:blur(20px);border-top:1px solid var(--line);padding:11px 4px calc(10px + env(safe-area-inset-bottom));box-shadow:0 -10px 25px #0b49210b}
.bottom-item{background:transparent;border:0;display:flex;flex-direction:column;align-items:center;gap:5px;color:var(--muted);font-size:9px;font-weight:750;min-width:56px}
.bottom-item.active{color:var(--positive)}
.bottom-item .icon{width:21px;height:21px}
.bottom-add{height:50px;width:50px;display:grid;place-items:center;border:0;border-radius:16px;background:var(--grad);color:white;box-shadow:0 9px 22px #08a56b60;transform:translateY(-18px);margin-bottom:-12px}
.bottom-add .icon{width:25px;height:25px}
.mobile-only{display:block}
.desktop-only{display:none}
.group-detail-hero{padding:18px;flex-wrap:wrap}
.group-detail-hero h2{font-size:18px}
.group-actions{width:100%}
.group-actions .btn{flex:1}
.group-big-emoji{height:55px;width:55px;font-size:26px}
.group-summary{margin:0 17px;padding:15px 0}
.summary-value{font-size:14px}
.summary-label{font-size:9px}
.group-summary>div:not(:first-child){padding-left:11px}
.tabs{padding:0 17px;gap:20px}
.expense-row{padding:14px 15px;gap:10px}
.expense-symbol{width:37px;height:37px;font-size:18px}
.expense-right{min-width:66px}
.expense-text strong{font-size:11px}
.expense-date strong{font-size:14px}
.expense-date{min-width:25px}
.toolbar .searchbar{width:100%}
.report-metrics{grid-template-columns:1fr 1fr}
.report-metrics .report-metric:last-child{grid-column:1/-1}
.settings-grid{grid-template-columns:1fr}
.dialog{border-radius:24px 24px 0 0;width:100%;max-height:94dvh}
.overlay{align-items:flex-end;padding:0}
.dialog-head{padding:22px 19px 15px}
.dialog-body{padding:19px 19px 8px}
.dialog-foot{padding:13px 19px calc(18px + env(safe-area-inset-bottom))}
.field-grid{gap:9px}
.members-grid{grid-template-columns:1fr}
.auth-layout{display:block;min-height:100dvh}
.auth-art{display:none}
.auth-right{min-height:100dvh;padding:45px 28px;align-items:center}
.auth-mobile-logo{display:flex;justify-content:center;margin-bottom:35px}
.auth-form-area{max-width:420px}
.auth-form-area h2{font-size:27px}
.toast{left:17px;right:17px;bottom:calc(93px + env(safe-area-inset-bottom));justify-content:center}
.page-head .head-actions{flex-wrap:wrap;justify-content:flex-end}
}

@media(max-width:370px){.content{padding:18px 12px 105px}
.stat-value{font-size:17px}
.group-avatars{display:none}
.page-head h1{font-size:21px}
.group-list{gap:8px}
.group-card{padding:12px}
}

/* Brand artwork retains its original proportions and has no visual effects. */
.logo { gap: 0; }
.logo-lockup { width: 100%; min-width: 0; max-width: 195px; }
.logo-wordmark { display: block; width: 100%; height: auto; }
.logo-dark, .logo-symbol { display: none; }
.logo-tag { color: var(--muted); font-size: 9px; letter-spacing: .1px; text-align: center; margin-top: 8px; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.auth-art .logo-light { display: none; }
.auth-art .logo-dark { display: block; }
.auth-art .logo-tag { color: var(--on-brand); }
.auth-art .logo { max-width: 240px; }
.auth-art .logo-lockup { max-width: 240px; }
.boot-mark { background: transparent; box-shadow: none; border-radius: 0; }
.boot-mark img { width: 100%; height: 100%; object-fit: contain; }
.theme-toggle { flex-shrink: 0; color: var(--ink); }
.auth-theme { position: absolute; top: 20px; right: 24px; z-index: 5; }
.auth-layout { position: relative; }
.theme-switch { width: 52px; height: 30px; border-radius: 18px; border: 1px solid var(--line); padding: 3px; background: var(--surface-soft); flex-shrink: 0; }
.theme-switch span { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .2s; }
.theme-switch[aria-checked="true"] { background: var(--sm-forest); border-color: var(--accent); }
.theme-switch[aria-checked="true"] span { transform: translateX(22px); background: var(--sm-mint); }
/* White text uses the darker brand shades for accessible actions. */
.btn.primary, .bottom-add { background: var(--action-gradient); color: var(--on-brand); }
.hero-balance, .auth-art { background: linear-gradient(rgba(8,43,43,.38), rgba(8,43,43,.38)), var(--sm-gradient); }
.hero-balance .card-kicker, .hero-balance .card-kicker .icon, .hero-note, .hero-chip,
.auth-headline p, .auth-foot { color: var(--on-brand); }
.card-kicker .icon { color: var(--muted); }
.auth-showcase { background: var(--surface); color: var(--ink); }
.stat-icon, .group-emoji, .group-big-emoji, .activity-ico, .expense-symbol, .empty .empty-icon { background: var(--surface-soft); }
.avatar { color: var(--positive); }
.avatar.dark { background: var(--sm-forest); color: var(--sm-mint); }
.avatar.soft { background: var(--surface-soft); color: var(--muted); }
.nav-item.active, .side-group.active, .tab.active, .bottom-item.active { color: var(--positive); }
.chart-bar { background: var(--surface-soft); }
.field input::placeholder, .field textarea::placeholder, .searchbar input::placeholder { color: var(--muted); opacity: 1; }
input, textarea, select { color: var(--ink); background-color: var(--surface); }
input:disabled { opacity: 1; background: var(--surface-soft); color: var(--muted); }
input[type="date"] { color-scheme: inherit; }
.dialog h2, .setting-block h3, .panel-top h3, .group-detail-hero h2 { font-family: Manrope, sans-serif; font-weight: 800; }
.hero-value, .stat-value, .report-metric strong, .summary-value { font-variant-numeric: tabular-nums; }
::selection { background: var(--sm-forest); color: var(--sm-mint); }
::-webkit-scrollbar-thumb { background: var(--line); }
.stat-icon.debt { background: var(--danger-soft); color: var(--negative); }
.btn.danger, .error-box { background: var(--danger-soft); color: var(--negative); }
@media (min-width: 691px) and (max-width: 960px) {
  .side-logo .logo-lockup { display: none; }
  .side-logo .logo-symbol { display: block; width: 40px; height: 40px; object-fit: contain; }
}
@media (max-width: 690px) {
  body { background: var(--bg); }
  .mobile-header { padding: 12px 16px; }
  .mobile-header .logo { width: 140px; }
  .mobile-header .logo-tag { display: none; }
  .mobile-header .top-actions { gap: 6px; }
  .mobile-header .icon-btn { width: 34px; height: 34px; }
  .auth-mobile-logo .logo-lockup { width: 210px; max-width: 210px; }
  .auth-right { padding-top: 80px; }
}
@media (max-width: 370px) {
  .mobile-header .logo { width: 125px; }
  .mobile-header .small-avatar { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
button { color: inherit; }
.main-grid > div, .report-layout > div, .group-card { min-width: 0; }
@media (max-width: 690px) {
  .main-grid, .report-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 370px) {
  .group-card h4 { overflow-wrap: anywhere; }
  .quick-add { padding: 12px; gap: 8px; }
  .quick-add .btn { padding: 7px 10px; }
}
.avatar.stack, .small-avatar { border-color: var(--surface); }
.toast.bad { background: #7A2C2C; }
@media (max-width: 690px) {
  .split-preview { flex-wrap: wrap; gap: 8px; }
  .split-preview > .flex { margin-left: auto; }
  .field input, .field select, .field textarea { min-width: 0; }
}
.field label, .field > span { color: var(--muted); }
.field input, .field select, .field textarea, .searchbar input, .split-preview input { color: var(--ink); }
.comment p { color: var(--muted); }
/* Settings live beside the profile; category panels retain unsaved form values. */
.settings-layout { max-width: 900px; }
.settings-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 5px 3px 14px; margin-bottom: 12px; scrollbar-width: thin; }
.settings-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0; min-height: 44px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 800; }
.settings-tab:hover { color: var(--positive); background: var(--surface-soft); }
.settings-tab[aria-selected="true"] { color: var(--positive); background: var(--surface-soft); border-color: var(--accent); }
.settings-panel { max-width: 720px; padding: 28px; }
.settings-panel[hidden] { display: none; }
.settings-panel .setting-line small { display: block; margin-top: 5px; line-height: 1.5; }
@media (max-width: 690px) {
  .mobile-header .logo { width: 125px; }
  .mobile-header .top-actions { gap: 5px; }
  .mobile-header .icon-btn { width: 32px; height: 34px; }
  .settings-tabs { margin-right: -3px; }
  .settings-tab { padding: 10px 13px; }
  .settings-panel { padding: 22px 19px; }
}
@media (max-width: 370px) {
  .mobile-header .logo { width: 110px; }
  .mobile-header { padding-left: 12px; padding-right: 12px; }
}
/* Profile menu */
.account-dropdown { position: relative; flex-shrink: 0; }
.account-trigger { display: grid; place-items: center; padding: 3px; border: 1px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; transition: border-color .15s, background .15s; }
.account-trigger:hover, .account-trigger[aria-expanded="true"] { border-color: var(--accent); background: var(--surface-soft); }
.account-trigger .small-avatar { box-shadow: none; }
.account-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 204px; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 16px 48px rgba(0, 20, 20, .2); z-index: 60; }
.account-menu[hidden] { display: none; }
.account-menu button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; border: 0; border-radius: 10px; padding: 11px 12px; background: transparent; color: var(--ink); text-align: left; font-size: 13px; font-weight: 700; }
.account-menu button:hover, .account-menu button:focus-visible { background: var(--surface-soft); color: var(--positive); }
.account-menu .menu-logout { color: var(--negative); }
.account-menu .menu-logout:hover, .account-menu .menu-logout:focus-visible { background: var(--danger-soft); color: var(--negative); }
.menu-divider { height: 1px; margin: 5px 7px; background: var(--line); }
/* Shared dropdown fields: native selects remain the form's source of truth. */
.dropdown-field { position: relative; width: 100%; min-width: 0; }
select.dropdown-native, .field select.dropdown-native { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; clip-path: inset(50%); pointer-events: none; }
.dropdown-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 47px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500; text-align: left; transition: border-color .15s, box-shadow .15s; }
.dropdown-trigger:hover:not(:disabled) { border-color: var(--accent); }
.dropdown-trigger[aria-expanded="true"], .dropdown-trigger:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.dropdown-trigger:disabled { opacity: 1; color: var(--muted); background: var(--surface-soft); cursor: default; }
.dropdown-trigger[aria-invalid="true"] { border-color: var(--negative); }
.dropdown-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-trigger svg, .dropdown-option svg { width: 17px; height: 17px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dropdown-trigger svg { color: var(--muted); transition: transform .15s; }
.dropdown-trigger[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--positive); }
.dropdown-list { position: fixed; z-index: 120; overflow-y: auto; overscroll-behavior: contain; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 14px 42px rgba(0, 20, 20, .24); scrollbar-width: thin; }
.dropdown-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 43px; padding: 10px 11px; margin: 2px 0; border-radius: 9px; color: var(--ink); font-size: 13px; line-height: 1.4; cursor: pointer; }
.dropdown-option span { min-width: 0; overflow-wrap: anywhere; }
.dropdown-option.highlighted { background: var(--surface-soft); }
.dropdown-option[aria-selected="true"] { color: var(--positive); font-weight: 700; }
.dropdown-option[aria-disabled="true"] { color: var(--muted); cursor: default; opacity: .65; }
@media (max-width: 690px) {
  .account-trigger { padding: 2px; }
  .dropdown-option { min-height: 46px; }
}
/* Use a monochrome white lockup on colored/dark surfaces so the symbol cannot blend in. */
.logo-dark { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .logo-symbol,
:root[data-theme="dark"] .boot-mark img { filter: brightness(0) invert(1); }
/* Back to the marketing page without competing with the login artwork. */
.auth-back{position:absolute;top:20px;left:calc(50% + 24px);z-index:5;display:inline-flex;align-items:center;gap:7px;min-height:42px;padding:10px 13px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:700}
.auth-back:hover{background:var(--surface-soft);border-color:var(--accent);color:var(--positive)}
.auth-back .icon{width:16px;height:16px;transform:rotate(180deg)}
@media(max-width:690px){.auth-back{left:24px}}
.password-input{position:relative}
.field .password-input input{padding-right:70px}
.password-toggle{position:absolute;right:5px;top:50%;transform:translateY(-50%);min-width:55px;min-height:38px;border:0;border-radius:8px;background:transparent;color:var(--positive);font-size:12px;font-weight:800}
.password-toggle:hover,.password-toggle[aria-pressed="true"]{background:var(--surface-soft)}
.auth-layout .auth-right{padding-top:85px}

/* iOS focuses small text fields by zooming; keep touch field text at 16px. */
@media (max-width: 900px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  textarea, select, .field input, .field textarea, .field select,
  .searchbar input, .split-preview input, .dropdown-trigger { font-size: 16px; }
}

/* Native date controls must fit their grid cell, including Safari's date editor. */
.field, .field-grid, .dialog, .dialog-body, .dialog-head > div { min-width: 0; }
.field input, .field select, .field textarea, .dropdown-trigger { max-width: 100%; min-width: 0; }
.field input[type="date"] { display: block; width: 100%; min-width: 0; }
.field input[type="date"]::-webkit-date-and-time-value { min-width: 0; text-align: left; }
.dialog-head h2, .dialog-body p, .comment, .invite-code, .receipt-upload { overflow-wrap: anywhere; }
.dialog-foot { flex-wrap: wrap; }
@media (max-width: 480px) {
  .field-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Keep ordinary scrolling while disabling touchscreen pinch zoom in the app. */
html, body { touch-action: pan-x pan-y; }

/* Bound the native iOS date view independently of its intrinsic flex width. */
.date-input { width: 100%; max-width: 100%; min-width: 0; overflow: hidden; border-radius: 12px; }
.field .date-input input[type="date"] {
  -webkit-appearance: none; appearance: none; box-sizing: border-box;
  width: 0; min-width: 100%; max-width: 100%; margin: 0;
}
.date-input:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.currency-choices { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.currency-choices legend { font-size: 12px; font-weight: 700; margin-bottom: 10px; color: var(--muted); }
.currency-choices > div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.currency-choices label, .currency-switch label { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 700; }
.currency-choices label:has(:checked), .currency-switch label:has(:checked) { border-color: var(--accent); background: var(--surface-soft); color: var(--positive); }
.currency-choices input, .currency-switch input { width: 17px; min-height: 17px; height: 17px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.currency-choices small { display: block; margin-top: 10px; color: var(--muted); line-height: 1.6; }
.currency-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.currency-switch label { flex: 1; }
.currency-view { min-width: 0; width: min(100%,200px); }
.group-currency-balances { display: flex; flex-direction: column; gap: 5px; min-width: 0; overflow-wrap: anywhere; }

.conversion-panel { padding: 16px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.conversion-panel h3 { margin: 0 0 8px; font-size: 14px; }
.conversion-panel p, .conversion-preview p { font-size: 12px; line-height: 1.7; color: var(--muted); }
.conversion-panel small { display: block; color: var(--muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.conversion-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.conversion-preview { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); margin: 12px 0; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.conversion-preview .mini-balance { flex-wrap: wrap; gap: 8px; }

.fx-rate-list .mini-balance { flex-wrap: wrap; gap: 8px; }
.conversion-panel a, .conversion-preview a { color: var(--positive); }

/* Shared currency equivalents wrap without widening mobile rows. */
.currency-equivalents{display:block;color:var(--muted);font-size:11px;font-weight:500;line-height:1.6;white-space:normal;overflow-wrap:anywhere;margin-top:4px}
.expense-text,.expense-right,.activity-info,.activity-money,.settle-flow .desc,.settle-flow .value,.mini-balance>strong{min-width:0;overflow-wrap:anywhere}
.manual-rates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.manual-rates .field{min-width:0}.manual-rates input{width:100%;max-width:100%;min-width:0}
#settlement-owing{margin:12px 0}#settlement-owing p{line-height:1.7}#settlement-owing .btn{margin-top:10px}
@media(max-width:480px){.manual-rates{grid-template-columns:minmax(0,1fr)}.settle-flow{flex-wrap:wrap}.settle-flow .value{flex:1 1 100%;text-align:left}.mini-balance>strong{max-width:48%}.expense-text .currency-equivalents{font-size:10px}}

.refresh-records{flex-shrink:0}.refresh-records[aria-busy="true"] .icon{animation:refresh-spin 1s linear infinite}.refresh-records:disabled{opacity:.6;cursor:wait}@keyframes refresh-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.refresh-records[aria-busy="true"] .icon{animation:none}}
@media(max-width:360px){.mobile-header .logo{width:120px}.mobile-header .top-actions{gap:4px}}
