/* TSL People — design tokens */
:root {
  --bg: #F5F4F0; --surface: #FFFFFF; --surface-2: #F1F0EB; --surface-3: #E9E7E1; --line: #E5E3DC; --line-2: #D9D6CE;
  --text: #17161C; --text-2: #45434D; --muted: #6E6B78; --faint: #A09DA8;
  --brand: #6C4CF1; --brand-ink: #5236D9; --brand-soft: #EFEBFF; --brand-line: #D9D0FF; --on-brand: #fff;
  --ok: #12804A; --ok-soft: #E3F5EA; --warn: #A35A06; --warn-soft: #FDF1DE; --bad: #D33A40; --bad-soft: #FCEBEB;
  --info: #2563EB; --info-soft: #E8EFFE;
  --radius: 20px; --radius-sm: 14px; --radius-xs: 10px;
  --shadow: 0 1px 2px rgba(23, 22, 28, .04), 0 6px 24px -8px rgba(23, 22, 28, .08);
  --shadow-lg: 0 24px 60px -12px rgba(23, 22, 28, .28);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0D12; --surface: #18171E; --surface-2: #211F28; --surface-3: #2A2832; --line: #2A2931; --line-2: #3A3842;
    --text: #F4F3F8; --text-2: #D2D0DA; --muted: #A19EAD; --faint: #6F6C7A;
    --brand: #8C74FF; --brand-ink: #A894FF; --brand-soft: #241E43; --brand-line: #3B3170;
    --ok: #3DD68C; --ok-soft: #10291C; --warn: #F5B14C; --warn-soft: #2D2210; --bad: #FF6B70; --bad-soft: #331517;
    --info: #79A6FF; --info-soft: #14213D;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100dvh; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 14px; } .tiny { font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- shell ---------- */
.app { min-height: 100dvh; }
.main { padding: calc(var(--safe-t) + 8px) 16px calc(var(--tabbar-h) + var(--safe-b) + 28px); max-width: 680px; margin: 0 auto; }
.main.wide { max-width: 1080px; }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 56px; margin-bottom: 6px; }
.topbar h1 { font-size: 28px; font-weight: 750; letter-spacing: -.025em; line-height: 1.15; flex: 1; min-width: 0; }
.topbar .sub { display: block; font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-bottom: 2px; }
.topbar.page h1 { font-size: 22px; }
.iconbtn { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; position: relative; color: var(--text); flex: none; }
.iconbtn:active { transform: scale(.94); }
.iconbtn .dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 9px; background: var(--bad); border: 2px solid var(--surface); }
.avatarbtn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 99px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; padding: 6px 8px calc(var(--safe-b) + 6px);
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); border-top: 1px solid var(--line); }
.tab { flex: 1; max-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; color: var(--faint); font-size: 11px; font-weight: 600; border-radius: 12px; position: relative; }
.tab svg.i { width: 24px; height: 24px; stroke-width: 1.9; }
.tab.on { color: var(--brand); }
.tab .badge { position: absolute; top: 1px; left: calc(50% + 6px); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }

.side { display: none; }
@media (min-width: 960px) {
  .tabbar { display: none; }
  .side { display: flex; flex-direction: column; gap: 4px; position: fixed; inset: 0 auto 0 0; width: 248px; padding: 24px 14px; border-right: 1px solid var(--line); background: var(--surface); }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 750; letter-spacing: -.01em; }
  .side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 560; font-size: 15px; }
  .side a:hover { background: var(--surface-2); }
  .side a.on { background: var(--brand-soft); color: var(--brand-ink); }
  .side a .badge { margin-left: auto; }
  .side .spacer { flex: 1; }
  .app.authed .main { margin-left: max(248px, calc(50vw - 340px + 124px)); padding-top: 28px; padding-bottom: 48px; }
  .app.authed .main.wide { margin-left: 248px; padding-left: 40px; padding-right: 40px; max-width: 1180px; }
}

/* ---------- building blocks ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card, .stack > * + * { margin-top: 12px; }
.section { margin-top: 28px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; gap: 12px; }
.section-h h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.section-h a { font-size: 14px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 16px; border: 0; font-size: 16px; font-weight: 650;
  cursor: pointer; background: var(--brand); color: var(--on-brand); transition: transform .12s, filter .12s, opacity .12s; text-align: center; letter-spacing: -.005em; }
.btn:active { transform: scale(.98); }
.btn:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.outline { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.sm { min-height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14.5px; }
.btn.xs { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 99px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btns { display: flex; gap: 10px; } .btns > * { flex: 1; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin: 0 2px 6px; }
.field > span em { font-style: normal; font-weight: 500; color: var(--faint); }
.input, select.input, textarea.input { width: 100%; min-height: 52px; padding: 13px 15px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; outline: 0;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
textarea.input { min-height: 88px; resize: vertical; line-height: 1.45; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
input[type=date].input { min-height: 52px; display: block; }
input[type=date].input::-webkit-date-and-time-value { text-align: left; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 2px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 > .field { margin-bottom: 14px; }
@media (max-width: 380px) { .grid2.stack-sm { grid-template-columns: 1fr; gap: 0; } }

.switch { display: flex; align-items: center; gap: 14px; padding: 14px 0; cursor: pointer; }
.switch + .switch { border-top: 1px solid var(--line); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .knob { width: 50px; height: 30px; border-radius: 99px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 99px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .knob { background: var(--brand); }
.switch input:checked + .knob::after { transform: translateX(20px); }
.switch input:focus-visible + .knob { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.switch b { display: block; font-weight: 600; font-size: 15.5px; } .switch small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.4; margin-top: 1px; }

.seg { display: flex; background: var(--surface-2); padding: 4px; border-radius: 14px; gap: 4px; }
.seg button { flex: 1; min-height: 42px; border: 0; background: transparent; border-radius: 11px; font-weight: 600; font-size: 15px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); cursor: pointer; background: var(--surface); }
.choice + .choice { margin-top: 10px; }
.choice input { margin: 3px 0 0; accent-color: var(--brand); width: 20px; height: 20px; flex: none; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice b { display: block; font-weight: 650; } .choice small { color: var(--muted); font-size: 13.5px; display: block; line-height: 1.4; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 9px; background: currentColor; opacity: .9; }
.pill.plain::before { display: none; }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.approved { background: var(--ok-soft); color: var(--ok); }
.pill.rejected { background: var(--bad-soft); color: var(--bad); }
.pill.withdrawn, .pill.cancelled { background: var(--surface-2); color: var(--muted); }
.pill.cancel_pending { background: var(--info-soft); color: var(--info); }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); }

.avatar { width: 40px; height: 40px; border-radius: 99px; display: grid; place-items: center; font-weight: 700; font-size: 14.5px; flex: none; color: #fff; letter-spacing: .01em; }
.avatar.lg { width: 76px; height: 76px; font-size: 26px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatars { display: flex; } .avatars .avatar { border: 2.5px solid var(--surface); margin-left: -10px; } .avatars .avatar:first-child { margin-left: 0; }

.typeicon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.typeicon svg.i { width: 22px; height: 22px; }
.typeicon.sm { width: 36px; height: 36px; border-radius: 11px; } .typeicon.sm svg.i { width: 18px; height: 18px; }

.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: inherit; width: 100%; text-align: left; border: 0; background: none; cursor: pointer; }
.item + .item { border-top: 1px solid var(--line); }
a.item:active, button.item:active { background: var(--surface-2); }
.item .title { font-weight: 620; font-size: 15.5px; line-height: 1.3; }
.item .meta { font-size: 13.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.item .chev { color: var(--faint); }
.item .end { text-align: right; flex: none; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .art { width: 72px; height: 72px; border-radius: 24px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--brand-soft); color: var(--brand); }
.empty .art svg.i { width: 32px; height: 32px; }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; align-items: flex-start; }
.note svg.i { margin-top: 1px; }
.note.info { background: var(--info-soft); color: var(--info); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.note.neutral { background: var(--surface-2); color: var(--text-2); }
.note b { font-weight: 650; }
.note .grow > * + * { margin-top: 4px; }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(135deg, #6C4CF1 0%, #5236D9 55%, #3F28B5 100%); border-radius: 24px; padding: 22px; box-shadow: 0 18px 40px -18px rgba(82, 54, 217, .7); }
.hero::after { content: ""; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%); }
.hero .label { font-size: 14px; font-weight: 600; opacity: .85; display: flex; align-items: center; gap: 8px; }
.hero .big { font-size: 56px; font-weight: 780; letter-spacing: -.04em; line-height: 1; margin: 12px 0 4px; }
.hero .big small { font-size: 18px; font-weight: 600; letter-spacing: -.01em; opacity: .85; margin-left: 6px; }
.hero .bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.22); margin: 16px 0 10px; overflow: hidden; display: flex; }
.hero .bar i { display: block; height: 100%; background: #fff; }
.hero .bar i.p { background: rgba(255,255,255,.5); }
.hero .foot { display: flex; justify-content: space-between; font-size: 13.5px; opacity: .9; gap: 10px; flex-wrap: wrap; }
.hero .btn { margin-top: 18px; background: #fff; color: #4A2FD0; width: 100%; }

.balances { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 10px; scrollbar-width: none; }
.balances::-webkit-scrollbar { display: none; }
.bal { scroll-snap-align: start; flex: none; width: 150px; background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.bal .n { font-size: 26px; font-weight: 750; letter-spacing: -.03em; margin-top: 10px; line-height: 1.1; }
.bal .n small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.bal .t { font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-top: 2px; }
.bal .s { font-size: 12.5px; color: var(--muted); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; display: flex; }
.progress i { display: block; height: 100%; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick a { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; color: var(--text); display: flex; flex-direction: column; gap: 10px; font-weight: 620; font-size: 15px; }
.quick a .typeicon { width: 38px; height: 38px; border-radius: 12px; }

/* ---------- request form ---------- */
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type { position: relative; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 18px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; min-height: 112px; transition: border-color .15s, background .15s, transform .12s; }
.type:active { transform: scale(.98); }
.type b { font-size: 15px; font-weight: 650; line-height: 1.25; }
.type small { font-size: 13px; color: var(--muted); }
.type.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 16%, transparent); }
.type.on::after { content: ""; position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 99px; background: var(--c) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/14px no-repeat; }
.type[disabled] { opacity: .45; }
.step { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 26px 4px 10px; }
.summary { border-radius: 20px; padding: 18px; background: var(--surface); box-shadow: var(--shadow); }
.summary .days { font-size: 34px; font-weight: 780; letter-spacing: -.03em; line-height: 1.05; }
.summary .days small { font-size: 16px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.checks { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; gap: 10px; font-size: 14.5px; line-height: 1.4; align-items: flex-start; }
.check .ic { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; flex: none; margin-top: -1px; }
.check .ic svg.i { width: 13px; height: 13px; stroke-width: 3.2; }
.check.ok .ic { background: var(--ok-soft); color: var(--ok); }
.check.bad .ic { background: var(--bad-soft); color: var(--bad); }
.check.warn .ic { background: var(--warn-soft); color: var(--warn); }
.check.bad { color: var(--text); }
.check button { margin-top: 8px; }
.sticky-cta { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); margin-top: 20px; z-index: 5; }
@media (min-width: 960px) { .sticky-cta { bottom: 20px; } }
.sticky-cta .btn { box-shadow: 0 12px 30px -10px rgba(82, 54, 217, .6); }
.approvers { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin: 14px 4px 0; }

/* success */
.done { text-align: center; padding: 48px 12px 24px; }
.done .tick { width: 96px; height: 96px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 22px; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.done .tick svg.i { width: 46px; height: 46px; stroke-width: 2.6; }
.done h1 { font-size: 26px; letter-spacing: -.02em; margin-bottom: 8px; }
.done p { color: var(--muted); max-width: 340px; margin: 0 auto; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* timeline */
.timeline { position: relative; padding-left: 4px; }
.tl { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .ic { width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.tl .ic svg.i { width: 16px; height: 16px; stroke-width: 2.6; }
.tl.approved .ic { background: var(--ok-soft); color: var(--ok); }
.tl.rejected .ic { background: var(--bad-soft); color: var(--bad); }
.tl.pending .ic { background: var(--warn-soft); color: var(--warn); }
.tl b { display: block; font-weight: 620; font-size: 15px; } .tl small { color: var(--muted); font-size: 13.5px; display: block; }
.tl q { display: block; margin-top: 6px; font-size: 14px; color: var(--text-2); background: var(--surface-2); padding: 8px 12px; border-radius: 12px; quotes: none; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 560; }

/* who's out */
.days-strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 18px; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.days-strip::-webkit-scrollbar { display: none; }
.daychip { flex: none; scroll-snap-align: start; width: 58px; padding: 10px 0 9px; border-radius: 18px; border: 0; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text); }
.daychip .w { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.daychip .d { font-size: 20px; font-weight: 720; letter-spacing: -.02em; }
.daychip .c { height: 16px; font-size: 11px; font-weight: 700; color: var(--brand); }
.daychip.weekend { opacity: .55; }
.daychip.on { background: var(--brand); color: #fff; } .daychip.on .w, .daychip.on .c { color: rgba(255,255,255,.85); }

/* sheet (bottom modal) */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh; background: var(--surface); color: var(--text); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg); overflow: auto; overscroll-behavior: contain; }
dialog.sheet[open] { animation: up .28s cubic-bezier(.2, .9, .3, 1); }
dialog.sheet::backdrop { background: rgba(10, 8, 20, .45); backdrop-filter: blur(2px); animation: fade .2s; }
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: 26px; } }
.sheet-in { padding: 10px 20px calc(var(--safe-b) + 20px); }
.sheet-grab { width: 40px; height: 5px; background: var(--line-2); border-radius: 9px; margin: 0 auto 14px; }
.sheet-h { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.sheet-h h2 { font-size: 21px; font-weight: 740; letter-spacing: -.02em; flex: 1; line-height: 1.25; }
.sheet-h p { color: var(--muted); font-size: 15px; margin-top: 4px; letter-spacing: 0; font-weight: 400; }
.sheet .x { width: 36px; height: 36px; border-radius: 99px; background: var(--surface-2); border: 0; display: grid; place-items: center; cursor: pointer; flex: none; color: var(--muted); }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

/* toast */
.toasts { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 12px); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: #1D1B24; color: #fff; padding: 12px 16px; border-radius: 16px; font-size: 15px; font-weight: 550; box-shadow: var(--shadow-lg); max-width: 460px; animation: drop .3s cubic-bezier(.2, .9, .3, 1); }
.toast.bad { background: var(--bad); } .toast.ok svg.i { color: #4ADE80; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .25s; }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }

/* login */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 24px); max-width: 420px; margin: 0 auto; }
.logo { width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(140deg, #7B5CFF, #4A2FD0); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 19px; letter-spacing: -.02em; box-shadow: 0 14px 30px -12px rgba(82, 54, 217, .7); }
.logo.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; box-shadow: none; }
.login h1 { font-size: 30px; letter-spacing: -.03em; margin: 22px 0 6px; line-height: 1.15; }
.login .lead { color: var(--muted); margin-bottom: 28px; }
.pin-input { letter-spacing: .5em; font-size: 22px !important; font-weight: 700; text-align: center; padding-left: calc(15px + .5em) !important; }
.pin-input::placeholder { letter-spacing: .3em; color: var(--faint); font-weight: 500; }
.peek { position: relative; } .peek button { position: absolute; right: 6px; top: 6px; height: 40px; padding: 0 12px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }

/* install banner */
.install { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 14px; font-size: 14px; }
.install b { display: block; font-size: 15px; }

/* credentials card */
.creds { background: var(--surface-2); border-radius: 18px; padding: 16px; }
.creds .k { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.creds .v { font-size: 17px; font-weight: 650; word-break: break-all; margin-bottom: 12px; }
.creds .pin { font-size: 34px; font-weight: 800; letter-spacing: .22em; font-variant-numeric: tabular-nums; }

/* admin */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; }
.search { position: relative; flex: 1; }
.search svg.i { position: absolute; left: 14px; top: 16px; color: var(--faint); width: 18px; height: 18px; }
.search .input { padding-left: 42px; min-height: 50px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text-2); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tablewrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
table.t th, table.t td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th { font-size: 12.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; background: var(--surface); position: sticky; top: 0; }
table.t td:first-child, table.t th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.t tr:last-child td { border-bottom: 0; }
.cell-bal b { font-size: 15px; } .cell-bal span { color: var(--faint); }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 700px) { .admin-grid { grid-template-columns: repeat(3, 1fr); } }
.admin-grid a { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; color: var(--text); display: flex; flex-direction: column; gap: 12px; min-height: 124px; }
.admin-grid a b { font-size: 15.5px; } .admin-grid a small { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; line-height: 1.35; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; margin-bottom: 16px; }
.tabs a { flex: 1; text-align: center; padding: 9px 0; border-radius: 11px; font-weight: 620; font-size: 14.5px; color: var(--muted); }
.tabs a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ent { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.ent + .ent { border-top: 1px solid var(--line); }
.ent .input { width: 92px; min-height: 44px; text-align: center; padding: 8px; }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors label { width: 38px; height: 38px; border-radius: 99px; background: var(--c); cursor: pointer; display: grid; place-items: center; }
.colors input { position: absolute; opacity: 0; }
.colors label:has(input:checked) { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fadein { animation: fadein .25s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* fixes after first visual pass */
.grid2 > * { min-width: 0; }
input[type=date].input { width: 100%; min-width: 0; }
.btn[disabled] { opacity: 1; background: var(--surface-3); color: var(--faint); box-shadow: none !important; }
.balances { scroll-padding-inline: 16px; }
.sticky-cta { background: linear-gradient(to top, var(--bg) 60%, transparent); padding-top: 12px; margin-left: -4px; margin-right: -4px; padding-left: 4px; padding-right: 4px; }
.days-strip { scroll-padding-inline: 16px; }
[hidden] { display: none !important; }
@media (min-width: 960px) {
  .balances { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 0; padding: 2px 0 10px; overflow: visible; }
  .bal { width: auto; }
}
