:root {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.bi { line-height: 1; }

/* Sidebar */
aside {
  position: fixed; inset: 0 auto 0 0; width: 208px;
  background: var(--color-surface); border-right: 1px solid var(--color-border);
  padding: 28px 16px; display: flex; flex-direction: column; gap: 36px;
}
.brand {
  display: flex; align-items: center; gap: 8px; padding: 0 10px;
  font-size: 19px; font-weight: 800; letter-spacing: -.5px;
  color: var(--color-text); text-decoration: none;
}
.brand .bi { font-size: 20px; }
.brand span + span { font-weight: 400; margin-left: -4px; color: var(--color-text-muted); }
nav a {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--radius-md);
  color: var(--color-text-secondary); text-decoration: none; font-weight: 500;
}
nav a:hover { background: var(--color-hover); }
nav a[aria-current] { background: var(--color-primary); color: var(--color-on-primary); }

/* Layout */
main { margin-left: 208px; max-width: 1560px; padding: 40px 48px 48px; }
header { margin-bottom: 24px; }
h1 { font-size: 28px; letter-spacing: -.8px; margin: 0; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 13px; margin: 0; display: flex; align-items: center; gap: 8px; }
.panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 20px; }

/* Controls */
input, select, button { font: inherit; }
label { font-size: 12px; font-weight: 500; display: block; color: var(--color-text-muted); }
input:not([type=checkbox]), select {
  width: 100%; min-width: 0; height: 40px; padding: 0 12px;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-text);
  transition: border-color .15s;
}
input:not([type=checkbox]):hover, select:hover { border-color: var(--color-border-hover); }
input:focus, select:focus { outline: none; border-color: var(--color-focus); box-shadow: var(--focus-ring); }
button:focus-visible, a:focus-visible, .chip:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--color-primary); border-radius: var(--radius-md);
  background: var(--color-primary); color: var(--color-on-primary); font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
button:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
button:disabled { opacity: .35; cursor: not-allowed; }
button:disabled:hover { background: var(--color-primary); border-color: var(--color-primary); }
.secondary { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }
.secondary:hover { background: var(--color-hover); border-color: var(--color-border-strong); }
.text-button { height: auto; padding: 0; border: 0; background: none; color: var(--color-text-muted); font-size: 12px; font-weight: 500; gap: 5px; }
.text-button:hover { background: none; color: var(--color-text); }

.search-line { display: flex; gap: 10px; }
.input-icon { position: relative; flex: 1; }
.input-icon > .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--color-text-subtle); pointer-events: none; }
.input-icon input { height: 44px; padding-left: 40px; font-size: 15px; }
.search-line button { height: 44px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  height: 30px; padding: 0 12px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; color: var(--color-text-muted); background: var(--color-surface);
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--color-border-hover); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .bi { display: none; }
.chip:has(input:checked) { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.chip:has(input:checked) .bi { display: inline; }

/* Results heading */
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 32px 0 14px; }
.heading-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.count { font-size: 12px; font-weight: 600; color: var(--color-text-secondary); background: var(--color-surface-sunken); border-radius: var(--radius-pill); padding: 4px 10px; font-variant-numeric: tabular-nums; }
#status { font-size: 12px; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 6px; }
#status .bi-arrow-repeat { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.view-toggle { display: inline-flex; padding: 3px; gap: 2px; background: var(--color-surface-sunken); border-radius: var(--radius-md); }
.icon-button { width: 34px; height: 30px; padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-text-muted); font-size: 15px; }
.icon-button:hover { background: var(--color-toggle-hover); border: 0; color: var(--color-text); }
.icon-button[aria-pressed=true] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }

#errors p {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 10px 14px;
  border: 1px solid var(--color-border-strong); border-left: 3px solid var(--color-primary); border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-text); font-size: 13px;
}

/* Filters */
.filters { display: flex; flex-direction: column; gap: 16px; }
.filter-top { display: flex; justify-content: space-between; align-items: center; }
.filter-search input { height: 40px; font-size: 14px; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 16px; align-items: end; }
.field > span, .price-head > span { display: block; font-size: 12px; font-weight: 500; color: var(--color-text-muted); }
.field select { margin-top: 6px; }
.filters .chips { margin-top: 0; padding-top: 16px; border-top: 1px solid var(--color-divider); }

/* Dual-thumb price slider */
.price-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
[data-role="price-label"] { font-size: 12px; font-weight: 600; color: var(--color-text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.range { --thumb: 18px; position: relative; height: 40px; margin-top: 6px; }
.range-track {
  position: absolute; top: 50%; left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2);
  height: 4px; transform: translateY(-50%);
  background: var(--color-surface-sunken); border-radius: var(--radius-pill);
}
.range-fill { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: var(--color-text-subtle); border-radius: inherit; }
.range.active .range-fill { background: var(--color-primary); }
.range input[type=range] {
  position: absolute; left: 0; right: 0; top: 50%; z-index: 2;
  width: 100%; height: var(--thumb); margin: 0; padding: 0; transform: translateY(-50%);
  -webkit-appearance: none; appearance: none;
  background: transparent; border: 0; box-shadow: none; pointer-events: none;
}
.range input[type=range].on-top { z-index: 3; }
.range input[type=range]:hover, .range input[type=range]:focus { border: 0; box-shadow: none; }
.range input[type=range]::-webkit-slider-runnable-track { height: var(--thumb); background: transparent; }
.range input[type=range]::-moz-range-track { height: var(--thumb); background: transparent; }
.range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: grab;
  width: var(--thumb); height: var(--thumb); border-radius: 50%;
  background: var(--color-surface); border: 2px solid var(--color-primary); box-shadow: var(--shadow-sm);
  transition: transform .1s;
}
.range input[type=range]::-moz-range-thumb {
  pointer-events: auto; cursor: grab;
  width: var(--thumb); height: var(--thumb); border-radius: 50%; box-sizing: border-box;
  background: var(--color-surface); border: 2px solid var(--color-primary); box-shadow: var(--shadow-sm);
}
.range input[type=range]:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.1); }
.range input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus-ring); }
.range input[type=range]:focus-visible::-moz-range-thumb { box-shadow: var(--focus-ring); }
.range input[type=range]:disabled::-webkit-slider-thumb { cursor: default; border-color: var(--color-border-hover); }
.range input[type=range]:disabled::-moz-range-thumb { cursor: default; border-color: var(--color-border-hover); }

/* Table view */
.table-panel { padding: 0; margin-top: 14px; overflow: hidden; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px;
  background: var(--color-surface-muted); color: var(--color-text-muted);
  padding: 12px 18px; white-space: nowrap; border-bottom: 1px solid var(--color-border);
}
td { padding: 13px 18px; border-top: 1px solid var(--color-divider); font-size: 13px; line-height: 1.5; }
tbody tr:hover { background: var(--color-surface-muted); }
td:nth-child(4) { min-width: 230px; }
.mono { white-space: nowrap; color: var(--color-text-muted); font-family: var(--font-mono); font-size: 12px; }
td a, .card-name { color: var(--color-text); text-decoration: none; }
td a:hover, .card-name:hover { text-decoration: underline; }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.game-tag { display: inline-block; font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--color-text-secondary); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); padding: 1px 6px; }
.rarity-tag { display: inline-block; font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--color-on-primary); background: var(--color-primary); border: 1px solid var(--color-primary); border-radius: var(--radius-sm); padding: 1px 6px; letter-spacing: .3px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; color: var(--color-text-subtle); }
.badge.in_stock { color: var(--color-text); font-weight: 500; }
.badge.out_of_stock { color: var(--color-text-subtle); }

/* Grid view */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 14px; }
.card {
  display: flex; flex-direction: column; gap: 10px; padding: 16px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--color-border-hover); box-shadow: var(--shadow-md); }
.card-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; }
.card-tags { display: flex; align-items: center; gap: 6px; }
.card-name { font-weight: 600; line-height: 1.45; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--color-divider); }
.card .price { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card.out_of_stock .price, .card.out_of_stock .card-name { color: var(--color-text-subtle); }

/* Empty + more */
.empty { margin-top: 14px; padding: 56px 20px; text-align: center; color: var(--color-text-subtle); background: var(--color-surface); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-lg); }
.empty > .bi { font-size: 30px; }
.empty h3 { display: block; font-size: 14px; font-weight: 500; color: var(--color-text-muted); margin: 12px 0 0; }
.more-wrap { text-align: center; padding: 18px 0 0; }
.more-wrap:has(button[hidden]) { display: none; }

@media (max-width: 1050px) {
  main { padding: 28px 24px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .price-field { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  aside { position: static; width: 100%; padding: 12px 16px; flex-direction: row; align-items: center; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--color-border); }
  nav a { padding: 7px 12px; }
  main { margin: 0; padding: 24px 16px; }
  h1 { font-size: 24px; }
  .panel { padding: 16px; }
  .table-panel { padding: 0; }
  .search-line { flex-wrap: wrap; }
  .input-icon { flex-basis: 100%; }
  .search-line button { flex: 1; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Card artwork: keep layout stable while loading or unavailable. */
.product-summary { display: flex; align-items: center; gap: 14px; }
.card-image {
  position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 50px; height: 70px; overflow: hidden;
  background: var(--color-placeholder); border-radius: var(--radius-sm);
}
.card-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.image-fallback { font-size: 10px; color: var(--color-text-subtle); text-align: center; }
.card > .card-image { width: 100%; height: 180px; margin: 0; border-radius: var(--radius-md); }
.card-image [hidden] { display: none !important; }

/* Header language control */
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.language-control { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.language-control select { width: auto; min-width: 110px; height: 34px; }

/* Leave-site confirmation dialog */
#detail-dialog {
  width: min(480px, 90vw); padding: 24px;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
#detail-dialog::backdrop { background: var(--color-overlay); }
#detail-dialog h2 { margin-bottom: 8px; }
#detail-description { margin: 0 0 16px; line-height: 1.6; color: var(--color-text-secondary); }
#detail-name { margin: 0; font-weight: 600; }
#detail-url {
  margin: 8px 0 0; padding: 8px 10px; overflow-wrap: anywhere;
  font-family: var(--font-mono); font-size: 12px; color: var(--color-text-muted);
  background: var(--color-surface-muted); border: 1px solid var(--color-border); border-radius: var(--radius-md);
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
#detail-confirm {
  display: inline-flex; align-items: center; height: 40px; padding: 0 18px;
  border-radius: var(--radius-md); font-weight: 600; text-decoration: none;
  background: var(--color-primary); color: var(--color-on-primary);
  transition: background .15s;
}
#detail-confirm:hover { background: var(--color-primary-hover); }

/* Search history dropdown */
#keyword-wrapper { position: relative; }
#search-history {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  max-height: 340px; overflow-y: auto; padding: 6px;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: dropdown-in .12s ease-out;
}
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-4px); } }
.history-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 10px; }
.history-heading { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--color-text-muted); }
#history-clear { font-size: 12px; }
#history-clear:disabled { display: none; }
.history-row { position: relative; display: flex; align-items: center; border-radius: var(--radius-md); }
.history-row:hover, .history-row:focus-within { background: var(--color-hover); }
button.history-item {
  flex: 1; min-width: 0; height: 36px; padding: 0 40px 0 10px; justify-content: flex-start; gap: 10px;
  background: transparent; border: 0; border-radius: var(--radius-md);
  color: var(--color-text); font-weight: 400; text-align: left;
}
button.history-item:hover { background: transparent; border: 0; }
button.history-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--color-border-hover); }
.history-item .bi { color: var(--color-text-subtle); flex: none; }
.history-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.history-delete {
  position: absolute; right: 6px; width: 26px; height: 26px; padding: 0;
  background: transparent; border: 0; border-radius: var(--radius-sm);
  color: var(--color-text-subtle); font-size: 12px; opacity: 0;
}
.history-row:hover .history-delete, .history-row:focus-within .history-delete { opacity: 1; }
button.history-delete:hover { background: var(--color-surface-sunken); border: 0; color: var(--color-text); }
button.history-delete:focus-visible { opacity: 1; outline: 2px solid var(--color-focus); outline-offset: 0; }
#history-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; padding: 18px 10px 20px; font-size: 13px; color: var(--color-text-muted); }
#history-empty .bi { font-size: 20px; color: var(--color-text-subtle); }
#history-empty[hidden] { display: none; }
@media (hover: none) { button.history-delete { opacity: 1; } }

.currency-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:14px;margin-top:22px}#currency-status{font-size:12px;color:var(--color-text-muted)}.converted-price{display:inline-flex;flex-direction:column;gap:3px;white-space:nowrap;font-variant-numeric:tabular-nums}.original-price{font-size:11px;font-weight:normal;color:var(--color-text-muted)}

header h1{margin-right:auto}header .currency-toolbar{margin-top:0}header #currency-status{white-space:nowrap}


/* Account entry and user centre share the existing surface tokens. */
/* Sidebar account block (bottom-left) */
.sidebar-settings { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.setting { position: relative; display: block; }
.setting > .bi { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; }
.setting select { height: 34px; padding-left: 32px; font-size: 13px; color: var(--color-text-secondary); background-color: var(--color-surface-muted); }
.sidebar-settings #currency-status { padding: 0 4px; font-size: 11px; line-height: 1.4; color: var(--color-text-subtle); }
.sidebar-user { padding-top: 12px; border-top: 1px solid var(--color-border); }
.user-link {
  display: flex; min-width: 0; align-items: center; gap: 10px; padding: 8px;
  border-radius: var(--radius-md); color: var(--color-text); text-decoration: none;
}
.user-link:hover { background: var(--color-hover); }
.user-link[aria-current] { background: var(--color-hover); box-shadow: inset 0 0 0 1px var(--color-border-strong); }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
#current-username { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-sub { font-size: 11px; color: var(--color-text-muted); }
#account-status { font-size: 12px; font-weight: 600; color: var(--color-text); }
#account-status:empty { display: none; }
.avatar {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-primary); color: var(--color-on-primary); font-size: 14px; font-weight: 700;
}
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }

/* Sign-in page: standalone, no sidebar. */
body.signed-out aside { display: none; }
#auth-panel {
  position: relative; display: flex; align-items: center; justify-content: center;
  max-width: none; min-height: 100vh; margin: 0; padding: 64px 20px;
}
.auth-language { position: absolute; top: 20px; right: 24px; display: flex; align-items: center; gap: 8px; color: var(--color-text-muted); }
.auth-language select { width: auto; height: 34px; }
.auth-wrap { display: flex; flex-direction: column; align-items: center; gap: 24px; width: 100%; max-width: 400px; }
.auth-brand { padding: 0; font-size: 22px; }
.auth-brand .bi { font-size: 24px; }
.auth-card { width: 100%; padding: 32px; box-shadow: var(--shadow-md); }
.auth-card h1 { margin-bottom: 24px; font-size: 22px; text-align: center; }
.auth-card form { display: grid; gap: 16px; }
.auth-card .input-icon { display: block; margin-top: 6px; }
.auth-card .input-icon input { font-size: 14px; }
#auth-password { padding-right: 44px; }
button.password-toggle {
  position: absolute; top: 50%; right: 6px; width: 32px; height: 32px; padding: 0;
  transform: translateY(-50%); border: 0; border-radius: var(--radius-md);
  background: transparent; color: var(--color-text-subtle); font-size: 15px;
}
button.password-toggle:hover { border: 0; background: var(--color-hover); color: var(--color-text); }
#auth-rules { margin: -4px 0 0; font-size: 12px; line-height: 1.5; color: var(--color-text-muted); }
#auth-error {
  margin: 0; padding: 10px 14px; font-size: 13px; color: var(--color-text);
  background: var(--color-surface-muted); border: 1px solid var(--color-border-strong);
  border-left: 3px solid var(--color-primary); border-radius: var(--radius-md);
}
#auth-error:empty { display: none; }
#auth-submit { width: 100%; height: 44px; margin-top: 4px; }
#auth-switch { justify-self: center; font-size: 13px; }
/* Confirm password */
#auth-confirm-password { padding-right: 44px; }
.input-icon > .confirm-state { left: auto; right: 14px; font-size: 15px; }
.confirm-state.match { color: var(--color-text); }
.confirm-state.mismatch { color: var(--color-text-subtle); }
#auth-confirm-password[aria-invalid=true] { border-color: var(--color-text-secondary); }

/* User centre */
#account-panel { max-width: 960px; }
.profile-card { display: flex; align-items: center; gap: 20px; padding: 24px; margin-bottom: 16px; }
.profile-meta { flex: 1; min-width: 0; }
.profile-meta h2 { font-size: 20px; overflow-wrap: anywhere; }
.profile-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.profile-meta p { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 13px; color: var(--color-text-muted); }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.account-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.account-card h2 { font-size: 15px; }
.account-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: var(--radius-md); background: var(--color-hover); color: var(--color-text); font-size: 18px;
}
.soon {
  position: absolute; top: 20px; right: 20px; padding: 2px 8px;
  font-size: 11px; font-weight: 500; color: var(--color-text-muted);
  background: var(--color-surface-muted); border: 1px solid var(--color-border); border-radius: var(--radius-pill);
}
@media (max-width: 760px) { .auth-card { padding: 24px; } }
@media (max-width: 700px) {
  /* Rows: brand + avatar, then nav, then the two pickers. */
  aside { flex-wrap: wrap; gap: 10px 12px; }
  aside .brand { order: 1; }
  .sidebar-user { order: 2; margin: 0 0 0 auto; padding-top: 0; border-top: 0; }
  #app-nav { order: 3; display: flex; gap: 6px; width: 100%; }
  #app-nav a { white-space: nowrap; }
  .sidebar-settings { order: 4; flex-direction: row; width: 100%; margin: 0; }
  .setting { flex: 1; min-width: 0; }
  .sidebar-settings #currency-status { display: none; }
  .user-link { padding: 4px; }
  .user-meta { display: none; }
  .profile-card { flex-wrap: wrap; }
  .profile-actions { width: 100%; align-items: stretch; }
}

/* Favorites */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bi.spin { display: inline-block; animation: spin 1s linear infinite; }
th.action-col, td.action-col { width: 1%; text-align: right; }
.favorite-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.fav-actions { display: flex; gap: 4px; }
/* Star and refresh share one look; [aria-pressed] must not pick up the view-toggle style. */
button.fav-toggle, button.fav-refresh, button.fav-toggle[aria-pressed=true] {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; box-shadow: none; color: var(--color-text-muted); font-size: 16px;
}
button.fav-toggle:hover, button.fav-refresh:hover { background: var(--color-hover); color: var(--color-text); }
button.fav-toggle:hover .bi-star { color: var(--color-favorite); }
button.fav-toggle[aria-pressed=true] .bi-star-fill { color: var(--color-favorite); }
button.fav-toggle[aria-pressed=true]:hover .bi-star-fill { color: var(--color-favorite-hover); }
button.fav-toggle:disabled:hover, button.fav-refresh:disabled:hover { background: transparent; }
.card-image button.fav-toggle, .card-image button.fav-toggle[aria-pressed=true] {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  background: var(--color-surface); box-shadow: var(--shadow-sm);
  transition: transform .12s;
}
.card-image button.fav-toggle:hover { background: var(--color-surface); transform: scale(1.08); }
.card-image button.fav-toggle:disabled:hover { background: var(--color-surface); transform: none; }
.fav-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 11px; color: var(--color-text-muted); }
.favorite-controls .fav-meta { flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.card .fav-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; margin-top: -2px; }
.card .fav-meta > span { grid-column: 1; }
.card .fav-meta .fav-refresh { grid-column: 2; grid-row: 1 / span 2; width: 28px; height: 28px; font-size: 14px; }
.fav-time, .fav-note { display: inline-flex; align-items: center; gap: 5px; }
.fav-note { color: var(--color-text); font-weight: 500; }
.fav-note.ok { color: var(--color-text-muted); font-weight: 400; }
#favorites-retry { margin-bottom: 14px; }
/* Shared page skeleton: header, optional top panel, results heading, filters, list. */
header + .results > .section-heading { margin-top: 0; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
button.compact { height: 34px; padding: 0 12px; font-size: 13px; }
#favorites-panel .filters { margin-bottom: 14px; }
.progress { height: 3px; margin: -4px 0 14px; overflow: hidden; background: var(--color-surface-sunken); border-radius: var(--radius-pill); }
.progress-bar { height: 100%; width: 0; background: var(--color-primary); transition: width .3s ease; }
#favorites-empty h3 { max-width: 320px; margin-left: auto; margin-right: auto; line-height: 1.5; }
