:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,sans-serif;color:#182824;background:#f6faff;font-synthesis:none;-webkit-text-size-adjust:100%;color-scheme:light}*{box-sizing:border-box}body{margin:0;min-width:300px}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}input,select{width:100%;min-height:47px;border:1px solid #dbe5de;border-radius:13px;background:#fff;color:#21332c;padding:10px 13px;outline:0;font-size:16px}input:focus,select:focus{border-color:#2c8761;box-shadow:0 0 0 3px #2c876126}input[type=checkbox]{min-height:initial;width:auto;accent-color:#1266dd}label{font-size:12px;font-weight:750;color:#53675e;display:grid;gap:7px}.hide{display:none!important}#app{min-height:100dvh}.shell{max-width:1180px;margin:0 auto;padding:0 20px 110px}.desktopHeader{height:82px;display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:11px;color:#173153;font-weight:800;font-size:21px;letter-spacing:-.8px}.brandIcon{background:#173153;color:#a9e9bb;font-size:19px;width:34px;height:34px;display:grid;place-items:center;border-radius:11px}.headerRight{display:flex;align-items:center;gap:14px;color:#7b8d83;font-size:13px}.headerRight button{border:0;background:transparent;color:#657c70}.columns{display:grid;grid-template-columns:305px 1fr;gap:28px}.side{border-radius:22px;background:#fff;padding:23px;align-self:start;border:1px solid #e7ece7;position:sticky;top:20px}.side h3{font-size:11px;text-transform:uppercase;letter-spacing:1.1px;color:#91a399}.side .sideLink{display:flex;align-items:center;gap:11px;border:0;background:transparent;width:100%;padding:13px 12px;text-align:left;border-radius:12px;margin:3px 0;font-weight:650;font-size:14px;color:#50675c}.side .sideLink.active{background:#eaf2ff;color:#1266dd}.welcome{margin:11px 0 22px}.eyebrow{font-size:12px;text-transform:uppercase;font-weight:800;letter-spacing:1.8px;color:#6a9684}.welcome h1{font-size:29px;line-height:1.15;letter-spacing:-1.2px;margin:9px 0;color:#173153}.welcome p{color:#819188;font-size:14px;margin:8px 0 0}.hero{background:#173153;color:white;border-radius:25px;padding:24px 25px;min-height:177px;position:relative;overflow:hidden}.hero:after{content:'';position:absolute;right:-32px;top:-34px;height:180px;width:180px;border-radius:100%;border:24px solid #ffffff0a;pointer-events:none}.hero .top{display:flex;align-items:center;justify-content:space-between;gap:12px;position:relative;z-index:1}.hero .sub{color:#c1daf5;font-size:12px}.hero h2{font-size:34px;margin:12px 0 4px;letter-spacing:-1px;font-weight:750}.hero .heroFoot{font-size:12px;color:#cfe2f8;margin-top:5px}.hero .tag{font-size:11px;border:1px solid #6694d2;padding:7px 10px;border-radius:25px;color:#c6e6d1}.statbar{display:flex;gap:8px;margin-top:16px}.statbar .stat{flex:1;background:#fff;border:1px solid #e6ebe5;border-radius:16px;padding:14px 15px;min-width:0}.stat small{display:block;color:#86978d;font-size:11px}.stat strong{font-size:18px;color:#204c3b;display:block;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.row{display:flex;align-items:center;justify-content:space-between;gap:10px}.sectionTitle{font-size:16px;font-weight:800;letter-spacing:-.3px;margin:24px 0 13px;color:#213b31}.smallButton{border:0;background:#e9f2ff;color:#1158b8;font-size:12px;padding:9px 12px;border-radius:11px;font-weight:750}.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}.groupCard{border:1px solid #e5ece6;background:#fff;border-radius:19px;padding:16px;text-align:left;min-height:130px;box-shadow:0 2px 8px #133a2a05}.groupCard .emoji{background:#eef6ec;display:grid;place-items:center;width:40px;height:40px;border-radius:13px;font-size:20px}.groupCard h3{font-size:16px;margin:10px 0 3px}.groupCard p{font-size:12px;color:#8b9a8f;margin:0}.newGroup{border:1.5px dashed #abcbb7;background:#eff8f0;color:#1266dd;font-weight:750;display:grid;place-items:center;gap:7px}.newGroup b{font-size:27px}.back{border:0;background:transparent;color:#4c7460;padding:10px 0;font-weight:700;font-size:13px}.groupHead{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-bottom:16px}.groupHead h1{font-size:25px;line-height:1.1;margin:2px 0 5px;color:#173153}.groupHead p{font-size:12px;margin:0;color:#8ca097}.groupActions{display:flex;gap:8px}.ghostButton{border:1px solid #dce9dd;border-radius:12px;background:white;padding:10px 12px;color:#1158b8;font-weight:700;font-size:12px}.tabs{margin-top:22px;display:flex;background:#edf1ed;padding:5px;border-radius:14px;gap:4px}.tabs button{flex:1;border:0;border-radius:10px;background:none;font-size:13px;font-weight:750;color:#82918a;padding:11px 7px}.tabs button.active{background:#fff;color:#1266dd;box-shadow:0 1px 5px #17315312}.entry{display:flex;align-items:center;gap:11px;padding:16px;background:#fff;border:1px solid #e9eee9;border-radius:16px;margin:9px 0}.entry .bubble{height:42px;width:42px;min-width:42px;background:#f0f4ea;display:grid;place-items:center;font-size:19px;border-radius:14px}.entry .info{min-width:0;flex:1}.entry .info strong{font-size:14px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.entry .info small{font-size:11px;color:#82938a;display:block;margin-top:5px}.entry .amount{text-align:right;white-space:nowrap}.entry .amount strong{display:block;font-size:14px}.entry .amount small{color:#8b9a92;font-size:11px}.entry .delete{border:0;background:none;color:#b3beb6;font-size:18px;padding:2px}.balancePos{color:#08734c!important}.balanceNeg{color:#bc6049!important}.balanceZero{color:#748d7e!important}.empty{text-align:center;border:1px dashed #cbdcd0;border-radius:17px;padding:33px 20px;color:#81948a;background:#fff}.empty .symbol{font-size:33px;margin:8px}.empty strong{display:block;color:#345749;font-size:15px;margin:10px 0}.empty p{font-size:13px;line-height:1.55;max-width:270px;margin:8px auto}.settleBox{background:#ecf5ff;border:1px solid #d8e7ff;border-radius:18px;padding:18px;margin-top:17px}.settleBox h3{margin:0 0 12px;font-size:14px;color:#173d78}.settleItem{padding:13px 0;display:flex;justify-content:space-between;gap:10px;align-items:center;border-top:1px solid #cbe3d2;font-size:13px}.settleItem small{color:#67977b}.fab{position:fixed;bottom:calc(89px + env(safe-area-inset-bottom));right:max(calc((100vw - 1180px)/2 + 34px),23px);background:#1266dd;border:0;border-radius:17px;color:#fff;font-weight:800;font-size:14px;box-shadow:0 8px 28px #0c69454d;display:flex;gap:9px;align-items:center;justify-content:center;padding:15px 20px;z-index:10}.fab span{font-size:21px;font-weight:400}.nav{position:fixed;bottom:0;left:0;right:0;z-index:8;padding:7px 12px calc(9px + env(safe-area-inset-bottom));display:flex;justify-content:space-around;background:#fff;border-top:1px solid #e3ebe4}.nav button{border:0;background:transparent;color:#a0aea3;min-width:90px;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:10px;font-weight:750;padding:4px 8px}.nav button.active{color:#1266dd}.nav .ico{font-size:21px}.overlay{position:fixed;inset:0;background:#0d271ba8;z-index:30;display:flex;align-items:flex-end;justify-content:center}.sheet{background:#fff;width:100%;max-width:530px;max-height:min(94dvh,850px);overflow-y:auto;border-radius:26px 26px 0 0;padding:17px 20px calc(21px + env(safe-area-inset-bottom));box-shadow:0 -15px 60px #04140e25}.sheet .handle{height:5px;background:#dce7de;border-radius:5px;width:38px;margin:0 auto 15px}.sheet h2{font-size:22px;letter-spacing:-.6px;color:#173e2f;margin:0 0 8px}.sheet p{font-size:13px;color:#82958b;margin:0 0 20px;line-height:1.5}.formGrid{display:grid;gap:15px}.formRow{display:grid;grid-template-columns:1fr 1fr;gap:10px}.primary{width:100%;min-height:49px;background:#1266dd;border:0;border-radius:14px;color:white;font-size:14px;font-weight:800;padding:13px 15px}.secondary{width:100%;min-height:45px;border:1px solid #d8e4dc;background:#fff;color:#436550;border-radius:12px;font-weight:750;font-size:13px}.sheetButtons{display:flex;gap:10px;margin-top:15px}.sheetButtons .secondary{flex:1}.sheetButtons .primary{flex:2}.chips{display:flex;gap:7px;flex-wrap:wrap}.chip{border:1px solid #dce7dd;color:#647d6b;background:#fff;padding:9px 13px;font-size:12px;border-radius:30px;font-weight:750}.chip.active{background:#eaf2ff;border-color:#79bb8b;color:#0e7049}.picker{display:flex;align-items:center;gap:10px;background:#f7f9f6;border-radius:12px;padding:11px 12px}.picker span{flex:1;font-size:13px;color:#3f5547}.picker input[type=number]{min-height:35px;width:115px;font-size:14px}.picker label{display:flex;flex:1;align-items:center;gap:9px;font-size:13px;color:#304b3a}.muted{color:#91a39a;font-size:12px}.authScreen{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:25px;background:radial-gradient(circle at 85% 2%,#d1ebd5,transparent 35%),#f6faff}.authCard{width:100%;max-width:410px;background:#fff;border-radius:26px;padding:31px 25px;box-shadow:0 12px 55px #235a3716}.authCard h1{font-size:29px;letter-spacing:-1px;margin:19px 0 7px}.authCard p{color:#8d9d93;line-height:1.5;margin:0 0 23px;font-size:13px}.authCard .flip{background:none;border:0;color:#1266dd;margin-top:14px;font-weight:700;font-size:13px;width:100%}.authCard .brand{font-size:22px}.authCard .brandIcon{width:42px;height:42px;font-size:24px}#toast{position:fixed;left:50%;bottom:calc(80px + env(safe-area-inset-bottom));transform:translate(-50%,20px);background:#1b382d;color:white;font-size:13px;border-radius:13px;box-shadow:0 8px 22px #1116;padding:12px 18px;opacity:0;pointer-events:none;z-index:50;transition:.2s;max-width:90vw}#toast.show{opacity:1;transform:translate(-50%,0)}@media(min-width:800px){.nav{display:none}.fab{bottom:32px}.shell{padding-bottom:85px}.overlay{align-items:center}.sheet{border-radius:25px;max-height:88dvh}.welcome{margin-top:17px}}@media(max-width:799px){.shell{padding:0 16px 120px}.desktopHeader{height:66px}.headerRight span{display:none}.columns{display:block}.side{display:none}.welcome{margin:4px 0 17px}.welcome h1{font-size:25px}.hero{padding:21px;min-height:158px;border-radius:20px}.hero h2{font-size:31px}.statbar .stat{padding:12px 11px}.stat strong{font-size:15px}.sectionTitle{font-size:15px;margin-top:23px}.cards{grid-template-columns:1fr 1fr;gap:10px}.groupCard{min-height:132px;padding:14px}.groupCard h3{font-size:14px}.groupCard p{font-size:11px}.groupHead h1{font-size:23px}.fab{right:20px;bottom:calc(78px + env(safe-area-inset-bottom))}.sheet{padding-left:17px;padding-right:17px}}

/* AMedias brand: accessible compact navigation and iPhone safe-area UX. */
.brand{color:#142b4c;font-size:20px;letter-spacing:-.7px;white-space:nowrap;gap:6px}
.brand b{color:#0c83f7}
.brandIcon{background:transparent;color:inherit;object-fit:contain;width:42px;height:42px;border-radius:0;flex-shrink:0}
.authLogo{width:min(240px,75%);height:auto;max-height:190px;object-fit:contain;display:block;margin:0 auto 12px}
.authCard h1{font-size:clamp(22px,6vw,29px);margin-top:9px}
.authCard{padding:22px 22px 26px}
.hero{background:linear-gradient(125deg,#142c51,#1266dd)}
.hero:after{border-color:#ffffff19}
.fab{box-shadow:0 8px 28px #1b65d94d}
.entry .info small{overflow-wrap:anywhere}
.entry .amount{max-width:40%;overflow:hidden;text-overflow:ellipsis}
.groupCard{min-width:0}
.groupCard h3{overflow-wrap:anywhere}
.nav button{min-width:0;flex:1}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #76b0ff;outline-offset:2px}
@media(max-width:430px){.desktopHeader{height:60px}.shell{padding-left:13px;padding-right:13px}.brand{font-size:19px}.brandIcon{width:38px;height:38px}.headerRight{font-size:12px}.cards{gap:9px}.groupCard{padding:12px}.stat strong{font-size:13px}.entry{gap:8px;padding:12px}.entry .bubble{height:37px;min-width:37px;width:37px}.entry .info strong{font-size:13px}.entry .amount strong{font-size:13px}.nav{padding-left:4px;padding-right:4px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition-duration:0.01ms!important;animation-duration:0.01ms!important}}

/* AMedias v1.1 — OCR tickets & private account management, iPhone first. */
.receiptCapture{padding:13px;border-radius:15px;border:1px solid #d8e5f9;background:#f5f9ff;display:grid;gap:11px}
.receiptCapture>strong{font-size:14px;color:#193a61}.receiptButtons{display:flex;gap:9px;flex-wrap:wrap}
.captureButton{flex:1;min-height:48px;padding:12px 9px;border:1px solid #accaf3;border-radius:13px;color:#135fbe;background:white;text-align:center;cursor:pointer;display:grid;place-items:center;font-size:13px;white-space:nowrap}
.receiptProgress{margin:0!important;font-size:12px;color:#466b9b!important;min-height:14px}.receiptMini{display:flex;align-items:center;gap:9px;min-width:0}.receiptMini img{width:54px;height:62px;object-fit:cover;border-radius:9px}.receiptMini span{flex:1;overflow:hidden;text-overflow:ellipsis;font-size:12px;min-width:0}.receiptMini button{flex-shrink:0}
.receiptHint{font-size:11px!important;margin:2px 0 0!important}.receiptLarge{width:100%;max-height:50vh;object-fit:contain;border-radius:14px;background:#edf2f7}
.receiptSummary{background:#f7f9fc;padding:13px;border-radius:14px;margin:13px 0;font-size:13px}.receiptSummary p{white-space:normal;line-height:1.7;margin:8px 0!important}
.receiptLink{margin-top:4px;border:0;background:none;padding:4px 0;color:#1266dd;font-size:12px;font-weight:750;text-align:left;cursor:pointer}
.userList{max-height:210px;overflow:auto;display:grid;gap:7px;margin:10px 0 20px}.userItem{border:1px solid #e4ebf2;padding:10px;border-radius:12px;display:flex;gap:10px;align-items:center;justify-content:space-between}.userItem strong{font-size:13px}.userItem small{display:block;font-size:11px;color:#617386}.userItem .smallButton{flex-shrink:0}
.sheet textarea{font:inherit;width:100%;min-height:110px;resize:vertical;border:1px solid #dbe5de;border-radius:13px;padding:12px;font-size:16px}
@media(max-width:430px){.receiptButtons{gap:6px}.captureButton{font-size:12px;min-width:0}.receiptMini span{font-size:11px}}

/* v1.2: iPhone dark mode, persistent user choice (system/light/dark). */
.themeToggle{background:#eef4fd;color:#174277;border:1px solid #c9d9f2;border-radius:11px;padding:8px 11px;font-size:12px;font-weight:700;white-space:nowrap;cursor:pointer}
.authCard .themeToggle{margin-top:16px;width:100%;min-height:42px}
.closedPill{display:inline-flex;padding:9px 12px;background:#e5f5ec;color:#20613f;border-radius:12px;font-size:12px;font-weight:800}
.closedNotice{margin:20px 0 0;background:#f0f5fc;border:1px solid #cbdcf4;border-radius:12px;padding:13px;font-size:12px;line-height:1.7;color:#23446e}.closedNotice button{margin-top:8px}
.groupActions{flex-wrap:wrap;align-items:center}
@media(max-width:430px){.headerRight{gap:5px}.themeToggle{padding:7px 8px;font-size:11px}.groupActions{width:100%}}
html[data-theme=dark]{background:#101824;color-scheme:dark}
html[data-theme=dark] body,html[data-theme=dark] .shell{background:#101824;color:#e8edf6}
html[data-theme=dark] .authScreen{background:radial-gradient(circle at 70% 0,#1b3451,transparent 55%),#101824}
html[data-theme=dark] .authCard,html[data-theme=dark] .sheet,html[data-theme=dark] .desktopHeader,html[data-theme=dark] .side,html[data-theme=dark] .groupCard,html[data-theme=dark] .entry,html[data-theme=dark] .nav,html[data-theme=dark] .empty{background:#1c2837;border-color:#35465b;color:#e8edf6}
html[data-theme=dark] :is(.authCard h1,.welcome h1,.groupHead h1,.groupCard h3,.sectionTitle,.sheet h2,.entry .info strong,.brand,.empty strong){color:#e8edf6}
html[data-theme=dark] :is(.welcome p,.groupHead p,.authCard p,.sheet p,.groupCard p,.entry .info small,.empty p,.muted){color:#aebdd0}
html[data-theme=dark] :is(input,select,textarea){background:#14202e;color:#f1f5ff;border-color:#456077}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#90a1b5}
html[data-theme=dark] :is(.tabs,.picker,.receiptSummary,.receiptCapture,.closedNotice,.settleBox,.userItem){background:#172537;border-color:#33465e;color:#e5effc}
html[data-theme=dark] :is(.tabs button.active,.chip.active,.captureButton,.ghostButton,.smallButton,.secondary,.themeToggle,.chip){background:#243951;color:#c9e2ff;border-color:#405f7d}
html[data-theme=dark] .receiptCapture>strong,html[data-theme=dark] .settleBox h3{color:#c7dcfa}
html[data-theme=dark] .closedPill{background:#173b32;color:#bdf7d6}
html[data-theme=dark] .receiptProgress,html[data-theme=dark] .receiptHint{color:#b4c9e6!important}
html[data-theme=dark] .hero{background:linear-gradient(135deg,#183767,#0e458a)}
html[data-theme=dark] .overlay{background:#000b}
html[data-theme=dark] .nav{border-top-color:#405268}
html[data-theme=dark] .nav button{color:#9bacc6}
html[data-theme=dark] .nav button.active{color:#7aafff}
html[data-theme=dark] .sideLink{color:#bdd1ec}
@media(prefers-color-scheme:dark){html:not([data-theme]){color-scheme:dark}}
