/* Native dropdowns: dark popup list in night mode, readable options in both themes */
select option,select optgroup{background:var(--paper);color:var(--ink)}
select option:checked{background:var(--field);font-weight:700}

    /* Colour, type and shape tokens come from /shared/zui.css */

    *{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}

    /* Minimal Scrollbar System */
    * {
      scrollbar-width: thin;
      scrollbar-color: var(--rule) transparent;
    }
    ::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    ::-webkit-scrollbar-track {
      background: transparent;
    }
    ::-webkit-scrollbar-thumb {
      background: var(--rule);
      border-radius: 99px;
      border: 1px solid transparent;
      background-clip: padding-box;
      transition: background 0.15s ease;
    }
    ::-webkit-scrollbar-thumb:hover {
      background: var(--soft);
    }
    ::-webkit-scrollbar-thumb:active {
      background: var(--mid);
    }
    html{
      -webkit-text-size-adjust:100%;
      background:var(--desk);
      height:100%;
      height:100dvh;
      overflow:hidden;
    }
    body{
      font-family:var(--font);
      font-size:13px;
      line-height:1.5;
      background:var(--desk);
      color:var(--ink);
      height:100%;
      height:100dvh;
      width:100vw;
      max-width:100vw;
      overflow:hidden;
      display:flex;
      justify-content:center;
      align-items:stretch;
      -webkit-font-smoothing:antialiased;
      font-variant-numeric:slashed-zero;
    }

    .container{
      width:100%;
      max-width:520px;
      min-width:0;
      height:100%;
      height:100dvh;
      max-height:100dvh;
      display:flex;
      flex-direction:column;
      position:relative;
      overflow:hidden;
      background:var(--paper);
      box-shadow:0 0 35px rgba(0,0,0,0.08);
      border-left:1px solid var(--rule);
      border-right:1px solid var(--rule);
    }
    strong{font-weight:700}

    /* Motion System Keyframes */
    @keyframes smoothCardEnter {
      0% { opacity: 0; transform: translateY(14px) scale(0.99); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes smoothFadeUp {
      0% { opacity: 0; transform: translateY(8px); }
      100% { opacity: 1; transform: translateY(0); }
    }
    @keyframes smoothTileEnter {
      0% { opacity: 0; transform: translateY(12px) scale(0.96); }
      100% { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes shakeError {
      0%, 100% { transform: translateX(0); }
      20%, 60% { transform: translateX(-6px); }
      40%, 80% { transform: translateX(6px); }
    }
    .activity-banner {
      position: fixed;
      top: 14px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--paper);
      color: var(--ink);
      border: 1px solid var(--border-strong);
      box-shadow: 0 6px 22px rgba(0,0,0,0.18);
      padding: 7px 12px;
      border-radius: var(--r-sm);
      z-index: 1300;
      display: flex;
      align-items: center;
      gap: 9px;
      max-width: 92%;
      width: max-content;
      font-size: 11.5px;
      line-height: 1.35;
      animation: bannerSlideIn 0.3s var(--ease-out-gentle) both;
    }
    @keyframes bannerSlideIn {
      0% { opacity: 0; transform: translateX(-50%) translateY(-12px); }
      100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    }
    .activity-pulse-dot {
      width: 7px;
      height: 7px;
      background: var(--stamp);
      border-radius: 50%;
      display: inline-block;
      animation: pulseDot 1.4s infinite ease-in-out;
      flex-shrink: 0;
    }
    @keyframes pulseDot {
      0%, 100% { transform: scale(1); opacity: 1; }
      50% { transform: scale(1.4); opacity: 0.5; }
    }
    .sync-status-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 10px;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 99px;
      border: 1px solid var(--rule);
      background: var(--paper);
      color: var(--muted);
      user-select: none;
      cursor: pointer;
      transition: all 0.2s ease;
      vertical-align: middle;
      line-height: 1.2;
    }
    .sync-status-pill:hover {
      border-color: var(--soft);
      color: var(--ink);
    }
    .sync-status-pill .sync-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--ink-green);
      display: inline-block;
      flex-shrink: 0;
      transition: background 0.2s ease;
    }
    .sync-status-pill.syncing .sync-dot {
      background: var(--ink-gold);
      animation: pulseDot 0.8s infinite ease-in-out;
    }
    .sync-status-pill.syncing {
      color: var(--ink-gold);
      border-color: var(--ink-gold);
    }
    .sync-status-pill.offline .sync-dot {
      background: var(--muted);
    }
    .sync-status-pill.offline {
      color: var(--muted);
      border-color: var(--rule);
    }
    .sync-status-pill.error .sync-dot {
      background: var(--stamp);
      animation: pulseDot 0.6s infinite ease-in-out;
    }
    .sync-status-pill.error {
      color: var(--stamp);
      border-color: var(--stamp);
    }
    .activity-banner-content {
      display: inline-block;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 260px;
    }
    .activity-close-btn {
      background: transparent;
      border: 0;
      color: var(--muted);
      font: inherit;
      font-size: 12px;
      cursor: pointer;
      padding: 0 2px;
      line-height: 1;
    }
    .activity-close-btn:hover {
      color: var(--ink);
    }
    @keyframes realtimeHighlight {
      0% {
        background-color: rgba(168, 50, 31, 0.24);
        box-shadow: inset 0 0 0 1.5px var(--stamp);
      }
      60% {
        background-color: rgba(168, 50, 31, 0.12);
        box-shadow: inset 0 0 0 1.5px var(--stamp);
      }
      100% {
        background-color: transparent;
        box-shadow: inset 0 0 0 1.5px transparent;
      }
    }
    .highlight-realtime {
      animation: realtimeHighlight 2.4s ease-out forwards;
    }
    .container > .card, #screen-workspace {
      position:relative;
      background:var(--paper);
      width:100%;
      height:100%;
      flex:1;
      min-height:0;
      display:flex;
      flex-direction:column;
      margin:0;
      box-sizing:border-box;
      animation: smoothCardEnter 0.45s var(--ease-out-gentle) both;
      will-change: transform, opacity;
      overflow-y:auto;
      -webkit-overflow-scrolling:touch;
      padding:24px 20px calc(24px + env(safe-area-inset-bottom,0px));
    }

    .container > .card::before, #screen-workspace::before{
      content:'';
      position:absolute;
      left:0;
      right:0;
      top:0;
      height:8px;
      pointer-events:none;
      background:radial-gradient(circle at 6px 0,var(--desk) 4px,transparent 4.5px) 0 0/12px 8px repeat-x;
      z-index:45;
    }

    #screen-workspace {
      padding:0;
      overflow:hidden;
    }

    .ws-header-area {
      flex-shrink:0;position:relative;
      background:var(--paper);
      padding:16px 18px 10px;
      border-bottom:1px solid var(--rule);
      z-index:50;
    }

    .ws-scrollable-body {
      flex:1;
      min-height:0;
      overflow-y:auto;
      overflow-x:hidden;
      -webkit-overflow-scrolling:touch;
      overscroll-behavior-y:contain;
      padding:14px 18px 24px;
    }

    #screen-workspace .card {
      background:var(--field);
      padding:16px 14px;
      margin:14px 0;
      animation:none;
      border:1px solid var(--border);
      height:auto;
      flex:none;
      overflow:visible;
    }
    #screen-workspace .card::before,#screen-workspace .card::after{display:none}

    .anim-header {
      animation: smoothFadeUp 0.4s var(--ease-out-gentle) 0.08s both;
    }

    .footer-note {
      margin-top: 24px;
      padding-top: 14px;
      border-top: 1px solid var(--border);
      text-align: center;
      font-size: 11px;
      color: var(--soft);
      animation: smoothFadeUp 0.4s var(--ease-out-gentle) 0.3s both;
    }
    h1{font-size:15px;font-weight:700;letter-spacing:.01em;text-transform:none;margin-bottom:4px}
    h2{font-size:11px;font-weight:400;color:var(--muted);text-transform:uppercase}
    h3{font-size:13px;font-weight:700;text-transform:uppercase}
    p.subtitle{color:var(--muted);font-size:12px;margin-bottom:16px;line-height:1.5}
    .ticket-title{text-align:center}
    .brand-subtext{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:0.07em;margin-top:1px}

    .nav-breadcrumbs{position:relative;z-index:50;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:8px;
      flex-wrap:wrap;
      padding-bottom:10px;
      margin-bottom:12px;
      border-bottom:1px solid var(--border);
      font-size:12px;
      animation: smoothFadeUp 0.4s var(--ease-out-gentle) 0.05s both;
    }
    .nav-back-link{
      display:inline-flex;
      align-items:center;
      font:inherit;
      color:var(--muted);
      text-decoration:none;
      cursor:pointer;
      background:none;
      border:0;
      padding:4px 0;
      min-height:30px;
      transition: color 0.15s ease;
    }
    .nav-back-link:hover{color:var(--ink)}

    .internal-password{-webkit-text-security:disc}
    .admin-pill{font-size:11px;padding:3px 10px;border:1px solid var(--border);color:var(--muted);cursor:pointer;user-select:none;border-radius:var(--r-sm);transition: all 0.15s ease;}
    .admin-pill[hidden]{display:none}
    .admin-pill.active{border:1px solid var(--stamp);color:var(--stamp);font-weight:700}
    .input-group{margin-bottom:16px}
    label{display:block;font-size:11px;font-weight:400;margin-bottom:6px;color:var(--muted);text-transform:uppercase}
    input,select{width:100%;font:inherit;font-size:16px;background:var(--field);border:0;border-bottom:1px solid var(--border);border-radius:0;color:var(--ink);padding:10px 8px;outline:none;min-height:44px;transition: border-bottom-color 0.15s ease, background 0.15s ease;}
    input:focus,select:focus{border-bottom:1px solid var(--border-strong);background:transparent;box-shadow:0 2px 0 var(--ink)}
    input::placeholder{color:var(--soft)}
    input[type=file]{font-size:12px;padding:10px 8px}
    select option{background:var(--paper);color:var(--ink)}
    input[type=checkbox]{appearance:none;-webkit-appearance:none;width:18px;height:18px;min-height:0;padding:0;flex:none;border:1.5px solid var(--border-strong);border-radius:var(--r-sm);background:transparent;display:inline-grid;place-content:center;cursor:pointer}
    input[type=checkbox]::before{content:'✓';font-size:13px;line-height:1;color:var(--on-solid);transform:scale(0);transition:transform .12s}
    input[type=checkbox]:checked{background:var(--solid);box-shadow:none}
    input[type=checkbox]:checked::before{transform:scale(1)}
    button:focus-visible,a:focus-visible,.entity-item:focus-visible{outline:2px solid var(--border-strong);outline-offset:2px}
    .btn{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      gap:6px;
      padding:10px 14px;
      border-radius:var(--r-sm);
      font:inherit;
      font-weight:700;
      font-size:12px;
      cursor:pointer;
      border:1px solid var(--border-strong);
      user-select:none;
      min-height:42px;
      background:transparent;
      color:var(--ink);
      transition: background 0.15s ease, transform 0.1s ease;
    }
    .btn:active{transform:translateY(1px)}
    .btn:disabled{opacity:.5;cursor:default}
    .btn-primary,.btn-ai{background:var(--solid);color:var(--on-solid)}
    .btn-primary:hover{opacity: 0.92;}
    .btn-secondary{background:var(--field);border:1px solid var(--border);font-weight:500}
    .btn-outline:hover,.btn-secondary:hover{background:var(--field)}
    .btn-danger-outline{border-color:var(--stamp);color:var(--stamp)}
    .btn-sm{padding:4px 9px;font-size:11px;min-height:30px}

    .btn-theme-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px 8px;
      font-size: 13px;
      line-height: 1;
      min-height: 30px;
      min-width: 30px;
      border: 1px solid var(--border);
      background: transparent;
      color: var(--ink);
      border-radius: var(--r-sm);
      cursor: pointer;
      user-select: none;
      transition: all 0.15s ease;
    }
    .btn-theme-toggle:hover {
      border-color: var(--border-strong);
      background: var(--field);
    }
    .entity-item{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      padding:12px 6px;
      border-bottom:1px solid var(--rule);
      cursor:pointer;
      animation: smoothTileEnter 0.4s var(--ease-out-gentle) calc(0.08s + (var(--i, 0) * 0.04s)) both;
      transition: background 0.15s ease, transform 0.18s cubic-bezier(0.2, 0.8, 0.4, 1);
      will-change: transform, opacity;
    }
    .entity-item:hover{
      background:var(--field);
      transform: translateX(2px);
    }
    .entity-info-title{font-weight:700;font-size:13px;display:flex;align-items:center}
    .entity-info-subtitle{font-size:11px;color:var(--soft);margin-top:2px}
    .lock-svg{display:inline-block;vertical-align:-1px;margin-right:5px;flex-shrink:0;color:var(--muted)}

    .ws-user-strip{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0 2px;flex-wrap:wrap}
    .ws-user-info{display:flex;flex-direction:column}
    .ws-user-sub{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
    .ws-user-name{font-weight:700;font-size:14px;color:var(--ink)}
    .ws-user-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}

    .ws-navbar{
      display:flex;
      align-items:stretch;
      border-top:1px solid var(--border-strong);
      border-bottom:0;
      margin:0;
      background:var(--paper);
      position:sticky;
      bottom:0;
      left:0;
      right:0;
      z-index:40;
      flex-shrink:0;
      padding-bottom:env(safe-area-inset-bottom, 0px);
      box-shadow:0 -4px 14px rgba(0,0,0,0.04);
    }
    .ws-nav-btn{
      flex:1;
      display:inline-flex;
      flex-direction:column;
      align-items:center;
      justify-content:center;
      gap:2px;
      padding:8px 4px 7px;
      background:transparent;
      border:0;
      border-top:2px solid transparent;
      color:var(--muted);
      font:inherit;
      font-size:10px;
      font-weight:700;
      text-transform:uppercase;
      letter-spacing:.03em;
      cursor:pointer;
      transition:all .15s;
      position:relative;
      min-height:50px;
    }
    .ws-nav-btn:hover{color:var(--ink);background:var(--field)}
    .ws-nav-btn.active { 
      color: var(--ink-blue); 
      border-top: 2px solid var(--ink-blue); 
      background: var(--bg-blue); 
    }
    .ws-nav-icon{font-size:14px;line-height:1}
    .ws-nav-label{line-height:1.2}
    .ws-nav-badge{
      font-size:9px;
      padding:1px 5px;
      border-radius:var(--r-sm);
      background:var(--paper);
      border:1px solid var(--border);
      color:var(--ink);
      position:absolute;
      top:3px;
      right:calc(50% - 30px);
    }
    .ws-nav-badge.alert{background:var(--stamp);border-color:var(--stamp);color:var(--on-solid)}

    /* Settlement Hero Cards */
    .prominent-settle-card{margin-bottom:16px;padding:16px 14px;border-radius:var(--r-sm);background:var(--field)}
    .prominent-settle-card.owe{border:2px solid var(--stamp);background:rgba(168,50,31,.05)}
    .prominent-settle-card.receive { border: 2px solid var(--ink-green); background: var(--bg-green); }
    .prominent-settle-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
    .prominent-badge{font-size:10px;font-weight:700;text-transform:uppercase;padding:2px 6px;border-radius:var(--r-sm);letter-spacing:.04em}
    .prominent-badge.owe{background:var(--stamp);color:var(--on-solid)}
    .prominent-badge.receive { background: var(--ink-green); color: var(--on-solid); }
    .prominent-title{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.03em}
    .prominent-amount{font-size:24px;font-weight:800;letter-spacing:-.01em;margin-bottom:12px}
    .prominent-settle-card.owe .prominent-amount{color:var(--stamp)}
    .prominent-settle-card.receive .prominent-amount { color: var(--ink-green); }
    .prominent-list{display:flex;flex-direction:column;gap:8px}
    .prominent-row{display:flex;flex-direction:column;gap:6px;padding:10px 12px;background:var(--paper);border:1px solid var(--border);border-radius:var(--r-sm);transition: all 0.2s ease;}
    .prominent-row-top{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}

    .personal-card{padding:14px 0 16px;margin:0 0 14px;border-bottom:1px solid var(--border)}
    .stats-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:12px}
    .stat-box{display:flex;flex-direction:column;padding:8px 10px;background:var(--field);border:1px solid var(--rule);border-radius:var(--r-sm)}
    .stat-label{font-size:11px;color:var(--muted);text-transform:uppercase}
    .stat-val{font-size:15px;font-weight:700}
    .transfers-container{margin-top:10px}
    .transfer-section-title{font-size:11px;font-weight:400;text-transform:uppercase;margin-bottom:8px;color:var(--muted)}
    .transfer-item{display:flex;flex-direction:column;gap:6px;padding:10px 0;border-bottom:1px solid var(--rule);font-size:13px;transition: all 0.2s ease;}
    .transfer-settled{color:var(--soft)!important}
    .transfer-settled strong{text-decoration:line-through}
    .transfer-row-main{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
    .payment-info-box{font-size:11px;color:var(--soft);padding:0 0 0 8px}
    .unclaimed-summary-banner{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;margin:10px 0;font-size:12px;border:1px solid var(--border)}
    .unclaimed-summary-banner.has-unclaimed{border:1px solid var(--stamp);color:var(--stamp);font-weight:700}
    .unclaimed-tag{display:inline-block;padding:0 6px;font-size:11px;font-weight:700;border:1px solid var(--stamp);color:var(--stamp);border-radius:var(--r-sm)}
    .split-mode-selector{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-bottom:14px}
    .split-mode-btn{padding:10px 4px;font-size:12px;font-weight:700;border:1px solid var(--border);color:var(--muted);cursor:pointer;text-align:center;display:flex;flex-direction:column;align-items:center;gap:2px;border-radius:var(--r-sm)}
    .split-mode-btn.active{border:1px solid var(--border-strong);color:var(--ink);background:var(--field)}
    .receipt-accordion {
      border: 1px solid var(--rule);
      border-radius: var(--r-sm);
      margin-bottom: 12px;
      overflow: hidden;
      transition: background 0.15s ease, border-color 0.15s ease;
    }
    .receipt-accordion.receipt-alt-0 {
      background: var(--paper);
    }
    .receipt-accordion.receipt-alt-1 {
      background: rgba(18, 18, 17, 0.038);
    }
    [data-theme="dark"] .receipt-accordion.receipt-alt-0 {
      background: var(--paper);
    }
    [data-theme="dark"] .receipt-accordion.receipt-alt-1 {
      background: rgba(255, 255, 255, 0.038);
    }
    .receipt-accordion:hover {
      border-color: var(--soft);
    }

    .receipt-header{
      padding:12px 14px;
      cursor:pointer;
      display:flex;
      justify-content:space-between;
      align-items:flex-start;
      gap:12px;
      user-select:none;
      transition: background 0.12s ease;
    }
    .receipt-header:hover{background:var(--field)}
    .receipt-accordion:not(.collapsed) .receipt-header {
      border-bottom: 1px solid var(--rule);
    }

    .receipt-title{font-weight:700;font-size:14px}
    .receipt-meta{font-size:11px;color:var(--soft);margin-top:3px;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
    .receipt-total{font-weight:700;font-size:15px;margin-right:2px}
    .receipt-actions{display:flex;align-items:center;gap:6px;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end}
    .btn-receipt-toggle{display:inline-flex;align-items:center;gap:5px;font:inherit;font-size:11px;font-weight:700;padding:4px 9px;min-height:30px;border:1px solid var(--border-strong);background:var(--paper);color:var(--ink);border-radius:var(--r-sm);cursor:pointer;user-select:none;transition:all .15s}
    .btn-receipt-toggle:hover{background:var(--solid);color:var(--on-solid)}
    .btn-receipt-toggle .receipt-toggle-icon{display:inline-flex;transition:transform .2s ease}
    .receipt-accordion.collapsed .btn-receipt-toggle .receipt-toggle-icon{transform:rotate(180deg)}
    .receipt-body{padding:6px 14px 12px 14px}
    .receipt-accordion.collapsed .receipt-body{display:none}
    
    .item-card{padding:10px 0;border-top:1px dotted var(--rule);transition: all 0.2s ease;}
    .item-card:first-child{border-top:none}
    .item-card.is-unclaimed{border-left:2px solid var(--stamp);padding-left:10px}
    .item-main{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
    .item-title{font-weight:700}
    .item-price{font-weight:700}
    .item-info{font-size:11px;color:var(--soft);margin:2px 0 8px}
    .claim-action-row{display:flex;align-items:center;gap:8px}
    .btn-claim-me,.btn-claim-others{font:inherit;font-size:12px;font-weight:700;padding:8px 12px;min-height:38px;cursor:pointer;border-radius:var(--r-sm);color:var(--ink)}
    .btn-claim-me{flex:1;border:1px solid var(--border-strong);background:transparent}
    .btn-claim-me.claimed{background:var(--solid);color:var(--on-solid)}
    .btn-claim-others{border:1px solid var(--border);background:transparent;font-weight:500}
    .claimant-badges{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
    .claimant-badge{padding:0 8px;border:1px solid var(--border);font-size:11px;color:var(--mid);border-radius:var(--r-sm)}
    .claimant-badge.me{background:var(--solid);color:var(--on-solid);border-color:var(--border-strong)}
    .roster-pill{display:inline-flex;align-items:center;gap:6px;padding:2px 8px;border:1px solid var(--border);font-size:12px;border-radius:var(--r-sm)}
    .roster-del-btn{cursor:pointer;color:var(--muted);border:0;background:transparent;font:inherit}
    .tag{display:inline-block;padding:0 8px;font-size:12px;font-weight:700;border:1px solid var(--border-strong);border-radius:var(--r-sm)}
    .hidden{display:none!important}
    .shake{animation: shakeError 0.4s ease-in-out;}

    .line-item-input{display:flex;gap:8px;margin-bottom:8px;align-items:center}
    .total-bar{border:1px solid var(--border-strong);padding:10px 12px;margin:0 0 14px;display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;background:var(--field)}
    .total-bar .tb-label{font-size:11px;text-transform:uppercase;color:var(--muted);line-height:1.3}
    .total-bar .tb-amount{font-size:1.7rem;font-weight:700;line-height:1.1;letter-spacing:-.01em;font-variant-numeric:tabular-nums}
    .total-bar .tb-check{flex-basis:100%;font-size:12px;font-weight:700;border-top:1px solid var(--border);padding-top:6px}
    .total-bar .tb-check.ok{color:var(--ink)}
    .total-bar .tb-check.warn{color:var(--stamp)}
    .total-bar.flash{animation:tbFlash 1.4s ease}
    @keyframes tbFlash{0%,60%{box-shadow:0 0 0 3px var(--ink)}100%{box-shadow:0 0 0 0 transparent}}
    .scanner-banner{border:1px solid var(--border-strong);padding:12px;margin-bottom:18px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
    .checklist-row{display:flex;align-items:center;justify-content:space-between;padding:10px 4px;border-bottom:1px solid var(--rule);cursor:pointer;min-height:44px;margin:0;font-size:13px;color:var(--ink);text-transform:none}
    .checklist-row:last-child{border-bottom:0}
    .modal-overlay{position:fixed;inset:0;background:rgba(12,12,11,.6);display:flex;align-items:center;justify-content:center;padding:16px;z-index:1100}
    .modal{background:var(--paper);outline:1px solid var(--soft);outline-offset:-8px;width:100%;max-width:440px;padding:26px 20px;max-height:86vh;overflow-y:auto;animation: smoothCardEnter 0.35s var(--ease-out-gentle) both;}
    .modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;padding-bottom:10px;border-bottom:1px solid var(--border)}
    .modal-close{cursor:pointer;font:inherit;color:var(--muted);border:1px solid var(--rule);background:transparent;width:32px;height:32px;border-radius:var(--r-sm)}
    .rx-preview{max-height:56vh;overflow:auto;border:1px solid var(--rule);background:#fefdf9}
    .rx-preview img{width:100%;display:block;min-height:120px}
    .rx-status{font-size:11px;color:var(--muted);text-align:center;margin-top:8px}
    .toast-banner{position:fixed;top:18px;left:50%;transform:translateX(-50%);background:var(--solid);color:var(--on-solid);padding:10px 18px;font-size:12px;font-weight:700;border-radius:var(--r-sm);z-index:1200;box-shadow:0 6px 18px rgba(0,0,0,.25);max-width:90%;text-align:center;animation:smoothFadeUp .2s ease}

    @media (max-width:480px){
      .container > .card{padding:20px 16px calc(20px + env(safe-area-inset-bottom,0px));}
      .ws-header-area{padding:14px 14px 8px;}
      .ws-scrollable-body{padding:12px 14px 20px;}
      .claim-action-row{flex-direction:column;align-items:stretch}
      .line-item-input input.li-price{max-width:85px!important}
      .receipt-actions{gap:4px}
      .stats-grid{grid-template-columns:1fr}
      .activity-banner-content{max-width: 170px;}
    }

    @media (max-width: 767px) {
      .ws-web-tab-bar {
        display: none !important;
      }
      .ws-workspace-columns,
      .ws-col-settle,
      .ws-col-interactive,
      .ws-interactive-panes {
        display: contents;
      }
    }

    /* Desktop & Wide Screen Single-Page Fit */
    @media (min-width: 768px) {
      html, body {
        overflow: hidden;
        height: 100vh;
        max-height: 100vh;
      }
      /* Same frame as the zSuite hub, so the shell holds still across page transitions */
      body {
        padding: 28px;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
      }
      .container {
        max-width: 1120px;
        width: 100%;
        height: min(94vh, 860px);
        max-height: min(94vh, 860px);
        margin: 0 auto;
        border-radius: 8px;
        border: 1px solid var(--rule);
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        display: flex;
        flex-direction: column;
      }
      .container > .card {
        padding: 24px 28px;
        height: 100%;
        max-height: 100%;
        min-height: 0;
        overflow-y: auto;
        flex: 1;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
      }
      .container > .card::before {
        border-radius: 8px 8px 0 0;
      }

      /* Screen Hub */
      /* Scrolls as one page like the other lobbies; the header sticks */
      #screen-hub {
        overflow-y: auto;
        display: flex;
        flex-direction: column;
      }
      #screen-hub > * { flex-shrink: 0; }
      #hub-groups-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
        gap: 14px;
        align-content: start;
      }
      #screen-hub .footer-note {
        margin-top: auto;
        padding-top: 12px;
      }

      /* Screen Group (Trip View) */
      #screen-group {
        overflow: hidden;
        overflow: clip; /* hidden still lets scripts scroll it (tour, scrollIntoView); clip does not */
      }
      #screen-group > .nav-breadcrumbs {
        flex-shrink: 0;
      }
      .zsplit-group-layout {
        display: grid;
        grid-template-columns: 310px 1fr;
        gap: 24px;
        align-items: stretch;
        margin-top: 14px;
        flex: 1;
        min-height: 0;
        overflow: hidden;
        overflow: clip;
      }
      .zsplit-group-side {
        overflow-y: auto;
        padding-right: 6px;
        height: 100%;
        min-height: 0;
      }
      .zsplit-group-main {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        overflow: clip;
      }
      .zsplit-group-main > div {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        overflow: hidden;
        overflow: clip;
      }
      #group-events-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
        align-content: start;
        /* Room for the hover lift + shadow; negative margins keep the grid aligned */
        padding: 6px 6px 10px 4px;
        margin: -6px 0 -10px -4px;
      }

      /* Workspace Screen */
      #screen-workspace {
        height: 100%;
        max-height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: 8px;
        padding: 0;
      }
      .ws-header-area {
        flex-shrink: 0;
        padding: 16px 24px 12px;
      }
      .ws-scrollable-body {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        padding: 16px 24px;
        display: flex;
        flex-direction: column;
      }
      .ws-workspace-columns {
        display: grid;
        grid-template-columns: 380px 1fr;
        gap: 24px;
        height: 100%;
        min-height: 0;
        flex: 1;
        overflow: hidden;
      }
      .ws-col-settle {
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        padding-right: 12px;
        border-right: 1px solid var(--rule);
      }
      #tab-pane-settle {
        display: block !important;
        height: auto;
      }
      .ws-col-interactive {
        height: 100%;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }
      .ws-web-tab-bar {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
        padding-bottom: 10px;
        margin-bottom: 12px;
        border-bottom: 1px solid var(--rule);
      }
      .ws-web-tab-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 7px 14px;
        background: transparent;
        border: 1px solid var(--rule);
        border-radius: var(--radius-sm);
        color: var(--muted);
        font: inherit;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.15s ease;
      }
      .ws-web-tab-btn:hover {
        color: var(--ink);
        border-color: var(--soft);
        background: var(--field);
      }
      .ws-web-tab-btn.active {
        color: var(--ink-blue);
        border-color: var(--ink-blue);
        background: var(--bg-blue);
      }
      .ws-interactive-panes {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 6px;
      }
      .ws-interactive-panes > #tab-pane-receipts,
      .ws-interactive-panes > #tab-pane-balances {
        height: auto;
      }
      .ws-navbar {
        display: none !important;
      }
      .zsplit-balances-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        align-items: start;
      }
    }

    @media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

    /* ==================== INTERACTIVE TUTORIAL SPOTLIGHT & POPOVER ==================== */
    .tutorial-overlay {
      position: fixed;
      inset: 0;
      z-index: 1200;
      pointer-events: auto;
    }

    .tutorial-spotlight-frame {
      position: fixed;
      z-index: 1201;
      box-shadow: 0 0 0 9999px rgba(12, 12, 11, 0.65);
      border: 2px solid var(--paper);
      outline: 2px solid var(--border-strong);
      outline-offset: 2px;
      pointer-events: none;
      border-radius: var(--radius-sm);
      transition: top 0.22s var(--ease-out-gentle), left 0.22s var(--ease-out-gentle), width 0.22s var(--ease-out-gentle), height 0.22s var(--ease-out-gentle);
      animation: tutorialTargetPulse 2s infinite ease-in-out;
    }

    [data-theme="dark"] .tutorial-spotlight-frame {
      box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72);
      border-color: var(--border-strong);
      outline-color: var(--paper);
    }

    .tutorial-spotlighted-target {
      position: relative !important;
      z-index: 1202 !important;
      pointer-events: none !important;
    }

    .tutorial-popover {
      position: fixed;
      z-index: 1250;
      background: var(--paper);
      border: 1.5px solid var(--border-strong);
      box-shadow: 0 10px 32px rgba(0, 0, 0, 0.25);
      border-radius: var(--radius-sm);
      padding: 13px 15px 12px;
      width: calc(100% - 32px);
      max-width: 360px;
      min-width: 270px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      animation: smoothCardEnter 0.25s var(--ease-out-gentle) both;
      transition: top 0.22s var(--ease-out-gentle), left 0.22s var(--ease-out-gentle);
    }

    .tutorial-popover-arrow {
      position: absolute;
      width: 12px;
      height: 12px;
      background: var(--paper);
      border: 1.5px solid var(--border-strong);
      transform: rotate(45deg);
      z-index: 2;
    }

    .tutorial-popover-arrow.arrow-top {
      top: -7px;
      border-bottom: 0 !important;
      border-right: 0 !important;
    }

    .tutorial-popover-arrow.arrow-bottom {
      bottom: -7px;
      border-top: 0 !important;
      border-left: 0 !important;
    }

    .tutorial-popover-arrow.arrow-left {
      left: -7px;
      border-top: 0 !important;
      border-right: 0 !important;
    }

    .tutorial-popover-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .tutorial-popover-close {
      background: transparent;
      border: 1px solid var(--rule);
      color: var(--muted);
      cursor: pointer;
      width: 22px;
      height: 22px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      border-radius: var(--r-sm);
      line-height: 1;
      transition: all 0.15s ease;
    }

    .tutorial-popover-close:hover {
      color: var(--ink);
      border-color: var(--border-strong);
    }

    .tutorial-popover-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--ink);
      line-height: 1.3;
      letter-spacing: 0.01em;
    }

    .tutorial-popover-desc {
      font-size: 11.5px;
      color: var(--mid);
      line-height: 1.45;
    }

    .tutorial-popover-hint {
      font-size: 11px;
      background: var(--field);
      border: 1px solid var(--border);
      padding: 5px 8px;
      border-radius: var(--radius-sm);
      color: var(--ink);
      line-height: 1.35;
    }

    .tutorial-popover-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      border-top: 1px solid var(--rule);
      padding-top: 8px;
      margin-top: 2px;
      flex-wrap: wrap;
    }

    .tutorial-popover-dots {
      display: flex;
      align-items: center;
      gap: 4px;
      flex-wrap: wrap;
      max-width: 170px;
    }

    .tutorial-popover-dot {
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: var(--rule);
      border: 1px solid var(--border);
      cursor: pointer;
      padding: 0;
      transition: all 0.2s ease;
    }

    .tutorial-popover-dot:hover {
      background: var(--muted);
    }

    .tutorial-popover-dot.active {
      background: var(--solid);
      border-color: var(--border-strong);
      width: 11px;
      border-radius: var(--r-sm);
    }

    .tutorial-popover-actions {
      display: flex;
      align-items: center;
      gap: 5px;
      margin-left: auto;
    }

    .tutorial-popover-actions .btn {
      min-height: 26px;
      padding: 2px 8px;
      font-size: 11px;
    }

    @keyframes tutorialTargetPulse {
      0%, 100% { outline-color: var(--ink); }
      50% { outline-color: var(--stamp); }
    }

/* Overflow (⋯) menu for secondary header actions */
.more-menu{position:relative;display:inline-block}
.more-menu-panel{position:absolute;right:0;top:calc(100% + 6px);min-width:180px;z-index:200;background-color:var(--paper);opacity:1;isolation:isolate;border:1px solid var(--rule);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.18);padding:4px;display:flex;flex-direction:column}
.more-menu-panel button{background:none;border:0;color:var(--ink);font:inherit;font-size:13px;text-align:left;padding:9px 12px;border-radius:6px;cursor:pointer}
.more-menu-panel button:hover{background:var(--field)}
.more-menu-panel button.danger{color:var(--stamp)}
.more-menu-panel hr{border:0;border-top:1px solid var(--rule);margin:4px 0}

/* ==========================================================================
   zUI polish layer — soft glass + depth
   ========================================================================== */
body { font-size: 14px; }

.container > .card, #screen-workspace { background: transparent; }
.container > .card::before, #screen-workspace::before { display: none; }

h1 { font-size: 24px; font-weight: 680; letter-spacing: -0.03em; }
h2 { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--text-3); }
h3 { font-size: 14px; font-weight: 620; text-transform: none; letter-spacing: -0.01em; }
p.subtitle { font-size: 13.5px; color: var(--text-3); }
.brand-subtext { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; color: var(--text-4); }
label { text-transform: none; font-size: 12px; }
.transfer-section-title, .stat-label, .total-bar .tb-label, .ws-user-sub {
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em; color: var(--text-3);
}

/* Inputs */
input, select { padding: 10px 12px; }
input[type=checkbox] { border-radius: 6px; border-color: var(--border-strong); transition: background var(--t-fast), transform var(--t-slow) var(--ease-spring); }
input[type=checkbox]:checked { background: var(--accent-grad); border-color: transparent; transform: scale(1.06); }
input[type=checkbox]::before { color: #fff; }

/* Header + bars */
.ws-header-area {
  background: transparent;
  border-bottom: 1px solid var(--border);
}
.sync-status-pill {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  background: var(--fill); border-color: var(--border);
}
.activity-banner {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  box-shadow: var(--glass-hi), var(--shadow-2);
  padding: 7px 10px 7px 14px;
  font-size: 12.5px;
}
.activity-pulse-dot { background: var(--accent); }
@keyframes realtimeHighlight {
  0%   { background-color: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
  60%  { background-color: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
  100% { background-color: transparent; box-shadow: inset 0 0 0 1.5px transparent; }
}

/* Group / trip lists */
.entity-item {
  padding: 14px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--fill);
  box-shadow: var(--glass-hi);
  animation: zuiRise .5s var(--ease-out) calc(.06s + var(--i, 0) * .04s) both;
  transition: transform var(--t-slow) var(--ease-spring), border-color var(--t-med), background var(--t-med), box-shadow var(--t-med);
}
.entity-item:hover {
  transform: translateY(-2px);
  background: var(--fill-2);
  border-color: var(--border-strong);
  box-shadow: var(--glass-hi), var(--shadow-2);
}
.entity-item:active { transform: scale(.985); }
.entity-info-title { font-size: 14.5px; font-weight: 620; }
.entity-info-subtitle { font-size: 12px; color: var(--text-3); }
/* Desktop lays these out as grids with their own gap; phones keep the 10px stack spacing */
#hub-groups-list .entity-item, #group-events-list .entity-item { margin-bottom: 10px; }
@media (min-width: 768px) {
  #hub-groups-list .entity-item, #group-events-list .entity-item { margin-bottom: 0; }
}

/* Workspace cards */
#screen-workspace .card {
  background: var(--fill);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-hi);
}
.ws-col-settle { border-right-color: var(--border); }
.ws-user-name { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }

/* Desktop tab bar: segmented control with sliding pill */
@media (min-width: 768px) {
  .ws-web-tab-bar {
    gap: 2px;
    padding: 4px;
    width: fit-content;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--fill);
  }
  .ws-web-tab-btn {
    border: 0;
    background: transparent;
    border-radius: var(--r-md);
    font-size: 13px;
    font-weight: 560;
    color: var(--text-3);
    padding: 7px 14px;
  }
  .ws-web-tab-btn:hover { background: transparent; color: var(--text); }
  .ws-web-tab-btn.active { background: transparent; border: 0; color: var(--text); }
  .ws-web-tab-bar.zui-tabs .zui-tab-pill { background: var(--surface-3); }
  :root:not([data-theme="dark"]) .ws-web-tab-bar.zui-tabs .zui-tab-pill { background: var(--surface); }
}

/* Mobile nav: floating glass dock */
.ws-navbar {
  margin: 0 12px calc(10px + env(safe-area-inset-bottom, 0px));
  padding: 5px;
  gap: 2px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--glass-hi), var(--shadow-3);
}
.ws-nav-btn {
  border: 0;
  border-radius: 15px;
  min-height: 52px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: none;
  color: var(--text-3);
}
.ws-nav-btn:hover { background: transparent; color: var(--text); }
.ws-nav-btn.active { border: 0; background: transparent; color: var(--accent-text); }
.ws-navbar.zui-tabs .zui-tab-pill { border-radius: 15px; background: var(--accent-soft); box-shadow: none; }
.ws-nav-icon { font-size: 16px; transition: transform var(--t-slow) var(--ease-spring); }
.ws-nav-btn.active .ws-nav-icon { transform: translateY(-1px) scale(1.12); }
.ws-nav-badge {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 0;
  color: var(--text-2);
  top: 4px;
}
.ws-nav-badge.alert { background: var(--negative); color: #fff; }
.ws-web-tab-btn .ws-nav-badge { position: static; }

/* Settlement heroes */
.prominent-settle-card {
  position: relative;
  overflow: hidden;
  padding: 18px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--glass-hi);
}
.prominent-settle-card.owe {
  border: 1px solid color-mix(in oklab, var(--negative) 35%, transparent);
  background: linear-gradient(160deg, var(--negative-bg), transparent 70%), var(--fill);
}
.prominent-settle-card.receive {
  border: 1px solid color-mix(in oklab, var(--positive) 35%, transparent);
  background: linear-gradient(160deg, var(--positive-bg), transparent 70%), var(--fill);
}
.prominent-badge { border-radius: var(--r-pill); padding: 3px 9px; font-size: 10px; font-weight: 650; }
.prominent-badge.owe { background: var(--negative); color: #fff; }
.prominent-badge.receive { background: var(--positive); color: #04130c; }
.prominent-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--text-2); }
.prominent-amount, .stat-val, .receipt-total, .item-price, .total-bar .tb-amount, .ws-nav-badge {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums slashed-zero;
  letter-spacing: -0.03em;
}
.prominent-amount { font-size: 32px; font-weight: 700; margin: 4px 0 14px; }
.prominent-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}
.stat-box {
  padding: 12px 14px;
  gap: 2px;
  background: var(--fill);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.stat-val { font-size: 18px; font-weight: 650; }
.transfer-item { border-bottom-color: var(--border); }
.payment-info-box { color: var(--text-3); }

.unclaimed-summary-banner { border-radius: var(--r-md); border-color: var(--border); background: var(--fill); }
.unclaimed-summary-banner.has-unclaimed { border: 1px solid color-mix(in oklab, var(--negative) 35%, transparent); background: var(--negative-bg); color: var(--negative); }
.unclaimed-tag {
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 600;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--negative-bg);
  color: var(--negative);
}

/* Split mode segmented buttons */
.split-mode-btn {
  border-radius: var(--r-md);
  border-color: var(--border);
  color: var(--text-3);
  background: var(--fill);
  transition: all var(--t-med);
}
.split-mode-btn:hover { color: var(--text); border-color: var(--border-strong); }
.split-mode-btn.active {
  border: 1px solid var(--accent);
  color: var(--accent-text);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Receipts */
.receipt-accordion,
.receipt-accordion.receipt-alt-0,
.receipt-accordion.receipt-alt-1,
[data-theme="dark"] .receipt-accordion.receipt-alt-0,
[data-theme="dark"] .receipt-accordion.receipt-alt-1 {
  background: var(--fill);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-hi);
  margin-bottom: 10px;
  animation: zuiRise .45s var(--ease-out) both;
  transition: border-color var(--t-med), box-shadow var(--t-med), background var(--t-med);
}
.receipt-accordion:hover { border-color: var(--border-strong); }
.receipt-accordion:not(.collapsed) { background: var(--fill-2); box-shadow: var(--glass-hi), var(--shadow-2); }
.receipt-header { padding: 14px 16px; }
.receipt-header:hover { background: transparent; }
.receipt-accordion:not(.collapsed) .receipt-header { border-bottom-color: var(--border); }
.receipt-title { font-size: 15px; font-weight: 620; letter-spacing: -0.01em; }
.receipt-meta { font-size: 12px; color: var(--text-3); }
.receipt-total { font-size: 16px; font-weight: 650; }
.btn-receipt-toggle {
  font-family: var(--font-ui);
  font-weight: 560;
  font-size: 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--fill);
  color: var(--text);
}
.btn-receipt-toggle:hover { background: var(--fill-2); color: var(--text); }
.btn-receipt-toggle .receipt-toggle-icon { transition: transform var(--t-slow) var(--ease-spring); }
.receipt-body { padding: 4px 16px 14px; }
.receipt-accordion:not(.collapsed) .receipt-body { animation: zuiRise .35s var(--ease-out) both; }

.item-card { border-top: 1px solid var(--border); padding: 12px 0; }
.item-card.is-unclaimed { border-left: 2px solid var(--negative); padding-left: 12px; }
.item-title { font-weight: 560; }
.item-price { font-weight: 650; }
.item-info { font-size: 12px; color: var(--text-3); }

.btn-claim-me, .btn-claim-others {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 560;
  border-radius: var(--r-md);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-slow) var(--ease-spring), box-shadow var(--t-med);
}
.btn-claim-me { border: 1px solid var(--border-strong); background: var(--fill); }
.btn-claim-me:hover, .btn-claim-others:hover { background: var(--fill-2); }
.btn-claim-me:active, .btn-claim-others:active { transform: scale(.97); }
.btn-claim-me.claimed {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), var(--glow);
  animation: claimPop .45s var(--ease-spring);
}
@keyframes claimPop { 0% { transform: scale(.94); } 100% { transform: none; } }

.claimant-badges { gap: 6px; }
.claimant-badge {
  --h: 260;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--fill);
  animation: zuiPop .35s var(--ease-spring) both;
}
.claimant-badge .avatar {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 75% 62%), hsl(calc(var(--h) + 40) 75% 52%));
}
.claimant-badge.me {
  color: var(--accent-text);
  background: var(--accent-soft);
  border-color: color-mix(in oklab, var(--accent) 35%, transparent);
}
.roster-pill { border-radius: var(--r-pill); padding: 3px 10px; background: var(--fill); }

/* Expense form */
.total-bar {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  background: var(--fill);
}
.total-bar .tb-amount { font-size: 28px; font-weight: 650; }
.total-bar .tb-check { border-top-color: var(--border); }
.total-bar .tb-check.ok { color: var(--positive); }
.total-bar .tb-check.warn { color: var(--negative); }
@keyframes tbFlash { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.scanner-banner {
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 80%);
}
.checklist-row { border-bottom-color: var(--border); font-size: 14px; }

/* Modals + menus */
.modal { outline: 0; padding: 22px 20px; }
.modal-header { border-bottom-color: var(--border); }
.modal-close {
  border: 1px solid var(--border);
  background: var(--fill);
  border-radius: var(--r-md);
  color: var(--text-3);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-slow) var(--ease-spring);
}
.modal-close:hover { background: var(--fill-2); color: var(--text); transform: rotate(90deg); }
.rx-preview { border-radius: var(--r-md); border-color: var(--border); background: #d8d4cb; }

.more-menu-panel {
  background-color: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--glass-hi), var(--shadow-3);
  padding: 5px;
  transform-origin: top right;
  animation: zuiPop .28s var(--ease-spring) both;
}
.more-menu-panel button { border-radius: 9px; font-size: 13.5px; padding: 9px 12px; }
.more-menu-panel button:hover { background: var(--fill-2); }
.more-menu-panel button.danger { color: var(--negative); }
.more-menu-panel hr { border-top-color: var(--border); }

/* Tutorial */
.tutorial-spotlight-frame,
[data-theme="dark"] .tutorial-spotlight-frame {
  border-radius: var(--r-md);
  border: 2px solid var(--accent);
  outline: 4px solid var(--accent-soft);
  box-shadow: 0 0 0 9999px rgba(5, 7, 12, .66);
  transition: top .45s var(--ease-out), left .45s var(--ease-out), width .45s var(--ease-out), height .45s var(--ease-out), border-radius .45s var(--ease-out);
}
@keyframes tutorialTargetPulse { 0%, 100% { outline-color: var(--accent-soft); } 50% { outline-color: transparent; } }
.tutorial-popover {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-hi), var(--shadow-3);
  padding: 16px 16px 14px;
  gap: 10px;
  animation: zuiPop var(--t-slow) var(--ease-spring) both;
  /* Only glides during a step change (see applyTutorialStep), so it tracks scrolling without lag. */
  transition: none;
}
.tutorial-popover.is-gliding { transition: top .45s var(--ease-out), left .45s var(--ease-out); }
.tutorial-popover.is-gliding .tutorial-popover-arrow { transition: top .45s var(--ease-out), left .45s var(--ease-out); }
.tutorial-popover-body { display: flex; flex-direction: column; gap: inherit; min-height: 0; }
.tutorial-popover-arrow { background: var(--surface-2); border-color: var(--glass-border); }
.tutorial-popover-title { font-size: 15px; font-weight: 650; letter-spacing: -0.015em; }
.tutorial-popover-desc { font-size: 13px; color: var(--text-2); }
.tutorial-popover-hint { border-radius: var(--r-md); font-size: 12.5px; }
.tutorial-popover-close { border-radius: var(--r-sm); }
.tutorial-popover-footer { border-top-color: var(--border); }
.tutorial-popover-dot { border: 0; background: var(--border-strong); transition: width var(--t-slow) var(--ease-spring), background var(--t-med); }
.tutorial-popover-dot.active { width: 16px; border-radius: 99px; background: var(--accent-grad); }
.tutorial-popover-actions .btn { min-height: 30px; padding: 4px 12px; font-size: 12px; }

@media (min-width: 768px) {
  .container { border-radius: var(--r-xl); }
}
.container h2 { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; text-transform: none; color: var(--text); }

/* Page transitions (see /shared/zui.css); the brand mark is .zui-brand */
.container > .card, #screen-workspace { view-transition-name: zui-page; }

/* Groups hub header: same look as the zARCADE / zPOLLS lobbies (hero from /shared/zui.css) */
#screen-hub { timeline-scope: --zui-hero; }
#screen-hub > .nav-breadcrumbs.zui-sticky-head {
  margin: -24px -20px 14px;
  padding: 14px 20px;
  border-bottom: 1px solid transparent !important;
}
#screen-hub > .nav-breadcrumbs > span:first-child { display: inline-flex; align-items: center; }
.zs-compact { margin-left: 6px; font-weight: 600; color: var(--text); }
.zs-groups-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.zs-groups-head .section-title { margin: 0; }
.zs-groups-actions { display: flex; align-items: center; gap: 8px; }
#screen-hub .footer-note { border-top: 0; color: var(--text-4); font-size: 11.5px; }
#screen-hub .footer-note a { color: inherit; text-underline-offset: 2px; }
@media (max-width: 480px) {
  #screen-hub > .nav-breadcrumbs.zui-sticky-head { margin: -20px -16px 14px; padding: 14px 16px; }
  #screen-hub > .nav-breadcrumbs .tag { display: none; } /* keeps the bar on one row */
}
@media (min-width: 768px) {
  #screen-hub > .nav-breadcrumbs.zui-sticky-head { margin: -24px -28px 14px; padding: 14px 28px; }
}

/* ==========================================================================
   Scroll layer hooks (see /shared/zui.css)
   ========================================================================== */
@supports (animation-timeline: view()) {
/* Sticky offset for the hub header (position: sticky comes from zui.css under the same
   conditions). Kept here, not on the base rule: without sticky the header is
   position: relative and a negative top would push it out of the card (Firefox). */
@media (prefers-reduced-motion: no-preference) {
  #screen-hub > .nav-breadcrumbs.zui-sticky-head { top: -24px; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 480px) {
  #screen-hub > .nav-breadcrumbs.zui-sticky-head { top: -20px; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 767px) {
  /* List screens: breadcrumbs stick and turn to glass */
  .container > .card > .nav-breadcrumbs {
    position: sticky;
    top: -24px;
    margin: -24px -20px 12px;
    padding: 16px 20px 10px;
    border-bottom-color: transparent !important;
    animation: zuiHeaderGlass linear both;
    animation-timeline: scroll(nearest);
    animation-range: 0px 80px;
  }

  /* Trip workspace: the header condenses as the body scrolls */
  #screen-workspace { timeline-scope: --wsbody; }
  #ws-scrollable-body {
    scroll-timeline: --wsbody block;
    /* edge fades + bottom padding that grows by roughly what the header
       loses, so the scroll range stays put while it condenses */
    animation: zuiFadeTop linear both, zuiFadeBottom linear both, wsBodyCompensate linear both;
    animation-timeline: scroll(self), scroll(self), --wsbody;
    animation-range: 0px 48px, calc(100% - 48px) 100%, 0px 90px;
  }
  @keyframes wsBodyCompensate { to { padding-bottom: 130px; } }
  .ws-header-area {
    animation: zuiHeaderGlass linear both;
    animation-timeline: --wsbody;
    animation-range: 0px 90px;
  }
  @keyframes wsTitleCondense { to { font-size: 17px; margin-bottom: 0; } }
  @keyframes wsCollapse { to { max-height: 0; opacity: 0; margin: 0; padding-top: 0; padding-bottom: 0; } }
  #ws-event-title {
    animation: wsTitleCondense linear both;
    animation-timeline: --wsbody;
    animation-range: 0px 90px;
  }
  #ws-event-sub, .ws-header-area .ws-user-strip {
    max-height: 64px;
    overflow: hidden;
    animation: wsCollapse linear both;
    animation-timeline: --wsbody;
    animation-range: 0px 70px;
  }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 480px) {
  .container > .card > .nav-breadcrumbs { top: -20px; margin: -20px -16px 12px; padding: 14px 16px 10px; }
}
}

/* Phones: receipt header stacks — title on top, total + actions on one row below */
@media (max-width: 480px) {
  .receipt-header { flex-wrap: wrap; }
  .receipt-actions { width: 100%; justify-content: flex-start; }
  .receipt-actions .receipt-total { margin-right: auto; }
}

/* Copy-link buttons: icon-only in the groups list, icon + label on the group page */
.btn-copy-group-link { display: inline-flex; align-items: center; justify-content: center; width: 30px; padding: 0; }
.btn-copy-link-labeled { display: inline-flex; align-items: center; gap: 5px; }

/* Accounts: Open / Members-only groups (shared/zauth.js) */
.zs-link-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 9px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.zs-link-banner > span { flex: 1; min-width: 180px; }
.zs-link-banner b { color: var(--ink); }
.zs-link-banner .tag { font-size: 9.5px; padding: 1px 6px; vertical-align: 1px; }
.roster-pill.is-linked { border-color: var(--ink-green); }
.zs-linked-dot { color: var(--ink-green); font-weight: 700; font-size: 11px; }

/* ---------- Group requests ---------- */
.req-modal { max-width: 440px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.req-modal textarea { width: 100%; resize: vertical; font: inherit; }
.req-roster { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.req-tag { display: inline-flex; align-items: center; gap: 4px; }
.req-tag button { padding: 0 2px; font-size: 11px; line-height: 1; color: inherit; background: none; border: 0; cursor: pointer; opacity: .7; }
.req-tag button:hover { opacity: 1; }
.req-toggle { display: flex !important; align-items: center; gap: 8px; margin: 0; text-transform: none; font-weight: 500; font-size: 13px; color: var(--ink); cursor: pointer; }
.req-toggle input { width: auto; margin: 0; }
.req-hint { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.req-strip { margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; }
.req-strip-title { margin-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.req-strip-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 0.9rem; }
.req-strip-row + .req-strip-row { border-top: 1px solid var(--rule); }
.req-strip-end { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.req-strip-x { padding: 2px 4px; font-size: 12px; line-height: 1; color: var(--muted); background: none; border: 0; cursor: pointer; }
.req-strip-x:hover { color: var(--ink); }
