/* Trip Kitty — app shell: top bar, scrolling content, bottom tab bar. Forest green + amber, built for one hand on a phone. */
:root{
  --bg:#F2F5F3; --surface:#FFFFFF; --sunken:#E6ECE8; --line:#D3DDD7;
  --fg:#16221D; --muted:#5A6A62;
  --accent:#1E5E4B; --accent-fg:#FFFFFF; --accent-soft:#DCEBE4;
  --amber:#B06A0E; --amber-soft:#F7E8D0;
  --owed:#1E7A4F; --owes:#B5402F; --bar:rgba(242,245,243,.92);
  --display:"Bricolage Grotesque",ui-sans-serif,system-ui,sans-serif;
  --body:"Figtree",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --r:12px; --tabh:62px;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){:root{
  --bg:#0F1614; --surface:#17211D; --sunken:#0B110F; --line:#2A3732;
  --fg:#E5EEEA; --muted:#93A59C;
  --accent:#5DBB98; --accent-fg:#0A1411; --accent-soft:#1C3A2F;
  --amber:#E7A54A; --amber-soft:#3A2B14;
  --owed:#6CCB9B; --owes:#F08A78; --bar:rgba(15,22,20,.92);
  color-scheme:dark}}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--fg)}
body{font:15px/1.5 var(--body);min-height:100dvh}
[hidden]{display:none!important}
img{max-width:100%}
h1,h2,h3{font-family:var(--display);margin:0;letter-spacing:-.01em;text-wrap:balance}
h1{font-size:26px;font-weight:800} h2{font-size:19px;font-weight:600} h3{font-size:16px;font-weight:600}
p{margin:0}
.num{font-family:var(--mono);font-variant-numeric:tabular-nums}
.label{font-size:11.5px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:600}
.muted{color:var(--muted)} .small{font-size:13px}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--accent)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* Shell */
.topbar{position:sticky;top:0;z-index:20;background:var(--bar);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  padding:calc(10px + env(safe-area-inset-top,0px)) 16px 10px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px}
.topbar .titles{flex:1;min-width:0}
.topbar .t1{font-family:var(--display);font-weight:700;font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .t2{font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.iconbtn{border:0;background:transparent;width:38px;height:38px;border-radius:10px;display:grid;place-items:center;color:var(--fg);flex:none}
.iconbtn:hover{background:var(--sunken)}
.iconbtn svg{width:22px;height:22px}
.sync{font-size:11.5px;font-weight:600;padding:3px 8px;border-radius:999px;background:var(--sunken);color:var(--muted);white-space:nowrap}
.sync.off{background:var(--amber-soft);color:var(--amber)}
main{padding:16px 16px calc(var(--tabh) + 28px + env(safe-area-inset-bottom,0px));max-width:760px;margin:0 auto;display:flex;flex-direction:column;gap:16px}
main.notabs{padding-bottom:calc(32px + env(safe-area-inset-bottom,0px))}
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:20;background:var(--bar);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(4,1fr);padding-bottom:env(safe-area-inset-bottom,0px)}
.tabs a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;height:var(--tabh);text-decoration:none;color:var(--muted);font-size:11.5px;font-weight:600}
.tabs a svg{width:24px;height:24px}
.tabs a[aria-current="page"]{color:var(--accent)}

/* Blocks */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:12px;min-width:0}
.card.hero{border-color:var(--accent);border-width:1.5px}
.row{display:flex;align-items:center;gap:10px;min-width:0}
.row.between{justify-content:space-between}
.row.wrap{flex-wrap:wrap}
.grow{flex:1;min-width:0}
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.stats div{display:flex;flex-direction:column;min-width:0}
.stats .num{font-size:clamp(14px,4.3vw,20px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.seg{display:flex;background:var(--sunken);border-radius:10px;padding:3px;gap:3px;overflow-x:auto}
.seg button{flex:1;border:0;background:transparent;padding:8px 10px;border-radius:8px;font-size:14px;font-weight:600;color:var(--muted);white-space:nowrap}
.seg button[aria-pressed="true"]{background:var(--surface);color:var(--fg);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:6px 11px;border:1px solid var(--line);border-radius:999px;font-size:13.5px;background:var(--surface);user-select:none}
.chip input{margin:0;accent-color:var(--accent)}
.chip:has(input:checked),.chip.on{background:var(--accent-soft);border-color:var(--accent)}
.daychips{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.daychips button{flex:none;border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:6px 10px;display:flex;flex-direction:column;align-items:center;min-width:52px}
.daychips button b{font-size:16px;font-family:var(--display)} .daychips button span{font-size:11px;color:var(--muted)}
.daychips button[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}
.daychips button[aria-pressed="true"] span{color:var(--accent-fg)}
.tag{display:inline-block;font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;padding:2px 7px;border-radius:999px;background:var(--sunken);color:var(--muted);white-space:nowrap}
.tag.amber{background:var(--amber-soft);color:var(--amber)} .tag.green{background:var(--accent-soft);color:var(--accent)}
.empty{padding:18px;border-radius:10px;background:var(--sunken);color:var(--muted);text-align:center;font-size:14px}
.pos{color:var(--owed)} .neg{color:var(--owes)}

/* Buttons and fields */
.btn{border:1px solid var(--line);background:var(--surface);padding:10px 14px;border-radius:10px;font-weight:600;font-size:14.5px;text-decoration:none;color:var(--fg);display:inline-flex;align-items:center;justify-content:center;gap:6px;text-align:center}
.btn:hover{border-color:var(--accent)}
.btn.primary{background:var(--accent);color:var(--accent-fg);border-color:var(--accent)}
.btn.block{width:100%}
.btn.sm{padding:6px 10px;font-size:13px;border-radius:8px}
.btn.danger{color:var(--owes)}
.btn:disabled{opacity:.55;cursor:default}
.linkbtn{border:0;background:none;padding:0;color:var(--accent);font-weight:600;font-size:13.5px}
.field{display:flex;flex-direction:column;gap:5px;min-width:0}
.grid2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
input[type=text],input[type=number],input[type=date],input[type=time],input[type=password],input[type=search],select,textarea{
  width:100%;padding:10px 11px;border:1px solid var(--line);border-radius:10px;background:var(--surface);min-width:0;font-size:16px}
textarea{resize:vertical;min-height:70px}
input:focus,select:focus,textarea:focus{border-color:var(--accent);outline:none}
.msg{font-size:13.5px;color:var(--owes);min-height:1em}
.drop{border:1.5px dashed var(--line);border-radius:10px;padding:12px;display:flex;align-items:center;gap:12px;font-size:13.5px;color:var(--muted);cursor:pointer}
.drop img{width:48px;height:48px;object-fit:cover;border-radius:6px}
.drop input{display:none}

/* Lists */
.list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.li{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line);text-align:left;background:none;border-left:0;border-right:0;border-top:0;width:100%;color:inherit}
.li:last-child{border-bottom:0}
.xrow{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:center;border-bottom:1px solid var(--line)}
.xrow:last-child{border-bottom:0}
.xrow .li{grid-template-columns:minmax(0,1fr) auto;border-bottom:0}
button.thumb{cursor:zoom-in}
.li .t{font-weight:600;overflow-wrap:anywhere}
.li .m{font-size:13px;color:var(--muted);overflow-wrap:anywhere}
.li .r{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.thumb{width:46px;height:46px;border-radius:10px;background:var(--sunken);display:grid;place-items:center;font-size:10.5px;font-weight:600;color:var(--muted);overflow:hidden;border:0;padding:0;text-transform:uppercase}
.thumb img{width:100%;height:100%;object-fit:cover}

/* Timeline */
.tl{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.tl li{display:grid;grid-template-columns:76px 14px minmax(0,1fr);gap:0 10px;position:relative}
.tl .time{font-size:12.5px;font-weight:600;color:var(--muted);padding-top:2px;text-align:right;overflow-wrap:anywhere}
.tl .dot{position:relative;display:flex;justify-content:center}
.tl .dot::before{content:"";position:absolute;top:0;bottom:0;width:2px;background:var(--line)}
.tl li:first-child .dot::before{top:8px} .tl li:last-child .dot::before{bottom:calc(100% - 8px)}
.tl .dot i{position:relative;width:12px;height:12px;border-radius:50%;background:var(--surface);border:2px solid var(--accent);margin-top:4px}
.tl li.past .dot i{background:var(--line);border-color:var(--line)}
.tl li.next .dot i{background:var(--amber);border-color:var(--amber);box-shadow:0 0 0 4px var(--amber-soft)}
.tl .body{padding-bottom:16px;min-width:0;display:flex;flex-direction:column;gap:4px}
.tl .body .t{font-weight:600;background:none;border:0;padding:0;text-align:left;color:inherit;font-size:15px}
.tl .body .m{font-size:13.5px;color:var(--muted);overflow-wrap:anywhere}
.tl .acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:2px}
.tl li.past .body .t{color:var(--muted)}

/* Settle */
.transfer{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 10px;padding:10px 12px;border-radius:10px;background:var(--accent-soft)}
.transfer b{font-weight:600}
.transfer .btn{grid-column:1/-1;justify-self:start}
.table-wrap{overflow-x:auto}
table{border-collapse:collapse;width:100%;font-size:13.5px}
th,td{text-align:right;padding:7px 5px;border-bottom:1px solid var(--line);white-space:nowrap}
th:first-child,td:first-child{text-align:left;white-space:normal}
th{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:600}
.bar{height:8px;border-radius:999px;background:var(--sunken);overflow:hidden}
.bar i{display:block;height:100%;background:var(--accent);border-radius:999px}

/* Checklist */
.check{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:10px;align-items:center;padding:9px 0;border-bottom:1px solid var(--line)}
.check:last-child{border-bottom:0}
.check input{width:22px;height:22px;accent-color:var(--accent);margin:0}
.check.done .t{text-decoration:line-through;color:var(--muted)}
.check .t{background:none;border:0;padding:0;text-align:left;color:inherit;font-size:15px;overflow-wrap:anywhere}

/* FAB */
.fab{position:fixed;right:16px;bottom:calc(var(--tabh) + 16px + env(safe-area-inset-bottom,0px));z-index:15;border:0;border-radius:16px;background:var(--accent);color:var(--accent-fg);
  padding:14px 18px;font-weight:700;font-size:15px;box-shadow:0 6px 18px rgba(0,0,0,.18);display:flex;align-items:center;gap:8px}
.fab svg{width:20px;height:20px}

/* Sheet */
.scrim{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:40;display:flex;align-items:flex-end;justify-content:center}
.sheet{background:var(--bg);width:100%;max-width:560px;max-height:92dvh;overflow-y:auto;border-radius:18px 18px 0 0;padding:8px 16px calc(20px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:14px}
.sheet .grab{width:40px;height:5px;border-radius:99px;background:var(--line);align-self:center;margin:4px 0}
.sheet form{display:flex;flex-direction:column;gap:12px}
@media (min-width:700px){.scrim{align-items:center}.sheet{border-radius:18px;padding-bottom:20px}}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.85);z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px 16px}
.lightbox img{max-height:80dvh;border-radius:8px;background:#fff}
.lightbox .row{justify-content:center}
.toast{position:fixed;left:50%;bottom:calc(var(--tabh) + 84px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--fg);color:var(--bg);padding:9px 16px;border-radius:999px;font-size:14px;z-index:60;max-width:calc(100% - 32px);text-align:center}

/* Home */
.brand{display:flex;align-items:center;gap:12px;padding-top:8px}
.brand img,.brand .logo{width:48px;height:48px;border-radius:12px;flex:none}
.tripcard{display:flex;flex-direction:column;gap:6px;text-decoration:none;color:inherit;padding:16px;border-radius:var(--r);background:var(--surface);border:1px solid var(--line)}
.tripcard:hover{border-color:var(--accent)}
.code{font-family:var(--mono);font-size:24px;letter-spacing:.06em;padding:10px 14px;border-radius:10px;background:var(--sunken);text-align:center;user-select:all}
.spin{width:28px;height:28px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:sp 1s linear infinite;margin:40px auto}
@keyframes sp{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation-duration:3s}}

/* Families, toasts, weather, emergency, larger text */
.fdot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:6px;vertical-align:middle;flex:none;background:var(--line)}
.toastbtn{border:0;background:transparent;color:var(--amber-soft);font-weight:700;margin-left:10px;padding:2px 4px;text-decoration:underline}
.zelle{grid-column:1/-1;background:var(--surface);border-radius:8px;padding:8px 10px;display:flex;flex-direction:column;gap:6px}
.wx{font-size:13.5px;color:var(--muted)} .wx:empty{display:none}
.wxb{font-weight:600;color:var(--fg)}
.act{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;align-items:start;padding:8px 0;border-bottom:1px solid var(--line)}
.act:last-child{border-bottom:0} .act .fdot{margin-top:7px}
.btn.sos{color:var(--owes);border-color:var(--owes)}
html.big body{zoom:1.18}
