/* The six chart apps (bar, line, pie, scatter, pyramid chart makers and the diagram maker; Landing/ChartMakers.cs):
   only what is their own - the chart's box, its hover read-out and the editable data table. Panels, fields, buttons,
   the playback bar and colours come from the app kit (css/app-kit, docs/app-kit.md). Loaded only on their pages
   (StylePaths in SeoFilterDemoCatalog.ChartMakers.cs). */

/* The chart: as wide as the panel, 16:10, no taller than the screen allows. */
.cm-chart-wrap {
    position: relative;
    width: 100%;
    height: clamp(260px, min(62.5cqw, calc(100vh - 260px)), 640px);
}

.cm-chart-panel {
    container-type: inline-size;
}

.cm-chart {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--ak-radius, 12px);
    touch-action: pan-y;
}

.cm-tip {
    position: absolute;
    z-index: 2;
    max-width: min(18rem, 80%);
    padding: 0.45rem 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);
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

/* The data table: every cell is a field, compact, the numbers right-aligned. The selectors match the site's own
   input rule (input:not([type=...]) x4) so the kit's colours win, as .ak-field does in components.css. */
.cm-data-head {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
}

.cm-grid-wrap {
    max-height: 26rem;
}

.cm-grid {
    min-width: 100%;
    width: max-content;
}

.cm-grid th,
.cm-grid td {
    padding: 2px;
}

.cm-grid th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ak-panel);
}

.ak-app .cm-grid input.cm-cell:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="file"]) {
    width: 100%;
    min-width: 6.5rem;
    padding: 0.32rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--ak-field);
    color: var(--ak-text);
    font: inherit;
    font-size: var(--ak-fs-sm);
}

.ak-app .cm-grid input.cm-cell:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="file"]).ak-num {
    min-width: 5rem;
    text-align: end;
    font-variant-numeric: tabular-nums;
}

.ak-app .cm-grid input.cm-cell:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="file"]):hover {
    border-color: var(--ak-border);
}

.ak-app .cm-grid input.cm-cell:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="file"]):focus {
    border-color: var(--ak-accent);
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ak-accent) 25%, transparent);
}

.cm-head {
    font-weight: 600;
}

.cm-fixed {
    padding: 0.32rem 0.5rem;
    color: var(--ak-muted);
    font-size: var(--ak-fs-sm);
    white-space: nowrap;
}

.cm-paste {
    display: grid;
    gap: 0.5rem;
}

.cm-paste-text {
    min-height: 8rem;
}

.cm-paste-actions {
    display: flex;
    gap: 0.5rem;
}

.cm-status {
    margin: 0;
}
