/* NorthSea Tools - Centering Checker */

.nst-centering {
    --nst-outer: #6d4eec;
    --nst-inner: #ff9f1c;
    --nst-ink: #14161c;
    --nst-muted: #616a7d;
    --nst-line: #e2e5ec;
    --nst-bg: #ffffff;
    --nst-soft: #f6f7fa;
    --nst-ok: #11875a;
    --nst-bad: #c02b1f;
    --nst-accent-soft: #f2effe;
    --nst-bad-soft: #fdecea;
    --nst-radius: 10px;

    max-width: 960px;
    margin: 0 auto;
    color: var(--nst-ink);
    font-size: 16px;
    line-height: 1.55;
    box-sizing: border-box;
}

.nst-centering *,
.nst-centering *::before,
.nst-centering *::after {
    box-sizing: inherit;
}

/* Dark surfaces. Applied by the script, or forced with theme="dark". */
.nst-centering.nst-theme-dark {
    --nst-ink: #f3f5f9;
    --nst-muted: #a6aec0;
    --nst-line: #333b4a;
    --nst-bg: #171a21;
    --nst-soft: #1f232c;
    --nst-ok: #3ddc97;
    --nst-bad: #ff7468;
    --nst-accent-soft: #241f3d;
    --nst-bad-soft: #3a1e1b;
}

.nst-centering.nst-theme-dark .nst-drop {
    background: var(--nst-soft);
}

.nst-head {
    margin-bottom: 20px;
}

.nst-centering .nst-title,
.nst-centering .nst-results-title,
.nst-centering .nst-step,
.nst-centering .nst-margins,
.nst-centering .nst-grades td:not(.nst-status),
.nst-centering .nst-score-value,
.nst-centering .nst-cta-body strong {
    color: var(--nst-ink);
}

.nst-centering .nst-intro,
.nst-centering .nst-hint,
.nst-centering .nst-side-hint,
.nst-centering .nst-disclaimer,
.nst-centering .nst-drop-sub,
.nst-centering .nst-grades thead th {
    color: var(--nst-muted);
}

.nst-title {
    margin: 0 0 6px;
    font-size: 1.6em;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.nst-intro {
    margin: 0;
    color: var(--nst-muted);
}

/* Dropzone */

.nst-drop {
    border: 2px dashed var(--nst-line);
    border-radius: var(--nst-radius);
    background: var(--nst-soft);
    padding: 40px 24px;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
    cursor: pointer;
}

.nst-drop.is-over {
    border-color: var(--nst-outer);
    background: var(--nst-accent-soft);
}

.nst-drop-icon {
    width: 40px;
    height: 40px;
    display: block;
    margin: 0 auto 12px;
    fill: none;
    stroke: var(--nst-outer);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nst-drop-hint {
    margin: 0 0 4px;
    font-weight: 600;
}

.nst-drop-sub {
    margin: 0 0 16px;
    font-size: 0.88em;
    color: var(--nst-muted);
}

.nst-file {
    display: none;
}

/* Buttons */

.nst-btn {
    display: inline-block;
    border: 1px solid var(--nst-outer);
    background: var(--nst-outer);
    color: #fff;
    border-radius: 6px;
    padding: 9px 18px;
    font: inherit;
    font-size: 0.92em;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.15s ease;
}

.nst-btn:hover {
    filter: brightness(1.08);
    color: #fff;
}

.nst-btn-ghost {
    background: transparent;
    color: var(--nst-ink);
    border-color: var(--nst-line);
}

.nst-btn-ghost:hover {
    color: var(--nst-ink);
    border-color: var(--nst-muted);
    filter: none;
}

/* Toolbar */

.nst-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin-bottom: 12px;
}

.nst-seg {
    display: inline-flex;
    border: 1px solid var(--nst-line);
    border-radius: 6px;
    overflow: hidden;
}

.nst-seg-btn {
    border: 0;
    background: var(--nst-bg);
    color: var(--nst-muted);
    font: inherit;
    font-size: 0.86em;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    line-height: 1.2;
}

.nst-seg-btn + .nst-seg-btn {
    border-left: 1px solid var(--nst-line);
}

.nst-seg-btn.is-active {
    background: var(--nst-ink);
    color: var(--nst-bg);
}

.nst-seg-btn[data-nst-target="outer"].is-active {
    background: var(--nst-outer);
}

.nst-seg-btn[data-nst-target="inner"].is-active {
    background: var(--nst-inner);
    color: #23180a;
}

.nst-rotate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86em;
    color: var(--nst-muted);
}

.nst-rotate input {
    width: 130px;
}

.nst-rotate output {
    font-variant-numeric: tabular-nums;
    min-width: 44px;
    color: var(--nst-ink);
    font-weight: 600;
}

.nst-toolbar-actions {
    display: inline-flex;
    gap: 8px;
    margin-left: auto;
}

.nst-step {
    margin: 0 0 10px;
    font-size: 0.9em;
    font-weight: 600;
}

/* Canvas */

.nst-canvas-wrap {
    position: relative;
    background: #10121a;
    border-radius: var(--nst-radius);
    overflow: hidden;
}

.nst-canvas {
    display: block;
    width: 100%;
    touch-action: none;
    cursor: crosshair;
    outline: none;
}

.nst-canvas:focus-visible {
    box-shadow: inset 0 0 0 2px var(--nst-outer);
}

.nst-loupe {
    position: absolute;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    z-index: 3;
}

.nst-hint {
    margin: 10px 0 0;
    font-size: 0.82em;
    color: var(--nst-muted);
}

.nst-error {
    margin: 14px 0 0;
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--nst-bad-soft);
    color: var(--nst-bad);
    font-size: 0.9em;
    font-weight: 600;
}

/* Results */

.nst-results {
    margin-top: 24px;
    border: 1px solid var(--nst-line);
    border-radius: var(--nst-radius);
    padding: 20px;
    background: var(--nst-bg);
    color: var(--nst-ink);
}

.nst-results-title {
    margin: 0 0 14px;
    font-size: 1.15em;
}

.nst-scores {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.nst-score {
    background: var(--nst-soft);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.nst-score-worst {
    background: var(--nst-accent-soft);
}

.nst-score-label {
    display: block;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nst-muted);
    font-weight: 700;
}

.nst-score-value {
    display: block;
    font-size: 1.7em;
    font-weight: 700;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

.nst-score-sub {
    display: block;
    font-size: 0.78em;
    color: var(--nst-muted);
}

.nst-margins {
    margin: 14px 0 0;
    font-size: 0.86em;
    color: var(--nst-muted);
    font-variant-numeric: tabular-nums;
}

.nst-margins-label {
    font-weight: 700;
    color: var(--nst-ink);
}

.nst-grades {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    font-size: 0.9em;
}

.nst-grades th,
.nst-grades td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--nst-line);
}

.nst-grades thead th {
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nst-muted);
}

.nst-centering .nst-grades td.nst-status {
    font-weight: 700;
    white-space: nowrap;
}

.nst-centering .nst-grades td.nst-status.is-pass {
    color: var(--nst-ok);
}

.nst-centering .nst-grades td.nst-status.is-fail {
    color: var(--nst-bad);
}

/* Kleur alleen is niet genoeg voor wie kleurenblind is; een teken ervoor wel. */
.nst-centering .nst-grades td.nst-status::before {
    display: inline-block;
    width: 1.1em;
    font-weight: 700;
}

.nst-centering .nst-grades td.nst-status.is-pass::before {
    content: "\2713";
}

.nst-centering .nst-grades td.nst-status.is-fail::before {
    content: "\2715";
}

.nst-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.nst-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border-radius: 8px;
    background: var(--nst-accent-soft);
}

.nst-cta-body {
    flex: 1 1 260px;
}

.nst-cta-body strong {
    display: block;
}

.nst-cta-body span {
    font-size: 0.9em;
    color: var(--nst-muted);
}

.nst-disclaimer {
    margin: 18px 0 0;
    font-size: 0.78em;
    color: var(--nst-muted);
}

@media (max-width: 600px) {
    .nst-scores {
        grid-template-columns: 1fr;
    }

    .nst-toolbar-actions {
        margin-left: 0;
        width: 100%;
    }

    .nst-rotate input {
        width: 100px;
    }
}


/* Side switcher, always visible above the dropzone and the stage */

.nst-sidebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 14px;
}

.nst-side-hint {
    margin: 0;
    font-size: 0.82em;
    flex: 1 1 240px;
}

.nst-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 7px;
    border-radius: 50%;
    background: currentColor;
    vertical-align: middle;
    opacity: 0.75;
}

.nst-drop-side {
    margin: 0 0 6px;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--nst-outer);
}

.nst-btn-ghost {
    color: var(--nst-ink);
}
