
  :root{
    --bg:#ECEFEE;
    --surface:#FFFFFF;
    --ink:#23262B;
    --ink-soft:#63666C;
    --hairline:#DADDD9;
    --amber:#C2801A;
    --amber-tint:#F6E7CF;
    --teal:#2C6E68;
    --teal-tint:#D9E9E6;
    --plum:#6B3F6B;
    --plum-tint:#EBDFEA;
    --danger:#B23A3A;
    --radius:14px;
    --font-display:'Fraunces', serif;
    --font-body:'Inter', sans-serif;
    --font-mono:'IBM Plex Mono', monospace;
  }
  *{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
  html,body{margin:0; padding:0; height:100%;}
  body{
    background:var(--bg);
    color:var(--ink);
    font-family:var(--font-body);
    display:flex;
    justify-content:center;
  }
  #shell{
    width:100%;
    max-width:480px;
    min-height:100vh;
    background:var(--bg);
    display:flex;
    flex-direction:column;
    position:relative;
  }
  header{
    padding:20px 20px 14px;
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
  }
  header .title{
    font-family:var(--font-display);
    font-weight:600;
    font-size:28px;
    letter-spacing:-0.01em;
  }
  header .date{
    font-size:13px;
    color:var(--ink-soft);
    margin-top:2px;
  }
  header button.icon-btn{
    background:none;
    border:none;
    font-size:20px;
    color:var(--ink-soft);
    padding:6px;
    cursor:pointer;
  }
  main{
    flex:1;
    padding:0 16px 90px;
    overflow-y:auto;
  }
  .card{
    background:var(--surface);
    border:0.5px solid var(--hairline);
    border-radius:var(--radius);
    padding:14px 16px;
    margin-bottom:10px;
  }
  .empty{
    text-align:center;
    padding:60px 20px;
    color:var(--ink-soft);
  }
  .empty .glyph{
    font-size:32px;
    margin-bottom:10px;
    opacity:0.5;
  }
  .empty h3{
    font-family:var(--font-display);
    font-weight:500;
    font-size:18px;
    margin:0 0 4px;
    color:var(--ink);
  }
  .empty p{ margin:0; font-size:13px; }

  .badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:20px; height:20px;
    border-radius:50%;
    flex-shrink:0;
  }
  .badge.together{ position:relative; width:26px; }
  .badge.together .c1, .badge.together .c2{
    width:16px; height:16px; border-radius:50%;
    position:absolute; top:1px;
  }
  .badge.together .c1{ left:0; background:var(--amber); }
  .badge.together .c2{ left:9px; background:var(--teal); opacity:0.85; }

  .row{ display:flex; align-items:center; gap:10px; }
  .row + .row{ margin-top:10px; padding-top:10px; border-top:0.5px solid var(--hairline); }

  .section-label{
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:0.06em;
    color:var(--ink-soft);
    margin:18px 4px 8px;
    font-weight:600;
  }
  .section-label:first-child{ margin-top:4px; }

  .item-title{ font-size:15px; font-weight:500; }
  .item-sub{ font-size:12px; color:var(--ink-soft); margin-top:1px; }
  .item-title.done{ text-decoration:line-through; color:var(--ink-soft); font-weight:400; }

  .amount{ font-family:var(--font-mono); font-weight:500; font-size:15px; }

  input[type=text], input[type=date], input[type=time], input[type=number], textarea{
    width:100%;
    font-family:var(--font-body);
    font-size:15px;
    padding:10px 12px;
    border-radius:10px;
    border:0.5px solid var(--hairline);
    background:var(--bg);
    color:var(--ink);
    margin-bottom:10px;
  }
  textarea{ resize:none; min-height:60px; }
  label.field-label{ font-size:12px; color:var(--ink-soft); margin:0 0 4px 2px; display:block; font-weight:500; }

  .segmented{
    display:flex;
    border:0.5px solid var(--hairline);
    border-radius:10px;
    overflow:hidden;
    margin-bottom:12px;
  }
  .segmented button{
    flex:1;
    border:none;
    background:var(--bg);
    padding:10px 6px;
    font-size:13px;
    font-family:var(--font-body);
    font-weight:500;
    color:var(--ink-soft);
    cursor:pointer;
  }
  .segmented button.active{ background:var(--plum); color:#fff; }
  .segmented button + button{ border-left:0.5px solid var(--hairline); }

  .btn-primary{
    width:100%;
    background:var(--plum);
    color:#fff;
    border:none;
    border-radius:10px;
    padding:13px;
    font-size:15px;
    font-family:var(--font-body);
    font-weight:600;
    cursor:pointer;
    margin-top:4px;
  }
  .btn-ghost{
    width:100%;
    background:none;
    color:var(--ink-soft);
    border:none;
    padding:10px;
    font-size:14px;
    cursor:pointer;
  }

  .fab{
    position:absolute;
    right:20px;
    bottom:90px;
    width:52px; height:52px;
    border-radius:50%;
    background:var(--plum);
    color:#fff;
    border:none;
    font-size:26px;
    box-shadow:0 3px 10px rgba(107,63,107,0.35);
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  nav#tabbar{
    position:absolute;
    left:0; right:0; bottom:0;
    background:var(--surface);
    border-top:0.5px solid var(--hairline);
    display:flex;
    padding:8px 4px calc(8px + env(safe-area-inset-bottom));
  }
  nav#tabbar button{
    flex:1;
    background:none;
    border:none;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:3px;
    padding:6px 0;
    color:var(--ink-soft);
    font-size:11px;
    font-family:var(--font-body);
    cursor:pointer;
  }
  nav#tabbar button .glyph{ font-size:19px; }
  nav#tabbar button.active{ color:var(--plum); }

  .overlay{
    position:absolute; inset:0;
    background:rgba(35,38,43,0.4);
    display:flex;
    align-items:flex-end;
    z-index:20;
  }
  .sheet{
    background:var(--bg);
    width:100%;
    border-radius:20px 20px 0 0;
    padding:18px 20px calc(20px + env(safe-area-inset-bottom));
    max-height:85vh;
    overflow-y:auto;
  }
  .sheet h2{
    font-family:var(--font-display);
    font-weight:600;
    font-size:20px;
    margin:0 0 16px;
  }
  .sheet-close{
    position:absolute;
    top:14px; right:16px;
    background:none; border:none;
    font-size:20px; color:var(--ink-soft);
    cursor:pointer;
  }

  .chip{
    display:inline-block;
    font-size:11px;
    font-weight:600;
    padding:2px 8px;
    border-radius:20px;
  }
  .chip.a{ background:var(--amber-tint); color:#7A5210; }
  .chip.b{ background:var(--teal-tint); color:#1B4643; }
  .chip.both{ background:var(--plum-tint); color:#4A2A4A; }

  .checkbox{
    width:22px; height:22px;
    border-radius:6px;
    border:1.5px solid var(--hairline);
    flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    cursor:pointer;
    font-size:13px;
    color:#fff;
  }
  .checkbox.checked{ background:var(--plum); border-color:var(--plum); }

  .balance-card{
    background:var(--plum);
    color:#fff;
    border-radius:var(--radius);
    padding:18px 20px;
    margin-bottom:14px;
  }
  .balance-card .label{ font-size:12px; opacity:0.8; text-transform:uppercase; letter-spacing:0.05em; }
  .balance-card .value{ font-family:var(--font-mono); font-size:26px; font-weight:500; margin-top:4px; }

  .icon-del{
    background:none; border:none; color:var(--ink-soft);
    font-size:16px; cursor:pointer; padding:4px;
    margin-left:auto;
  }
