/*
 * Aktienallianz member app (/depots).
 *
 * Direction: a calm trading-desk feel. One app shell (sidebar on desktop, tab bar on phones),
 * one dominant figure per page, charts without boxes around them, and data in quiet rows
 * instead of bordered widgets. Brand rules still hold: navy base, mint only for gains and
 * active states, solid colors (no gradients), serif only for headline figures and the
 * wordmark, tabular figures everywhere.
 *
 * Dark is the default theme; html[data-theme="light"] is the second theme.
 */

:root {
  --bg: #012041;
  --side: #011a36;
  --panel: #062b52;
  --panel-2: #0c3662;
  --hair: #14406e;
  --fg: #f3f6fa;
  --muted: #9db0c7;
  --faint: #6f88a6;
  --accent: #3ddc97;
  --accent-soft: #0d4553;
  --neg: #ff8a80;
  --neg-soft: #3d2a47;
  --warn: #f2b45c;
  --warn-soft: #3f3a3c;
  --pie-l: 56%;
  --pie-l2: 68%;
  --rate-1: #ff8a80;
  --rate-2: #ff9f5c;
  --rate-3: #f2cf5c;
  --rate-4: #a3e07a;
  --rate-5: #3ddc97;
  --on-accent: #012041;
  --panel-border: transparent;
  --shadow: none;
  --s1: #3ddc97;
  --s2: #8fb8ff;
  --s3: #1f9f72;
  --s4: #5b8def;
  --s5: #a6f0d0;
  --s6: #c4d4ea;
  --s7: #2f6fd0;
  --s8: #7f93ad;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-panel: 20px;
  --r-ctl: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f6f9;
  --side: #012041;
  --panel: #ffffff;
  --panel-2: #eef2f7;
  --hair: #e3e9f1;
  --fg: #012041;
  --muted: #4f6480;
  --faint: #8193aa;
  --accent: #0f9d6a;
  --accent-soft: #e1f4ea;
  --neg: #cf3f3f;
  --neg-soft: #fbe8e8;
  --warn: #b8690a;
  --warn-soft: #fbefdc;
  --pie-l: 40%;
  --pie-l2: 53%;
  --rate-1: #cf3f3f;
  --rate-2: #dc6a1a;
  --rate-3: #c79a12;
  --rate-4: #5aa83a;
  --rate-5: #0f9d6a;
  --on-accent: #ffffff;
  --panel-border: #e3e9f1;
  --shadow: 0 1px 2px #0120410a, 0 12px 32px #0120410a;
  --s1: #0f9d6a;
  --s2: #5b8def;
  --s3: #6fcfa8;
  --s4: #012041;
  --s5: #9db8ee;
  --s6: #4f6480;
  --s7: #b9e6d2;
  --s8: #b4c0d0;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.ic {
  width: 18px;
  height: 18px;
  flex: none;
  fill: currentColor;
}

.pos {
  color: var(--accent);
}

.neg {
  color: var(--neg);
}

/* ------------------------------------------------------------------- shell */

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px;
  background: var(--side);
  color: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  color: #ffffff;
}

.brand img {
  display: block;
  height: auto;
}

.brand span {
  font: 600 19px/1 var(--serif);
  letter-spacing: 0.005em;
}

.menu {
  display: grid;
  gap: 2px;
  margin-top: 36px;
}

.menu-label {
  margin: 22px 10px 8px;
  font-size: 12px;
  font-weight: 500;
  color: #6f88a6;
}

.menu a,
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-ctl);
  background: none;
  color: #9db0c7;
  font-weight: 500;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.menu a:hover,
.side-link:hover {
  color: #ffffff;
  background: #ffffff0d;
}

.menu a[aria-current="page"] {
  color: #ffffff;
  background: #ffffff14;
}

.menu a[aria-current="page"] .ic {
  color: #3ddc97;
}

.side-foot {
  margin-top: auto;
  display: grid;
  gap: 2px;
  padding-top: 16px;
  border-top: 1px solid #ffffff14;
}

.main {
  min-width: 0;
}

.topbar,
.tabbar {
  display: none;
}

.content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 40px 64px;
}

.view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

/* New pages ease in; each block follows the one before. */
@media (prefers-reduced-motion: no-preference) {
  .view > * {
    animation: rise 0.45s var(--ease) both;
  }

  .view > :nth-child(2) {
    animation-delay: 0.05s;
  }

  .view > :nth-child(3) {
    animation-delay: 0.1s;
  }

  .view > :nth-child(n + 4) {
    animation-delay: 0.15s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
  }
}

/* ------------------------------------------------------------- page header */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.page-title {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-sub {
  margin-top: 4px;
  color: var(--muted);
  max-width: 64ch;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  height: 32px;
  padding: 0 12px 0 8px;
  margin-bottom: -4px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.back:hover {
  color: var(--fg);
  background: var(--panel);
}

.back .ic {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------------ panels */

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  padding: 22px 24px 0;
}

.panel-h h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.panel-note {
  color: var(--faint);
  font-size: 13px;
}

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.cols--even {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Cards side by side that end on one line; the "more" link sits at the bottom. */
.cols--match {
  align-items: stretch;
}

.cols--match > .panel {
  display: flex;
  flex-direction: column;
}

.cols--match > .panel > .more {
  margin-top: auto;
}

.stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.empty-note {
  padding: 18px 24px 26px;
  color: var(--muted);
}

/* --------------------------------------------------------------- controls */

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 11px;
  background: var(--panel-2);
}

.seg button {
  border: 0;
  background: transparent;
  height: 28px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.seg button:hover {
  color: var(--fg);
}

.seg button[aria-pressed="true"] {
  background: var(--panel);
  color: var(--fg);
  box-shadow: 0 1px 2px #00000026;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-ctl);
  background: var(--panel-2);
  color: var(--fg);
  font-weight: 500;
  cursor: pointer;
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff14;
  color: #ffffff;
}

.chg {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.chg .ic {
  width: 13px;
  height: 13px;
}

.chg.pos {
  color: var(--accent);
}

.chg.neg {
  color: var(--neg);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.tag .ic {
  width: 13px;
  height: 13px;
}

.tag--neutral {
  background: var(--panel-2);
  color: var(--fg);
}

/* -------------------------------------------------------------------- logo */

.logo {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  background: var(--panel-2);
  color: var(--muted);
}

.logo.has-img {
  background: #ffffff;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
}

/* A square logo tile fills the box and is cropped a touch, so neither the white ground
   nor a hairline baked into the picture shows as an outline. */
.logo.is-tile {
  background: transparent;
}

.logo.is-tile img {
  padding: 0;
  object-fit: cover;
  transform: scale(1.07);
}

.logo--sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 11px;
}

.logo--sm img {
  padding: 5px;
}

.logo--lg {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  font-size: 17px;
}

.logo--lg img {
  padding: 10px;
}

.logo.is-cash {
  color: var(--accent);
}

/* -------------------------------------------------------------------- hero */

.hero {
  padding: 28px 0 0;
  overflow: hidden;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 0 28px;
}

.hero-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 500;
}

.hero-label .ic {
  width: 17px;
  height: 17px;
}

.hero-value {
  margin: 6px 0 8px;
  font: 600 clamp(44px, 6.4vw, 68px) / 1.02 var(--serif);
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
}

.hero-value .cur {
  margin-left: 0.14em;
  font-weight: 500;
  color: var(--faint);
}

.hero-value--price {
  font-size: clamp(36px, 5vw, 52px);
}

.hero-delta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 24px;
  font-size: 15px;
  color: var(--muted);
}

.hero-delta .chg {
  font-size: 15px;
  font-weight: 600;
}

.hero-delta .chg .ic {
  width: 15px;
  height: 15px;
}

.hero-side {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend i {
  width: 14px;
  height: 0;
  border-top: 2px solid var(--accent);
  border-radius: 2px;
}

.legend i.is-bench {
  border-top: 2px dashed var(--faint);
}

.legend i.is-buy,
.legend i.is-sell {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}

.legend i.is-sell {
  background: none;
  box-shadow: inset 0 0 0 2px var(--fg);
}

.legend b {
  font-weight: 600;
}

/* ------------------------------------------------------------------- chart */

.chart {
  position: relative;
  height: 300px;
  margin-top: 20px;
}

/* The stock chart carries zones, levels and an outlook: it gets more room. */
.chart.chart--tall {
  height: 420px;
}

@media (max-width: 720px) {
  .chart.chart--tall {
    height: 360px;
  }
}

/* Labels inside the plot sit on a small plate, so they read over lines and coloured bands. */
.chart .labels {
  pointer-events: none;
}

.chart .lbl-plate {
  fill: var(--panel);
  opacity: 0.86;
}

.chart text.lbl {
  font-size: 11.5px;
  font-weight: 600;
  stroke: none;
}

.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: pan-y;
  cursor: crosshair;
}

.chart text {
  fill: var(--faint);
  font: 400 11px var(--sans);
}

.chart .grid {
  stroke: var(--hair);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.chart .area {
  fill: var(--accent);
  opacity: 0.08;
}

.chart .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart .bench {
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.5;
  stroke-dasharray: 3 5;
  stroke-linejoin: round;
}

.chart .end {
  fill: var(--accent);
}

.chart .end-ring {
  fill: var(--accent);
  opacity: 0.18;
}

.chart .cross {
  stroke: var(--muted);
  stroke-width: 1;
}

.chart .dot {
  fill: var(--panel);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.chart .marker {
  stroke: var(--panel);
  stroke-width: 2;
}

.chart .marker--buy {
  fill: var(--accent);
}

.chart .marker--sell {
  fill: var(--panel);
  stroke: var(--fg);
  stroke-width: 2.5;
}

.chart .stem {
  stroke-width: 1.5;
  stroke-dasharray: 2 3;
}

.chart .stem--buy {
  stroke: var(--accent);
}

.chart .stem--sell {
  stroke: var(--muted);
}

.chart .flag--buy {
  fill: var(--accent);
}

.chart .flag--sell {
  fill: var(--fg);
}

.chart text.flag-text {
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

.chart text.flag-text--buy {
  fill: var(--on-accent);
}

.chart text.flag-text--sell {
  fill: var(--bg);
}

.chart-flag {
  position: absolute;
  top: -4px;
  transform: translateX(-50%);
  pointer-events: none;
  display: grid;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 2;
}

.chart-flag span {
  font-weight: 400;
  opacity: 0.75;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  padding: 0 24px;
  text-align: center;
  pointer-events: none;
}

.chart-empty .state-icon {
  margin-bottom: 8px;
}

.chart-empty strong {
  font-weight: 600;
}

.chart-empty span {
  color: var(--muted);
  font-size: 13px;
}

@media (prefers-reduced-motion: no-preference) {
  .line-draw {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 1s var(--ease) 0.1s forwards;
  }

  @keyframes draw {
    to {
      stroke-dashoffset: 0;
    }
  }
}

/* ------------------------------------------------------------------- stats */

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 8px;
  border-top: 1px solid var(--hair);
}

.stats--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  display: grid;
  gap: 3px;
  align-content: start;
  padding: 20px 28px 22px;
}

/* Five tiles with longer notes (stock page): a little less air at the sides. */
.stats--5 .stat {
  padding-inline: 20px;
}

.stat + .stat {
  border-left: 1px solid var(--hair);
}

.stat-l {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.stat-l .ic {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.stat-v {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.stat-s {
  color: var(--faint);
  font-size: 12.5px;
}

.panel > .stats:first-child {
  margin-top: 0;
  border-top: 0;
}

/* ---------------------------------------------------------- overview cards */

.depot-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.dcard {
  display: grid;
  overflow: hidden;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.dcard:hover {
  transform: translateY(-2px);
}

.dcard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px 0;
}

.dcard-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 500;
}

.dcard-go {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: var(--muted);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.dcard:hover .dcard-go {
  background: var(--accent);
  color: var(--on-accent);
}

.dcard-go .ic {
  width: 15px;
  height: 15px;
}

.dcard-value {
  padding: 6px 24px 0;
  font: 600 38px/1.1 var(--serif);
  letter-spacing: -0.015em;
  font-variant-numeric: lining-nums tabular-nums;
}

.dcard-value .cur {
  margin-left: 0.14em;
  font-weight: 500;
  color: var(--faint);
}

.dcard-delta {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 24px 0;
  color: var(--muted);
  font-size: 13px;
}

.dcard-delta .chg {
  font-weight: 600;
}

.mini {
  display: block;
  width: 100%;
  height: 84px;
  margin-top: 14px;
}

.mini .area {
  fill: var(--accent);
  opacity: 0.08;
}

.mini .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}

.mini-empty {
  height: 84px;
  margin-top: 14px;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 13px;
  border-top: 1px dashed var(--hair);
}

.dcard-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--hair);
}

.dcard-foot div {
  display: grid;
  gap: 1px;
  padding: 14px 24px 16px;
}

.dcard-foot div + div {
  border-left: 1px solid var(--hair);
}

.dcard-foot span {
  color: var(--faint);
  font-size: 12.5px;
}

.dcard-foot b {
  font-weight: 600;
}

/* -------------------------------------------------------------------- rows */

.rows {
  padding: 10px 12px 12px;
}

.row,
.row-head {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) 112px minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}

.row-head {
  height: 36px;
  color: var(--faint);
  font-size: 12.5px;
}

.row-head > * {
  justify-self: end;
}

.row-head > :first-child,
.row-head > :nth-child(2) {
  justify-self: start;
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  padding: 4px 0;
  background: none;
  color: inherit;
  font-size: inherit;
  cursor: pointer;
}

.sort:hover,
.sort[aria-sort] {
  color: var(--fg);
}

.sort .ic {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

.row {
  min-height: 68px;
  border-radius: 14px;
  transition: background 0.15s var(--ease);
}

a.row:hover {
  background: var(--panel-2);
}

.row + .row {
  box-shadow: 0 -1px 0 var(--hair);
}

a.row:hover,
a.row:hover + .row {
  box-shadow: none;
}

.cell-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nm {
  display: grid;
  min-width: 0;
}

.nm b {
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nm small,
.cell-num small {
  font-size: 12.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-num {
  display: grid;
  justify-items: end;
  gap: 1px;
  text-align: right;
  min-width: 0;
}

.cell-num b {
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
}

.cell-num .chg {
  font-size: 12.5px;
}

.weight {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--faint);
}

.bar {
  width: 56px;
  height: 4px;
  border-radius: 4px;
  background: var(--panel-2);
  overflow: hidden;
}

a.row:hover .bar {
  background: var(--panel);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}

.row--total {
  min-height: 52px;
  font-weight: 600;
}

.spark {
  width: 112px;
  height: 36px;
  display: block;
}

.spark path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.spark circle {
  fill: var(--accent);
}

.spark.neg path {
  stroke: var(--neg);
}

.spark.neg circle {
  fill: var(--neg);
}

.dash {
  color: var(--faint);
}

/* -------------------------------------------------------------- allocation */

.donut {
  position: relative;
  width: 176px;
  aspect-ratio: 1;
  max-width: 100%;
  margin: 22px auto 14px;
}

.donut svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.donut circle {
  transition: opacity 0.15s var(--ease), stroke-width 0.15s var(--ease);
  cursor: pointer;
}

.donut.is-focus circle {
  opacity: 0.25;
}

.donut.is-focus circle.is-on {
  opacity: 1;
  stroke-width: 22;
}

.donut .c {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  padding: 0 34px;
}

.donut .c b {
  white-space: nowrap;
  font: 600 32px/1 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
}

.donut .c span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-list {
  list-style: none;
  margin: 0;
  padding: 0 12px 14px;
}

.legend-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  min-width: 0;
  transition: background 0.15s var(--ease), opacity 0.15s var(--ease);
}

.legend-list li:hover,
.legend-list li.is-on {
  background: var(--panel-2);
}

.legend-list .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.legend-list .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-list .val {
  margin-left: auto;
  font-weight: 600;
  flex: none;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- pie view of a depot */

.panel-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pie-view {
  padding: 20px 24px 28px;
}

.pie {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.pie svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pie-slice {
  stroke: var(--panel);
  stroke-width: 3;
  stroke-linejoin: round;
  cursor: pointer;
  transform-origin: 210px 210px;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

.pie.is-focus .pie-slice {
  opacity: 0.4;
}

.pie.is-focus .pie-slice.is-on {
  opacity: 1;
  transform: scale(1.035);
}

.pie-logo {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 2px 10px #01204155;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

.pie.is-focus .pie-logo {
  opacity: 0.45;
}

.pie.is-focus .pie-logo.is-on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.12);
}

.pie-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 0 29%;
  text-align: center;
  pointer-events: none;
}

.pie-center span {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.3;
}

.pie-center b {
  font: 600 38px/1 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

.pie-center b.pos {
  color: var(--accent);
}

.pie-center b.neg {
  color: var(--neg);
}

.pie-center em {
  color: var(--faint);
  font-size: 12.5px;
  font-style: normal;
}

@media (max-width: 720px) {
  .pie-view {
    padding: 14px 12px 22px;
  }

  .pie-logo {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .pie-center b {
    font-size: 26px;
  }

  .pie-center span {
    font-size: 12px;
  }
}

.glance {
  list-style: none;
  margin: 0;
  padding: 8px 24px 12px;
}

.glance li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  min-width: 0;
}

.glance li + li {
  border-top: 1px solid var(--hair);
}

.glance .k {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  flex: none;
}

.glance .k .ic {
  width: 16px;
  height: 16px;
  color: var(--faint);
}

.glance .v {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
}

.glance .v span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- timeline */

.tl {
  list-style: none;
  margin: 0;
  padding: 8px 12px 12px;
}

.tl li {
  display: grid;
  grid-template-columns: 44px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
}

.tl li + li {
  box-shadow: 0 -1px 0 var(--hair);
}

.tl-date {
  display: grid;
  justify-items: center;
  line-height: 1.15;
  color: var(--faint);
  font-size: 11.5px;
}

.tl-date b {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
}

.tl-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 14.5px;
}

.tl-title a:hover {
  color: var(--accent);
}

.tl-sub {
  color: var(--faint);
  font-size: 12.5px;
}

.tl-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

/* Facts line under the name: depot and price, then the result as a pill. */
.tl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 3px;
}

.tl-perf {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.5;
  background: var(--panel-2);
  color: var(--muted);
  white-space: nowrap;
}

.tl-perf b {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.tl-perf.pos {
  background: var(--accent-soft);
}

.tl-perf.pos b {
  color: var(--accent);
}

.tl-perf.neg {
  background: var(--neg-soft);
}

.tl-perf.neg b {
  color: var(--neg);
}

/* Why we did it: a quiet box with a small label, two lines at most. */
.tl-why {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  align-items: baseline;
  margin-top: 9px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  max-width: 82ch;
}

/* Open (button) or on the News page: the whole reason. */
.tl-why.is-open p,
.tl-why.tl-why--full p {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.tl-why-more {
  grid-column: 2;
  justify-self: start;
  margin-top: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 12.5px/1.5 var(--sans);
  cursor: pointer;
}

.tl-why-more:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tl-why-more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.tl-why-label {
  flex: none;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.tl-why--note .tl-why-label {
  color: var(--muted);
}

.tl-why p {
  margin: 0;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tl-amt {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.tl--compact li {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  margin: 0 12px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.more:hover {
  background: var(--panel-2);
  color: var(--fg);
}

.more .ic {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------- watchlist */

.wgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.wcard {
  display: grid;
  gap: 14px;
  padding: 22px 24px 18px;
  transition: transform 0.2s var(--ease);
}

.wcard:hover {
  transform: translateY(-2px);
}

.wcard-link {
  display: grid;
  gap: 18px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.wcard-mid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.wcard-price {
  display: grid;
  gap: 2px;
}

.wcard-price b {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.stock-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.35;
}

.isin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.isin-copy {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.isin-copy:hover,
.isin-copy:focus-visible {
  background: var(--panel-2);
  color: var(--fg);
  outline: none;
}

.isin-copy .ic {
  width: 15px;
  height: 15px;
}

.aa-toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  max-width: min(90vw, 320px);
  padding: 10px 14px;
  border-radius: 12px;
  background: #011a36;
  color: #f3f6fa;
  border: 1px solid #18416d;
  box-shadow: 0 10px 30px #01204166;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.aa-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

:root[data-theme="light"] .aa-toast {
  background: #012041;
  border-color: #012041;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
}

.facts div {
  display: grid;
  gap: 1px;
}

.facts span {
  font-size: 12.5px;
  color: var(--faint);
}

.facts b {
  font-weight: 600;
}

/* -------------------------------------------------------------- stock page */

.ident {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 0 28px 20px;
}

.ident h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.ident p {
  color: var(--muted);
  font-size: 13px;
}

.ident-tags {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brief {
  padding: 24px 28px 28px;
  display: grid;
  gap: 26px;
}

.brief h2 {
  font-size: 15px;
  font-weight: 600;
}

.brief h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 12px;
}

.brief-summary {
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  max-width: 68ch;
}

.quote-box {
  position: relative;
  padding: 20px 22px 20px 26px;
  border-radius: 14px;
  background: var(--panel-2);
  max-width: 76ch;
}

.quote-box::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.quote-box h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--accent);
}

.quote-box h3 .ic {
  width: 15px;
  height: 15px;
}

.quote-box p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.quote-box small {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--faint);
}

.range {
  max-width: 560px;
}

.range-track {
  position: relative;
  height: 6px;
  border-radius: 6px;
  background: var(--panel-2);
}

.range-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 6px;
  background: var(--accent);
  opacity: 0.35;
}

.range-track i {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--panel);
  transform: translate(-50%, -50%);
}

.range-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--faint);
}

.range-ends b {
  color: var(--fg);
  font-weight: 600;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.score {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px;
  border-radius: 14px;
  background: var(--panel-2);
}

.score-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.score-top span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.score-top .ic {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.verdict {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--fg);
  font-size: 12px;
  font-weight: 500;
}

.score-v {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.score .bar {
  width: 100%;
  background: var(--panel);
}

.score .bar i {
  background: var(--muted);
}

.score p {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--faint);
}

/* ------------------------------------------------------- states + skeleton */

.state {
  max-width: 440px;
  margin: 14vh auto 0;
  text-align: center;
  color: var(--muted);
  display: grid;
  gap: 10px;
  justify-items: center;
}

.state h1 {
  color: var(--fg);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.state-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: var(--accent);
}

.state-icon .ic {
  width: 22px;
  height: 22px;
}

.state-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.aa-loader--page {
  min-height: min(70vh, 560px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  padding: 48px 16px;
}

/* Animated wordmark with a transparent background: white in the dark design, navy in the light one. */
.aa-loader-mark {
  display: block;
  width: min(320px, 78vw);
  aspect-ratio: 800 / 489;
  margin: 0 auto;
  background: url("/img/aktienallianz-loader-white.webp") center / contain no-repeat;
}

:root[data-theme="light"] .aa-loader-mark {
  background-image: url("/img/aktienallianz-loader-navy.webp");
}

.aa-loader-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.skeleton {
  display: grid;
  gap: 20px;
}

.sk {
  border-radius: var(--r-panel);
  background: var(--panel);
}

.sk-title {
  width: 220px;
  height: 30px;
  border-radius: 10px;
}

.sk-hero {
  height: 420px;
}

.sk-row {
  display: grid;
  grid-template-columns: 1.75fr 1fr;
  gap: 20px;
}

.sk-card {
  height: 260px;
}

@media (prefers-reduced-motion: no-preference) {
  .sk {
    animation: pulse 1.4s ease-in-out infinite;
  }

  @keyframes pulse {
    50% {
      opacity: 0.55;
    }
  }
}

.foot {
  margin-top: auto;
  padding-top: 36px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.55;
}

.foot p {
  max-width: 96ch;
}

.foot-legal a,
.foot-legal a:visited {
  color: inherit;
}

.foot-legal a:hover {
  color: var(--fg);
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .stack--side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 960px) {
  .app {
    display: block;
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .side {
    display: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
    background: #012041;
    border-bottom: 1px solid #ffffff14;
  }

  .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 6;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: #011a36;
    border-top: 1px solid #ffffff14;
  }

  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 52px;
    padding: 8px 2px 6px;
    border-radius: 12px;
    color: #9db0c7;
    font-size: 11px;
    font-weight: 500;
  }

  .tabbar .ic {
    width: 22px;
    height: 22px;
  }

  .tabbar a[aria-current="page"] {
    color: #ffffff;
  }

  .tabbar a[aria-current="page"] .ic {
    color: #3ddc97;
  }

  .content {
    /* Below the 60px top bar. */
    min-height: calc(100vh - 60px);
    padding: 28px 20px 40px;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats .stat:nth-child(4) {
    border-left: 0;
  }

  .stats .stat:nth-child(n + 4) {
    border-top: 1px solid var(--hair);
  }

  .stats--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats--4 .stat:nth-child(3) {
    border-left: 0;
  }

  .stats--4 .stat:nth-child(n + 3) {
    border-top: 1px solid var(--hair);
  }

  .stats--4 .stat:nth-child(4) {
    border-left: 1px solid var(--hair);
  }
}

@media (max-width: 680px) {
  .content {
    padding: 20px 14px calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .view,
  .cols,
  .stack,
  .depot-cards,
  .wgrid {
    gap: 14px;
  }

  .depot-cards,
  .stack--side {
    grid-template-columns: minmax(0, 1fr);
  }

  .wgrid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-head {
    gap: 12px;
  }

  .page-title {
    font-size: 22px;
  }

  .page-sub {
    font-size: 14px;
  }

  .hero {
    padding-top: 22px;
  }

  .hero-top,
  .ident {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-top {
    display: grid;
    gap: 16px;
  }

  .hero-value {
    font-size: clamp(28px, 9vw, 40px);
  }

  .hero-side {
    justify-items: start;
    width: 100%;
  }

  .seg {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .seg::-webkit-scrollbar {
    display: none;
  }

  .seg button {
    flex: none;
    min-height: 36px;
    padding: 0 12px;
  }

  .legend {
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .chart {
    height: 220px;
  }

  .wcard {
    padding: 18px 16px 14px;
  }

  .wcard-price b {
    font-size: 20px;
  }

  .isin-copy {
    width: 36px;
    height: 36px;
  }

  .stats,
  .stats--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat {
    padding: 16px 20px;
  }

  .stats .stat {
    border-left: 0;
    border-top: 1px solid var(--hair);
  }

  .stats .stat:nth-child(even) {
    border-left: 1px solid var(--hair);
  }

  .stats .stat:nth-child(-n + 2) {
    border-top: 0;
  }

  .stats:not(.stats--4) .stat:last-child {
    grid-column: 1 / -1;
    border-left: 0;
  }

  .panel-h {
    padding: 18px 20px 0;
  }

  .rows {
    padding: 6px 8px 8px;
  }

  .row,
  .row-head {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 14px;
    padding: 0 12px;
  }

  .row > :nth-child(2),
  .row > :nth-child(3),
  .row-head > :nth-child(2),
  .row-head > :nth-child(3) {
    display: none;
  }

  .weight .bar {
    display: none;
  }

  .tl li {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
  }

  .tl-date {
    display: none;
  }

  .brief {
    padding: 20px;
  }

  .ident-tags {
    display: none;
  }

  .legend-list {
    padding-left: 8px;
    padding-right: 8px;
  }

  .glance {
    padding-left: 20px;
    padding-right: 20px;
  }

  .sk-row {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------------- news */

.nw {
  list-style: none;
  margin: 0;
  padding: 8px 12px 12px;
}

.nw-day {
  padding: 16px 12px 6px;
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 500;
}

.nw-day:first-child {
  padding-top: 8px;
}

.nw-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  transition: background 0.15s var(--ease);
}

.nw-item:hover {
  background: var(--panel-2);
}

.nw-item + .nw-item {
  box-shadow: 0 -1px 0 var(--hair);
}

.nw-item:hover,
.nw-item:hover + .nw-item {
  box-shadow: none;
}

.nw-tile {
  flex: none;
  display: block;
}

.logo.is-src {
  color: var(--faint);
}

.logo.is-src .ic {
  width: 16px;
  height: 16px;
}

.nw-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.nw-title {
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* The whole row is the click target for the article. */
.nw-item {
  position: relative;
}

.nw-title::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
}

.nw-item:hover .nw-title {
  color: var(--accent);
}

.nw-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 12.5px;
}

.nw-chip,
.nw-tile {
  position: relative;
  z-index: 1;
}

.nw-chip {
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.nw-item:hover .nw-chip {
  background: var(--panel);
}

.nw-chip:hover {
  color: var(--fg);
}

.nw-out {
  flex: none;
  color: var(--faint);
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}

.nw-item:hover .nw-out {
  opacity: 1;
}

.nw-out .ic {
  width: 15px;
  height: 15px;
}

@media (max-width: 960px) {
  .tabbar {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .tabbar a {
    font-size: 10.5px;
  }
}

@media (max-width: 680px) {
  .nw {
    padding: 6px 8px 8px;
  }

  .nw-out {
    display: none;
  }
}

/* ------------------------------------------------------------------- posts */

/* A list of our own posts: the rows of the news list, with two lines of text under the title. */
.pl .nw-item {
  align-items: flex-start;
}

.pl .logo {
  margin-top: 2px;
}

.pl .nw-out {
  align-self: center;
}

.pl-teaser {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.pl-flag {
  color: var(--accent);
  font-weight: 600;
}

/* The page of one post: a single column at reading width. */
.post {
  padding: 28px clamp(20px, 4vw, 40px) 30px;
}

/* One measure for every block, whatever its font size. */
.post > * {
  max-width: 700px;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 13px;
}

.post-stock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 4px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s var(--ease);
}

.post-stock:hover {
  color: var(--accent);
}

.post-title {
  margin-top: 18px;
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.post-lead {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.55;
}

.post-points {
  margin-top: 24px;
  padding: 18px 20px 20px;
  border-radius: 14px;
  background: var(--panel-2);
}

.post-points h2,
.post-outlook h2 {
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 600;
}

.post-points ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.post-points li {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.5;
}

.post-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.post-h {
  margin-top: 28px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.post-p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.65;
}

.post-outlook {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--hair);
}

.post-outlook p {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.6;
}

.post-foot {
  margin-top: 24px;
  color: var(--faint);
  font-size: 12.5px;
}

@media (max-width: 680px) {
  .post {
    padding: 22px 18px 24px;
  }

  .post-lead {
    font-size: 15.5px;
  }
}

/* ---------------------------------------------------------------------------------------
   Feedback round: buy/sell badges, valuation zones, toned key figures, euro-free depot view
   --------------------------------------------------------------------------------------- */

/* "K" / "V" badge on a stem above the day we bought or sold. */
.chart .kbadge {
  fill: var(--panel);
  stroke: var(--accent);
  stroke-width: 2;
}

.chart .kbadge--sell {
  stroke: var(--neg);
}

.chart text.kbadge-text {
  fill: var(--fg);
  font-size: 11.5px;
  font-weight: 700;
}

/* The count on the last badge of a long stack ("+3"). */
.chart text.kbadge-text--more {
  font-size: 9.5px;
}

.chart .stem {
  stroke-dasharray: none;
}

.chart .stem--sell {
  stroke: var(--neg);
}

/* Valuation zones behind the price line. */
.chart .zone--strong-under {
  fill: var(--accent);
  opacity: 0.17;
}

.chart .zone--under {
  fill: var(--accent);
  opacity: 0.07;
}

.chart .zone--over {
  fill: var(--warn);
  opacity: 0.08;
}

.chart .zone--strong-over {
  fill: var(--neg);
  opacity: 0.15;
}

.chart .area--quiet {
  opacity: 0.04;
}

.chart .zone-line {
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart .zone-line--under,
.chart .zone-line--strong-under {
  stroke: var(--accent);
}

.chart .zone-line--over {
  stroke: var(--warn);
}

.chart .zone-line--strong-over {
  stroke: var(--neg);
}

.chart text.zone-text {
  font-size: 11.5px;
  font-weight: 600;
}

.chart text.zone-text--under,
.chart text.zone-text--strong-under {
  fill: var(--accent);
}

.chart text.zone-text--over {
  fill: var(--warn);
}

.chart text.zone-text--strong-over {
  fill: var(--neg);
}

/* Key figures: the whole tile is tinted, the verdict carries the full colour. */
.score--good {
  background: color-mix(in srgb, var(--accent) 11%, var(--panel-2));
}

.score--bad {
  background: color-mix(in srgb, var(--neg) 12%, var(--panel-2));
}

.score--good .verdict {
  background: var(--accent);
  color: var(--on-accent, #012041);
  font-weight: 600;
}

.score--bad .verdict {
  background: var(--neg);
  color: var(--bg);
  font-weight: 600;
}

.score--good .bar i {
  background: var(--accent);
}

.score--bad .bar i {
  background: var(--neg);
}

/* Valuation scale: five zones from strongly undervalued to strongly overvalued. */
.val,
.val-tiles,
.scen-grid,
.cr-grid {
  display: grid;
  gap: 12px;
}

/* One row per zone, limit on the right; side by side only where five columns have room. */
.light {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.light-seg {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 12px;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--faint);
  font-size: 12.5px;
}

.light-seg b {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.light-seg.is-on {
  color: var(--fg);
}

.light-seg.is-on b {
  color: inherit;
}

/* The outer zones are solid, the inner ones tinted, fair is neutral. */
.light-seg--strong-under.is-on {
  background: var(--accent);
  color: var(--on-accent, #012041);
}

.light-seg--under.is-on {
  background: color-mix(in srgb, var(--accent) 30%, var(--panel-2));
}

.light-seg--fair.is-on {
  background: color-mix(in srgb, var(--fg) 14%, var(--panel-2));
  box-shadow: inset 0 0 0 1.5px var(--muted);
}

.light-seg--over.is-on {
  background: color-mix(in srgb, var(--warn) 32%, var(--panel-2));
}

.light-seg--strong-over.is-on {
  background: var(--neg);
  color: var(--bg);
}

@media (min-width: 1180px) {
  .light {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .light-seg {
    display: grid;
    align-content: start;
    padding: 12px 14px;
  }
}

.light-lim {
  display: grid;
  gap: 1px;
  text-align: right;
}

.light-eur {
  font-size: 11.5px;
  opacity: 0.75;
}

@media (min-width: 1180px) {
  .light-lim {
    text-align: left;
  }
}

.val-eur {
  margin-left: 8px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

/* Outlook to the right of today: dashed lines to the fair value and the analysts' target. */
.chart .today {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  opacity: 0.6;
}

.chart .outlook {
  fill: none;
  stroke-width: 1.75;
  stroke-dasharray: 5 5;
  stroke-linecap: round;
}

.chart .outlook--fair {
  stroke: var(--fg);
}

.chart .outlook--analyst {
  stroke: var(--s2);
}

.chart .outlook-tip--fair {
  fill: var(--fg);
}

.chart .outlook-tip--analyst {
  fill: var(--s2);
}

.chart text.outlook-text {
  font-size: 11.5px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--panel);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.chart text.outlook-text--fair {
  fill: var(--fg);
}

.chart text.outlook-text--analyst {
  fill: var(--s2);
}

.val-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.val-tiles {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.val-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 14px;
  background: var(--panel-2);
}

.val-tile > div:first-child {
  display: grid;
  gap: 4px;
}

.val-label,
.val-note,
.val-pot span {
  color: var(--muted);
  font-size: 13px;
}

.val-amount {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.val-pot {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.val-pot b {
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.val-pot {
  flex: none;
}

.val-pot b.pos,
.cell-num b.pos,
.facts b.pos,
.hero-value.pos {
  color: var(--accent);
}

.val-pot b.neg,
.cell-num b.neg,
.facts b.neg,
.hero-value.neg {
  color: var(--neg);
}

.zone-chip {
  justify-self: start;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  width: fit-content;
}

/* Chips under a watchlist name: the zone, and the depot that holds the stock. */
.wcard-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.zone-chip--held {
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--hair);
}

.zone-chip--strong-under {
  background: var(--accent);
  color: var(--on-accent, #012041);
}

.zone-chip--under {
  background: var(--accent-soft);
  color: var(--accent);
}

.zone-chip--fair {
  background: var(--panel-2);
  color: var(--muted);
}

.zone-chip--over {
  background: var(--warn-soft);
  color: var(--warn);
}

.zone-chip--strong-over {
  background: var(--neg);
  color: var(--bg);
}

.chg-note {
  margin-left: 6px;
  color: var(--faint);
  font-weight: 400;
}

/* Scenarios, chances and risks. */
.scen-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.scen,
.cr {
  padding: 18px;
  border-radius: 14px;
  background: var(--panel-2);
}

.scen h4,
.cr h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.scen h4 .ic,
.cr h4 .ic {
  width: 16px;
  height: 16px;
}

.scen--bull h4 .ic,
.cr--pos h4 .ic {
  color: var(--accent);
}

.scen--bear h4 .ic,
.cr--neg h4 .ic {
  color: var(--neg);
}

.scen p,
.cr li {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.cr-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.cr ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cr li {
  position: relative;
  padding-left: 16px;
}

.cr li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.cr--pos li::before {
  background: var(--accent);
}

.cr--neg li::before {
  background: var(--neg);
}

/* Depot strategy text. */
.about-text {
  max-width: 76ch;
  margin: 0;
  padding: 0 24px 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.about-text:last-child {
  padding-bottom: 24px;
}

.about-text--empty {
  color: var(--faint);
}

/* Euro-free positions table: one more column (potential), no amounts. */
.rows--pct .row,
.rows--pct .row-head {
  grid-template-columns: minmax(0, 1.5fr) 76px minmax(78px, 0.9fr) minmax(50px, 0.6fr) minmax(62px, 0.7fr) minmax(62px, 0.7fr);
  gap: 10px;
}

/* The share is a plain percentage here; the bar would not fit next to six columns. */
.rows--pct .weight .bar {
  display: none;
}

.rows--pct .weight {
  justify-content: flex-end;
}

.rows--pct .spark {
  width: 76px;
}

/* Overview card in the euro-free view: the donut with the performance in the middle. */
.donut--card {
  width: min(210px, 62%);
  margin: 6px auto 18px;
}

.donut--card .c b {
  font-family: var(--serif);
  font-size: 30px;
}

.donut--card.pos .c b {
  color: var(--accent);
}

.donut--card.neg .c b {
  color: var(--neg);
}

@media (max-width: 720px) {
  .rows--pct .row,
  .rows--pct .row-head {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .rows--pct .row > :nth-child(6),
  .rows--pct .row-head > :nth-child(6) {
    display: none;
  }

  .about-text {
    padding: 0 16px 12px;
  }
}

/* Watchlist card head: logo, name, then sector and ISIN with its copy button. */
.wcard-head {
  align-items: flex-start;
}

.wcard-title,
.wcard-logo {
  color: inherit;
  text-decoration: none;
}

.wcard-title:hover b {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wcard-head .stock-meta {
  margin-top: 2px;
}

.cols--single {
  grid-template-columns: minmax(0, 1fr);
}

/* Research blocks from the daily import: thesis, quarter, peer comparison, health grades. */
.thesis {
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--accent-soft);
}

.thesis h3 {
  margin: 0 0 6px;
  color: var(--accent);
}

.thesis p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
}

.cr--plain li::before {
  background: var(--muted);
}

.peer {
  border-radius: 14px;
  background: var(--panel-2);
  padding: 6px 18px;
}

.peer-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  min-height: 42px;
  font-size: 14px;
  color: var(--muted);
}

.peer-row + .peer-row {
  box-shadow: 0 -1px 0 var(--hair);
}

.peer-row > :not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.peer-row b {
  color: var(--fg);
  font-weight: 600;
}

.peer-head {
  font-size: 12.5px;
  color: var(--faint);
}

.peer-head > :nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peer-note {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 12.5px;
}

.grades {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.grade {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13.5px;
}

.grade-name {
  color: var(--fg);
  font-weight: 600;
}

/* Qualitäts-Check: five dots, filled up to the level. */
.grade-dots {
  display: flex;
  gap: 5px;
}

.grade-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--faint);
}

.grade-dots i.on {
  background: var(--fg);
  box-shadow: none;
}

.grade--good .grade-dots i.on {
  background: var(--accent);
}

.grade--bad .grade-dots i.on {
  background: var(--neg);
}

@media (max-width: 720px) {
  .peer {
    padding: 4px 12px;
  }

  .peer-row {
    grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 0.9fr));
    gap: 8px;
    font-size: 13px;
  }
}

/* AktienAllianz-Score: badge on watchlist cards, breakdown on the stock page. */
.aascore {
  display: grid;
  justify-items: center;
  align-content: center;
  flex: none;
  position: relative;
  width: 54px;
  height: 54px;
  margin-left: auto;
  color: var(--fg);
  line-height: 1;
}

/* The ring: a quiet track, filled as far as the score reaches in the colour of its step. */
.aascore svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.aascore-track,
.aascore-fill {
  fill: none;
  stroke-width: 7;
}

.aascore-track {
  stroke: color-mix(in srgb, var(--fg) 12%, transparent);
}

.aascore-fill {
  stroke: var(--rate, var(--muted));
  stroke-linecap: round;
}

.rate-1 {
  --rate: var(--rate-1);
}

.rate-2 {
  --rate: var(--rate-2);
}

.rate-3 {
  --rate: var(--rate-3);
}

.rate-4 {
  --rate: var(--rate-4);
}

.rate-5 {
  --rate: var(--rate-5);
}

.rate-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rate) 18%, transparent);
  color: var(--rate);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

.aascore b {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.aascore small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 9.5px;
}

.aascore--lg {
  width: 84px;
  height: 84px;
  margin-left: 0;
}

.aascore--lg .aascore-track,
.aascore--lg .aascore-fill {
  stroke-width: 6;
}

.aascore--lg b {
  font-size: 28px;
}

.aascore--lg small {
  font-size: 11px;
}

.scorebox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 20px 32px;
  align-items: center;
  padding: 20px;
  border-radius: 14px;
  background: var(--panel-2);
}

.scorebox-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.scorebox-head h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 6px;
}

.scorebox-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.scorebox-parts {
  display: grid;
  gap: 8px;
}

.scorepart {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 62px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13.5px;
}

.scorepart .bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--panel);
  overflow: hidden;
}

.scorepart .bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.scorepart b {
  color: var(--fg);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .scorebox {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  .aascore {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 720px) {
  .aascore--lg {
    width: 72px;
    height: 72px;
  }
}

/* Support and resistance lines in the price chart. */
.chart .lvl {
  stroke: var(--muted);
  stroke-width: 1.25;
  stroke-dasharray: 1 4;
  stroke-linecap: round;
}

.chart text.lvl-text {
  fill: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  paint-order: stroke;
  stroke: var(--panel);
  stroke-width: 4px;
  stroke-linejoin: round;
}

/* ------------------------------------------- investment thesis, deep dive */

.thesis-part + .thesis-part {
  margin-top: 14px;
}

.thesis-part h4 {
  margin: 0 0 3px;
  font-size: 13.5px;
  font-weight: 600;
}

.thesis-meta {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.thesis .thesis-meta {
  font-size: 12.5px;
}

.deepdive {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--hair);
  border-radius: 14px;
}

.deepdive b {
  display: block;
  font-size: 15px;
}

.deepdive span {
  color: var(--muted);
  font-size: 13px;
}

.deepdive .btn {
  flex: none;
  text-decoration: none;
}

/* ------------------------------------------------- folded on a phone only */

.fold > summary {
  display: none;
}

.fold-body {
  display: grid;
  gap: 26px;
}

@media (max-width: 720px) {
  .fold > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--hair);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
  }

  .fold > summary::-webkit-details-marker {
    display: none;
  }

  .fold > summary::after {
    content: '+';
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
  }

  .fold[open] > summary {
    margin-bottom: 16px;
  }

  .fold[open] > summary::after {
    content: '\2212';
  }

  .deepdive {
    flex-direction: column;
    align-items: stretch;
  }
}

.grade small {
  display: block;
  color: var(--faint);
  font-size: 12px;
}

/* ------------------------------------------------ key figures: explanations */

.stat--tip .stat-l {
  position: relative;
}

.stat-info {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 2px;
  padding: 0;
  border: 1px solid var(--faint);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: 600 10px/1 var(--sans, inherit);
  font-style: italic;
  cursor: help;
}

.stat-info:hover,
.stat-info:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.stat-tip {
  position: absolute;
  left: 0;
  /* Above the label: the panel clips anything below its bottom edge. */
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(280px, 78vw);
  padding: 10px 12px;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--fg);
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.stat-info:hover + .stat-tip,
.stat-info:focus + .stat-tip {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .stat-tip {
    transition: none;
  }
}

/* Each depot leads with what it is about: potential (growth), dividend yield (dividend). */
.stat--lead {
  background: var(--accent-soft);
}

.stat--lead .stat-v {
  font-size: 22px;
}

/* ------------------------------------------------------- News: company filter */

.news-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 40px;
  border: 1px solid var(--hair);
  border-radius: var(--r-ctl, 10px);
  background: var(--panel);
  color: var(--muted);
}

.news-filter .ic {
  width: 16px;
  height: 16px;
}

.news-filter select {
  min-width: 180px;
  max-width: 60vw;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
}

.news-filter select:focus {
  outline: none;
}

.news-filter:focus-within {
  border-color: var(--accent);
}

/* ------------------------------------------------------------------ Marktnews */

.news-switch {
  display: none;
  gap: 4px;
  width: fit-content;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--panel);
}

.news-switch a {
  padding: 7px 14px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.news-switch a.is-on {
  background: var(--panel-2);
  color: var(--fg);
}

/* The sidebar has both entries; the switch is for the phone tab bar's single "News". */
@media (max-width: 960px) {
  .news-switch {
    display: flex;
  }
}

.mk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 24px;
}

.mk-card {
  position: relative;
  overflow: hidden;
  padding: 14px 16px 0;
  border: 1px solid var(--hair);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--panel-2);
}

.mk-card.is-down {
  border-left-color: var(--neg);
}

.mk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mk-name {
  color: var(--muted);
  font-size: 13.5px;
}

.mk-pill {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.mk-pill.pos {
  background: var(--accent-soft);
}

.mk-pill.neg {
  background: var(--neg-soft);
}

.mk-value {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.mk-card .mini {
  height: 52px;
  margin: 8px -16px 0;
  width: calc(100% + 32px);
}

.mini--down .area {
  fill: var(--neg);
}

.mini--down .line {
  stroke: var(--neg);
}

.mk-note {
  margin: 10px 24px 20px;
  color: var(--faint);
  font-size: 12.5px;
}

.mk-meta {
  display: block;
  color: var(--faint);
  font-size: 12.5px;
}

.mk-breaking {
  padding: 18px 24px 20px;
  border-left: 3px solid var(--neg);
}

.mk-breaking-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mk-breaking-h h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}

.mk-breaking-h .ic {
  width: 17px;
  height: 17px;
  color: var(--neg);
}

.mk-badge {
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--neg-soft);
  color: var(--neg);
  font-size: 12px;
  font-weight: 600;
}

.mk-breaking-title {
  display: block;
  color: var(--fg);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.mk-breaking-title:hover {
  text-decoration: underline;
}

.mk-breaking-text {
  margin: 6px 0 6px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.mk-review {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 24px 20px;
  padding: 16px 18px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  color: var(--fg);
  text-decoration: none;
}

.mk-review:hover {
  border-color: var(--accent);
}

.mk-review > .ic {
  flex: none;
  color: var(--muted);
}

.mk-review-title {
  margin: 4px 0;
  font-size: 16px;
  font-weight: 600;
}

.mk-review-lead {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.mk-older {
  margin: -6px 24px 20px;
  padding: 0;
  list-style: none;
}

.mk-older li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--hair);
  font-size: 14px;
}

.mk-older a {
  color: var(--fg);
  text-decoration: none;
}

.mk-older a:hover {
  text-decoration: underline;
}

.mv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 24px 20px;
}

.mv {
  padding: 14px 16px;
  border: 1px solid var(--hair);
  border-radius: 12px;
}

.mv-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.mv-h .ic {
  width: 16px;
  height: 16px;
}

.mv-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mv-list li {
  padding: 8px 0 7px;
}

.mv-list li + li {
  border-top: 1px solid var(--hair);
}

.mv-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.mv-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mv-name small {
  margin-left: 6px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 400;
}

.mv-price {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.mv-bar {
  display: block;
  height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  background: var(--accent);
}

.mv-bar.is-down {
  background: var(--neg);
}

@media (max-width: 860px) {
  .mk-grid,
  .mv-grid {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 16px;
  }

  .mk-note,
  .mk-review,
  .mk-older {
    margin-inline: 16px;
  }

  .mk-breaking {
    padding-inline: 16px;
  }
}

.mk-more {
  margin: 4px 24px 22px;
}

@media (max-width: 860px) {
  .mk-more {
    margin-inline: 16px;
  }
}

/* Phone: the reason gets the full width, its label sits above it. */
@media (max-width: 560px) {
  .tl-why {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
    padding: 8px 10px;
  }

  .tl-why-more {
    grid-column: 1;
  }
}

/* ------------------------------------------------- fair value calculator (#rechner)
 * One column: a large search field, then the result card (price, fair value, zones,
 * chart). Quiet surfaces, one serif figure: the fair value. */

.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  max-width: 960px;
}

.calc-search {
  padding: 22px;
  position: relative;
  z-index: 3;
}

/* Nothing picked yet: the search alone, with room to breathe. */
.calc--empty {
  gap: 28px;
}

.calc--empty .calc-search {
  margin-top: 4vh;
  padding: 40px 36px 34px;
}

.calc--empty .calc-field input {
  height: 64px;
  font-size: 18px;
}

.calc--empty .calc-picks {
  margin-top: 22px;
}

.calc-field {
  position: relative;
}

.calc-field input {
  width: 100%;
  height: 58px;
  padding: 0 18px 0 52px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--bg);
  color: var(--fg);
  font: 500 17px/1 var(--sans);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.calc-field input::placeholder {
  color: var(--faint);
  font-weight: 400;
}

.calc-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.calc-mag {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--faint);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.calc-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 360px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.calc-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.calc-opt-text {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.calc-opt b {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-opt-text > span {
  flex: none;
  color: var(--faint);
  font-size: 12.5px;
}

/* Logo tile; initials on the same tile when there is no logo. */
.calc-logo {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  color: #012041;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.calc-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.calc-logo--sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 10.5px;
}

.calc-logo--lg {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  font-size: 15px;
}

.calc-who {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.calc-opt.is-active,
.calc-opt:hover {
  background: var(--panel-2);
}

.calc-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
}

.calc-picks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.calc-picks-l {
  margin-right: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.calc-chip {
  display: inline-flex;
  padding: 3px;
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px var(--hair);
  transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}

.calc-chip:hover {
  box-shadow: inset 0 0 0 2px var(--accent);
  transform: translateY(-1px);
}

.calc-chip:focus-visible,
.calc-covered:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.calc-slot {
  margin-top: 20px;
}

.calc-card {
  padding: 28px;
}

.calc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--hair);
}

.calc-id {
  min-width: 0;
}

.calc-name {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.calc-meta {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 13px;
}

.calc-price {
  display: grid;
  justify-items: end;
  gap: 3px;
  flex: none;
}

.calc-price b {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.calc-sum {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 28px;
  padding: 24px 0;
  border-bottom: 1px solid var(--hair);
}

.calc-l {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.calc-fv {
  display: block;
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 46px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.calc-pot {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.calc-pot.pos {
  background: var(--accent-soft);
  color: var(--accent);
}

.calc-pot.neg {
  background: var(--neg-soft);
  color: var(--neg);
}

.calc-zonebox .zone-chip {
  display: inline-block;
}

.calc-zonewrap {
  margin-top: 16px;
}

.calc-zones {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  height: 8px;
}

.calc-zone {
  border-radius: 4px;
  opacity: 0.35;
}

.calc-zone.is-on {
  opacity: 1;
}

.calc-zone--strong-under {
  background: var(--accent);
}

.calc-zone--under {
  background: var(--accent);
  opacity: 0.22;
}

.calc-zone--under.is-on {
  opacity: 0.6;
}

.calc-zone--fair {
  background: var(--faint);
}

.calc-zone--over {
  background: var(--warn);
}

.calc-zone--strong-over {
  background: var(--neg);
}

.calc-mark {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 0 3px var(--panel);
  transform: translate(-50%, -50%);
}

.calc-zonelabels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--faint);
  font-size: 11.5px;
}

.calc-facts {
  display: grid;
  gap: 14px;
  margin: 0;
  align-content: start;
}

.calc-facts dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.calc-facts dd {
  margin: 4px 0 0;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

.calc-chart {
  padding-top: 22px;
}

.calc-charthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.calc-charthead .calc-l {
  margin: 0;
}

.calc-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.calc-foot p {
  margin: 0;
  max-width: 88ch;
}

.calc-foot .calc-stand {
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
}

.calc-covered {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 600;
}

.calc-covered .ic {
  width: 14px;
  height: 14px;
}

.calc-none {
  margin: 20px 0 0;
  color: var(--muted);
}

.calc-loading {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 44px 20px;
  text-align: center;
  background: var(--panel);
  border-radius: var(--r-panel);
}

.calc-loading .aa-loader-mark {
  width: min(200px, 60vw);
  margin-bottom: 8px;
}

.calc-loading p {
  margin: 0;
  font-weight: 600;
}

.calc-loading-sub {
  color: var(--muted);
  font-size: 13px;
}

.calc-state h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.calc-state p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 860px) {
  .calc-sum {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .calc-fair {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .calc-search,
  .calc-card {
    padding: 18px;
  }

  .calc-head {
    flex-direction: column;
    gap: 10px;
  }

  .calc-price {
    justify-items: start;
  }

  .calc-sum {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .calc--empty .calc-search {
    margin-top: 2vh;
    padding: 26px 18px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .calc-field input,
  .calc-chip {
    transition: none;
  }
}

/* Calculator: loader steps and progress, then the result appears in sequence. */
.calc-step {
  min-height: 1.5em;
}

.calc-step.is-new {
  animation: calcStep 0.35s var(--ease) both;
}

.calc-progress {
  display: block;
  width: min(280px, 70vw);
  height: 4px;
  margin: 10px 0 6px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}

.calc-progress-fill {
  display: block;
  width: 4%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition-property: width;
  transition-timing-function: cubic-bezier(0.25, 0.8, 0.3, 1);
}

.calc-reveal .calc-head,
.calc-reveal .calc-fair,
.calc-reveal .calc-zonebox,
.calc-reveal .calc-facts,
.calc-reveal .calc-chart,
.calc-reveal .calc-foot {
  animation: calcIn 0.6s var(--ease) both;
}

.calc-reveal .calc-fair {
  animation-delay: 0.08s;
}

.calc-reveal .calc-zonebox {
  animation-delay: 0.22s;
}

.calc-reveal .calc-facts {
  animation-delay: 0.34s;
}

.calc-reveal .calc-chart {
  animation-delay: 0.5s;
}

.calc-reveal .calc-foot {
  animation-delay: 1.1s;
}

/* The potential appears once the fair value has counted up. */
.calc-reveal .calc-pot {
  animation: calcPop 0.5s var(--ease) 1.5s both;
}

.calc-reveal .calc-mark {
  transition: left 1.2s var(--ease) 0.6s;
}

/* The chart draws after the card is in, then the zones fade in behind the line. */
.calc-reveal .line-draw {
  animation-duration: 1.5s;
  animation-delay: 0.75s;
}

.calc-reveal .chart .zone {
  animation: calcFade 0.9s ease 1.4s both;
}

@keyframes calcIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes calcPop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
}

@keyframes calcFade {
  from {
    opacity: 0;
  }
}

@keyframes calcStep {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .calc-step.is-new,
  .calc-reveal .calc-head,
  .calc-reveal .calc-fair,
  .calc-reveal .calc-zonebox,
  .calc-reveal .calc-facts,
  .calc-reveal .calc-chart,
  .calc-reveal .calc-foot,
  .calc-reveal .calc-pot,
  .calc-reveal .chart .zone {
    animation: none;
  }

  .calc-progress-fill,
  .calc-reveal .calc-mark {
    transition: none;
  }
}

/* ------------------------------------------------- Dividend depot: calendar */

.divcal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 24px 0;
}

.divcal-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.divcal-badge .ic {
  width: 20px;
  height: 20px;
}

.divcal-head h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.divcal-head p {
  margin-top: 3px;
  max-width: 64ch;
  color: var(--muted);
  font-size: 13px;
}

.divcal-chart {
  position: relative;
  padding: 20px 24px 0;
}

.divcal-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  height: 236px;
}

.divcal-col {
  appearance: none;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.divcal-col:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.divcal-v {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}

.divcal-track {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.divcal-bar {
  display: block;
  width: 100%;
  /* Room for the amount above the tallest bar. */
  height: calc((100% - 26px) * var(--k));
  border-radius: 8px 8px 3px 3px;
  background: color-mix(in srgb, var(--accent) var(--a), var(--panel-2));
  transform-origin: bottom;
  transition: transform 0.8s var(--ease) calc(var(--i) * 45ms), opacity 0.2s;
}

.divcal-bar.is-empty {
  background: var(--hair);
}

.divcal:not(.is-in) .divcal-bar {
  transform: scaleY(0);
}

.divcal-m {
  padding-top: 9px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  white-space: nowrap;
}

.divcal-m small {
  margin-left: 1px;
  color: var(--faint);
  font-size: 10.5px;
}

/* One month in focus: the others step back. */
.divcal.is-active .divcal-col:not(.is-on) .divcal-bar {
  opacity: 0.32;
}

.divcal.is-active .divcal-col:not(.is-on) .divcal-v {
  color: var(--faint);
}

.divcal-col.is-on .divcal-m {
  color: var(--fg);
  font-weight: 600;
}

.divcal-tip {
  position: absolute;
  z-index: 5;
  width: min(264px, calc(50% - 30px));
  padding: 14px 16px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 2px 6px #0120411a, 0 16px 40px #01204129;
  pointer-events: none;
  animation: divcalTip 0.16s var(--ease);
}

@keyframes divcalTip {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.divcal-tip-h {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
}

.divcal-tip ul,
.divcal-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.divcal-tip li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.divcal-tip li > span:first-child {
  display: grid;
  min-width: 0;
}

.divcal-tip li b {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divcal-tip li small {
  color: var(--faint);
  font-size: 12px;
}

.divcal-amt {
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.divcal-none {
  color: var(--faint);
}

.divcal-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: center;
  margin: 22px 24px 0;
  padding: 18px 0;
  border-top: 1px solid var(--hair);
}

.divcal-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0 20px;
  border-left: 1px solid var(--hair);
}

.divcal-stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.divcal-stat span {
  color: var(--muted);
  font-size: 13px;
}

.divcal-stat b {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.divcal-stat small {
  overflow: hidden;
  color: var(--faint);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divcal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px 0 16px;
  border: 1px solid var(--hair);
  border-radius: var(--r-ctl);
  background: var(--panel-2);
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s;
}

.divcal-toggle:hover {
  border-color: var(--accent);
}

.divcal-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.divcal-toggle .ic {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.divcal-toggle .ic:last-child {
  transition: transform 0.2s var(--ease);
}

.divcal-toggle.is-open .ic:last-child {
  transform: rotate(180deg);
}

.divcal-all {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 2px 24px 6px;
}

.divcal-all[hidden] {
  display: none;
}

.divcal-card {
  padding: 14px 16px;
  border: 1px solid var(--hair);
  border-radius: 14px;
}

.divcal-card-h {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
}

.divcal-card ul {
  gap: 6px;
}

.divcal-card li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.divcal-card li.divcal-none {
  display: block;
}

.divcal-card li .n {
  overflow: hidden;
  color: var(--fg);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divcal-card li b {
  color: var(--fg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.divcal-note {
  padding: 8px 24px 22px;
  color: var(--faint);
  font-size: 12.5px;
}

@media (max-width: 1180px) {
  .divcal-v {
    font-size: 11px;
  }

  .divcal-bars {
    gap: 6px;
  }

  .divcal-foot {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 16px;
  }

  .divcal-toggle {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .divcal-all {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  /* Too narrow for amounts above every bar: tap a bar instead. */
  .divcal-v {
    visibility: hidden;
  }

  .divcal-head,
  .divcal-chart {
    padding-left: 16px;
    padding-right: 16px;
  }

  .divcal-bars {
    gap: 4px;
    height: 190px;
  }

  .divcal-m {
    font-size: 11px;
  }

  .divcal-m small {
    display: none;
  }

  /* Under the chart instead of beside the bar. */
  .divcal-tip {
    position: static;
    width: auto;
    margin-top: 14px;
    box-shadow: none;
    background: var(--panel-2);
  }

  .divcal-foot {
    grid-template-columns: minmax(0, 1fr);
    margin: 18px 16px 0;
  }

  .divcal-stat {
    padding: 0;
    border-left: 0;
  }

  .divcal-all {
    grid-template-columns: minmax(0, 1fr);
    padding: 2px 16px 6px;
  }

  .divcal-note {
    padding: 8px 16px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .divcal-bar,
  .divcal-toggle .ic:last-child {
    transition: none;
  }

  .divcal-tip {
    animation: none;
  }
}
