/* PFCvault — Liquid Glass, after iOS 26 / macOS Tahoe. Phone first. */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI Variable', 'Segoe UI', Roboto, system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --rounded: ui-rounded, 'SF Pro Rounded', var(--font);

  --bg: #f2f2f7;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-hover: #f7f7fa;
  --label: #000;
  --label-2: rgba(60, 60, 67, 0.62);
  --label-3: rgba(60, 60, 67, 0.32);
  --sep: rgba(60, 60, 67, 0.18);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --accent: #2547b8;
  --navy: #1f2f63;
  --brand-red: #ed1c24;
  --accent-ink: #fff;
  --red: #ff3b30;
  --green: #34c759;
  --orange: #ff9500;

  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 0 0 0.5px rgba(255, 255, 255, 0.5);
  --sheet-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);

  --c-blue: #0a84ff; --c-indigo: #5e5ce6; --c-purple: #bf5af2; --c-pink: #ff375f; --c-red: #ff453a;
  --c-orange: #ff9f0a; --c-yellow: #ffcc00; --c-green: #30d158; --c-teal: #40c8e0; --c-gray: #8e8e93;

  --r-card: 20px;
  --r-row: 14px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --side-w: 290px;
  --list-w: 370px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --bg-elevated: #1c1c1e;
    --card: #1c1c1e;
    --card-hover: #242427;
    --label: #fff;
    --label-2: rgba(235, 235, 245, 0.62);
    --label-3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.55);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.34);
    --accent: #5b8cff;
    --red: #ff453a;
    --green: #30d158;
    --glass: rgba(40, 40, 44, 0.55);
    --glass-strong: rgba(44, 44, 48, 0.82);
    --glass-edge: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 0 0.5px rgba(255, 255, 255, 0.1);
    --sheet-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font: 17px/1.35 var(--font);
  letter-spacing: -0.012em;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 10px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon .dot { fill: currentColor; stroke: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- glass ---------- */

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  border: 0.5px solid var(--glass-edge);
}

.gbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; min-width: 44px; padding: 0 14px; border-radius: 22px;
  font-weight: 590; font-size: 16px;
  transition: transform 0.35s var(--spring), background 0.2s;
}
.gbtn.round { padding: 0; width: 44px; }
.gbtn .icon { width: 21px; height: 21px; }
.gbtn:active { transform: scale(0.92); }
.gbtn.tint { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border-radius: 25px;
  font-weight: 600; font-size: 17px;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform 0.35s var(--spring), opacity 0.2s, filter 0.2s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(0.96); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn.wide { width: 100%; }
.btn.plain { background: var(--fill); color: var(--accent); box-shadow: none; }
.btn.danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); box-shadow: none; }
.btn .icon { width: 20px; height: 20px; }
.btn.busy { pointer-events: none; }
.btn.busy::after { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.link { color: var(--accent); font-weight: 500; font-size: 17px; padding: 8px 4px; border-radius: 8px; }
.link.danger { color: var(--red); }
.info { color: var(--accent); display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 15px; vertical-align: middle; }
.info .icon { width: 19px; height: 19px; }
.info:active { background: var(--fill); }

/* ---------- shell: sidebar | list | detail ---------- */

.shell { position: fixed; inset: 0; overflow: hidden; }
.pane { position: absolute; inset: 0; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.scroll-inner { padding: calc(var(--safe-top) + 58px) 16px calc(var(--safe-bottom) + 110px); max-width: 720px; margin: 0 auto; }

/* phone: a navigation stack */
@media (max-width: 899px) {
  .pane { transition: transform 0.5s var(--ease), filter 0.5s var(--ease); will-change: transform; }
  .pane-list, .pane-detail { transform: translateX(100%); box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12); }
  .shell[data-depth='1'] .pane-side, .shell[data-depth='2'] .pane-side { transform: translateX(-28%); filter: brightness(0.92); }
  .shell[data-depth='1'] .pane-list { transform: none; }
  .shell[data-depth='2'] .pane-list { transform: translateX(-28%); filter: brightness(0.92); }
  .shell[data-depth='2'] .pane-detail { transform: none; }
  .shell.dragging .pane { transition: none; }
  .desktop-only { display: none !important; }
}

/* desktop: three columns, like Passwords on the Mac */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: var(--side-w) var(--list-w) 1fr; }
  .pane { position: relative; inset: auto; }
  .pane-side { background: transparent; padding: 10px 0 10px 10px; }
  .pane-side .side-card { flex: 1; display: flex; flex-direction: column; border-radius: 26px; overflow: hidden; }
  .pane-list { border-right: 0.5px solid var(--sep); }
  .pane-detail { background: var(--bg-elevated); }
  .phone-only { display: none !important; }
  .scroll-inner { padding-top: 64px; padding-bottom: 40px; }
  .pane-side .scroll-inner { padding: 22px 12px 14px; }
  .shell.wide-list { grid-template-columns: var(--side-w) 1fr 0; }
  .shell.wide-list .pane-detail { display: none; }
  .shell { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--bg)), var(--bg) 50%); }
  .pane-list { background: color-mix(in srgb, var(--bg) 88%, transparent); }
}
@media (min-width: 900px) and (max-width: 1180px) { :root { --side-w: 250px; --list-w: 320px; } }
@media (min-width: 900px) and (prefers-color-scheme: dark) { .pane-detail { background: #0f0f10; } }

/* top bar: floats over content, title appears when the large title scrolls away */
.topbar {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  pointer-events: none;
}
.topbar::before {
  content: ''; position: absolute; inset: 0 0 -18px; z-index: -1;
  background: linear-gradient(var(--bg) 40%, color-mix(in srgb, var(--bg) 0%, transparent));
  opacity: 0; transition: opacity 0.25s;
}
.pane-detail .topbar::before { background: linear-gradient(var(--bg-elevated) 40%, color-mix(in srgb, var(--bg-elevated) 0%, transparent)); }
.topbar.scrolled::before { opacity: 1; }
.topbar > * { pointer-events: auto; }
.topbar .lead { justify-self: start; display: flex; gap: 8px; }
.topbar .trail { justify-self: end; display: flex; gap: 8px; }
.topbar .mini-title { font-weight: 600; font-size: 17px; opacity: 0; transform: translateY(6px); transition: 0.3s var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; }
.topbar.scrolled .mini-title { opacity: 1; transform: none; }

.large-title { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; margin: 6px 4px 4px; }
.subtitle { color: var(--label-2); font-size: 15px; margin: 0 4px 18px; }

/* ---------- sidebar / home ---------- */

.brand { display: flex; align-items: center; gap: 12px; margin: 4px 4px 18px; }
.brand .mark { width: 40px; height: 40px; border-radius: 11px; flex: none; box-shadow: 0 2px 8px rgba(31, 47, 99, 0.2), 0 0 0 0.5px rgba(0, 0, 0, 0.06); }
.brand b { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; display: block; line-height: 1.1; }
.brand span { font-size: 13px; color: var(--label-2); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 26px; }
.cat {
  position: relative; text-align: left; padding: 12px 12px 11px; border-radius: 18px; background: var(--card);
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; row-gap: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.35s var(--spring), background 0.2s, box-shadow 0.2s;
}
.cat:active { transform: scale(0.96); }
.cat .badge { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--tone); }
.cat .badge .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.cat .count { font: 700 24px/1 var(--rounded); align-self: center; }
.cat .name { grid-column: 1 / -1; font-weight: 600; font-size: 15px; color: var(--label-2); }
.cat.on { background: var(--accent); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.cat.on .name { color: rgba(255, 255, 255, 0.85); }
.cat.on .badge { background: rgba(255, 255, 255, 0.25); }
@media (min-width: 900px) { .cat { background: var(--fill); box-shadow: none; } .cat:hover:not(.on) { background: var(--fill-2); } }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 8px; }
.section-head h2 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.section-head .small { font-size: 13px; color: var(--label-2); font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em; }
.group-caption { font-size: 13px; color: var(--label-2); margin: 22px 20px 7px; text-transform: uppercase; letter-spacing: 0.02em; }
.group-foot { font-size: 13px; color: var(--label-2); margin: 7px 20px 0; line-height: 1.4; }

/* ---------- inset grouped lists ---------- */

.list { background: var(--card); border-radius: var(--r-card); overflow: hidden; margin-bottom: 26px; }
@media (min-width: 900px) { .pane-side .list { background: transparent; border-radius: 0; margin-bottom: 18px; } }
.row {
  position: relative; display: flex; align-items: center; gap: 13px; width: 100%; min-height: 52px; padding: 9px 16px;
  text-align: left; background: transparent; transition: background 0.15s;
}
.row + .row::before { content: ''; position: absolute; top: 0; right: 0; left: var(--inset, 16px); height: 0.5px; background: var(--sep); }
.row.with-tile { --inset: 70px; }
.row.with-badge { --inset: 58px; }
button.row:active, a.row:active, .row.tap:active { background: var(--fill); }
@media (hover: hover) { button.row:hover, a.row:hover { background: var(--card-hover); } }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 15px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row .end { color: var(--label-2); font-size: 17px; display: flex; align-items: center; gap: 6px; flex: none; }
.row .chev { color: var(--label-3); width: 15px; height: 15px; stroke-width: 2.6; }
.row.sel { background: var(--accent) !important; color: #fff; border-radius: 12px; }
.row.sel .s, .row.sel .end, .row.sel .chev { color: rgba(255, 255, 255, 0.8); }
.row.sel::before, .row.sel + .row::before { display: none; }
.row.danger { color: var(--red); justify-content: center; font-weight: 500; }
.row.accent { color: var(--accent); }
.row .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--tone, var(--c-gray)); color: #fff; flex: none; }
.row .ico .icon { width: 17px; height: 17px; stroke-width: 2.2; }
.pane-side .row { border-radius: 12px; min-height: 44px; }
.pane-side .row + .row::before { display: none; }

[data-color='blue'] { --tone: var(--c-blue); } [data-color='indigo'] { --tone: var(--c-indigo); } [data-color='purple'] { --tone: var(--c-purple); }
[data-color='pink'] { --tone: var(--c-pink); } [data-color='red'] { --tone: var(--c-red); } [data-color='orange'] { --tone: var(--c-orange); }
[data-color='yellow'] { --tone: var(--c-yellow); } [data-color='green'] { --tone: var(--c-green); } [data-color='teal'] { --tone: var(--c-teal); }
[data-color='gray'] { --tone: var(--c-gray); }

.tile {
  width: 42px; height: 42px; border-radius: 11px; flex: none; display: grid; place-items: center;
  font: 600 19px/1 var(--rounded); color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 78%, #fff), var(--tone) 60%, color-mix(in srgb, var(--tone) 80%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.12);
}
.tile .icon { width: 21px; height: 21px; stroke-width: 2.2; }
.tile.xl { width: 84px; height: 84px; border-radius: 22px; font-size: 38px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 30px color-mix(in srgb, var(--tone) 35%, transparent); }
.tile.xl .icon { width: 40px; height: 40px; stroke-width: 1.8; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 600 14px/1 var(--rounded); color: #fff; background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 70%, #fff), var(--tone)); }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.letter { position: sticky; top: calc(var(--safe-top) + 58px); z-index: 1; font-size: 13px; font-weight: 600; color: var(--label-2); margin: 0 20px 6px; }

/* ---------- list pane chrome ---------- */

.bottombar {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 0;
  padding: 10px 14px calc(var(--safe-bottom) + 12px);
  display: flex; gap: 10px; align-items: center;
  pointer-events: none;
}
.bottombar > * { pointer-events: auto; }
.bottombar::before { content: ''; position: absolute; inset: -24px 0 0; z-index: -1; pointer-events: none; background: linear-gradient(color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 70%); }
.searchbox { flex: 1; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 24px; color: var(--label-2); }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--label); font-size: 17px; height: 100%; }
.searchbox input::placeholder { color: var(--label-2); }
.searchbox input::-webkit-search-cancel-button { display: none; }
.searchbox .x { color: var(--label-3); display: grid; }
.bottombar .gbtn { height: 48px; width: 48px; border-radius: 24px; }
@media (min-width: 900px) {
  .bottombar { position: static; padding: 0 0 12px; pointer-events: auto; }
  .bottombar::before { display: none; }
  .list-head { padding: 18px 16px 0; }
  .searchbox { height: 38px; border-radius: 12px; background: var(--fill); box-shadow: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .searchbox input { font-size: 15px; }
  .bottombar .gbtn { height: 38px; width: 38px; }
}

.item-list .row { min-height: 64px; }
.item-list .chips { display: flex; gap: 4px; margin-top: 3px; overflow: hidden; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--tone, var(--label-2)); background: color-mix(in srgb, var(--tone, var(--c-gray)) 15%, transparent); }
.chip .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.row.sel .chip { color: #fff; background: rgba(255, 255, 255, 0.22); }

/* ---------- empty ---------- */

.empty { text-align: center; padding: 70px 24px; color: var(--label-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .halo { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--label-2); margin-bottom: 8px; }
.empty .halo .icon { width: 34px; height: 34px; stroke-width: 1.6; }
.empty b { color: var(--label); font-size: 20px; font-weight: 600; }
.empty p { margin: 0; max-width: 300px; font-size: 15px; }
.empty .btn { margin-top: 14px; height: 44px; font-size: 16px; }
.pane-detail .empty { height: 100%; justify-content: center; }

/* ---------- detail ---------- */

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin: 8px 0 26px; }
.hero h1 { font-size: 28px; font-weight: 700; margin: 14px 0 0; letter-spacing: -0.02em; line-height: 1.15; word-break: break-word; }
.hero .meta { color: var(--label-2); font-size: 14px; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.hero .chips .chip { height: 26px; padding: 0 10px; font-size: 13px; border-radius: 13px; }

.field { flex-direction: column; align-items: stretch; gap: 2px; padding: 11px 16px; cursor: pointer; }
.field .k { font-size: 14px; color: var(--label-2); }
.field .v { font-size: 17px; word-break: break-all; display: flex; align-items: center; gap: 8px; min-height: 24px; }
.field .v.mono { font-family: var(--mono); font-size: 16px; letter-spacing: 0.02em; }
.field .v.secret { letter-spacing: 0.18em; }
.field .v .act { margin-left: auto; color: var(--accent); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 17px; flex: none; }
.field .v .act:active { background: var(--fill); }
.field .v .act .icon { width: 20px; height: 20px; }
.field .v.wrap { white-space: pre-wrap; word-break: break-word; font-size: 16px; line-height: 1.45; }
.field.flash { animation: flash 0.6s var(--ease); }
@keyframes flash { 0% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }

.otp { font: 600 26px/1 var(--mono); letter-spacing: 0.08em; color: var(--accent); font-variant-numeric: tabular-nums; }
.ring { width: 24px; height: 24px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: var(--fill-2); }
.ring .prog { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring.low .prog { stroke: var(--red); }

.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; margin-bottom: 26px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 13px 6px 11px; border-radius: 16px; background: var(--card); color: var(--accent); font-size: 13px; font-weight: 600; transition: transform 0.35s var(--spring), background 0.2s; }
.action .icon { width: 23px; height: 23px; }
.action:active { transform: scale(0.94); }
@media (hover: hover) { .action:hover { background: var(--card-hover); } }
.pane-detail .list, .pane-detail .action { background: var(--card); }
@media (min-width: 900px) { .pane-detail .list, .pane-detail .action { background: var(--bg); } }

.footnote { text-align: center; color: var(--label-2); font-size: 13px; margin: -8px 0 26px; }

/* ---------- forms ---------- */

.form .row { min-height: 50px; }
.form label.row { cursor: text; }
.form .row > .lbl { width: 106px; flex: none; color: var(--label); font-size: 16px; }
.form input:not([type='checkbox']), .form textarea, .form select {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 6px 0;
}
.form input::placeholder, .form textarea::placeholder { color: var(--label-3); }
.form textarea { resize: none; min-height: 110px; line-height: 1.4; field-sizing: content; padding: 12px 0; }
.form .mono { font-family: var(--mono); font-size: 16px; }
.form .tool { color: var(--accent); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 17px; flex: none; }
.form .tool:active { background: var(--fill); }
.form .tool .icon { width: 20px; height: 20px; }
.strength { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; margin: 0 16px 10px; }
.strength i { display: block; height: 100%; border-radius: 2px; transition: width 0.4s var(--ease), background 0.4s; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 12px; background: var(--fill); margin-bottom: 22px; position: relative; }
.seg button { height: 34px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--label); display: flex; align-items: center; justify-content: center; gap: 6px; position: relative; z-index: 1; transition: color 0.2s; }
.seg button .icon { width: 15px; height: 15px; }
.seg button.on { background: var(--bg-elevated); box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--fill-2); transition: background 0.25s; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform 0.35s var(--spring); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }

.check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--label-3); display: grid; place-items: center; color: #fff; flex: none; transition: 0.2s; }
.check .icon { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.on > .check, .check.on { background: var(--accent); border-color: var(--accent); }
.on > .check .icon, .check.on .icon { opacity: 1; }
.perm { font-size: 13px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 5px 10px; border-radius: 13px; flex: none; }
.perm.view { color: var(--label-2); background: var(--fill); }

.swatches { display: flex; gap: 12px; flex-wrap: wrap; padding: 14px 16px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--tone); position: relative; transition: transform 0.3s var(--spring); }
.swatch.on::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2.5px solid var(--tone); }
.swatch:active { transform: scale(0.88); }
.symbols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 14px 16px; }
.symbols button { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--label-2); transition: 0.2s; }
.symbols button .icon { width: 22px; height: 22px; }
.symbols button.on { background: var(--tone); color: #fff; }

.error-text { color: var(--red); font-size: 15px; text-align: center; margin: 0 0 14px; min-height: 1px; }

/* ---------- sheets & alerts ---------- */

.overlay { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); opacity: 0; transition: opacity 0.4s var(--ease); pointer-events: auto; }
.overlay.open .scrim { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--safe-top) - 14px);
  display: flex; flex-direction: column; pointer-events: auto;
  background: var(--bg); border-radius: 30px 30px 0 0; box-shadow: var(--sheet-shadow);
  transform: translateY(100%); transition: transform 0.5s var(--ease);
}
.sheet.tall { height: calc(100% - var(--safe-top) - 14px); }
.overlay.open .sheet { transform: none; }
.sheet .grab { position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--label-3); z-index: 3; }
.sheet .topbar { position: relative; padding-top: 14px; }
.sheet .topbar::before { display: none; }
.sheet .topbar .mini-title { opacity: 1; transform: none; }
.sheet .scroll-inner { padding: 6px 16px calc(var(--safe-bottom) + 28px); }
@media (min-width: 700px) {
  .sheet { left: 50%; top: 50%; bottom: auto; width: min(560px, calc(100% - 48px)); max-height: min(780px, calc(100% - 60px)); border-radius: 30px; transform: translate(-50%, -46%) scale(0.94); opacity: 0; transition: transform 0.45s var(--spring), opacity 0.25s; }
  .sheet.tall { height: min(780px, calc(100% - 60px)); }
  .overlay.open .sheet { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }
  .sheet .topbar { padding-top: 12px; }
}
@media (prefers-color-scheme: dark) { .sheet { background: #1c1c1e; } .sheet .list, .sheet .action, .sheet .cat { background: #2c2c2e; } .sheet .seg button.on { background: #636366; } }

.alert {
  position: absolute; left: 50%; top: 50%; width: min(300px, calc(100% - 60px)); transform: translate(-50%, -50%) scale(1.12); opacity: 0;
  border-radius: 26px; padding: 22px 18px 16px; text-align: center; pointer-events: auto; transition: transform 0.4s var(--spring), opacity 0.2s;
  background: var(--glass-strong);
}
.overlay.open .alert { transform: translate(-50%, -50%); opacity: 1; }
.alert h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.alert p { margin: 0 0 18px; font-size: 14px; color: var(--label-2); line-height: 1.4; }
.alert .btns { display: flex; flex-direction: column; gap: 8px; }
.alert .btns.two { flex-direction: row-reverse; }
.alert .btns .btn { height: 46px; flex: 1; font-size: 16px; box-shadow: none; }

.popover { position: absolute; min-width: 230px; border-radius: 18px; padding: 6px; pointer-events: auto; transform-origin: top right; transform: scale(0.85); opacity: 0; transition: transform 0.35s var(--spring), opacity 0.18s; background: var(--glass-strong); }
.overlay.open .popover { transform: none; opacity: 1; }
.popover button { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; padding: 11px 12px; border-radius: 11px; font-size: 16px; text-align: left; }
.popover button:hover, .popover button:active { background: var(--fill); }
.popover button.danger { color: var(--red); }
.popover hr { border: 0; height: 0.5px; background: var(--sep); margin: 4px 8px; }

.toast {
  position: fixed; z-index: 80; left: 50%; top: calc(var(--safe-top) + 12px); transform: translate(-50%, -140%); opacity: 0;
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 14px; border-radius: 22px; font-size: 15px; font-weight: 600;
  transition: transform 0.5s var(--spring), opacity 0.3s; pointer-events: none; white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast .icon { width: 20px; height: 20px; color: var(--green); stroke-width: 2.6; }
.toast.err .icon { color: var(--red); }

/* ---------- onboarding ---------- */

.welcome { position: fixed; inset: 0; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-top) + 30px) 24px calc(var(--safe-bottom) + 30px); }
.welcome::before {
  content: ''; position: fixed; inset: -20%; z-index: -1;
  background:
    radial-gradient(42% 36% at 22% 18%, color-mix(in srgb, #3d5fc4 40%, transparent), transparent 70%),
    radial-gradient(34% 30% at 82% 28%, color-mix(in srgb, var(--brand-red) 22%, transparent), transparent 70%),
    radial-gradient(46% 36% at 60% 88%, color-mix(in srgb, var(--navy) 34%, transparent), transparent 70%), var(--bg);
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(4%, -3%, 0) rotate(6deg); } }
.welcome .card { width: 100%; max-width: 400px; border-radius: 36px; padding: 40px 28px 26px; text-align: center; animation: rise 0.8s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
.welcome .mark { width: 92px; height: 92px; border-radius: 24px; margin: 0 auto 22px; display: block; box-shadow: 0 16px 40px rgba(31, 47, 99, 0.35); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); } }
.welcome h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 6px; }
.welcome .lede { color: var(--label-2); font-size: 16px; margin: 0 0 28px; line-height: 1.4; }
.welcome .form { text-align: left; }
.welcome .list { background: color-mix(in srgb, var(--card) 70%, transparent); margin-bottom: 16px; }
.welcome .fine { color: var(--label-2); font-size: 13px; margin: 18px 0 0; display: flex; align-items: center; justify-content: center; gap: 2px; }
.welcome .done-check { width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 22px; display: grid; place-items: center; background: var(--green); color: #fff; animation: pop 0.6s var(--spring) both; }
.welcome .done-check .icon { width: 48px; height: 48px; stroke-width: 2.6; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot img { width: 72px; height: 72px; border-radius: 18px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(0.94); opacity: 0.75; } }

/* ---------- activity ---------- */

.event .grow .t { white-space: normal; font-size: 16px; }
.event .grow .t b { font-weight: 600; }
.event .when { font-size: 13px; color: var(--label-2); flex: none; align-self: flex-start; margin-top: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- desktop list header ---------- */
.list-head { flex: none; }
.lh-row { display: flex; align-items: center; gap: 8px; margin: 0 2px 12px; min-height: 40px; }
.lh-row h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.lh-count { color: var(--label-2); font: 600 15px var(--rounded); padding-top: 5px; }
.lh-row .gbtn { height: 36px; width: 36px; color: var(--accent); }
.lh-row .gbtn.tint { color: #fff; }
.lh-row .gbtn:not(.tint):hover { background: var(--fill); }
.spacer { flex: 1; }
.scroll-inner.tight { padding: 2px 10px 30px; }
.scroll-inner.tight .list { background: transparent; border-radius: 0; }
.scroll-inner.tight .item-list .row { border-radius: 14px; }
.scroll-inner.tight .item-list .row + .row::before { left: 70px; right: 12px; }
.scroll-inner.readable { max-width: 760px; }
.list-head .seg { margin: 0 0 10px; }
.pane-list .scroll-inner.tight .row:hover:not(.sel) { background: var(--fill); }
.row > .icon { color: var(--accent); width: 22px; height: 22px; margin: 0 4px 0 4px; }
.row.accent .grow.t { color: var(--accent); }
.row .link.danger { font-size: 15px; }
.row .tool { color: var(--accent); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 17px; flex: none; }
.row .tool .icon { width: 20px; height: 20px; }
.chips .s { margin: 0 4px 0 0; flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.item-list .chips { align-items: center; }
.welcome .btn.wide + .fine { margin-top: 20px; }
.welcome .list.form .row > .lbl { width: 98px; }
.gbtn.glass:not(.tint) { color: var(--label); }
.topbar .gbtn.glass:not(.round) { color: var(--accent); }
.sheet .topbar .gbtn.glass:not(.tint) { color: var(--label); background: var(--fill); box-shadow: none; border-color: transparent; }
.gbtn[disabled] { opacity: 0.4; pointer-events: none; }
.side-foot { flex: none; padding: 8px 12px 12px; border-top: 0.5px solid var(--sep); }
.side-foot .row { border-radius: 12px; min-height: 52px; padding: 8px 10px; }
.side-foot .row:hover { background: var(--fill); }
@media (min-width: 900px) and (prefers-color-scheme: dark) { .pane-detail .list, .pane-detail .action { background: #1c1c1e; } }
.shell.wide-list .list-head, .shell.wide-list .scroll-inner.readable { max-width: 760px; width: 100%; margin-left: auto; margin-right: auto; }
.shell.wide-list .list-head { padding-left: 26px; padding-right: 26px; }
/* "All" spans the full row above the 2×2 categories */
.cat.wide { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; grid-template-rows: auto; align-items: center; column-gap: 12px; }
.cat.wide .name { grid-column: 2; grid-row: 1; color: var(--label); font-size: 17px; }
.cat.wide .count { grid-column: 3; grid-row: 1; }
.cat.wide.on .name { color: #fff; }

/* ---------- club link, codes, badges ---------- */
.pill { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--red); color: #fff; font: 600 13px/22px var(--rounded); text-align: center; }
.row.sel .pill { background: #fff; color: var(--accent); }
.code-input { display: block; width: 100%; height: 64px; border: 0; outline: 0; border-radius: 18px; background: color-mix(in srgb, var(--card) 70%, transparent); text-align: center; font: 600 32px/1 var(--mono); letter-spacing: 0.4em; padding-left: 0.4em; margin: 0 0 14px; font-variant-numeric: tabular-nums; }
.code-input::placeholder { color: var(--label-3); }
.code-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.code-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }
.code-links .link { font-size: 15px; }
.link[disabled] { color: var(--label-3); pointer-events: none; }
.welcome .list.form .row > .icon { color: var(--label-2); }
.qr-card { background: #fff; border-radius: 26px; padding: 22px 22px 16px; margin: 4px auto 22px; max-width: 290px; box-shadow: 0 14px 40px rgba(31, 47, 99, 0.18); text-align: center; transition: opacity 0.3s, filter 0.3s; }
.qr-card.off { opacity: 0.35; filter: grayscale(1); }
.qr { width: 100%; display: block; }
.qr path { fill: #1f2f63; }
.qr-caption { color: #1f2f63; font-weight: 600; font-size: 15px; margin-top: 10px; }
.welcome .code-signin { display: block; margin: 14px auto 0; font-size: 16px; }
.step { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent); color: #fff; font: 600 15px/1 var(--rounded); }
.row .t b { font-weight: 600; }
