/* ══════════════════════════════════════════════════════════════
   PATTERN — SORT profile (SORTERA app)

   Agenda-item assessment using the SORT model: 5 dimensions rated on
   sliders, aggregated into one of four categories (transformativ,
   utforskande, inkrementell, rutinmässig). Includes:

   - SORT data-viz tokens (4-tier category colors)
   - SORT indicators (colored circles for high/med/low)
   - SORT category badges
   - Agenda list + punkt (item) cards
   - Assessment form (punkt-title, mode-toggle, dimension sliders)
   - Results (summary grid, charts, legend, recommendations)
   - Team collaboration (share, participants, divergence)
   - History/compare views
   - OM (about) and METOD (method) content pages
   - Version timeline + Oversikt (overview) bars

   Base: strategios.css
   Used by: SORTERA (APP/SORTERA)
   Depends on: CSS variables from strategios.css

   Originally embedded as "§SORTERA" section in the canonical
   strategios.css file. Extracted 2026-04-11.
   ══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════
   SORT tokens (data viz colors, layout)
   ══════════════════════════════════════ */

:root {
    --color-high: #2e7d32;
    --color-med: #e6a817;
    --color-low: #9e9e9e;
    --color-explore: #d84315;
    --color-danger: #b71c1c;

    /* SORTERA layout overrides */
    --container: 56rem;
    --radius: 3px;
}

[data-theme="dark"] {
    --color-high: #5cb85c;
    --color-med: #f0c040;
    --color-low: #888888;
    --color-explore: #e57348;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-high: #5cb85c;
        --color-med: #f0c040;
        --color-low: #888888;
        --color-explore: #e57348;
    }
}

/* ══════════════════════════════════════
   SORT profile table
   ══════════════════════════════════════ */

.sort-table { width: 100%; border-collapse: collapse; margin: var(--s-4) 0; }
.sort-table th {
    font-size: 0.625rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--muted); text-align: center;
    padding: var(--s-2) var(--s-2); border-bottom: 2px solid var(--fg);
}
.sort-table th:first-child { text-align: left; }
.sort-table td {
    padding: var(--s-3) var(--s-2); text-align: center; vertical-align: middle;
    font-size: 0.875rem;
}
.sort-table td:first-child { text-align: left; font-weight: 500; font-size: 0.8125rem; }
.sort-table tr { border-bottom: 1px solid var(--border); }
.sort-table tbody tr:hover { background: var(--bg-alt); }

.sort-table--compact { font-size: 0.75rem; }
.sort-table--compact td,
.sort-table--compact th { padding: var(--s-1); }

/* ── SORT indicators (colored circles) ── */
.sort-indicator {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: 50%;
    font-size: 0.6875rem; font-weight: 600; color: var(--white);
    transition: transform var(--transition);
}
.sort-indicator:hover { transform: scale(1.1); }
.sort-indicator--high { background: var(--color-high); }
.sort-indicator--med { background: var(--color-med); color: var(--black); }
.sort-indicator--low { background: var(--color-low); }
.sort-indicator--sm { width: 1.625rem; height: 1.625rem; font-size: 0.5625rem; }

/* ── Category badges ── */
.badge--rutinmassig { background: var(--color-low); color: var(--white); }
.badge--inkrementell { background: var(--color-med); color: var(--black); }
.badge--utforskande { background: var(--color-explore); color: var(--white); }
.badge--transformativ { background: var(--color-high); color: var(--white); }
.badge--information { background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border); }
.badge--beslut { background: var(--fg); color: var(--bg); }
.badge--diskussion { background: var(--bg-alt); color: var(--fg); border: 1px solid var(--border-strong); }
.badge--ovrigt { background: var(--bg-alt); color: var(--muted); border: 1px solid var(--border); }

/* ══════════════════════════════════════
   Agenda
   ══════════════════════════════════════ */

.agenda-header { margin-bottom: var(--s-6); }
.punkt-list { margin-bottom: var(--s-6); }
.punkt-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--s-4); gap: var(--s-4);
}
.punkt-card__header { display: flex; align-items: center; gap: var(--s-4); flex: 1; }
.punkt-card__content { flex: 1; }
.punkt-card--assessed { border-left: 3px solid var(--color-high); }
.punkt-number {
    font-size: 0.75rem; font-weight: 600; color: var(--subtle);
    min-width: 1.75rem; text-align: center; font-variant-numeric: tabular-nums;
}
.punkt-text { font-size: 0.875rem; margin-bottom: var(--s-1); line-height: 1.4; }
.agenda-actions { display: flex; gap: var(--s-3); align-items: center; }

/* ══════════════════════════════════════
   Assessment form
   ══════════════════════════════════════ */

.punkt-title {
    font-style: italic; font-weight: 400; font-size: 1.5rem;
    margin-bottom: var(--s-8); line-height: 1.3;
    border-left: 3px solid var(--fg); padding-left: var(--s-4);
}
.bedom-form h2 { margin-top: var(--s-8); margin-bottom: var(--s-3); }

/* Slider container (NLP-vs-manual mode wrapper) */
.bedom-sliders { display: block; }

/* The range input itself (used inside .dim-row and team-bedom rows) */
.sort-slider {
    width: 100%; appearance: none; -webkit-appearance: none;
    height: 4px; background: var(--border); border-radius: 2px;
    outline: none; cursor: pointer;
}
.sort-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 1.25rem; height: 1.25rem; border-radius: 50%;
    background: var(--fg); cursor: pointer;
    border: 2px solid var(--bg);
}
.sort-slider::-moz-range-thumb {
    width: 1.25rem; height: 1.25rem; border-radius: 50%;
    background: var(--fg); cursor: pointer; border: 2px solid var(--bg);
}

/* Form wrapper for the lobby join code input */
.lobby-join-form {
    display: flex; gap: var(--s-2); align-items: center;
    margin-top: var(--s-2);
}

/* Method-page group wrapper (around metod-group-header + body) */
.metod-group { margin-bottom: var(--s-8); }

.mode-toggle {
    display: flex; gap: 0; margin: var(--s-4) 0 var(--s-2);
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    overflow: hidden; width: fit-content;
}
.mode-btn {
    padding: var(--s-2) var(--s-5); border: none; cursor: pointer;
    font-family: inherit; font-size: 0.8125rem; font-weight: 500;
    background: var(--bg-alt); color: var(--muted);
    transition: background 0.15s, color 0.15s;
}
.mode-btn + .mode-btn { border-left: 1px solid var(--border-strong); }
.mode-btn:hover { color: var(--fg); }
.mode-btn--active { background: var(--fg); color: var(--bg); }

/* Dimension sliders */
.dim-table { display: flex; flex-direction: column; }
.dim-row {
    display: grid; grid-template-columns: 10rem 7rem 1fr 7rem 2.5rem;
    align-items: center; gap: var(--s-3); padding: var(--s-3) 0;
    border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.dim-row:hover { background: var(--bg-alt); }
.dim-label { display: flex; align-items: baseline; gap: var(--s-2); }
.dim-key { font-weight: 600; font-size: 0.875rem; min-width: 1.5rem; color: var(--muted); }
.dim-name { font-size: 0.8125rem; font-weight: 500; }
.dim-info {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1rem; height: 1rem; border-radius: 50%;
    border: 1px solid var(--border-strong); color: var(--muted);
    font-size: 0.5625rem; font-weight: 600; cursor: help;
    position: relative; vertical-align: middle; margin-left: var(--s-1);
    transition: all var(--transition);
}
.dim-info:hover, .dim-info:focus { border-color: var(--fg); color: var(--fg); outline: none; }
.dim-tooltip {
    display: none; position: absolute; left: calc(100% + var(--s-2)); top: 50%;
    transform: translateY(-50%);
    background: var(--fg); color: var(--bg); font-size: 0.75rem; font-weight: 400;
    padding: var(--s-2) var(--s-3); border-radius: var(--radius);
    width: 16rem; line-height: 1.4; z-index: 10;
    white-space: normal; text-transform: none; letter-spacing: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.dim-info:hover .dim-tooltip, .dim-info:focus .dim-tooltip { display: block; }
.dim-lo, .dim-hi { font-size: 0.5625rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.3; }
.dim-lo { text-align: right; }
.dim-val { font-weight: 600; font-size: 1.125rem; text-align: right; font-variant-numeric: tabular-nums; min-width: 2.5rem; }

/* SORT uses thinner track + smaller thumb than strategios.css default */
input[type="range"] {
    height: 3px; background: var(--border); border-radius: 2px;
}
input[type="range"]:hover { background: var(--border-strong); }
input[type="range"]::-webkit-slider-thumb {
    width: 1rem; height: 1rem; border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
    width: 1rem; height: 1rem; border: none;
}

.bedom-actions {
    display: flex; justify-content: space-between; margin-top: var(--s-8);
    padding-top: var(--s-4); border-top: 2px solid var(--fg);
}
.bedom-actions--end { justify-content: flex-end; }

/* ══════════════════════════════════════
   Results
   ══════════════════════════════════════ */

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); margin-bottom: var(--s-6); }
.summary-card { text-align: center; padding: var(--s-4); }
.summary-count { display: block; font-size: 2.5rem; font-weight: 600; margin: var(--s-2) 0; font-variant-numeric: tabular-nums; line-height: 1; }
.summary-pct { font-size: 0.75rem; color: var(--muted); }
.result-card { margin-bottom: var(--s-4); }
.result-charts { display: flex; gap: var(--s-6); margin: var(--s-4) 0; justify-content: center; }
.chart-container { width: 180px; height: 180px; }
.chart-container--wide { width: 100%; max-width: 100%; margin: var(--s-6) 0; }
.result-scores { margin: var(--s-2) 0; }
.score-row { margin-bottom: var(--s-1); font-size: 0.8125rem; }
.score-chip {
    display: inline-block; padding: 0.125rem 0.375rem;
    background: var(--bg-alt); border-radius: 2px;
    font-size: 0.6875rem; font-weight: 600; margin-right: var(--s-1);
    font-variant-numeric: tabular-nums;
}

/* Legend + dots */
.legend { display: flex; align-items: center; gap: var(--s-4); margin-top: var(--s-2); margin-bottom: var(--s-4); }
.legend-item {
    display: inline-block; font-size: 0.75rem; font-weight: 600;
    padding: 0.2rem 0.625rem; border-radius: 2px;
    text-align: center; line-height: 1.4;
}
.legend-item.dot--high { background: var(--color-high); color: var(--white); }
.legend-item.dot--med { background: var(--color-med); color: var(--black); }
.legend-item.dot--low { background: var(--color-low); color: var(--white); }
.legend-label { font-size: 0.75rem; color: var(--muted); }
.dot { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; flex-shrink: 0; }
.dot--high { background: var(--color-high); }
.dot--med { background: var(--color-med); }
.dot--low { background: var(--color-low); }
.dot--explore { background: var(--color-explore); }
.dot--danger { background: var(--color-danger); }
.dot--sm { width: 0.5rem; height: 0.5rem; }
.dot--lg { width: 1rem; height: 1rem; }

.recommendation {
    margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--border);
}
.recommendation h4 {
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--muted); margin-bottom: var(--s-2);
}
.nuances { font-size: 0.8125rem; padding-left: var(--s-5); line-height: 1.5; }
.nuances li { margin-bottom: var(--s-1); }
.resultat-actions {
    display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-8);
    padding-top: var(--s-4); border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════
   Feedback widget
   Note: candidate for promotion to patterns/feedback-widget.css
   when a second app adopts the pattern.
   ══════════════════════════════════════ */

.feedback-section {
    max-width: 28rem; margin: var(--s-12) auto 0; text-align: center;
    padding-top: var(--s-8); border-top: 1px solid var(--border);
}
.feedback-heading { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; color: var(--muted); margin-bottom: var(--s-4); }
.feedback-rating { display: flex; gap: var(--s-1); justify-content: center; margin-bottom: var(--s-1); direction: rtl; }
.feedback-rating-option { cursor: pointer; }
.feedback-rating-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.feedback-rating-label {
    display: block; font-size: 1.75rem; line-height: 1;
    color: var(--border); transition: color var(--transition);
}
.feedback-rating-option:hover .feedback-rating-label,
.feedback-rating-option:hover ~ .feedback-rating-option .feedback-rating-label { color: var(--fg); }
.feedback-rating-option:has(input:checked) .feedback-rating-label,
.feedback-rating-option:has(input:checked) ~ .feedback-rating-option .feedback-rating-label { color: var(--fg); }
.feedback-scale { display: flex; justify-content: space-between; font-size: 0.6875rem; color: var(--muted); margin-bottom: var(--s-4); padding: 0 var(--s-1); }
.feedback-section textarea { width: 100%; margin-bottom: var(--s-3); }
.feedback-submit { width: 100%; }

/* ══════════════════════════════════════
   Team / collaboration
   ══════════════════════════════════════ */

.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8); }
.session-share {
    padding: var(--s-5); background: var(--bg-alt);
    border: 1px solid var(--border); border-radius: var(--radius); margin: var(--s-6) 0;
}
.share-url-row { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
.share-input {
    flex: 1; font-size: 0.8125rem; padding: var(--s-2) var(--s-3);
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--fg); font-family: var(--font-body);
}
.code-label { font-size: 0.75rem; color: var(--muted); display: block; }
.participant-list { list-style: none; padding: 0; }
.participant-list li { padding: var(--s-2) 0; border-bottom: 1px solid var(--border); font-size: 0.8125rem; }
.lobby-actions { margin-top: var(--s-6); }

/* Divergence */
.divergence-high { background: rgba(183, 28, 28, 0.05); }
.divergence-med { background: rgba(230, 168, 23, 0.06); }
.spread-bar {
    display: inline-block; height: 4px; background: var(--fg);
    border-radius: 2px; vertical-align: middle; margin-right: var(--s-1);
    min-width: 2px; transition: width var(--transition);
}
.spread-bar[data-spread="1"] { width: 20%; }
.spread-bar[data-spread="2"] { width: 40%; }
.spread-bar[data-spread="3"] { width: 60%; }
.spread-bar[data-spread="4"] { width: 80%; }
.spread-bar[data-spread="5"] { width: 100%; }
.divergence-note {
    font-size: 0.8125rem; font-weight: 500; color: var(--color-danger);
    margin-top: var(--s-3); padding: var(--s-2) var(--s-3);
    border-left: 3px solid var(--color-danger); background: rgba(183, 28, 28, 0.03);
}

/* ══════════════════════════════════════
   History / compare
   ══════════════════════════════════════ */

.filter-bar { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-6); }
.filter-bar label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.filter-bar select {
    font-family: var(--font-body); font-size: 0.8125rem;
    padding: var(--s-2) var(--s-3); border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--bg); color: var(--fg);
}
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-8); }
.compare-summary { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-3); }
.jamfor-bar { margin-top: var(--s-4); display: none; }
.jamfor-bar--visible { display: block; }

/* ══════════════════════════════════════
   OM (about) page
   ══════════════════════════════════════ */

.om .lead { max-width: 42rem; }
.om-group-intro { font-size: 0.875rem; color: var(--muted); margin-bottom: var(--s-4); }
.om-categories { margin-top: var(--s-12); }
.om-categories > p { font-size: 0.875rem; color: var(--muted); margin-bottom: var(--s-6); }
.om-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.om-cat { padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--radius); }
.om-cat .badge { margin-bottom: var(--s-2); }
.om-cat p { font-size: 0.8125rem; color: var(--muted); line-height: 1.5; }
.om-insight { margin-top: var(--s-12); }
.om-insight blockquote {
    margin: var(--s-4) 0 0; padding: var(--s-5) var(--s-6);
    border-left: 3px solid var(--fg); font-size: 0.9375rem;
    line-height: 1.65; font-style: italic; color: var(--muted);
}
.om-links { margin-top: var(--s-12); }
.om-links ul { padding-left: var(--s-6); margin: var(--s-3) 0 var(--s-4); }
.om-links li { font-size: 0.875rem; margin-bottom: var(--s-2); line-height: 1.5; }
.om-about { margin-top: var(--s-12); padding-top: var(--s-8); border-top: 1px solid var(--border); }
.om-about p { font-size: 0.875rem; color: var(--muted); margin-bottom: var(--s-3); }

/* ══════════════════════════════════════
   METOD (method) page
   ══════════════════════════════════════ */

.metod .lead { max-width: 38rem; }
.metod-grid { display: flex; flex-direction: column; gap: var(--s-12); margin-top: var(--s-8); }
.metod-group-header {
    display: flex; align-items: baseline; gap: var(--s-4);
    padding-bottom: var(--s-3); border-bottom: 2px solid var(--fg); margin-bottom: var(--s-6);
}
.metod-group-label { font-size: 1.5rem; font-weight: 600; letter-spacing: 0.08em; }
.metod-group-desc { font-size: 0.8125rem; color: var(--muted); font-weight: 400; }
.metod-dimensions { display: flex; flex-direction: column; }
.metod-dim {
    display: grid; grid-template-columns: 3.5rem 1fr;
    gap: 0 var(--s-4); padding: var(--s-5) 0; border-bottom: 1px solid var(--border);
}
.metod-dim:last-child { border-bottom: none; }
.metod-letter { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; padding-top: 0.15rem; text-align: right; }
.metod-dim-body h2 { margin-bottom: var(--s-2); font-size: 1rem; }
.metod-dim-body p { font-size: 0.8125rem; line-height: 1.6; color: var(--muted); }
.metod-dim-body .ref { margin-top: var(--s-2); font-size: 0.6875rem; }
.metod-references { margin-top: var(--s-12); padding-top: var(--s-8); border-top: 1px solid var(--border); }
.references { list-style: none; padding: 0; }
.references li {
    font-size: 0.8125rem; margin-bottom: var(--s-2);
    padding-left: var(--s-6); text-indent: calc(-1 * var(--s-6)); line-height: 1.5;
}

/* ══════════════════════════════════════
   Version timeline
   Note: candidate for patterns/version-timeline.css when another
   app adopts version-history UI (STRATEGIANALYS already has one).
   ══════════════════════════════════════ */

.version-timeline { position: relative; padding-left: var(--s-6); }
.version-timeline::before {
    content: ''; position: absolute; left: 0.75rem; top: 0; bottom: 0;
    width: 2px; background: var(--border);
}
.version-card { position: relative; }
.version-card::before {
    content: ''; position: absolute; left: calc(-1 * var(--s-6) + 0.5rem);
    top: var(--s-5); width: 0.625rem; height: 0.625rem;
    border-radius: 50%; background: var(--border-strong); z-index: 1;
}
.version-card--current::before { background: var(--fg); }
.version-header { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); }
.version-number { font-weight: 600; font-size: 0.875rem; }
.version-stats { font-size: 0.8125rem; color: var(--muted); display: flex; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-2); }
.version-actions { display: flex; gap: var(--s-2); }

/* ══════════════════════════════════════
   Oversikt (overview bars)
   ══════════════════════════════════════ */

.oversikt-cats { margin: var(--s-4) 0; }
.oversikt-cat-row { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); }
.oversikt-cat-row .badge { min-width: 7rem; text-align: center; }
.oversikt-bar-track { flex: 1; height: 1.25rem; background: var(--bg-alt); border-radius: var(--radius); overflow: hidden; }
.oversikt-bar { height: 100%; border-radius: var(--radius); transition: width 0.5s ease; }
.oversikt-bar--transformativ { background: var(--color-high); }
.oversikt-bar--utforskande { background: var(--color-explore); }
.oversikt-bar--inkrementell { background: var(--color-med); }
.oversikt-bar--rutinmassig { background: var(--color-low); }
.oversikt-count { font-size: 0.875rem; font-weight: 600; min-width: 2rem; text-align: right; }

/* ══════════════════════════════════════
   Print
   ══════════════════════════════════════ */

@media print {
    header, footer, .bedom-actions, .resultat-actions,
    .feedback-section, .theme-toggle, .btn, .btn-sm, .btn-outline { display: none !important; }
    body { background: white; color: black; font-size: 11pt; }
    .sort-indicator { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .badge { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ══════════════════════════════════════
   Responsive
   ══════════════════════════════════════ */

@media (max-width: 640px) {
    .sort-table { font-size: 0.75rem; }
    .sort-table th { font-size: 0.5625rem; }
    .sort-indicator { width: 1.75rem; height: 1.75rem; font-size: 0.5625rem; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .dim-row { grid-template-columns: 7rem 1fr 2.5rem; }
    .dim-lo, .dim-hi { display: none; }
    .punkt-card { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
    .punkt-card__actions { margin-top: var(--s-2); }
    .team-grid { grid-template-columns: 1fr; }
    .compare-grid { grid-template-columns: 1fr; }
    .result-charts { flex-direction: column; align-items: center; }
    .om-cat-grid { grid-template-columns: 1fr; }
    .metod-dim { grid-template-columns: 2.5rem 1fr; }
    .metod-letter { font-size: 1.5rem; }
    .metod-group-header { flex-direction: column; gap: var(--s-1); }
}
