/* map.arbou.live, the PER panel: a company's PER, shares, total earnings and EPS charts
   (heatmap-per.js, Chart.js), their chips, and the AAOIFI rings. */

/* A company's PER chart, in place of its candles: the candles' legend, plot and controls step
   aside; the Cours / PER switch stays. */
.hm-chart.is-per .hm-chart__plot,
.hm-chart.is-per > .hm-chart__head > .tech-chart-legend,
.hm-chart.is-per [data-heatmap-tools],
.hm-chart.is-per [data-heatmap-timeframes],
.hm-chart.is-per [data-heatmap-line] {
    display: none;
}

.hm-chart.is-empty .hm-per {
    visibility: hidden;
}

.hm-per {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
}

.hm-per[hidden] {
    display: none;
}

/* Each line's chip: its swatch, its name, today's figure and what it is made of; a click shows
   or hides the line. */
.hm-per__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hm-per__chip {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 7px;
    max-width: 100%;
    padding: 6px 11px;
    border: 1px solid var(--hm-line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--hm-ink);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: opacity .16s ease, border-color .16s ease;
}

.hm-per__chip::before {
    width: 16px;
    border-top: 2.5px solid var(--swatch);
    content: '';
}

.hm-per__chip strong {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.hm-per__chip:hover {
    border-color: #c8d1de;
}

/* A figure drawn as no line: the chip only reads, with no swatch. */
.hm-per__chip.is-static {
    cursor: default;
}

.hm-per__chip.is-static::before {
    display: none;
}

/* A figure chip in green, orange or red (a change over a year, the shares' change); details on
   hover. */
.hm-per__chip.hm-per__sharia {
    cursor: help;
}

.hm-per__sharia.is-pass strong {
    color: var(--hm-up);
}

.hm-per__sharia.is-near strong {
    color: #c27500;
}

.hm-per__sharia.is-fail strong {
    color: var(--hm-down);
}

/* The AAOIFI screen at the bottom of the PER panel: a head with the verdict, the rings' key, then
   two cards side by side, half the width each (one under the other on a narrow screen). */
.hm-aaoifi {
    display: grid;
    flex: none;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--hm-line);
}

.hm-aaoifi:empty {
    display: none;
}

.hm-aaoifi__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.hm-aaoifi__head h3 {
    margin: 0;
    color: var(--hm-ink);
    font-size: 15px;
    font-weight: 750;
}

.hm-aaoifi__verdict {
    padding: 3px 11px;
    border-radius: 999px;
    background: #eef1f6;
    color: var(--hm-muted);
    font-size: 12.5px;
    font-weight: 700;
}

.hm-aaoifi__verdict.is-pass {
    background: #e7f6f0;
    color: var(--hm-up);
}

.hm-aaoifi__verdict.is-near {
    background: #fdf3e1;
    color: #a86500;
}

.hm-aaoifi__verdict.is-fail {
    background: #fdecef;
    color: var(--hm-down);
}

.hm-aaoifi__meta {
    color: var(--hm-muted);
    font-size: 12px;
}

.hm-aaoifi__key {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    margin: 0;
    color: var(--hm-muted);
    font-size: 12px;
}

.hm-aaoifi__swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 3px;
    vertical-align: -1px;
}

.hm-aaoifi__swatch--mark {
    width: 3px;
    height: 13px;
    border-radius: 2px;
    vertical-align: -2px;
}

.hm-aaoifi__verify {
    font-style: italic;
}

.hm-aaoifi__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 760px) {
    .hm-aaoifi__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hm-aaoifi__card {
    display: flex;
    align-items: center;
    gap: 22px;
    min-width: 0;
    padding: 16px 22px 16px 16px;
    border: 1px solid var(--hm-line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(20, 32, 51, 0.04);
}

.hm-aaoifi__ring {
    flex: none;
    width: clamp(124px, 13vw, 172px);
    height: clamp(124px, 13vw, 172px);
}

.hm-aaoifi__ring circle {
    transition: opacity .15s ease;
}

.hm-aaoifi__ring circle:hover {
    opacity: .78;
}

.hm-aaoifi__label {
    fill: var(--hm-muted);
    font-family: Inter, system-ui, sans-serif;
    font-weight: 600;
}

.hm-aaoifi__value {
    fill: var(--hm-ink);
    font-family: Inter, system-ui, sans-serif;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.hm-aaoifi__body {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.hm-aaoifi__body h4 {
    margin: 0;
    color: var(--hm-ink);
    font-size: 14.5px;
    font-weight: 750;
}

.hm-aaoifi__base {
    margin: 2px 0 0;
    color: var(--hm-muted);
    font-size: 12px;
    line-height: 1.4;
}

.hm-aaoifi__row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.hm-aaoifi__which {
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.hm-aaoifi__name {
    color: var(--hm-ink);
    font-size: 13.5px;
    font-weight: 700;
}

.hm-aaoifi__name small {
    margin-left: 7px;
    color: var(--hm-muted);
    font-size: 11.5px;
    font-weight: 500;
}

.hm-aaoifi__status {
    display: block;
    margin-top: 2px;
    color: var(--hm-muted);
    font-size: 13px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.hm-aaoifi__status.is-pass {
    color: var(--hm-up);
}

.hm-aaoifi__status.is-near {
    color: #a86500;
}

.hm-aaoifi__status.is-fail {
    color: var(--hm-down);
}

.hm-aaoifi__detail {
    display: block;
    margin-top: 2px;
    color: var(--hm-muted);
    font-size: 11.5px;
    line-height: 1.4;
}

/* A plain chip that keeps its line's colour (the earnings chart's). */
.hm-per__chip.is-label {
    cursor: default;
}

.hm-per__chip.is-label:hover {
    border-color: var(--hm-line);
}

.hm-per__chip.is-static:hover {
    border-color: var(--hm-line);
}

.hm-per__chip[aria-pressed="false"] {
    opacity: .45;
}

.hm-per__chip:focus-visible {
    outline: 3px solid #8fb0ff;
    outline-offset: 2px;
}

/* The PER chart takes half the room left by the legends, the earnings and share charts a quarter
   each: grow factors take those shares of the free space. On a short screen the panel scrolls. */
.hm-per__plot {
    position: relative;
    flex: 0.5 1 0;
    min-height: 230px;
}

.hm-per__plot--eps {
    flex: 0.25 1 0;
    min-height: 140px;
}

.hm-per__plot--shares {
    flex: 0.25 1 0;
    min-height: 130px;
}

/* The total earnings' bars, a little taller than the lines: room for their change above them. */
.hm-per__plot--totals {
    flex: 0.3 1 0;
    min-height: 180px;
}

.hm-per__note {
    margin: 0;
    color: var(--hm-muted);
    font-size: 12.5px;
}

.hm-per__note[hidden] {
    display: none;
}
