/* Polar number plot (/polar-number-plot): only what is the app's own - the square plot, its hover readout, the set
   chips and the checkbox grid. Panels, tables, fields, buttons and colours come from the app kit (css/app-kit,
   docs/app-kit.md). Loaded only on this app's page (StylePaths in its demo catalog entry). The set colours are in
   filter-engines/polar-number-plot.js (one light and one dark shade each) and arrive here as --pnp-c. */

/* The plot: a square as wide as the panel, no taller than the screen allows. */
.pnp-plot-wrap {
    position: relative;
    width: min(100%, calc(100vh - 230px));
    min-width: min(100%, 280px);
    aspect-ratio: 1 / 1;
    margin-inline: auto;
}

.pnp-plot {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--ak-radius, 12px);
    touch-action: none;
    cursor: crosshair;
}

.pnp-tip {
    position: absolute;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: min(18rem, 80%);
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--ak-border);
    border-radius: 10px;
    background: var(--ak-panel);
    color: var(--ak-text);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
    font-size: var(--ak-fs-sm);
    pointer-events: none;
}

.pnp-tip-n {
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

.pnp-tip-coords {
    color: var(--ak-muted);
    font-variant-numeric: tabular-nums;
}

.pnp-chips,
.pnp-sets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.pnp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.05rem 0.45rem 0.05rem 0.35rem;
    border: 1px solid var(--ak-border);
    border-radius: 999px;
    font-size: var(--ak-fs-xs);
    line-height: 1.5;
    white-space: nowrap;
}

.pnp-chip::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--pnp-c);
}

.pnp-legend {
    justify-content: center;
}

.pnp-legend-count {
    color: var(--ak-text);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* Table view */
.pnp-row-set {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.pnp-first {
    color: var(--ak-muted);
    font-variant-numeric: tabular-nums;
}

.pnp-numbers-table td.pnp-sets {
    display: table-cell;
    min-width: 14rem;
    white-space: normal;
}

.pnp-numbers-table td.pnp-sets .pnp-chip {
    margin: 0.1rem 0.25rem 0.1rem 0;
}

.pnp-table-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
}

.pnp-table-tools .ak-btn {
    margin-inline-start: auto;
}

.pnp-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--ak-muted);
    font-size: var(--ak-fs-sm);
}

.pnp-inline .ak-field {
    width: auto;
}

.pnp-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.pnp-page-label {
    min-width: 10rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* The set checkboxes: two columns, each with its colour. */
.pnp-set-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 0.75rem;
}

.pnp-set-dot {
    flex: none;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--pnp-c, var(--ak-muted));
}

/* Long compound words (Zwillingsprimzahlen) hyphenate instead of breaking at a random letter. */
.pnp-set span:last-child {
    min-width: 0;
    overflow-wrap: break-word;
    hyphens: auto;
}
