:root {
  --page: #d9d7d7;
  --panel-soft: rgba(255, 255, 255, .085);
  --panel-line: rgba(255, 255, 255, .14);
  --orange: #ff7400;
  --orange-soft: rgba(255, 116, 0, .16);
  --cream: #ffebdb;
  --muted: rgba(255, 235, 219, .69);
  --green: #5ee394;
  --red: #ff8080;
  --yellow: #ffd45e;
  --shadow: 0 18px 44px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, .58), transparent 34rem),
    var(--page);
  color: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(255, 116, 0, .42);
  outline-offset: 2px;
}
.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 999;
  padding: 10px 14px;
  color: #fff;
  background: #111;
  border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px;
  background: rgba(217, 215, 215, .91);
  backdrop-filter: blur(14px);
}
.header-shell, .detail-hero, .welcome-card, .results-panel {
  background:
    radial-gradient(circle at 86% 10%, rgba(52, 139, 205, .22), transparent 26rem),
    linear-gradient(145deg, #08243d, #061a2c);
  border: 1px solid rgba(73, 171, 227, .25);
  box-shadow: 0 22px 52px rgba(2, 13, 24, .18);
}
.header-shell {
  max-width: 1460px;
  margin: auto;
  padding: 15px 17px;
  border-radius: 20px;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow {
  margin: 0 0 3px;
  color: var(--orange);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h2, h3, p { overflow-wrap: anywhere; }
.catalog-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}
.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 12px currentColor;
}
.catalog-status.ready .status-dot { background: var(--green); }
.catalog-status.error .status-dot { background: var(--red); }
.portfolio-device-hint { display: none; }

.search-row {
  display: grid;
  grid-template-columns: minmax(280px, 720px) 1fr;
  gap: 13px;
  align-items: center;
  margin-top: 14px;
}
.search-box { position: relative; display: block; }
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  translate: 0 -51%;
  color: var(--orange);
  font-size: 25px;
}
.search-box input {
  width: 100%;
  height: 46px;
  padding: 0 45px;
  border: 1px solid rgba(255, 116, 0, .55);
  border-radius: 13px;
  color: var(--cream);
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 116, 0, .15);
}
.clear-button {
  position: absolute;
  right: 9px;
  top: 50%;
  translate: 0 -50%;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
}
.clear-button:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.search-help { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(118px, 1fr)) auto;
  gap: 9px;
  margin-top: 12px;
}
.filter-bar label { min-width: 0; }
.filter-bar label > span {
  display: block;
  margin: 0 0 4px 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.filter-bar select {
  width: 100%;
  height: 38px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  color: var(--cream);
  background: #0a2a55;
}
.ghost-button {
  align-self: end;
  height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255, 116, 0, .4);
  border-radius: 10px;
  color: var(--orange);
  background: var(--orange-soft);
  font-size: 11px;
  font-weight: 800;
}
.ghost-button:hover { color: #fff; border-color: var(--orange); }

.app-shell {
  display: grid;
  grid-template-columns: minmax(290px, 355px) minmax(0, 1fr);
  gap: 12px;
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 10px 24px;
}
.results-panel {
  position: sticky;
  top: 181px;
  align-self: start;
  max-height: calc(100vh - 195px);
  overflow: hidden;
  border-radius: 18px;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 15px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.panel-heading h2 { margin: 0; font-size: 18px; }
.count-badge, .asset-badge, .listing-badge, .cache-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 116, 0, .36);
  border-radius: 999px;
  color: var(--orange);
  background: var(--orange-soft);
  font-size: 10px;
  font-weight: 850;
}
.count-badge { padding: 5px 8px; }
.results-message {
  padding: 22px 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}
.result-list {
  max-height: calc(100vh - 315px);
  overflow: auto;
  scrollbar-color: rgba(255, 116, 0, .55) transparent;
}
.result-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: inherit;
  background: transparent;
  text-align: left;
}
.result-item:hover, .result-item:focus-visible, .result-item.selected {
  background: rgba(255, 116, 0, .12);
}
.result-logo {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 11px;
  color: var(--orange);
  background: rgba(255, 255, 255, .08);
  font-size: 11px;
  font-weight: 900;
}
.result-name {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}
.asset-badge { align-self: center; padding: 3px 6px; }
.result-badges {
  display: grid;
  justify-items: end;
  gap: 4px;
}
.listing-badge {
  max-width: 112px;
  padding: 3px 6px;
  border-color: rgba(255, 255, 255, .2);
  color: var(--muted);
  background: rgba(255, 255, 255, .07);
  line-height: 1.15;
  text-align: center;
}
.listing-primary {
  border-color: rgba(68, 242, 161, .4);
  color: var(--green);
  background: rgba(68, 242, 161, .1);
}
.listing-adr, .listing-foreign_ordinary {
  border-color: rgba(255, 212, 94, .35);
  color: var(--yellow);
  background: rgba(255, 212, 94, .09);
}
.pagination {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.pagination button {
  height: 32px;
  border: 1px solid var(--panel-line);
  border-radius: 9px;
  color: var(--cream);
  background: var(--panel-soft);
}
.pagination button:disabled { cursor: not-allowed; opacity: .35; }
.pagination span { color: var(--muted); font-size: 10px; text-align: center; }

.detail-region { min-width: 0; }
.welcome-card {
  display: grid;
  min-height: 390px;
  place-items: center;
  align-content: center;
  padding: 38px;
  border-radius: 18px;
  text-align: center;
}
.welcome-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid rgba(255, 116, 0, .5);
  border-radius: 22px;
  color: var(--orange);
  background: var(--orange-soft);
  font-size: 38px;
}
.welcome-card h2 { margin: 4px 0 9px; font-size: clamp(25px, 4vw, 43px); }
.welcome-card > p:not(.eyebrow) {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.architecture-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.architecture-strip span {
  padding: 7px 10px;
  border: 1px solid var(--panel-line);
  border-radius: 9px;
  background: var(--panel-soft);
  font-size: 11px;
  font-weight: 750;
}
.architecture-strip b { color: var(--orange); }

.detail-hero {
  padding: 20px;
  border-radius: 18px;
}
.detail-top {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
}
.detail-logo {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 16px;
  color: var(--orange);
  background: rgba(255, 255, 255, .09);
  font-weight: 950;
}
.detail-name h2 { margin: 0; color: #fff; font-size: clamp(20px, 3vw, 30px); }
.detail-symbol { margin: 4px 0 0; color: var(--orange); font-size: 12px; font-weight: 850; }
.listing-line { margin: 3px 0 0; color: var(--muted); font-size: 10px; font-weight: 750; }
.detail-price { text-align: right; }
.price-value { color: #fff; font-size: clamp(25px, 4vw, 39px); font-weight: 950; letter-spacing: -.04em; }
.change { margin-top: 2px; font-size: 13px; font-weight: 850; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.cache-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.cache-badge { padding: 4px 7px; }
.cache-badge.stale {
  border-color: rgba(255, 212, 94, .48);
  color: var(--yellow);
  background: rgba(255, 212, 94, .12);
}
.data-time { align-self: center; color: var(--muted); font-size: 10px; }
.stale-banner, .error-card {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 212, 94, .42);
  border-radius: 13px;
  color: var(--yellow);
  background: rgba(60, 42, 0, .88);
  font-size: 12px;
  line-height: 1.5;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.data-panel {
  grid-column: span 6;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 16px;
  color: var(--cream);
  background:
    radial-gradient(circle at 86% 10%, rgba(52, 139, 205, .16), transparent 22rem),
    linear-gradient(145deg, #08243d, #061a2c);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .21);
}
.data-panel.full { grid-column: 1 / -1; }
.data-panel h3 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 116, 0, .25);
  color: var(--orange);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 8px;
}
.kpi {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: var(--panel-soft);
}
.kpi dt { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.kpi dd { margin: 6px 0 0; color: #fff; font-size: 17px; font-weight: 850; }
.holdings-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.holdings-table th, .holdings-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  text-align: left;
}
.holdings-table th { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.holdings-table td:last-child, .holdings-table th:last-child { text-align: right; }
.chart-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.range-button {
  padding: 6px 10px;
  border: 1px solid var(--panel-line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 10px;
  font-weight: 850;
}
.range-button:hover, .range-button.active {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-soft);
}
.chart-stage {
  min-height: 260px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 13px;
  background: rgba(1, 14, 34, .45);
}
.chart-placeholder {
  display: grid;
  min-height: 238px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.chart-svg { display: block; width: 100%; height: 238px; overflow: visible; }
.chart-grid-line { stroke: rgba(255, 255, 255, .09); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--orange); stroke-width: 3; vector-effect: non-scaling-stroke; }
.chart-area { fill: url(#chart-gradient); }
.chart-label { fill: var(--muted); font-size: 16px; }
.availability {
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.loading-card, .error-card {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}
.spinner {
  width: 33px;
  height: 33px;
  margin-bottom: 13px;
  border: 3px solid rgba(255, 255, 255, .18);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { rotate: 1turn; } }
.retry-button {
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 116, 0, .5);
  border-radius: 9px;
  color: var(--orange);
  background: var(--orange-soft);
}
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 500;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 13px;
  border: 1px solid rgba(255, 116, 0, .45);
  border-radius: 12px;
  color: var(--cream);
  background: #061d3e;
  box-shadow: var(--shadow);
  font-size: 12px;
}

@media (max-width: 1050px) {
  .filter-bar { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .results-panel { top: 228px; max-height: calc(100vh - 240px); }
}
@media (max-width: 760px) {
  .app-header { position: static; }
  .brand-row { align-items: flex-start; }
  .catalog-status { max-width: 48%; }
  .search-row { grid-template-columns: 1fr; }
  .search-help { display: none; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ghost-button { grid-column: 1 / -1; }
  .app-shell { display: block; }
  .results-panel { position: static; max-height: none; margin-bottom: 12px; }
  .result-list { max-height: 330px; }
  .welcome-card { min-height: 300px; padding: 27px 18px; }
  .detail-top { grid-template-columns: 50px minmax(0, 1fr); }
  .detail-logo { width: 50px; height: 50px; }
  .detail-price { grid-column: 1 / -1; text-align: left; }
  .data-panel { grid-column: 1 / -1; }
}
@media (max-width: 430px) {
  .header-shell { padding: 13px; border-radius: 16px; }
  .catalog-status { font-size: 9px; }
  .filter-bar { grid-template-columns: 1fr; }
  .ghost-button { grid-column: auto; }
  .panel-heading { padding: 13px; }
  .detail-hero { padding: 15px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi dd { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* AF2-5 Nutzerabnahme: kompakte Fullscreen-Terminal-Dichte */
:root {
  --page: #d8d8d6;
  --shadow: 0 7px 18px rgba(0, 19, 45, .24);
}
body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  background: linear-gradient(135deg, #e3e3e0, #cfcfcd);
}
.app-header {
  padding: 5px 6px;
  background: rgba(216, 216, 214, .94);
  backdrop-filter: blur(8px);
}
.header-shell {
  max-width: none;
  padding: 9px 12px 10px;
  border-radius: 14px;
}
.brand-row { min-height: 28px; }
.catalog-status { font-size: 9px; }
.status-dot { width: 7px; height: 7px; }
.search-row {
  grid-template-columns: minmax(260px, 56%) 1fr;
  gap: 10px;
  margin-top: 7px;
}
.search-box input {
  height: 34px;
  padding: 0 38px;
  border-radius: 9px;
  font-size: 12px;
}
.search-icon {
  left: 12px;
  font-size: 18px;
}
.clear-button { width: 26px; height: 26px; font-size: 18px; }
.search-help { font-size: 9px; }
.filter-bar {
  gap: 7px;
  margin-top: 7px;
}
.filter-bar label > span {
  margin: 0 0 2px 2px;
  font-size: 7px;
}
.filter-bar select,
.ghost-button {
  height: 30px;
  border-radius: 8px;
  font-size: 10px;
}
.filter-bar select { padding-left: 8px; }
.ghost-button { padding: 0 10px; font-size: 9px; }

.app-shell {
  grid-template-columns: clamp(278px, 19vw, 328px) minmax(0, 1fr);
  gap: 7px;
  max-width: none;
  padding: 0 6px 10px;
}
.results-panel {
  top: 122px;
  max-height: calc(100vh - 128px);
  border-radius: 12px;
}
.panel-heading {
  padding: 10px 11px 8px;
  gap: 8px;
}
.panel-heading h2 { font-size: 14px; }
.eyebrow { margin-bottom: 2px; font-size: 7px; }
.count-badge { padding: 3px 6px; font-size: 8px; }
.results-message { padding: 16px 10px; font-size: 10px; }
.result-list { max-height: calc(100vh - 228px); }
.result-item {
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 7px;
  padding: 7px 9px;
}
.result-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 8px;
}
.result-name { font-size: 9px; }
.result-meta { gap: 3px 6px; margin-top: 3px; font-size: 7px; }
.asset-badge, .listing-badge { padding: 2px 5px; font-size: 7px; }
.pagination {
  grid-template-columns: 30px 1fr 30px;
  padding: 7px 9px;
}
.pagination button { height: 26px; border-radius: 7px; }
.pagination span { font-size: 8px; }

.welcome-card {
  min-height: 245px;
  padding: 24px;
  border-radius: 12px;
}
.welcome-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 10px;
  border-radius: 12px;
  font-size: 25px;
}
.welcome-card h2 { margin: 2px 0 6px; font-size: 25px; }
.welcome-card > p:not(.eyebrow) { font-size: 10px; line-height: 1.45; }
.architecture-strip { gap: 5px; margin-top: 14px; }
.architecture-strip span { padding: 4px 7px; border-radius: 6px; font-size: 8px; }

.detail-hero {
  padding: 10px 12px;
  border-radius: 12px;
}
.detail-top {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
}
.detail-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 10px;
}
.detail-name h2 { font-size: clamp(16px, 1.7vw, 23px); }
.detail-symbol { margin-top: 2px; font-size: 8px; }
.price-value { font-size: clamp(20px, 2.2vw, 28px); }
.change { font-size: 9px; }
.cache-row {
  gap: 5px;
  margin-top: 7px;
  padding-top: 6px;
}
.cache-badge { padding: 2px 5px; font-size: 7px; }
.data-time { font-size: 7px; }
.detail-grid {
  gap: 7px;
  margin-top: 7px;
}
.market-history-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(155px, 1fr);
  gap: 7px;
  margin-top: 7px;
}
.market-history-grid .data-panel { grid-column: auto; }
.data-panel {
  grid-column: span 4;
  padding: 9px;
  border-radius: 11px;
  box-shadow: 0 5px 13px rgba(0, 0, 0, .18);
}
.data-panel h3 {
  margin-bottom: 7px;
  padding-bottom: 5px;
  font-size: 8px;
}
.kpi-grid {
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 5px;
}
.kpi {
  padding: 7px;
  border-radius: 8px;
}
.kpi dt { font-size: 6.5px; }
.kpi dd { margin-top: 3px; font-size: 12px; }
.holdings-table { font-size: 9px; }
.holdings-table th,
.holdings-table td { padding: 5px 4px; }
.holdings-table th { font-size: 7px; }
.chart-toolbar { gap: 5px; margin-bottom: 7px; }
.range-button {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 8px;
}
.chart-stage {
  min-height: 310px;
  padding: 7px;
  border-radius: 9px;
  background: #031a36;
}
.performance-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.performance-caption {
  margin: -2px 0 6px;
  color: var(--muted);
  font-size: 7px;
  text-transform: uppercase;
}
.performance-list {
  display: grid;
  gap: 5px;
  margin: 0;
}
.performance-row {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel-soft);
}
.performance-row dt {
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
}
.performance-row dd {
  margin: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}
.performance-note {
  margin: auto 2px 0;
  padding-top: 7px;
  color: var(--muted);
  font-size: 7px;
}
.chart-placeholder { min-height: 294px; font-size: 9px; }
.chart-svg { height: 284px; }
.chart-line {
  stroke-width: 2;
  filter: drop-shadow(0 0 4px currentColor);
}
.chart-label { font-size: 11px; font-weight: 700; }
.chart-date { fill: rgba(255,255,255,.58); font-size: 9px; font-weight: 600; }
.availability { margin: 6px 2px 0; font-size: 7px; }
.stale-banner, .error-card {
  margin-bottom: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 9px;
}

@media (max-width: 1240px) {
  .data-panel { grid-column: span 6; }
}
@media (max-width: 900px) {
  .app-header { position: static; }
  .search-row { grid-template-columns: minmax(240px, 2fr) 1fr; }
  .filter-bar { grid-template-columns: repeat(3, minmax(100px, 1fr)); }
  .app-shell { grid-template-columns: 260px minmax(0, 1fr); }
  .results-panel { position: static; max-height: 620px; }
  .result-list { max-height: 520px; }
  .data-panel { grid-column: 1 / -1; }
  .market-history-grid { grid-template-columns: minmax(0, 3fr) minmax(145px, 1fr); }
  .market-history-grid .data-panel { grid-column: auto; }
}
@media (max-width: 680.999px) {
  .app-header { padding: 4px; }
  .header-shell { padding: 8px; border-radius: 11px; }
  .brand-row { min-height: 24px; }
  .catalog-status { max-width: 58%; font-size: 7px; }
  .search-row { grid-template-columns: 1fr; margin-top: 6px; }
  .search-help { display: none; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .ghost-button { grid-column: 1 / -1; }
  .app-shell { display: block; padding: 0 4px 8px; }
  .results-panel { margin-bottom: 6px; max-height: none; }
  .result-list { max-height: 255px; }
  .detail-top { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 7px; }
  .detail-logo { width: 36px; height: 36px; }
  .detail-price { grid-column: auto; text-align: right; }
  .price-value { font-size: 17px; }
  .detail-name h2 { font-size: 14px; }
  .detail-grid { gap: 5px; margin-top: 5px; }
  .market-history-grid {
    grid-template-columns: 1fr;
    gap: 5px;
    margin-top: 5px;
  }
  .data-panel { padding: 8px; border-radius: 9px; }
  .performance-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-row { min-height: 40px; }
  .chart-stage { min-height: 245px; }
  .chart-placeholder { min-height: 230px; }
  .chart-svg { height: 220px; }
}
@media (max-width: 430px) {
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ghost-button { grid-column: 1 / -1; }
  .panel-heading { padding: 9px; }
  .detail-hero { padding: 8px; }
  .detail-top { grid-template-columns: 34px minmax(0, 1fr); }
  .detail-logo { width: 34px; height: 34px; }
  .detail-price {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    text-align: left;
  }
  .kpi dd { font-size: 11px; }
}

/* AF2 P4: semantische Zustände und echte Logos, ohne bestehende Layoutmaße zu ändern. */
:root {
  --contrast: #2dd4bf;
  --contrast-soft: rgba(45, 212, 191, .13);
  --contrast-line: rgba(45, 212, 191, .52);
  --state-selection: var(--contrast);
  --state-portfolio: #ff7400;
  --state-positive: var(--green);
  --state-warning: var(--yellow);
  --state-negative: var(--red);
  --state-disabled: rgba(255, 255, 255, .36);
  --series-1: #41d9ff;
  --series-2: #ff9a3c;
  --series-3: #a47cff;
  --series-4: #32e4a0;
  --series-5: #ff6683;
  --series-6: #2b7de9;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline-color: rgba(45, 212, 191, .58);
}
.search-box input:focus { border-color: var(--state-selection); }
.result-item:hover,
.result-item:focus-visible,
.result-item.selected {
  background: var(--contrast-soft);
}
.result-item.selected {
  box-shadow: inset 3px 0 0 var(--state-selection);
}
.range-button:hover,
.range-button.active {
  border-color: var(--state-selection);
  color: var(--state-selection);
  background: var(--contrast-soft);
}
.pagination button:not(:disabled):hover {
  border-color: var(--state-selection);
  color: var(--state-selection);
}
.pagination button:disabled {
  color: var(--state-disabled);
  opacity: .45;
}
.positive { color: var(--state-positive) !important; }
.negative { color: var(--state-negative) !important; }
.cache-badge.stale,
.stale-banner,
.error-card { color: var(--state-warning); }

.instrument-logo {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  flex: 0 0 auto;
}
.instrument-logo-fallback {
  position: relative;
  z-index: 1;
}
.instrument-logo-image {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: inherit;
  object-fit: contain;
  opacity: 0;
  background: rgba(255, 255, 255, .96);
  transition: opacity .16s ease;
}
.instrument-logo.has-image .instrument-logo-image { opacity: 1; }
.instrument-logo.logo-missing {
  border-color: var(--contrast-line);
  color: var(--state-selection);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.watchlist-control {
  display: none;
  margin-top: 7px;
}
.watchlist-button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--contrast-line);
  border-radius: 9px;
  color: var(--state-selection);
  background: var(--contrast-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .02em;
}
.watchlist-button:hover:not(:disabled) {
  color: #fff;
  border-color: var(--state-selection);
}
.watchlist-button.remembered {
  color: #081d31;
  background: var(--state-selection);
}
.watchlist-button:disabled {
  cursor: wait;
  color: var(--state-disabled);
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .055);
}
.watchlist-icon { margin-right: 4px; font-size: 13px; line-height: 1; }

@media (min-width: 681px) {
  .watchlist-control { display: block; }
}

@media (max-width: 680.999px) {
  .portfolio-device-hint {
    display: block;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 8px;
    line-height: 1.35;
  }
  .watchlist-control,
  .watchlist-button { display: none !important; }
}

/* AF2 P6: lokale Portfolio-Grundoberfläche nur ab 681 px. */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.portfolio-open-button {
  display: none;
  min-height: 40px;
  padding: 8px 20px;
  border: 1px solid rgba(255, 116, 0, .82);
  border-radius: 12px;
  color: #111;
  background: linear-gradient(145deg, #ff9340, #ff7400);
  box-shadow: 0 6px 15px rgba(255, 116, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .32);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
}
.portfolio-open-button:hover:not(:disabled) {
  color: #111;
  border-color: #ffad67;
  background: linear-gradient(145deg, #ffa65f, #ff8420);
  box-shadow: 0 8px 19px rgba(255, 116, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .38);
}
.portfolio-open-button:disabled { opacity: .42; cursor: wait; }
.portfolio-open-button.premium-locked:disabled {
  opacity: 1;
  cursor: default;
  color: #dbe2eb;
  border-color: rgba(185, 194, 207, .45);
  background: rgba(185, 194, 207, .11);
}
.portfolio-open-button.starter-locked{
  border-color:rgba(255,116,0,.72);
  background:linear-gradient(145deg,rgba(16,61,98,.96),rgba(4,29,50,.96));
  cursor:pointer;
}
.portfolio-starter-prompt{
  position:fixed;
  inset:0;
  z-index:2400;
  display:grid;
  place-items:center;
  padding:22px;
  background:
    radial-gradient(circle at 50% 45%,rgba(0,126,190,.24),transparent 36%),
    rgba(2,13,24,.66);
  backdrop-filter:blur(10px);
}
.portfolio-starter-prompt[hidden]{display:none!important;}
.portfolio-starter-prompt-dialog{
  position:relative;
  width:min(620px,100%);
  padding:24px 58px 24px 24px;
  border:1px solid rgba(255,122,0,.72);
  border-radius:18px;
  background:linear-gradient(145deg,rgba(16,61,98,.98),rgba(4,29,50,.98));
  box-shadow:0 28px 70px rgba(0,0,0,.46),0 0 30px rgba(0,123,190,.20);
  color:#f5f9fc;
}
.portfolio-starter-prompt-close{
  position:absolute;
  top:14px;
  right:14px;
  width:34px;
  height:34px;
  padding:0;
  border:1px solid rgba(255,255,255,.28);
  border-radius:999px;
  background:rgba(255,255,255,.10);
  color:#fff;
  cursor:pointer;
  font-size:19px;
  line-height:1;
}
.portfolio-starter-prompt-close:hover{background:rgba(255,255,255,.18);}
.portfolio-starter-prompt-kicker{
  display:block;
  margin-bottom:10px;
  color:#ff8a25;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.portfolio-starter-prompt-dialog h2{
  margin:0 0 10px;
  color:#fff;
  font-size:clamp(20px,3vw,28px);
  line-height:1.12;
}
.portfolio-starter-prompt-dialog p{
  margin:0;
  color:rgba(245,249,252,.86);
  font-size:14px;
  line-height:1.5;
}
.portfolio-premium-badge {
  margin-left: 6px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 116, 0, .62);
  border-radius: 999px;
  color: #ffebdb;
  background: rgba(255, 116, 0, .18);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.25;
  text-transform: uppercase;
}
.instrument-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.portfolio-add-button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 116, 0, .58);
  border-radius: 9px;
  color: #ffebdb;
  background: rgba(255, 116, 0, .13);
  font-size: 9px;
  font-weight: 850;
}
.portfolio-add-button:hover:not(:disabled) { border-color: var(--state-portfolio); color: #fff; }
.portfolio-add-button:disabled { color: var(--state-disabled); opacity: .58; cursor: default; }
.portfolio-overlay {
  --cream: #fff3e8;
  --text: #fff3e8;
  --muted: #8dabbe;
  --green: #32e4a0;
  --red: #ff6683;
  --yellow: #ffcf66;
  --contrast: #69c8ff;
  --contrast-soft: rgba(105, 200, 255, .1);
  --contrast-line: rgba(105, 200, 255, .42);
  --state-selection: #ff7400;
  --state-portfolio: #ff7400;
  --portfolio-bg: #041221;
  --portfolio-bg-soft: #08233d;
  --portfolio-panel: rgba(17, 48, 76, .94);
  --portfolio-panel-strong: rgba(8, 35, 61, .96);
  --portfolio-line: rgba(105, 200, 255, .18);
  --portfolio-cyan: #42c9ee;
  --portfolio-orange: #ff7400;
  --portfolio-purple: #ff8b23;
  padding: 12px;
}
.portfolio-overlay[hidden] { display: none !important; }
.portfolio-dialog {
  position: relative;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 18px;
  background: #d9d7d7;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}
.portfolio-close {
  position: absolute;
  z-index: 2;
  top: 22px;
  right: 24px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 116, 0, .34);
  border-radius: 10px;
  color: #ffebdb;
  background: rgba(255, 116, 0, .12);
  font-size: 24px;
}
.portfolio-overlay-body {
  margin: 12px;
  padding: 18px 20px 20px;
  border: 1px solid rgba(73, 171, 227, .25);
  border-radius: 18px;
  color: #ffebdb;
  background:
    radial-gradient(circle at 86% 10%, rgba(52, 139, 205, .22), transparent 26rem),
    linear-gradient(145deg, #08243d, #061a2c);
  box-shadow: 0 22px 52px rgba(2, 13, 24, .18);
}
.portfolio-watchlist {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: transparent;
}
.portfolio-watchlist h3 { margin: 0 0 3px; font-size: 14px; }
.portfolio-watchlist .portfolio-section-heading p { margin: 0 0 10px; color: var(--muted); font-size: 9px; }
.portfolio-section-heading.portfolio-watchlist-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
}
.portfolio-content-title {
  margin: 0;
  align-self: start;
  transform: translateY(-7px);
  color: #ffebdb;
  font-family: "Raleway", Arial, Helvetica, sans-serif;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: .02em;
  line-height: 1.1;
  text-align: center;
}
.portfolio-watchlist-heading > span { justify-self: end; padding-right: 52px; }
.portfolio-watchlist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; }
.portfolio-watchlist-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .024));
}
.portfolio-watchlist-logo { width: 38px; height: 38px; border: 1px solid var(--contrast-line); border-radius: 10px; display: grid; place-items: center; color: var(--contrast); font-size: 8px; font-weight: 900; }
.portfolio-watchlist-copy { min-width: 0; display: grid; gap: 3px; }
.portfolio-watchlist-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.portfolio-watchlist-copy span { color: var(--muted); font-size: 8px; }
.portfolio-watchlist-actions { display: grid; gap: 5px; }
.portfolio-watchlist-actions button { min-height: 29px; padding: 5px 8px; border: 1px solid rgba(255, 116, 0, .48); border-radius: 8px; color: var(--cream); background: rgba(255, 116, 0, .12); font-size: 8px; font-weight: 800; }
.portfolio-watchlist-actions button:disabled { border-color: rgba(148, 163, 184, .28); color: var(--muted); background: rgba(148, 163, 184, .07); cursor: not-allowed; }
.portfolio-watchlist-actions .portfolio-watchlist-remove { border-color: rgba(248, 113, 113, .32); color: #fca5a5; background: rgba(248, 113, 113, .07); }
.portfolio-form-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); gap: 14px; }
.portfolio-section {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--portfolio-line);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--portfolio-panel), var(--portfolio-panel-strong));
  box-shadow: 0 12px 26px rgba(0, 0, 0, .15), inset 0 1px rgba(255, 255, 255, .04);
}
.portfolio-section h3 { margin: 0 0 14px; font-size: 14px; }
.portfolio-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.portfolio-section-heading span { color: var(--muted); font-size: 9px; }
.portfolio-field { display: grid; gap: 5px; min-width: 0; }
.portfolio-field > span,
.portfolio-asset-row label > span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.portfolio-field input,
.portfolio-field select,
.portfolio-asset-row input {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(130, 194, 232, .22);
  border-radius: 9px;
  color: var(--text);
  background: rgba(4, 18, 33, .88);
}
.portfolio-start-date-control > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.portfolio-start-date-control button { min-height: 36px; padding: 7px 10px; border: 1px solid rgba(255, 116, 0, .48); border-radius: 9px; color: var(--cream); background: rgba(255, 116, 0, .12); font-size: 8px; font-weight: 900; }
.portfolio-start-date-control input:disabled { color: var(--muted); opacity: .78; cursor: not-allowed; }
.portfolio-start-date-control small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.portfolio-start-date-control em { min-height: 12px; color: var(--contrast); font-size: 8px; font-style: normal; }
.portfolio-assets { display: grid; gap: 7px; margin-top: 12px; }
.portfolio-asset-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 112px auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .024));
}
.portfolio-asset-logo { width: 38px; height: 38px; border: 1px solid var(--contrast-line); border-radius: 10px; display: grid; place-items: center; color: var(--contrast); font-size: 8px; font-weight: 900; }
.portfolio-asset-copy { min-width: 0; display: grid; gap: 3px; }
.portfolio-asset-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.portfolio-asset-copy span { color: var(--muted); font-size: 8px; }
.portfolio-remove {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid rgba(248, 113, 113, .38);
  border-radius: 8px;
  color: #fca5a5;
  background: rgba(248, 113, 113, .08);
  font-size: 8px;
  font-weight: 800;
}
.portfolio-weight-total { margin-top: 10px; text-align: right; color: var(--muted); font-size: 10px; }
.portfolio-weight-total strong { color: var(--state-positive); }
.portfolio-weight-total strong.invalid { color: var(--state-negative); }
.portfolio-fields-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.portfolio-effective-note { margin: 13px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.portfolio-model-note { margin: 13px 0 0; padding: 10px 12px; border: 1px solid rgba(105, 200, 255, .22); border-radius: 10px; background: rgba(31, 77, 119, .34); color: var(--muted); font-size: 9px; line-height: 1.55; }
.portfolio-model-note strong { color: var(--text); }
.portfolio-form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 14px; }
#portfolio-save-status { margin-right: auto; color: var(--muted); font-size: 9px; }
.portfolio-save {
  min-height: 38px;
  padding: 7px 16px;
  border: 1px solid var(--portfolio-orange);
  border-radius: 10px;
  color: #111820;
  background: var(--portfolio-orange);
  font-size: 9px;
  font-weight: 900;
}
.portfolio-save:disabled { opacity: .45; cursor: not-allowed; }
.portfolio-form-message { margin-bottom: 12px; padding: 9px 11px; border: 1px solid var(--contrast-line); border-radius: 9px; color: var(--contrast); background: var(--contrast-soft); font-size: 9px; }
.portfolio-empty { padding: 44px 20px; text-align: center; }
.portfolio-empty h3 { margin: 0 0 8px; }
.portfolio-empty p,
.portfolio-empty-inline { color: var(--muted); font-size: 10px; }
body.portfolio-scroll-lock > :not(#portfolio-overlay) { display: none !important; }

/* AF2 P9: gespeicherte Portfolioauswertung und Diagramme. */
.portfolio-analysis {
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid rgba(105, 200, 255, .22);
}
.portfolio-analysis-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.portfolio-analysis-heading h3 { margin: 0 0 4px; font-size: 18px; }
.portfolio-analysis-heading p { margin: 0; color: var(--muted); font-size: 9px; }
.portfolio-range-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.portfolio-range-switch button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid rgba(105, 200, 255, .28);
  border-radius: 8px;
  color: #dcecf7;
  background: rgba(31, 77, 119, .64);
  font-size: 8px;
  font-weight: 850;
}
.portfolio-range-switch button[aria-pressed="true"] {
  color: #04101d;
  border-color: var(--state-selection);
  background: var(--state-selection);
}
.portfolio-distributions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.portfolio-distributions > section,
.portfolio-history,
.portfolio-monthly-transactions,
.portfolio-components,
.portfolio-factsheet {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--portfolio-line);
  border-radius: 14px;
  background: var(--portfolio-panel);
}
.portfolio-analysis h4 { margin: 0 0 12px; font-size: 12px; }
.portfolio-distribution-chart { display: grid; grid-template-columns: minmax(130px, .75fr) minmax(150px, 1.25fr); align-items: center; gap: 14px; }
.portfolio-donut { width: min(180px, 100%); height: auto; margin: auto; transform: rotate(-90deg); }
.portfolio-donut-track,
.portfolio-donut-segment { fill: none; stroke-width: 18; }
.portfolio-donut-track { stroke: rgba(255, 255, 255, .08); }
.portfolio-donut-segment { transition: stroke-dashoffset .25s ease, stroke-dasharray .25s ease; }
.portfolio-chart-legend { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.portfolio-chart-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 7px; color: var(--muted); font-size: 8px; }
.portfolio-chart-legend strong { color: var(--cream); font-size: 8px; }
.portfolio-legend-swatch { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.portfolio-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.portfolio-kpis article { display: grid; gap: 5px; padding: 14px; border: 1px solid rgba(255,255,255,.055); border-left: 3px solid var(--portfolio-cyan); border-radius: 0 10px 10px 0; background: rgba(105, 200, 255, .055); }
.portfolio-kpis article:nth-child(2) { border-left-color: var(--portfolio-orange); background: rgba(255, 116, 0, .055); }
.portfolio-kpis article:nth-child(3) { border-left-color: rgba(255, 235, 219, .72); background: rgba(255, 235, 219, .055); }
.portfolio-kpis article:nth-child(4) { border-left-color: var(--green); background: rgba(50, 228, 160, .055); }
.portfolio-kpis span,
.portfolio-kpis small { color: var(--muted); font-size: 8px; }
.portfolio-kpis strong { font-size: 18px; }
.portfolio-periods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.portfolio-periods div { display: grid; gap: 5px; padding: 10px; border-bottom: 2px solid rgba(105, 200, 255, .3); background: rgba(105, 200, 255, .045); }
.portfolio-periods span { color: var(--muted); font-size: 8px; }
.portfolio-periods strong { font-size: 10px; }
.portfolio-history,
.portfolio-monthly-transactions,
.portfolio-components,
.portfolio-factsheet { margin-top: 14px; }
.portfolio-history-chart svg { display: block; width: 100%; height: auto; min-height: 230px; }
.portfolio-chart-axis { stroke: rgba(255, 255, 255, .15); stroke-width: 1; }
.portfolio-chart-label { fill: var(--muted); font-size: 9px; text-anchor: end; }
.portfolio-chart-label.chart-label-end { text-anchor: end; }
.portfolio-history-line { fill: none; stroke-width: 2.1; vector-effect: non-scaling-stroke; }
.portfolio-history-line.series-total { stroke-width: 3; }
.portfolio-history-legend { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-top: 8px; }
.portfolio-monthly-transactions { border-color: rgba(255, 116, 0, .28); background: linear-gradient(145deg, var(--portfolio-panel), var(--portfolio-panel-strong)); }
.portfolio-monthly-heading { align-items: flex-end; gap: 18px; }
.portfolio-monthly-heading > div:first-child { min-width: 0; }
.portfolio-monthly-heading h4 { margin-bottom: 5px; }
.portfolio-monthly-heading p { max-width: 760px; margin: 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.portfolio-month-picker { display: grid; flex: 0 0 180px; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.portfolio-month-picker select { min-height: 38px; padding: 7px 9px; border: 1px solid rgba(105, 200, 255, .28); border-radius: 9px; color: var(--cream); background: var(--portfolio-bg); font-size: 9px; font-weight: 800; }
.portfolio-month-picker option { color: #263446; background: #d7dce2; }
.portfolio-month-picker option:checked { color: #111820; background: #ff8b23; }
.portfolio-monthly-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.portfolio-monthly-summary article { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.08); border-left: 3px solid var(--portfolio-orange); border-radius: 0 10px 10px 0; background: rgba(255,116,0,.055); }
.portfolio-monthly-summary span { color: var(--muted); font-size: 8px; }
.portfolio-monthly-summary strong { color: var(--cream); font-size: 13px; }
.portfolio-monthly-purchases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.portfolio-monthly-purchase { min-width: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(3,15,28,.64); }
.portfolio-monthly-purchase > header { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 9px; padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.portfolio-monthly-logo { width: 42px; height: 42px; border: 1px solid var(--contrast-line); border-radius: 10px; display: grid; place-items: center; color: var(--contrast); font-size: 8px; font-weight: 900; }
.portfolio-monthly-purchase > header div { display: grid; min-width: 0; gap: 3px; }
.portfolio-monthly-purchase > header strong,
.portfolio-monthly-purchase > header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-monthly-purchase > header strong { color: var(--cream); font-size: 10px; }
.portfolio-monthly-purchase > header span { color: var(--muted); font-size: 7px; }
.portfolio-monthly-purchase dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 4px 12px 10px; }
.portfolio-monthly-purchase dl div { display: grid; gap: 3px; padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,.055); }
.portfolio-monthly-purchase dt { color: var(--muted); font-size: 7px; }
.portfolio-monthly-purchase dd { margin: 0; color: var(--cream); font-size: 9px; font-weight: 850; }
.portfolio-monthly-purchase dl div:nth-child(2) dd { color: #ff8b23; }
.portfolio-monthly-purchase dd small { display: block; margin-top: 2px; color: var(--muted); font-size: 7px; font-weight: 600; }
.portfolio-monthly-purchase.is-blocked { border-color: rgba(255,179,71,.3); }
.portfolio-monthly-status { padding: 14px 12px; color: var(--state-warning); font-size: 8px; }
.portfolio-monthly-empty { display: grid; gap: 5px; margin-top: 14px; padding: 22px; border: 1px dashed rgba(255,116,0,.34); border-radius: 11px; color: var(--muted); background: rgba(255,116,0,.04); text-align: center; font-size: 9px; }
.portfolio-monthly-empty strong { color: var(--cream); font-size: 12px; }
.portfolio-components > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.portfolio-components article { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.portfolio-components span { color: var(--muted); font-size: 8px; }
.portfolio-components strong { font-size: 9px; }
.portfolio-components p { margin: 12px 0 0; color: var(--muted); font-size: 8px; }
.portfolio-factsheet .portfolio-section-heading { align-items: flex-start; }
.portfolio-factsheet .portfolio-section-heading h4 { margin-bottom: 4px; }
.portfolio-factsheet .portfolio-section-heading p { max-width: 760px; margin: 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.portfolio-factsheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.portfolio-factsheet-card { min-width: 0; overflow: hidden; border: 1px solid var(--portfolio-line); border-radius: 12px; background: linear-gradient(180deg, rgba(14,42,69,.9), rgba(5,20,34,.88)); }
.portfolio-factsheet-card > header { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 10px 11px 4px; }
.portfolio-factsheet-logo { width: 34px; height: 34px; border-radius: 9px; }
.portfolio-factsheet-card > header div { display: grid; min-width: 0; gap: 2px; }
.portfolio-factsheet-card > header strong { overflow: hidden; color: var(--cream); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-factsheet-card > header span { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.portfolio-factsheet-card > header em { padding: 4px 6px; border: 1px solid currentColor; border-radius: 999px; font-size: 8px; font-style: normal; font-weight: 900; }
.portfolio-factsheet-card svg { display: block; width: 100%; height: auto; }
.portfolio-factsheet-card svg text { fill: var(--muted); font-size: 8px; }
.portfolio-factsheet-axis { stroke: rgba(255,255,255,.1); stroke-width: 1; }
.portfolio-factsheet-line { fill: none; stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.portfolio-factsheet-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 11px 10px; }
.portfolio-factsheet-card > footer span { color: var(--muted); font-size: 7px; }
.portfolio-factsheet-card > footer strong { color: var(--cream); font-size: 9px; }
.portfolio-factsheet-empty { min-height: 150px; padding: 38px 18px; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: center; }
.portfolio-rebalancing { margin-top: 16px; padding: 16px; border: 1px solid rgba(255,116,0,.28); border-radius: 16px; background: linear-gradient(145deg, var(--portfolio-panel), var(--portfolio-panel-strong)); }
.rebalancing-controls { display: grid; grid-template-columns: minmax(230px,1.4fr) minmax(190px,1fr) auto; gap: 10px; align-items: end; margin-top: 12px; }
.rebalancing-controls label,
.rebalancing-confirm label { display: grid; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.rebalancing-controls select,
.rebalancing-controls input,
.rebalancing-confirm input { min-height: 40px; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; background: var(--navy-deep); color: var(--text); padding: 8px 10px; }
.rebalancing-controls select option { color: #263446; background: #d7dce2; }
.rebalancing-controls select option:checked { color: #06254d; background: #8fbbed; font-weight: 800; }
.rebalancing-controls button,
.rebalancing-confirm button { min-height: 40px; border: 1px solid rgba(255,116,0,.65); border-radius: 9px; background: rgba(255,116,0,.18); color: var(--cream); font-weight: 800; padding: 8px 14px; cursor: pointer; }
.portfolio-overlay button:focus-visible,
.portfolio-overlay input:focus-visible,
.portfolio-overlay select:focus-visible { outline-color: rgba(105, 200, 255, .58); }
.rebalancing-controls button:disabled,
.rebalancing-confirm button:disabled { opacity: .45; cursor: not-allowed; }
.rebalancing-proposal { margin-top: 14px; }
.rebalancing-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.rebalancing-summary article { display: grid; gap: 4px; padding: 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(4,28,56,.68); }
.rebalancing-summary span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.rebalancing-summary strong { color: var(--cream); font-size: 14px; }
.rebalancing-table-wrap { overflow-x: auto; margin-top: 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; }
.rebalancing-table-wrap table { width: 100%; min-width: 790px; border-collapse: collapse; font-size: 9px; }
.rebalancing-table-wrap th,
.rebalancing-table-wrap td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: right; white-space: nowrap; }
.rebalancing-table-wrap thead th { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.rebalancing-table-wrap th:first-child { text-align: left; }
.rebalancing-table-wrap tbody th { display: grid; gap: 2px; color: var(--cream); }
.rebalancing-table-wrap tbody th span { color: var(--muted); font-size: 8px; font-weight: 500; }
.rebalancing-action { display: inline-flex; padding: 3px 7px; border-radius: 999px; font-weight: 800; }
.rebalancing-action.buy { color: var(--positive); background: rgba(68,242,161,.1); }
.rebalancing-action.sell { color: var(--negative); background: rgba(255,92,112,.1); }
.rebalancing-action.hold { color: var(--muted); background: rgba(255,255,255,.07); }
.rebalancing-warning { margin: 10px 0; color: var(--orange); font-size: 8px; line-height: 1.5; }
.rebalancing-confirm { display: grid; grid-template-columns: minmax(240px,1fr) auto; gap: 10px; align-items: end; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.portfolio-analysis-loading,
.portfolio-analysis-error,
.portfolio-analysis-empty,
.portfolio-chart-empty { padding: 22px; color: var(--muted); text-align: center; font-size: 10px; }
.portfolio-analysis-error { color: var(--state-warning); }
.portfolio-analysis-error button { margin-left: 8px; padding: 5px 8px; border: 1px solid currentColor; border-radius: 7px; color: inherit; background: transparent; }
.portfolio-analysis-empty strong { color: var(--cream); }
.portfolio-analysis-empty p { max-width: 700px; margin: 8px auto 0; line-height: 1.55; }
.series-1 { color: var(--series-1); stroke: var(--series-1); }
.series-2 { color: var(--series-2); stroke: var(--series-2); }
.series-3 { color: var(--series-3); stroke: var(--series-3); }
.series-4 { color: var(--series-4); stroke: var(--series-4); }
.series-5 { color: var(--series-5); stroke: var(--series-5); }
.series-6 { color: var(--series-6); stroke: var(--series-6); }
.series-total { color: var(--cream); stroke: var(--cream); }
.neutral { color: var(--muted) !important; }

/* AF2 P13 Desktop: volle Iframe-Breite und lesbare Portfolio-Skalierung. */
@media (min-width: 1200px) {
  .portfolio-close { width: 48px; height: 48px; font-size: 29px; }
  .portfolio-overlay-body { padding: 22px 26px 28px; }
  .portfolio-content-title { font-size: 26px; }
  .portfolio-watchlist { padding: 18px 20px; }
  .portfolio-watchlist h3,
  .portfolio-section h3 { font-size: 20px; }
  .portfolio-watchlist .portfolio-section-heading p,
  .portfolio-analysis-heading p,
  .portfolio-effective-note,
  .portfolio-model-note,
  .portfolio-form-message { font-size: 12px; }
  .portfolio-watchlist-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
  .portfolio-watchlist-row { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; padding: 12px; }
  .portfolio-watchlist-logo,
  .portfolio-asset-logo { width: 48px; height: 48px; font-size: 11px; }
  .portfolio-watchlist-copy strong,
  .portfolio-asset-copy strong,
  .portfolio-factsheet-card > header strong { font-size: 14px; }
  .portfolio-watchlist-copy span,
  .portfolio-asset-copy span,
  .portfolio-factsheet-card > header span { font-size: 11px; }
  .portfolio-watchlist-actions button,
  .portfolio-start-date-control button,
  .portfolio-remove,
  .portfolio-range-switch button { min-height: 38px; font-size: 11px; }
  .portfolio-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .portfolio-section,
  .portfolio-distributions > section,
  .portfolio-history,
  .portfolio-monthly-transactions,
  .portfolio-components,
  .portfolio-factsheet { padding: 20px; }
  .portfolio-field > span,
  .portfolio-asset-row label > span,
  .portfolio-start-date-control small,
  .portfolio-start-date-control em,
  .portfolio-section-heading span,
  .portfolio-kpis span,
  .portfolio-kpis small,
  .portfolio-periods span,
  .portfolio-components span,
  .portfolio-components p,
  .portfolio-factsheet .portfolio-section-heading p,
  .portfolio-monthly-heading p,
  .portfolio-month-picker,
  .portfolio-monthly-summary span,
  .portfolio-monthly-purchase dt,
  .portfolio-monthly-purchase dd small,
  .rebalancing-controls label,
  .rebalancing-confirm label,
  .rebalancing-summary span,
  .rebalancing-table-wrap thead th,
  .rebalancing-table-wrap tbody th span,
  .rebalancing-warning { font-size: 11px; }
  .portfolio-field input,
  .portfolio-field select,
  .portfolio-asset-row input,
  .rebalancing-controls select,
  .rebalancing-controls input,
  .rebalancing-confirm input { min-height: 46px; font-size: 14px; }
  .portfolio-asset-row { grid-template-columns: 48px minmax(0, 1fr) 145px auto; gap: 12px; padding: 12px; }
  .portfolio-weight-total,
  #portfolio-save-status,
  .portfolio-empty p,
  .portfolio-empty-inline,
  .portfolio-chart-legend li,
  .portfolio-chart-legend strong,
  .portfolio-periods strong,
  .portfolio-monthly-summary strong,
  .portfolio-monthly-purchase dd,
  .portfolio-components strong,
  .portfolio-factsheet-card > header em,
  .portfolio-factsheet-card > footer strong,
  .portfolio-analysis-loading,
  .portfolio-analysis-error,
  .portfolio-analysis-empty,
  .portfolio-chart-empty { font-size: 13px; }
  .portfolio-save { min-height: 48px; padding-inline: 22px; font-size: 13px; }
  .portfolio-analysis-heading h3 { font-size: 25px; }
  .portfolio-analysis h4 { font-size: 17px; }
  .portfolio-month-picker select { min-height: 44px; font-size: 13px; }
  .portfolio-monthly-logo { width: 48px; height: 48px; font-size: 11px; }
  .portfolio-monthly-purchase > header { grid-template-columns: 48px minmax(0, 1fr); }
  .portfolio-monthly-purchase > header strong { font-size: 14px; }
  .portfolio-monthly-purchase > header span { font-size: 10px; }
  .portfolio-kpis strong { font-size: 24px; }
  .portfolio-chart-label,
  .portfolio-factsheet-card svg text { font-size: 11px; }
  .portfolio-factsheet-card > footer span { font-size: 10px; }
  .rebalancing-summary strong { font-size: 19px; }
  .rebalancing-table-wrap table { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-donut-segment { transition: none; }
}

@media (min-width: 681px) {
  .portfolio-open-button { display: inline-flex; align-items: center; justify-content: center; }
}
@media (min-width: 681px) and (max-width: 1023px) {
  .portfolio-form-grid { grid-template-columns: 1fr; }
  .portfolio-analysis-heading { align-items: flex-start; flex-direction: column; }
  .portfolio-distribution-chart { grid-template-columns: 150px minmax(0, 1fr); }
  .portfolio-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-periods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-components > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-monthly-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-monthly-purchases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-factsheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rebalancing-controls { grid-template-columns: 1fr 1fr; }
  .rebalancing-controls button { grid-column: 1 / -1; }
  .rebalancing-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .rebalancing-confirm { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .portfolio-section-heading.portfolio-watchlist-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .portfolio-content-title { grid-column: 1 / -1; grid-row: 1; padding-inline: 48px; margin-bottom: 12px; }
  .portfolio-watchlist-heading > div { grid-column: 1; grid-row: 2; }
  .portfolio-watchlist-heading > span { grid-column: 2; grid-row: 2; padding-right: 0; }
  .portfolio-asset-row { grid-template-columns: 34px minmax(0, 1fr) 102px; }
  .portfolio-remove { grid-column: 2 / -1; justify-self: end; }
  .portfolio-distributions { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .portfolio-open-button,
  .portfolio-add-button,
  .portfolio-overlay { display: none !important; }
}
