/* ZSG Cards — "Liquid Glass" styling: translucent, blurred surfaces floating over a soft color field. */

:root {
  --bg: #eef1f6;
  --blob-1: #8ec5ff;
  --blob-2: #b5f2d2;
  --blob-3: #f7c8e6;
  --text: #0b0c0f;
  --muted: rgba(60, 60, 67, .62);
  --faint: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .14);
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-shine: rgba(255, 255, 255, .9);
  --glass-shadow: 0 10px 34px rgba(31, 41, 74, .10), 0 1px 3px rgba(31, 41, 74, .06);
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --tint: #007aff;
  --tint-text: #ffffff;
  --gain: #1f9d55;
  --loss: #e5352b;
  --warn: #c77700;
  --blur: blur(28px) saturate(185%);
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --tab-h: 62px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07080b;
    --blob-1: #1d4ed8;
    --blob-2: #047857;
    --blob-3: #7e22ce;
    --text: #f5f5f7;
    --muted: rgba(235, 235, 245, .6);
    --faint: rgba(235, 235, 245, .3);
    --sep: rgba(235, 235, 245, .12);
    --glass: rgba(38, 40, 48, .5);
    --glass-strong: rgba(44, 46, 56, .72);
    --glass-edge: rgba(255, 255, 255, .12);
    --glass-shine: rgba(255, 255, 255, .16);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, .45);
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .36);
    --tint: #0a84ff;
    --gain: #30d158;
    --loss: #ff453a;
    --warn: #ff9f0a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #07080b;
  --blob-1: #1d4ed8;
  --blob-2: #047857;
  --blob-3: #7e22ce;
  --text: #f5f5f7;
  --muted: rgba(235, 235, 245, .6);
  --faint: rgba(235, 235, 245, .3);
  --sep: rgba(235, 235, 245, .12);
  --glass: rgba(38, 40, 48, .5);
  --glass-strong: rgba(44, 46, 56, .72);
  --glass-edge: rgba(255, 255, 255, .12);
  --glass-shine: rgba(255, 255, 255, .16);
  --glass-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  --fill: rgba(118, 118, 128, .24);
  --fill-2: rgba(118, 118, 128, .36);
  --tint: #0a84ff;
  --gain: #30d158;
  --loss: #ff453a;
  --warn: #ff9f0a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
a { color: var(--tint); text-decoration: none; }

/* Soft color field the glass floats over */
.ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.ambient i:nth-child(1) { width: 70vmax; height: 70vmax; background: var(--blob-1); top: -30vmax; left: -25vmax; }
.ambient i:nth-child(2) { width: 60vmax; height: 60vmax; background: var(--blob-2); top: 25vh; right: -30vmax; }
.ambient i:nth-child(3) { width: 55vmax; height: 55vmax; background: var(--blob-3); bottom: -30vmax; left: -10vmax; opacity: .4; }

/* The glass material */
.glass, .card, .tile, .pill, .fab, .toast, .seg, .chips button, .btn, .notice {
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.glass, .card, .tile {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-shine);
}

.shell {
  position: relative; z-index: 1;
  max-width: 720px; margin: 0 auto;
  padding: 0 16px calc(var(--tab-h) + 40px + env(safe-area-inset-bottom));
}

/* Header: compact glass bar on scroll + big title, like iOS */
header.top { position: sticky; top: 0; z-index: 6; margin: 0 -16px; padding: 0 8px; pointer-events: none; }
header.top .bar {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px; min-height: 52px;
  padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
  border-radius: 0 0 22px 22px;
  transition: background .25s, box-shadow .25s;
}
html.scrolled header.top .bar {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .08), inset 0 -1px 0 var(--sep);
}
header.top .mini { flex: 1; text-align: center; font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.scrolled header.top .mini { opacity: 1; }
header.top .side { min-width: 72px; display: flex; }
header.top .side.r { justify-content: flex-end; }
header.top .back {
  display: inline-flex; align-items: center; gap: 2px;
  font: inherit; font-size: 17px; color: var(--tint); background: none; border: 0; padding: 6px 6px; cursor: pointer;
}
header.top .back svg { width: 22px; height: 22px; }
h1.large .brand {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18), inset 0 0 0 1px rgba(255, 255, 255, .2);
}
h1.large { display: flex; align-items: center; gap: 12px; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; margin: 2px 4px 16px; }

/* Floating tab bar + separate add button (iOS 26 style) */
nav.tabbar {
  position: fixed; z-index: 10; left: 0; right: 0;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; gap: 10px; padding: 0 16px; pointer-events: none;
}
nav.tabbar .pill, nav.tabbar .fab { pointer-events: auto; }
.pill {
  flex: 1; max-width: 420px; height: var(--tab-h);
  display: flex; align-items: center; padding: 5px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-shine);
}
.pill a {
  flex: 1; height: 100%; border-radius: 999px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--text); font-size: 10.5px; font-weight: 600; letter-spacing: 0;
  transition: background .2s, color .2s;
}
.pill a svg { width: 24px; height: 24px; }
.pill a.on { color: var(--tint); background: var(--fill); }
.fab {
  width: var(--tab-h); height: var(--tab-h); flex: none; border-radius: 50%;
  display: grid; place-items: center; color: var(--tint-text);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tint) 80%, white), var(--tint));
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--tint) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.fab svg { width: 28px; height: 28px; }

/* Cards (inset grouped sections) */
.card { border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 13px; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; display: flex; justify-content: space-between; align-items: baseline; }
.card h2 .right, .card h2 a { text-transform: none; letter-spacing: -.01em; font-weight: 500; font-size: 15px; }
.card h2 a { color: var(--tint); }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 22px 4px 10px; display: flex; justify-content: space-between; align-items: baseline; }
.section-title a { font-size: 15px; font-weight: 500; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile { border-radius: var(--r-lg); padding: 14px 16px; min-width: 0; color: inherit; display: block; }
.tile.wide { grid-column: 1 / -1; padding: 18px; }
.tile .label { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tile .label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tint); }
.tile .value {
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif;
  font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
}
.tile.wide .value { font-size: 40px; }
.tile .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

.gain { color: var(--gain); }
.loss { color: var(--loss); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.warn { color: var(--warn); }

/* Search field (Google-simple entry point) */
.searchbox {
  display: flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 14px; margin-bottom: 14px;
  border-radius: 999px; background: var(--glass-strong);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-shine);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.searchbox svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.searchbox input { border: 0; background: none; padding: 0; height: 100%; outline: none; box-shadow: none; }
.searchbox input:focus { outline: none; }

/* Quick actions */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); font-size: 12px; font-weight: 600; text-align: center; }
.quick a .q {
  width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; color: var(--qc, var(--tint));
  background: var(--glass); border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-shine);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.quick a .q svg { width: 26px; height: 26px; }

/* Lists */
.list { margin: 0; padding: 0; list-style: none; }
.row {
  display: flex; align-items: center; gap: 12px; position: relative;
  padding: 12px 2px; color: inherit; cursor: pointer;
}
.row + .row::before, .row + div > .row::before, div + div > .row::before { content: ""; position: absolute; top: 0; left: 2px; right: 0; height: 1px; background: var(--sep); }
.list > :first-child .row::before { display: none; }
.row:active { opacity: .6; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row .amt { text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .amt .s { text-align: right; }
.row .chev { color: var(--faint); font-size: 20px; line-height: 1; }
.row .icon {
  width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; color: #fff;
  background: var(--ic, var(--tint));
}
.row .icon svg { width: 20px; height: 20px; }

.chip {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: var(--fill); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.chip.sold { color: var(--gain); background: color-mix(in srgb, var(--gain) 14%, transparent); }
.chip.grading { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.chip.listed { color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, transparent); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--glass-edge); background: var(--glass); color: var(--text);
  border-radius: 999px; padding: 7px 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05), inset 0 1px 0 var(--glass-shine);
}
.chips button.on { background: var(--text); color: var(--bg); border-color: transparent; }

.group-h {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-weight: 600; padding: 13px 2px; cursor: pointer; position: relative;
}
.group-h + .group-h::before, div + div > .group-h::before { content: ""; position: absolute; top: 0; left: 2px; right: 0; height: 1px; background: var(--sep); }
.group-h .muted { font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; }
.group-h .caret { display: inline-block; color: var(--faint); transition: transform .2s; margin-right: 6px; }
.group-h .caret.open { transform: rotate(90deg); }

/* Forms */
input, select, textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--text);
  background: var(--fill); border: 1px solid transparent; border-radius: var(--r-sm); padding: 11px 13px;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--tint); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tint) 18%, transparent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.search { margin-bottom: 10px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.toolbar select, .toolbar input { flex: 1; padding: 9px 12px; font-size: 15px; background-color: var(--glass); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.toolbar select { padding-right: 30px; }

/* Buttons: capsules */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 17px; border-radius: 999px; padding: 13px 20px; cursor: pointer;
  border: 1px solid var(--glass-edge); background: var(--glass); color: var(--tint);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05), inset 0 1px 0 var(--glass-shine);
  transition: transform .12s;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  color: var(--tint-text); border-color: rgba(255, 255, 255, .3);
  background: linear-gradient(170deg, color-mix(in srgb, var(--tint) 82%, white), var(--tint));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--tint) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn.danger { color: var(--loss); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 14px; font-size: 15px; }
.btn.plain { background: var(--fill); border-color: transparent; box-shadow: none; }
.btn:disabled { opacity: .5; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.actions .btn { flex: 1; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; position: relative; font-variant-numeric: tabular-nums; }
.kv + .kv::before { content: ""; position: absolute; top: 0; left: 2px; right: 0; height: 1px; background: var(--sep); }
.kv.total { font-weight: 700; font-size: 20px; margin: 2px 0 6px; padding-top: 14px; }
.kv .k { color: var(--muted); }
.kv .del { background: var(--fill); border: 0; color: var(--muted); cursor: pointer; width: 22px; height: 22px; border-radius: 50%; margin-left: 8px; font-size: 14px; line-height: 22px; padding: 0; }

.hero { margin: 0 4px 16px; }
.hero .player { color: var(--muted); font-weight: 600; font-size: 15px; }
.hero .title { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -.022em; margin: 4px 0 10px; }
.hero .big { font-family: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; font-size: 40px; font-weight: 700; letter-spacing: -.02em; }

.bars .b { padding: 8px 2px; cursor: pointer; }
.bars .b .top { display: flex; justify-content: space-between; font-size: 15px; gap: 8px; }
.bars .b .top .n { font-weight: 600; }
.bars .b .track { height: 8px; background: var(--fill); border-radius: 999px; margin-top: 7px; overflow: hidden; }
.bars .b .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--gain) 60%, white), var(--gain)); }
.bars .b .fill.neg { background: linear-gradient(90deg, color-mix(in srgb, var(--loss) 60%, white), var(--loss)); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.t th { text-align: right; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 3px 8px; }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t td { text-align: right; padding: 10px 3px; border-top: 1px solid var(--sep); white-space: nowrap; }
table.t td:first-child { white-space: normal; min-width: 80px; font-weight: 600; }
table.t tr.click { cursor: pointer; }
.scroll-x { overflow-x: auto; }

.balance { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 2px; cursor: pointer; position: relative; }
.balance + .balance::before { content: ""; position: absolute; top: 0; left: 2px; right: 0; height: 1px; background: var(--sep); }
.balance .who { font-weight: 600; display: flex; align-items: center; gap: 10px; }
.balance .amt { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: #fff; background: var(--av, #8e8e93);
}

.notice { background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 20;
  bottom: calc(var(--tab-h) + 26px + env(safe-area-inset-bottom));
  background: var(--glass-strong); color: var(--text); border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow); padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  animation: pop .25s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px) scale(.96); } }

.seg { display: flex; background: var(--fill); border-radius: 999px; padding: 3px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer; transition: background .2s; }
.seg button.on { background: var(--glass-strong); box-shadow: 0 3px 10px rgba(0, 0, 0, .1), inset 0 1px 0 var(--glass-shine); }
.split-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.split-row span { flex: 1; }
.split-row input { width: 96px; }

@media (min-width: 700px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tile.wide { grid-column: span 2; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: var(--glass-strong); }
}
