/* Otium app: Country and sector breakdowns (since 3.12.0): under the price history, the Portfolio's Exposure, the master
   view's Exposure by Profile and the Market's Missing Breakdowns. Load order: see index.html. */
/* five colours for the 5 largest, in a fixed order, plus a grey for Other (validated for colour blindness on each surface) */
:root { --mix1: #2a78d6; --mix2: #eb6834; --mix3: #1baf7a; --mix4: #eda100; --mix5: #e87ba4; --mix-other: #b5b4ad; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --mix1: #3987e5; --mix2: #d95926; --mix3: #199e70; --mix4: #c98500; --mix5: #d55181; --mix-other: #5d5c58; }
}
:root[data-theme="dark"] { --mix1: #3987e5; --mix2: #d95926; --mix3: #199e70; --mix4: #c98500; --mix5: #d55181; --mix-other: #5d5c58; }

/* the Breakdown under the price history (3.17.0): rows 1 to 4 in the level colours (--best, --good, --warn, --bad), 5 in this green */
:root { --mix-green: #1f9d4a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --mix-green: #4cc16a; } }
:root[data-theme="dark"] { --mix-green: #4cc16a; }

/* the strip (5 largest + Other), its legend and the bars */
.mixstrip { display: flex; gap: 2px; height: 14px; margin: 2px 0 8px; }
.mixstrip i { display: block; height: 100%; min-width: 2px; position: relative; overflow: hidden; }
.mixstrip i:first-child { border-radius: 4px 0 0 4px; } .mixstrip i:last-child { border-radius: 0 4px 4px 0; } .mixstrip i:only-child { border-radius: 4px; }
.mixlegend, .mixkey { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.mixlegend span::before, .mixkey span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--c); margin-right: 5px; }
.mixbars { display: grid; grid-template-columns: minmax(0, 10em) 1fr 3.6em; gap: 5px 10px; align-items: center; font-size: 13px; }
.mixbars.money { grid-template-columns: minmax(0, 10em) 1fr 3.6em 4.8em; }
.mixbars .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mixbars .v, .mixbars .eur { text-align: right; font-variant-numeric: tabular-nums; } .mixbars .eur { color: var(--text-2); }
.mixbars .tr { height: 10px; background: var(--grid); border-radius: 0 4px 4px 0; display: flex; }
.mixbars .tr > i { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.mixbars .tr.two { background: none; } .mixbars .tr.two > span { display: flex; gap: 2px; height: 100%; min-width: 2px; }
.mixbars .tr.two i { display: block; height: 100%; } .mixbars .tr.two i:last-child { border-radius: 0 4px 4px 0; }
@media (max-width: 560px) { .mixbars { grid-template-columns: minmax(0, 8.5em) 1fr 3.4em; } .mixbars.money { grid-template-columns: minmax(0, 8.5em) 1fr 3.4em 3.9em; gap: 5px 8px; } }
button.mixmore { padding: 0; margin-top: 6px; font-size: 13px; }
.seg.mixseg button { padding: 3px 10px; font-size: 13px; }

/* under the price history (Overview and pop-up) */
.mixbox { margin-top: 4px; }
.mixh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 8px; }
.mixh h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); font-weight: 600; }
.mixnone { margin: 0; }
#chartSlot .mixbox + p, #chartSlot > #chartBox > p.muted { margin: 4px 0 0; }
/* the periods share the full width on a phone (3.12.0: they ran past the screen) */
@media (max-width: 640px) {
  .seg.per { display: flex; width: 100%; overflow: visible; }
  .seg.per button { flex: 1 1 0; padding-left: 0; padding-right: 0; min-width: 0; }
  #chartSlot .row select { flex-basis: 100%; }
  .modal:has(#chartBox) { padding: 10px 8px; }
  #chartSlot .panel, .modal .panel.wide { padding: 12px; }
}

/* Portfolio: Exposure */
#expo .hrow, .mvmixh { justify-content: space-between; } #expo .hrow .seg, .mvmixh .seg { margin: 16px 0 4px; }
.expocover { margin: -4px 0 10px; }
.today[data-pt] { cursor: pointer; }
/* a fund's ticker and name opens its price history (3.18.0: the whole row before) */
.ptn { display: inline-block; cursor: pointer; border-radius: 6px; padding: 2px 6px; margin: -2px -6px; }
.ptn:hover { background: var(--accent-bg); }
/* Companies: the rest of the fund as a last row, over the full width (3.18.0) */
.mixbars .mixsep { grid-column: 1 / -1; height: 1px; background: var(--grid); }
.mixbars span.mixoth:not(.v) { grid-column: 1 / 3; color: var(--text-2); }
.mixbars .v.mixoth { color: var(--text-2); }

/* master view: Exposure by Profile */
.mvmixh { margin-top: 8px; }
.mvmix { display: grid; grid-template-columns: minmax(0, 9em) 1fr; gap: 10px 14px; align-items: center; font-size: 14px; }
.mvmix .tot { font-weight: 600; }
.mvmix .mixstrip { margin: 0; height: 18px; }
.mvmix .mixstrip i { cursor: pointer; }
.mvmix .mixstrip i b { position: absolute; left: 4px; top: 0; font-size: 10px; line-height: 18px; color: #fff; font-weight: 600; font-style: normal; white-space: nowrap; }
.mvmixtip { margin: 10px 0 0; }

/* Fund details: filled in from the scan */
.mixtag { display: inline-block; margin-left: 6px; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 99px; border: 1px solid var(--border); color: var(--text-2); text-transform: none; letter-spacing: 0; font-weight: 400; vertical-align: 1px; }
.mixfrom { font-size: 13px; color: var(--text-2); padding: 8px 12px; border-radius: 8px; background: var(--accent-bg); border: 1px solid var(--border); margin: 14px 0 0; }
.mixfrom b { color: var(--text); }

/* Market: Missing Breakdowns */
table.missing td.miss { color: var(--warn); font-weight: 600; white-space: nowrap; }
table.missing td.st { white-space: normal; font-size: 12px; color: var(--text-2); }   /* Why (since 3.13.0) */
table.missing td.act { text-align: right; width: 1%; } table.missing td.act button { padding: 4px 10px; font-size: 13px; white-space: nowrap; }
@media (max-width: 640px) { table.missing .hide-ph { display: none; } }

/* Portfolio, Exposure, Companies (3.15.0) and Missing Breakdowns' kinds */
.expocav { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--grid); }
#missingChips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
#missingChips button { font-size: 12px; padding: 3px 10px; border-radius: 99px; color: var(--text-2); }
#missingChips button.on { background: var(--accent-bg); border-color: var(--series); color: var(--text); }
/* Companies under the price history and in Exposure by Profile (3.16.0) */
.mvmix .mixstrip i.rest { background: var(--grid); cursor: default; }
@media (max-width: 560px) { .mixh { flex-wrap: wrap; } }
