:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-soft: #eef3f8;
  --ink: #17202f;
  --muted: #697386;
  --line: #dbe2ea;
  --accent: #147c7c;
  --accent-dark: #0f5f60;
  --gold: #c9962f;
  --red: #c94f4f;
  --shadow: 0 18px 45px rgba(35, 49, 72, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

/* ─── Layout ─────────────────────────────────────────────── */

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────── */

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 24px 20px;
  background: #080f1e;
  color: #ffffff;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.brand-sub {
  color: #8fa8c8;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-value {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-value > strong {
  display: block;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.sidebar-value > span {
  color: #4d6278;
  font-size: 0.8rem;
}

.sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.sidebar-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-stats span {
  color: #4d6278;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-stats strong {
  color: #cdd7e6;
  font-size: 0.95rem;
  font-weight: 700;
}


.nav-tabs {
  display: grid;
  gap: 4px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.nav-tab {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #aab6c8;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
}

.nav-tab.active {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

/* ─── Content area ───────────────────────────────────────── */

.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* ─── Topbar (unified sticky header) ────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 20px 28px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.topbar-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.portfolio-header-stats {
  display: flex;
  gap: 32px;
  align-items: flex-end;
  flex-shrink: 0;
}

.portfolio-header-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.portfolio-header-stat span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.portfolio-header-stat strong {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}

.portfolio-header-stat:first-child strong {
  font-size: 2rem;
}

.topbar-title .eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-title h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Toolbar row — lives inside topbar */
.topbar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
}

.topbar-portfolio-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
}

.portfolio-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.topbar-toolbar.hidden,
.topbar-portfolio-actions.hidden,
.portfolio-header-stats.hidden {
  display: none;
}

/* ─── Views ──────────────────────────────────────────────── */

.view {
  display: none;
  padding: 24px 28px;
  flex: 1;
}

.view.active {
  display: block;
}

/* ─── Toolbar inputs ─────────────────────────────────────── */

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-box,
.select-box {
  display: grid;
  gap: 6px;
}

.search-box {
  flex: 1;
}

.search-box span,
.select-box span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.9rem;
}

input {
  padding: 0 12px;
}

select {
  padding: 0 32px 0 12px;
  appearance: none;
  -webkit-appearance: none;
  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 1l5 5 5-5' stroke='%23697386' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.filter-box {
  position: relative;
  min-width: 150px;
}

.filter-menu {
  position: relative;
}

.filter-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  font-size: 0.9rem;
}

.filter-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu summary::after {
  content: "⌄";
  color: var(--muted);
  font-weight: 900;
}

.filter-menu[open] summary {
  border-color: var(--accent);
}

.filter-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 5;
  display: grid;
  width: max-content;
  min-width: 100%;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--ink);
  white-space: nowrap;
}

.filter-option:hover {
  background: var(--panel-soft);
}

.filter-option input {
  width: auto;
  min-height: auto;
}

/* ─── Card grid ──────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.card-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-art {
  display: grid;
  position: relative;
  min-height: 172px;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(20, 124, 124, 0.88), rgba(201, 150, 47, 0.74)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12) 10px, transparent 10px, transparent 20px);
  color: #ffffff;
}

.card-image {
  display: none;
  width: 100%;
  height: 220px;
  object-fit: contain;
  padding: 10px;
}

.card-art.has-image {
  background: #e8edf3;
}

.card-art.has-image .card-image {
  display: block;
}

.card-art.has-image .card-initials {
  display: none;
}

.card-code {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
}

.card-code[data-variant="Super Parallel"] {
  background: rgba(0, 0, 0, 0.28);
  color: #e8c96a;
  border: 1px solid rgba(232, 201, 106, 0.7);
}

.card-code[data-variant="Parallel"] {
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
}

.card-code-star {
  color: #e8c96a;
}

.card-code[data-variant="Parallel"] .card-code-star {
  color: #ffffff;
}

.card-initials {
  display: grid;
  width: 86px;
  height: 118px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.62);
  border-radius: 7px;
  background: rgba(12, 24, 38, 0.28);
  font-size: 2.2rem;
}

.card-body {
  padding: 16px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title-row h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.card-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Collapsible effect text */
.card-text {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  overflow: hidden;
}

.card-text.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.card-text-toggle {
  display: inline-block;
  margin: 4px 0 12px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.card-text-toggle:hover {
  text-decoration: underline;
}

/* Rarity pill — color-coded by tier */
.rarity-pill {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.rarity-pill[data-rarity="SEC"] {
  background: #fef08a;
  color: #713f12;
}

.rarity-pill[data-rarity="SP"] {
  background: #111;
  color: #e8c96a;
}

.rarity-pill[data-rarity="SR"] {
  background: #e2e8f0;
  color: #334155;
}

.rarity-pill[data-rarity="R"] {
  background: #eaf5ea;
  color: #237a23;
}

.rarity-pill[data-rarity^="P-"] {
  background: #fde68a;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.rarity-pill[data-rarity="C"],
.rarity-pill[data-rarity="UC"],
.rarity-pill[data-rarity="L"],
.rarity-pill[data-rarity="DON"],
.rarity-pill:not([data-rarity]) {
  background: #e5e7eb;
  color: #4b5563;
}

/* Price — hero stat */
.price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  /* qty controls and sparkline are now in .card-footer-row below */
}

.price-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.price-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1px;
}

.price-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.price {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.price-change {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.price-up {
  color: #16a34a;
}

.price-down {
  color: #dc2626;
}

.cardrush-price {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Quantity controls */
.search-quantity,
.quantity-control {
  display: grid;
  grid-template-columns: 28px 36px 28px;
  align-items: center;
  gap: 4px;
}

.search-quantity {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.search-quantity button {
  min-height: 28px;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 700;
}

.search-quantity .qty-plus {
  border-color: transparent;
  background: var(--ink);
  color: #ffffff;
}

.search-quantity .qty-plus:hover {
  background: #2a3a52;
}

.search-quantity .qty-minus {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

.search-quantity .qty-minus:hover:not(:disabled) {
  background: var(--line);
}

.search-quantity .qty-minus:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.search-quantity .qty-value {
  font-size: 0.9rem;
  text-align: center;
}

/* ─── Portfolio card tile extras ────────────────────────── */

.portfolio-qty-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.portfolio-total {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.portfolio-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  align-self: flex-end;
}

.portfolio-remove:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fef2f2;
}

/* ─── Portfolio view ─────────────────────────────────────── */

.price-source-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.price-source-toggle button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
}

.price-source-toggle button.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(23, 32, 47, 0.08);
}

.secondary-button,
.remove-button,
.quantity-control button {
  min-height: 36px;
  border-radius: 8px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.portfolio-list {
  display: grid;
  gap: 10px;
}

.portfolio-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 128px 110px 86px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.mini-art {
  display: grid;
  width: 58px;
  height: 76px;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #ffffff;
  font-weight: 900;
  overflow: hidden;
}

.mini-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-main {
  min-width: 0;
}

.portfolio-main h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.portfolio-main p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.quantity-control button {
  min-height: 34px;
}

.qty-value,
.line-value {
  text-align: center;
}

.remove-button {
  color: var(--red);
}

/* ─── Misc ───────────────────────────────────────────────── */

.empty-state {
  grid-column: 1 / -1;
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.load-more-sentinel {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

/* ─── Sidebar user widget ────────────────────────────────── */

.sidebar-user {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.user-prompt {
  margin: 0 0 10px;
  color: #4d6278;
  font-size: 0.75rem;
  line-height: 1.4;
}

.btn-signin {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: transparent;
  color: #cdd7e6;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-signin:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.user-avatar {
  display: grid;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
}

.user-email {
  color: #cdd7e6;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.btn-signout {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: transparent;
  color: #4d6278;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-signout:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: #aab6c8;
}

.sidebar-last-updated {
  margin: 14px 0 0;
  color: #3d5470;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-last-updated span {
  color: #6b8aaa;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

/* ─── Auth modal ─────────────────────────────────────────── */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 16, 26, 0.7);
  backdrop-filter: blur(4px);
  padding: 16px;
}

.auth-overlay[hidden] {
  display: none;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 32px 80px rgba(10, 16, 26, 0.4);
}

.auth-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.auth-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.auth-close:hover {
  background: var(--panel-soft);
}

.auth-sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-google:hover {
  background: var(--panel-soft);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.auth-field label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.85rem;
}

.auth-error[hidden] {
  display: none;
}

.btn-primary {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-switch {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.auth-link {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}

.auth-link:hover {
  text-decoration: underline;
}

/* ─── Insights nav sub-item ──────────────────────────────── */

.nav-tab-sub {
  padding-left: 28px;
  font-size: 0.84rem;
  color: #7a8fa8;
}

.nav-tab-sub.active {
  color: #ffffff;
}

.nav-tab-binder {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e2c97e;
}

.nav-tab-binder svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-tab-binder:hover {
  color: #f0da9a;
}

.nav-tab-binder.active {
  border-color: rgba(226, 201, 126, 0.25);
  background: rgba(226, 201, 126, 0.08);
  color: #f0da9a;
}

.nav-tab-help {
  margin-top: 8px;
  color: #566475;
  font-size: 0.84rem;
}

.nav-tab-help:hover {
  color: #aab6c8;
}

.mobile-filter-toggle {
  display: none;
}

.faq-card {
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 32px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 32px 80px rgba(10, 16, 26, 0.4);
}

.faq-body {
  overflow-y: auto;
  margin-top: 20px;
  padding-right: 4px;
}

.faq-section {
  margin-bottom: 28px;
}

.faq-section:last-child {
  margin-bottom: 0;
}

.faq-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.faq-section-text {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 8px 0 10px;
  line-height: 1.6;
}

.faq-steps {
  margin: 8px 0 0;
  padding: 0 0 0 18px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.8;
}

.faq-steps li {
  margin-bottom: 4px;
}

.faq-steps strong {
  color: var(--ink);
}

.faq-note {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--panel-soft);
  border-left: 3px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* ─── Insights page ──────────────────────────────────────── */

.insights-section {
  margin-bottom: 48px;
}

.insights-section-header {
  margin-bottom: 20px;
}

.insights-heading {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.insights-section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Podium — top 3 */

.insights-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 12px;
}

.insights-podium:empty {
  display: none;
}

.insights-podium-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.insights-podium-card[data-rank="1"] {
  border-color: rgba(200, 134, 10, 0.45);
  box-shadow: var(--shadow), 0 0 0 2px rgba(200, 134, 10, 0.13);
}

.insights-podium-card[data-rank="2"] {
  border-color: rgba(138, 138, 138, 0.5);
  box-shadow: var(--shadow), 0 0 0 2px rgba(138, 138, 138, 0.15);
}

.insights-podium-card[data-rank="3"] {
  border-color: rgba(160, 95, 35, 0.45);
  box-shadow: var(--shadow), 0 0 0 2px rgba(160, 95, 35, 0.13);
}

.insights-podium-art {
  min-height: 160px;
}

.insights-podium-body {
  padding: 14px 16px 16px;
}

.insights-podium-name {
  margin: 0 0 3px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.insights-podium-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.75rem;
}

.insights-podium-value {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* Medal badge */

.insights-medal {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 900;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  line-height: 1;
}

.insights-medal-gold {
  background: linear-gradient(145deg, #ffe066, #c8860a);
  border: 1.5px solid rgba(255, 224, 102, 0.9);
  color: #3d2200;
}

.insights-medal-silver {
  background: linear-gradient(145deg, #ececec, #8a8a8a);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  color: #222;
}

.insights-medal-bronze {
  background: linear-gradient(145deg, #e8a96a, #8b4b1a);
  border: 1.5px solid rgba(232, 169, 106, 0.8);
  color: #fff;
}

/* Ranked list — ranks 4+ */

.insights-list {
  display: grid;
  gap: 8px;
}

.insights-list:empty {
  display: none;
}

.insights-list-row {
  display: grid;
  grid-template-columns: 28px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.insights-list-rank {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}

.insights-list-art {
  width: 44px;
  height: 58px;
  border-radius: 5px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  flex-shrink: 0;
}

.insights-list-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.insights-list-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.insights-list-name {
  font-size: 0.88rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insights-list-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

.insights-list-value {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ─── app-shell hidden override (public binder mode) ────── */

.app-shell[hidden] {
  display: none;
}

/* ─── Portfolio card — binder toggle ────────────────────── */

.portfolio-card-actions {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.portfolio-binder-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.portfolio-binder-toggle svg {
  fill: none;
  transition: fill 0.12s ease;
}

.portfolio-binder-toggle:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: #fffbeb;
}

.portfolio-binder-toggle.in-binder {
  border-color: var(--gold);
  color: var(--gold);
  background: #fffbeb;
}

.portfolio-binder-toggle.in-binder svg {
  fill: currentColor;
}

.portfolio-binder-toggle.binder-gated {
  opacity: 0.4;
}

.portfolio-binder-toggle.binder-gated:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(20, 124, 124, 0.06);
  opacity: 1;
}

/* ─── Binder topbar toolbar ──────────────────────────────── */

.topbar-binder-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
}

.topbar-binder-actions.hidden {
  display: none;
}

.binder-name-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.binder-name-wrap,
.binder-sub-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.binder-name-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.binder-sub-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.binder-name-input {
  width: 200px;
}

.binder-sub-input {
  width: 280px;
  min-height: 32px;
  font-size: 0.8rem;
}

.binder-name-input[hidden],
.binder-sub-input[hidden] {
  display: none;
}

.binder-edit-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  display: grid;
  place-items: center;
  opacity: 0.5;
}

.binder-edit-btn:hover {
  background: var(--panel-soft);
  color: var(--accent);
  opacity: 1;
}

.binder-edit-btn-sm {
  width: 20px;
  height: 20px;
}

.binder-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-share-binder {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #c9a84c;
  border-radius: 7px;
  background: #e2c97e;
  color: #4a2e00;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.btn-share-binder:hover {
  background: #f0da9a;
  border-color: #b8922e;
}

.share-url-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-url-wrap[hidden] {
  display: none;
}

.share-url-input {
  width: 260px;
  min-height: 36px;
  border-color: var(--accent);
  color: var(--muted);
  font-size: 0.78rem;
  background: rgba(20, 124, 124, 0.04);
  cursor: text;
}

.share-copied-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #16a34a;
  white-space: nowrap;
}

.share-copied-badge[hidden] {
  display: none;
}

/* ── QR Modal ────────────────────────────────────────────────────────────── */

.qr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.qr-modal-overlay[hidden] {
  display: none;
}

.qr-modal {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 28px 24px;
  width: min(340px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.qr-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
}

.qr-modal-close:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.qr-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.qr-modal-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  text-align: center;
}

.qr-image-wrap {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  line-height: 0;
}

.qr-canvas canvas,
.qr-canvas img {
  width: 200px !important;
  height: 200px !important;
  display: block;
}

.qr-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.qr-url-row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.qr-url-input {
  flex: 1;
  min-height: 34px;
  font-size: 0.72rem;
  color: var(--muted);
  border-color: var(--line);
  background: var(--bg-alt);
  cursor: text;
  border-radius: 7px;
  padding: 0 8px;
  border: 1px solid var(--line);
  outline: none;
  min-width: 0;
}

.qr-copy-btn {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: #ffffff;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.qr-copy-btn:hover {
  background: var(--accent);
  color: #ffffff;
}

.qr-download-btn {
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.qr-download-btn:hover {
  color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────────── */

.binder-price-toggle {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: #c0ccd8;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.binder-price-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.binder-price-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(20, 124, 124, 0.06);
}

/* ─── Binder card ────────────────────────────────────────── */

.binder-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.binder-price-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.binder-price-section.hidden {
  display: none;
}

.binder-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  align-self: flex-end;
}

.binder-remove:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fef2f2;
}

/* ─── Public binder shell ────────────────────────────────── */

#publicBinderShell[hidden] {
  display: none;
}

#publicBinderShell {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.public-binder-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 32px;
  background: #080f1e;
  color: #ffffff;
  flex-shrink: 0;
}

.public-binder-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.public-binder-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.public-binder-domain {
  font-size: 0.72rem;
  font-weight: 600;
  color: #3a8fa8;
  letter-spacing: 0.02em;
}

.public-binder-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.public-binder-price-source {
  font-size: 0.65rem;
  color: #4d6278;
  letter-spacing: 0.02em;
}

.public-binder-title {
  flex: 1;
  min-width: 0;
}

.public-binder-title .eyebrow {
  color: #4d6278;
  margin-bottom: 2px;
}

.public-binder-sub {
  margin: 4px 0 0;
  color: #4d6278;
  font-size: 0.82rem;
}

.public-binder-title h1 {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-binder-header .binder-price-toggle {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.3);
}

.public-binder-header .binder-price-toggle:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: rgba(255, 255, 255, 0.7);
}

.public-binder-header .binder-price-toggle.active {
  border-color: var(--accent);
  color: #5ecfcf;
  background: rgba(20, 124, 124, 0.15);
}

.public-binder-content {
  padding: 28px 32px;
  flex: 1;
}

.public-binder-stats {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: #6b83a0;
  letter-spacing: 0.01em;
}

/* ─── Art-forward binder grid ────────────────────────────── */

.binder-art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.binder-art-card {
  border-radius: 10px;
  background: #ffffff;
  padding: 8px 8px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.binder-art-frame {
  position: relative;
  aspect-ratio: 5 / 7;
  background: #1a2535;
  border-radius: 6px;
  overflow: hidden;
}

.binder-art-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.binder-art-initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}


.binder-art-info {
  padding: 6px 4px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.binder-art-name-en {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.binder-art-name-jp {
  display: block;
  font-size: 0.62rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.binder-art-price {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
  margin-top: 5px;
}

/* ─── CTA strip (public binder footer) ──────────────────── */

.public-binder-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #080f1e;
  flex-shrink: 0;
}

.cta-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 32px;
  max-width: 960px;
  margin: 0 auto;
}

.cta-strip-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cta-strip-text strong {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.cta-strip-text span {
  font-size: 0.82rem;
  color: #4d6278;
}

.cta-strip-btn {
  flex-shrink: 0;
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.cta-strip-btn:hover {
  background: #0fa8a8;
  text-decoration: none;
}

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 8px 12px;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: unset;
    height: auto;
    align-self: start;
    overflow: visible;
  }

  .sidebar-value,
  .brand-sub {
    display: none;
  }

  .brand {
    margin-bottom: 0;
    flex-shrink: 0;
  }



  .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-width: 0;
    margin-top: 0;
    margin-left: 0;
    padding-top: 0;
    border-top: none;
    gap: 4px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .nav-tab-sub {
    padding-left: 8px;
  }

  .nav-tab-help {
    margin-top: 0;
  }

  .sidebar-last-updated {
    display: none;
  }

  .sidebar-user {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  .user-prompt,
  .user-avatar,
  .user-email,
  .sidebar-last-updated {
    display: none;
  }

  .btn-signin,
  .btn-signout {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: #d0d9e8;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    width: auto;
  }

  .btn-signin:hover,
  .btn-signout:hover {
    color: #ffffff;
  }

  .content {
    min-height: unset;
  }

  .topbar {
    padding: 12px 14px 0;
  }

  .topbar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-filter-toggle {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    flex-shrink: 0;
  }

  .mobile-filter-chevron {
    transition: transform 0.2s ease;
  }

  .mobile-filter-toggle.open .mobile-filter-chevron {
    transform: rotate(180deg);
  }

  .topbar-toolbar {
    flex-direction: column;
    align-items: stretch;
    display: none;
  }

  .topbar-toolbar.mobile-open {
    display: flex;
  }

  .topbar-toolbar.hidden,
  .topbar-portfolio-actions.hidden {
    display: none !important;
  }

  .topbar-portfolio-actions {
    flex-direction: column;
    align-items: stretch;
    display: none;
  }

  .topbar-portfolio-actions.mobile-open {
    display: flex;
  }

  .view {
    padding: 12px 14px;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .card-image {
    height: 150px;
  }

  .card-art {
    min-height: 120px;
  }

  .portfolio-item {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .quantity-control,
  .line-value,
  .remove-button {
    grid-column: 2;
  }

  .line-value {
    text-align: left;
  }

  .insights-podium {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  /* Public binder header — stack into two rows on mobile */
  .public-binder-header {
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 14px 18px;
  }

  /* Brand takes the first row left, controls sit right */
  .public-binder-brand {
    flex: 1;
    min-width: 0;
  }

  /* Hide brand text label on small screens, icon is enough */
  .public-binder-brand-text {
    display: none;
  }

  /* Controls row: align items horizontally */
  .public-binder-header-right {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  /* Hide the "Prices via Yuyutei" label — toggle icon says enough */
  .public-binder-price-source {
    display: none;
  }

  /* Title breaks onto its own full-width second row */
  .public-binder-title {
    width: 100%;
    flex: none;
  }

  /* Allow h1 to wrap rather than truncate on small screens */
  .public-binder-title h1 {
    white-space: normal;
    font-size: 1.35rem;
  }

  /* Tighten up sub text */
  .public-binder-sub {
    font-size: 0.78rem;
  }

  /* Reduce binder card grid to 2 columns minimum */
  .binder-art-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .public-binder-content {
    padding: 16px 18px;
  }
}

/* ─── Sparklines ─────────────────────────────────────────── */

.card-footer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.price-sparkline {
  display: block;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  border-radius: 3px;
  opacity: 0.9;
  transition: opacity 0.12s;
  /* scale SVG to fill available width */
  width: 100% !important;
  height: 30px;
}

.price-sparkline:hover {
  opacity: 1;
}

.sparkline-bg {
  fill: var(--panel-soft);
}

.price-sparkline polyline {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.price-sparkline[data-direction="up"] polyline { stroke: #16a34a; }
.price-sparkline[data-direction="down"] polyline { stroke: #dc2626; }
.price-sparkline[data-direction="flat"] polyline { stroke: var(--muted); }

/* ─── Price detail modal ─────────────────────────────────── */

.price-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 16, 26, 0.72);
  backdrop-filter: blur(4px);
  padding: 16px;
}

.price-modal-overlay[hidden] {
  display: none;
}

.price-modal {
  width: 100%;
  max-width: 560px;
  background: var(--panel);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 32px 80px rgba(10, 16, 26, 0.4);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.price-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.price-modal-card-code {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.price-modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.price-modal-range-tabs {
  display: flex;
  gap: 6px;
}

.price-range-btn {
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.price-range-btn.active,
.price-range-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.price-modal-chart-wrap {
  position: relative;
  height: 220px;
}

/* ─── Portfolio 7d change stat ───────────────────────────── */

.portfolio-value-change {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.portfolio-value-change.price-up {
  color: #16a34a;
}

.portfolio-value-change.price-down {
  color: #dc2626;
}

/* ─── Insights: accordion ────────────────────────────────── */

.insights-accordion {
  margin-top: 4px;
}

.insights-accordion[hidden] {
  display: none;
}

.insights-accordion-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 0 6px;
  user-select: none;
  width: fit-content;
}

.insights-accordion-toggle::-webkit-details-marker {
  display: none;
}

.insights-accordion-toggle::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid var(--accent);
  transition: transform 0.15s;
}

.insights-accordion[open] .insights-accordion-toggle::before {
  transform: rotate(90deg);
}
