/* Match website pages/portfolio.vue, PortfolioOverview and PortfolioHoldings.
   Fonts and logo are copies of the website's existing brand assets. */
@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/shared/assets/nunito-regular.woff2") format("woff2");
}
@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/shared/assets/nunito-500.woff2") format("woff2");
}
@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/shared/assets/nunito-700.woff2") format("woff2");
}
@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/shared/assets/nunito-800.woff2") format("woff2");
}
:root {
  font-family: Nunito, system-ui, sans-serif;
  color: #111827;
  background: #f9fafb;
  font-synthesis: none;
  font-weight: 500;
  line-height: 1.5;
  --blue: #2563eb;
  --border: #e5e7eb;
  --muted: #6b7280;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.site-header { background: #1764e2; border-bottom: 1px solid #1764e2; }
.header-content {
  max-width: 1280px;
  min-height: 76px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand, .brand img { display: block; }
.read-only { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: 14px; font-weight: 700; }
.read-only svg { flex: none; }
main { max-width: 1280px; margin: 0 auto; padding: 32px; }
.collection-header { margin-bottom: 28px; }
h1 { font-size: 32px; font-weight: 800; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
#description { margin: 8px 0 0; font-size: 15px; color: #4b5563; }
h2 { font-size: 20px; font-weight: 800; line-height: 1.4; margin: 0; }
.overview > h2 { margin-bottom: 16px; }
.metric-strip {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(var(--metric-count, 4), minmax(0, 1fr));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px #0000000d;
}
.metric { padding: 20px 24px; }
.metric + .metric { border-left: 1px solid var(--border); }
.metric-label { margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.metric-value { margin: 6px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -.4px; line-height: 1.3; overflow-wrap: anywhere; }
.metric-strip[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.valuation-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.sets { margin-top: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading-title { display: flex; gap: 12px; align-items: baseline; }
#sets-count { color: var(--muted); font-size: 14px; font-weight: 700; }
.view-switch { display: inline-flex; gap: 4px; padding: 4px; background: #e5e7eb; border-radius: 8px; }
.view-switch button { display: grid; place-items: center; width: 34px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #6b7280; }
.view-switch button[aria-pressed="true"] { color: #1d4ed8; background: #fff; box-shadow: 0 1px 2px #0000001a; }
.view-switch button:hover { color: #1d4ed8; }
.holdings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.holding { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px #0000000d; }
.holding:hover { border-color: #93c5fd; box-shadow: 0 2px 6px #0000000d; }
.set-link { display: block; text-decoration: none; }
.set-art { height: 176px; padding: 16px; display: flex; justify-content: center; align-items: center; background: #fff; }
.set-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.set-art[data-missing="true"]::after { content: "▧"; font-size: 36px; color: #d1d5db; }
.set-info { min-width: 0; padding: 12px 16px 0; }
.set-number { display: block; color: var(--blue); font-size: 12px; font-weight: 700; }
.set-title { display: block; margin: 4px 0 0; font-size: 16px; line-height: 1.4; font-weight: 800; min-height: 45px; overflow-wrap: anywhere; }
.set-link:hover .set-title { color: #1d4ed8; text-decoration: underline; }
.holding-values { margin: 12px 16px 16px; font-size: 14px; }
.holding-value { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; margin-top: 4px; }
.holding-value dt { color: #4b5563; }
.holding-value dd { margin: 0; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.set-details { display: block; border-top: 1px solid #f3f4f6; padding: 11px 16px; color: #4b5563; font-size: 14px; font-weight: 700; text-decoration: none; }
.set-details:hover { color: #1d4ed8; background: #eff6ff; text-decoration: underline; }
.holdings-grid.list-view { display: flex; flex-direction: column; gap: 12px; }
.list-view .holding { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: center; }
.list-view .set-link { display: flex; align-items: center; }
.list-view .set-art { flex: 0 0 128px; height: 128px; padding: 16px; }
.list-view .set-info { padding: 16px 12px 16px 0; }
.list-view .set-title { min-height: 0; }
.list-view .holding-values { margin: 16px 20px; }
.list-view .set-details { grid-column: 1 / -1; }
.more-button, .retry-button { padding: 10px 20px; border: 1px solid #d1d5db; border-radius: 12px; background: #fff; color: #374151; font-weight: 700; }
.more-button { display: block; margin: 24px auto 0; }
.more-button:hover, .retry-button:hover { border-color: #60a5fa; color: #1d4ed8; }
#status { padding: 24px 0; margin: 0; color: var(--muted); }
footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 40px; padding: 20px 0 8px; border-top: 1px solid var(--border); }
#cta { color: #4b5563; font-size: 13px; font-weight: 700; text-decoration: none; }
#cta:hover { color: #1d4ed8; text-decoration: underline; }
.legal { max-width: 660px; margin: 0; color: var(--muted); font-size: 11px; }
@media (max-width: 1023px) {
  .holdings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .header-content { padding: 14px 16px; min-height: 64px; gap: 12px; }
  .brand img { width: 128px; height: 32px; }
  .read-only { font-size: 12px; gap: 5px; }
  main { padding: 24px 16px; }
  h1 { font-size: 26px; }
  .collection-header { margin-bottom: 24px; }
  #description { font-size: 14px; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 16px; }
  .metric-label { font-size: 13px; }
  .metric-value { font-size: 24px; }
  .metric:nth-child(2n+1) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--border); }
  .holdings-grid { grid-template-columns: minmax(0, 1fr); }
  .set-title { min-height: 0; }
  .list-view .holding { grid-template-columns: minmax(0, 1fr); }
  .list-view .set-art { flex-basis: 104px; height: 104px; padding: 12px; }
  .list-view .set-info { padding-right: 16px; }
  .list-view .holding-values { margin: 0 16px 16px; }
  footer { margin-top: 32px; }
}

.history-card { margin-top: 28px; padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 1px 2px #0000000d; }
.history-card select { font: inherit; font-size: 14px; color: #374151; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 8px; padding: 7px 10px; max-width: 100%; }
.section-status { color: var(--muted); font-size: 14px; }
#history-chart { display: block; width: 100%; height: auto; min-height: 180px; overflow: visible; }
.chart-grid { stroke: #e5e7eb; stroke-width: 1; }
.chart-axis { fill: #6b7280; font-size: 13px; font-family: Nunito, sans-serif; }
.chart-portfolio, .chart-invested { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-portfolio { stroke: #2563eb; }
.chart-invested { stroke: #84cc16; stroke-dasharray: 6 5; }
.chart-area { fill: #2563eb; fill-opacity: .08; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; color: #4b5563; font-size: 13px; }
.chart-legend span::before { content: ''; display: inline-block; width: 18px; margin-right: 8px; vertical-align: middle; border-top: 3px solid #2563eb; }
.chart-legend .invested-key::before { border-color: #84cc16; border-top-style: dashed; }
#chart-position { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#chart-position:focus-visible { position: static; width: 100%; height: 20px; clip-path: none; margin: 20px 0 8px; accent-color: #2563eb; }
.chart-readout { text-align: center; font-size: 13px; min-height: 40px; color: #4b5563; font-variant-numeric: tabular-nums; }
.transactions { list-style: none; padding: 0; margin: 0; }
.transaction { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid #f3f4f6; }
.transaction-art { flex: 0 0 80px; height: 64px; display: flex; align-items: center; justify-content: center; }
.transaction-art img { width: 100%; height: 100%; object-fit: contain; }
.transaction-info { min-width: 0; }
.transaction-meta { margin: 0 0 4px; font-size: 12px; font-weight: 800; color: #1d4ed8; }
.transaction-meta.purchase { color: #4d7c0f; }
.transaction-title { font-size: 15px; font-weight: 800; text-decoration: none; overflow-wrap: anywhere; }
.transaction-title:hover { color: #1d4ed8; text-decoration: underline; }
.transaction-price { margin: 4px 0 0; font-size: 13px; color: #6b7280; }
@media (max-width: 639px) {
 .history-card { padding: 16px; }
 .history-card .section-heading { align-items: flex-start; }
 .history-card h2 { font-size: 18px; }
 .transaction { gap: 12px; }
 .transaction-art { flex-basis: 64px; }
 .chart-axis { font-size: 17px; }
}

/* Match website components/nav/LangSwitcher.vue: white flag/label, inset
   chevron, #06468c panel, .75rem corners and padded locale rows. */
.header-actions { display: flex; align-items: center; gap: 20px; }
.locale-switcher { position: relative; min-width: 148px; flex: none; color: #fff; font-size: 15px; }
.locale-trigger { position: relative; z-index: 30; display: flex; align-items: center; gap: 8px; width: 100%; border: 0; padding: 8px 32px 8px 16px; color: inherit; background: transparent; text-align: left; white-space: nowrap; border-radius: 12px; }
.locale-trigger[aria-disabled="true"] { opacity: .7; cursor: wait; }
.locale-chevron { position: absolute; right: 8px; flex: none; transition: transform .15s ease; }
.locale-switcher.is-open { background: #06468c; border-radius: 12px 12px 0 0; }
.locale-switcher.is-open .locale-chevron { transform: rotate(180deg); }
.locale-panel { position: absolute; z-index: 20; top: 16px; right: 0; min-width: 100%; width: 100%; max-width: calc(100vw - 32px); padding: 24px 0 8px; background: #06468c; border-radius: 0 0 12px 12px; box-shadow: 0 8px 16px #06254924; }
.locale-panel button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 16px; border: 0; color: inherit; background: transparent; text-align: left; white-space: normal; }
.locale-panel button:hover, .locale-panel button:focus-visible { background: #ffffff14; }
.locale-trigger:focus-visible, .locale-panel button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
@media (max-width: 639px) {
 .header-actions { gap: 8px; }
 .read-only > span { display: none; }
 .locale-switcher { min-width: 132px; font-size: 14px; }
 .locale-trigger { min-height: 44px; padding-left: 10px; }
 .locale-panel { top: 28px; padding-top: 20px; max-height: min(70vh, 360px); overflow-y: auto; }
 .locale-panel button { min-height: 44px; padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) { .locale-chevron { transition: none; } }
