/*
 * PREP4STEP - detailed skills analysis (تحليل المهارات).
 *
 * The Skills Scorecard: one scale, three answers. Each section is one calm
 * scorecard - a summary strip, then a single board that answers "start
 * improving these", "your best" and "promising start", with the full list
 * folded in as the continuation of the same table. Every accuracy on the tab
 * is a bar on one 0-100 axis, and every bar lines up with every other one.
 *
 * Colour means group, pattern means evidence, shape repeats the meaning:
 *   green (disc)               good
 *   amber (diamond, ranks)     the next step
 *   teal  (hatched)            an early signal
 *   grey  (hatched, hollow)    not measured enough yet
 * A 135deg hatch always and only means "fewer than five questions". Gold is
 * kept for the keyboard focus ring and nothing else.
 *
 * Built on the design-system --see-* tokens (with inline fallbacks, so the
 * sheet never renders blank). Section tabs are pure CSS (radio + sibling
 * selector): the dashboard is server-rendered and free of AJAX, so switching
 * sections must not introduce a request or a script.
 */

/* ------------------------------------------------------------ page head */

/* The platform reset strips the shell's own padding (body.see-app main), so
   this tab brings its own breathing room: a top margin under the header and,
   once the viewport is narrower than the 1180px panel plus a gutter, a side
   gutter so text and cards never touch the screen edge. */
.see-adaptive-panel.see-adaptive-panel--skills { padding-top: 32px; }

@media (max-width: 1260px) {
    .see-adaptive-panel.see-adaptive-panel--skills { padding-inline: clamp(18px, 3vw, 40px); }
}

/* Scoped to this tab only: the goal and plan panels keep their card head. */
.see-adaptive-panel--skills .see-adaptive-panel__head {
    padding: 0 0 4px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.see-adaptive-panel--skills .see-adaptive-panel__head > span {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--see-green-bright, #1bd17c);
}

.see-adaptive-panel--skills .see-adaptive-panel__head h2 {
    margin: 0;
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0;
    color: var(--see-text, #f6f2e9);
}

.see-adaptive-panel--skills .see-adaptive-panel__head p {
    max-width: 70ch;
    margin: 8px 0 0;
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.8;
    color: var(--see-muted, #a6b4b0);
}

/* ------------------------------------------------------------- the tab */

.p4s-sa {
    /* Meaning, not decoration: one colour per group. */
    --p4s-sa-good: var(--see-green-bright, #1bd17c);
    --p4s-sa-good-deep: var(--see-green, #12b96a);
    --p4s-sa-work: var(--see-warn, #e6b94e);
    --p4s-sa-early: var(--see-info, #6ec6c0);
    --p4s-sa-unknown: var(--see-muted, #a6b4b0);

    --p4s-sa-ink: var(--see-text, #f6f2e9);
    --p4s-sa-ink-soft: var(--see-text-soft, #d9e2dd);
    --p4s-sa-ink-mute: var(--see-muted, #a6b4b0);
    --p4s-sa-focus: var(--see-gold-bright, #f2ad1d);

    --p4s-sa-line: var(--see-line, rgba(255, 255, 255, .09));
    --p4s-sa-line-strong: var(--see-line-strong, rgba(255, 255, 255, .16));
    --p4s-sa-hairline: rgba(255, 255, 255, .06);
    --p4s-sa-track: rgba(255, 255, 255, .08);

    --p4s-sa-card-bg: linear-gradient(180deg, rgba(255, 255, 255, .028), rgba(255, 255, 255, .012)), var(--see-surface, #062322);
    --p4s-sa-card-shadow: var(--see-e2, 0 10px 30px rgba(0, 0, 0, .24)), inset 0 1px 0 rgba(255, 255, 255, .05);
    --p4s-sa-radius: var(--see-r-lg, 22px);
    --p4s-sa-radius-sm: var(--see-r-sm, 10px);
    --p4s-sa-fast: var(--see-dur-fast, 120ms) var(--see-ease, ease);

    /* A hatch always means "few questions". Bars use 3px stripes, glyphs 2px,
       and the 8px dots 1.5px so they read as texture rather than a slash. */
    --p4s-sa-hatch-early: repeating-linear-gradient(135deg, var(--p4s-sa-early) 0 3px, rgba(110, 198, 192, .30) 3px 6px);
    --p4s-sa-hatch-unknown: repeating-linear-gradient(135deg, var(--p4s-sa-unknown) 0 3px, rgba(166, 180, 176, .22) 3px 6px);
    --p4s-sa-hatch-work: repeating-linear-gradient(135deg, var(--p4s-sa-work) 0 3px, rgba(230, 185, 78, .50) 3px 6px);
    --p4s-sa-hatch-early-fine: repeating-linear-gradient(135deg, var(--p4s-sa-early) 0 2px, rgba(110, 198, 192, .30) 2px 4px);
    --p4s-sa-hatch-unknown-fine: repeating-linear-gradient(135deg, var(--p4s-sa-unknown) 0 2px, rgba(166, 180, 176, .22) 2px 4px);
    --p4s-sa-hatch-early-micro: repeating-linear-gradient(135deg, var(--p4s-sa-early) 0 1.5px, rgba(110, 198, 192, .30) 1.5px 3px);
    --p4s-sa-hatch-unknown-micro: repeating-linear-gradient(135deg, var(--p4s-sa-unknown) 0 1.5px, rgba(166, 180, 176, .22) 1.5px 3px);

    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 24px 32px;
    margin-top: 4px;
    direction: rtl;
    text-align: start;
    color: var(--p4s-sa-ink);
}

/* ------------------------------------------------------------- the intro */

.p4s-sa__intro {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.p4s-sa .p4s-sa__intro .p4s-sa__intro-eyebrow {
    display: block;
    margin: 0 0 6px;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--p4s-sa-ink-mute);
}

.p4s-sa .p4s-sa__intro h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0;
    color: var(--p4s-sa-ink);
}

.p4s-sa .p4s-sa__intro p {
    max-width: 62ch;
    margin: 0;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.8;
    color: var(--p4s-sa-ink-mute);
}

/* ------------------------------------------------ the section switcher */

/* The radios stay in the tab order (arrow keys switch sections) but take no
   grid cell and paint nothing; their labels are the visible control. */
.p4s-sa > input[type="radio"] {
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.p4s-sa__tabs {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--p4s-sa-line);
    border-radius: 999px;
    background: var(--see-surface-deep, #021616);
}

.p4s-sa__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 0 18px;
    border-radius: 999px;
    color: var(--p4s-sa-ink-mute);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background-color var(--p4s-sa-fast), color var(--p4s-sa-fast), box-shadow var(--p4s-sa-fast);
}

.p4s-sa__tab:hover {
    color: var(--p4s-sa-ink-soft);
    background: rgba(255, 255, 255, .04);
}

.p4s-sa__tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 20px;
    box-sizing: border-box;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: var(--p4s-sa-ink-soft);
    font-size: .75rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: isolate;
    transition: background-color var(--p4s-sa-fast), color var(--p4s-sa-fast);
}

/* An unmeasured section stays selectable, but its count reads as empty. */
.p4s-sa__tab-count[data-count="0"] {
    border: 1px dashed rgba(255, 255, 255, .22);
    background: transparent;
    color: var(--p4s-sa-ink-mute);
}

#p4s-sa-grammar:checked   ~ .p4s-sa__tabs [for="p4s-sa-grammar"],
#p4s-sa-reading:checked   ~ .p4s-sa__tabs [for="p4s-sa-reading"],
#p4s-sa-listening:checked ~ .p4s-sa__tabs [for="p4s-sa-listening"] {
    background: var(--see-surface-3, #123734);
    color: var(--p4s-sa-ink);
    box-shadow: inset 0 0 0 1px rgba(27, 209, 124, .45), 0 4px 14px rgba(0, 0, 0, .25);
}

#p4s-sa-grammar:checked   ~ .p4s-sa__tabs [for="p4s-sa-grammar"] .p4s-sa__tab-count,
#p4s-sa-reading:checked   ~ .p4s-sa__tabs [for="p4s-sa-reading"] .p4s-sa__tab-count,
#p4s-sa-listening:checked ~ .p4s-sa__tabs [for="p4s-sa-listening"] .p4s-sa__tab-count {
    background: rgba(27, 209, 124, .16);
    color: var(--p4s-sa-good);
}

#p4s-sa-grammar:checked   ~ .p4s-sa__tabs [for="p4s-sa-grammar"] .p4s-sa__tab-count[data-count="0"],
#p4s-sa-reading:checked   ~ .p4s-sa__tabs [for="p4s-sa-reading"] .p4s-sa__tab-count[data-count="0"],
#p4s-sa-listening:checked ~ .p4s-sa__tabs [for="p4s-sa-listening"] .p4s-sa__tab-count[data-count="0"] {
    background: transparent;
    color: var(--p4s-sa-ink-soft);
}

/* Keyboard focus lands on the hidden radio, so its own label shows the ring.
   One rule per radio: a sibling `+` selector could only ever reach the last. */
#p4s-sa-grammar:focus-visible   ~ .p4s-sa__tabs [for="p4s-sa-grammar"],
#p4s-sa-reading:focus-visible   ~ .p4s-sa__tabs [for="p4s-sa-reading"],
#p4s-sa-listening:focus-visible ~ .p4s-sa__tabs [for="p4s-sa-listening"] {
    outline: 2px solid var(--p4s-sa-focus);
    outline-offset: 2px;
}

.p4s-sa__panels {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
}

.p4s-sa__panel { display: none; }

/* Without CSS (or with it disabled) every panel simply shows - never blank. */
#p4s-sa-grammar:checked   ~ .p4s-sa__panels [data-p4s-sec="grammar"],
#p4s-sa-reading:checked   ~ .p4s-sa__panels [data-p4s-sec="reading"],
#p4s-sa-listening:checked ~ .p4s-sa__panels [data-p4s-sec="listening"] { display: block; }

/* ------------------------------------------------------------ the deck */

.p4s-sa__deck {
    display: grid;
    gap: 16px;
}

/* ------------------------------------------------ the summary strip */

.p4s-sa__hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    gap: 40px;
    padding: 24px 28px;
    border: 1px solid var(--p4s-sa-line);
    border-radius: var(--p4s-sa-radius);
    background:
        radial-gradient(120% 140% at 100% 0, rgba(27, 209, 124, .07), transparent 55%),
        var(--p4s-sa-card-bg);
    box-shadow: var(--p4s-sa-card-shadow);
}

.p4s-sa__hero-copy { min-width: 0; }

.p4s-sa .p4s-sa__hero h3 {
    margin: 0 0 6px;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
    color: var(--p4s-sa-ink);
}

.p4s-sa .p4s-sa__hero p {
    margin: 0;
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.7;
    color: var(--p4s-sa-ink-soft);
}

.p4s-sa .p4s-sa__hero p b {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--p4s-sa-ink);
    font-variant-numeric: tabular-nums;
    unicode-bidi: isolate;
}

.p4s-sa__mix { min-width: 0; }

/* The distribution: one stacked bar, good / work / unknown from the right. */
.p4s-sa__donut {
    display: flex;
    align-items: center;
    gap: 12px;
}

.p4s-sa__donut-track {
    display: flex;
    flex: 1 1 auto;
    gap: 3px;
    min-width: 0;
    height: 14px;
}

.p4s-sa__donut-arc {
    display: block;
    flex: 1 1 0;
    min-width: 8px;
    height: 100%;
    border-radius: 3px;
    background: var(--p4s-sa-unknown);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}

.p4s-sa__donut-arc:first-child {
    border-start-start-radius: 999px;
    border-end-start-radius: 999px;
}

.p4s-sa__donut-arc:last-child {
    border-start-end-radius: 999px;
    border-end-end-radius: 999px;
}

.p4s-sa__donut-arc--good { background: var(--p4s-sa-good); }
.p4s-sa__donut-arc--work { background: var(--p4s-sa-work); }
.p4s-sa__donut-arc--unknown {
    background: var(--p4s-sa-hatch-unknown);
    box-shadow: inset 0 0 0 1px var(--p4s-sa-unknown);
}

.p4s-sa__donut-mid {
    display: inline-flex;
    flex: none;
    align-items: baseline;
    gap: 4px;
    line-height: 1.2;
    white-space: nowrap;
}

.p4s-sa__donut-mid b {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--p4s-sa-ink);
    font-variant-numeric: tabular-nums;
}

.p4s-sa__donut-mid small {
    font-size: .85rem;
    font-weight: 500;
    color: var(--p4s-sa-ink-mute);
}

/* The key: counts in neutral ink; colour lives only in the swatch. The cells
   that are present share the row equally, so one or two never look stranded
   under a full-width bar. */
.p4s-sa__hero-key {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.p4s-sa__hero-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "mark count"
        "label label";
    align-items: center;
    gap: 2px 8px;
    min-width: 0;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--p4s-sa-line);
    border-radius: var(--p4s-sa-radius-sm);
    background: rgba(255, 255, 255, .03);
}

.p4s-sa__hero-item i {
    grid-area: mark;
    display: block;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    border-radius: 50%;
}

.p4s-sa__hero-item b {
    grid-area: count;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--p4s-sa-ink);
    font-variant-numeric: tabular-nums;
}

.p4s-sa__hero-item span {
    grid-area: label;
    min-width: 0;
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--p4s-sa-ink-soft);
}

.p4s-sa__hero-item--good i { background: var(--p4s-sa-good); }
.p4s-sa__hero-item--work i {
    width: 10px;
    height: 10px;
    margin: 1px;
    border-radius: 2px;
    background: var(--p4s-sa-work);
    transform: rotate(45deg);
}
.p4s-sa__hero-item--unknown i {
    border: 1.5px solid var(--p4s-sa-unknown);
    background: var(--p4s-sa-hatch-unknown-fine);
}

/* ------------------------------------------------------------ the board */

.p4s-sa__board {
    padding: 8px 28px 24px;
    border: 1px solid var(--p4s-sa-line);
    border-radius: var(--p4s-sa-radius);
    background: var(--p4s-sa-card-bg);
    box-shadow: var(--p4s-sa-card-shadow);
}

.p4s-sa__band { padding: 4px 0 16px; }
.p4s-sa__band + .p4s-sa__band { border-top: 1px solid var(--p4s-sa-line); }
.p4s-sa__band + .p4s-sa__band--early { border-top: 1px dashed rgba(110, 198, 192, .45); }

.p4s-sa__band-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    padding: 20px 0 8px;
}

.p4s-sa .p4s-sa__band-head h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0;
    color: var(--p4s-sa-ink);
}

/* The group accent: amber for the next step, green for good, teal hatch for
   early signals. */
.p4s-sa .p4s-sa__band-head h4::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    margin-inline-end: 10px;
    border-radius: 2px;
    vertical-align: -2px;
    background: var(--p4s-sa-line-strong);
}

.p4s-sa .p4s-sa__band--work .p4s-sa__band-head h4::before { background: var(--p4s-sa-work); }
.p4s-sa .p4s-sa__band--good .p4s-sa__band-head h4::before { background: var(--p4s-sa-good); }
.p4s-sa .p4s-sa__band--early .p4s-sa__band-head h4::before { background: var(--p4s-sa-hatch-early); }

.p4s-sa .p4s-sa__band-sub {
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--p4s-sa-ink-mute);
}

/* ---------------------------------------------- the shared row grid */

/* Featured rows and full-list rows share one grid, so every bar on the tab
   starts on the same edge, ends on the same edge and lines up. */
.p4s-sa__cards,
.p4s-sa__rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.p4s-sa__card,
.p4s-sa__skill {
    display: grid;
    grid-template-columns: 32px minmax(0, 1.15fr) minmax(180px, 1.7fr) 56px 230px;
    grid-template-areas: "mark name bar pct meta";
    align-items: center;
    column-gap: 16px;
    box-sizing: border-box;
    margin: 0;
}

/* ------------------------------------------------------ featured rows */

.p4s-sa__card {
    min-height: 60px;
    padding: 10px 0;
    border-bottom: 1px solid var(--p4s-sa-hairline);
}

.p4s-sa__card:last-child { border-bottom: 0; }

.p4s-sa__card-name {
    grid-area: name;
    min-width: 0;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--p4s-sa-ink);
    text-align: start;
    overflow-wrap: break-word;
}

.p4s-sa__card--early .p4s-sa__card-name { color: var(--p4s-sa-ink-soft); }

/* Row markers: rank circles for the next step, a disc for good, a dashed
   ring for an early signal. Decorative - the list itself carries the order. */
.p4s-sa__card::before {
    content: "";
    grid-area: mark;
    justify-self: center;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    box-sizing: border-box;
    border-radius: 50%;
}

.p4s-sa__band--work .p4s-sa__cards { counter-reset: p4s-sa-rank; }
.p4s-sa__card--work { counter-increment: p4s-sa-rank; }

.p4s-sa__card--work::before {
    content: counter(p4s-sa-rank);
    content: counter(p4s-sa-rank) / "";
    border: 1.5px solid var(--p4s-sa-work);
    background: rgba(230, 185, 78, .10);
    color: var(--p4s-sa-work);
    font-size: .85rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.p4s-sa__card--work:first-child::before {
    background: var(--p4s-sa-work);
    color: #1a1405;
}

.p4s-sa__card--good::before {
    background: radial-gradient(circle, var(--p4s-sa-good) 0 4px, rgba(27, 209, 124, .14) 4.5px);
}

.p4s-sa__card--early::before { border: 1.5px dashed var(--p4s-sa-early); }

.p4s-sa__card--early::after {
    content: "";
    grid-area: mark;
    justify-self: center;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--p4s-sa-hatch-early-micro);
}

/* The accuracy meter: bar and number span the shared bar + % columns. */
.p4s-sa__dial {
    grid-row: bar;
    grid-column: bar-start / pct-end;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.p4s-sa__dial-track {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: var(--p4s-sa-track);
    overflow: hidden;
}

/* A block in an RTL row, so it grows from the right (inline-start) edge. */
.p4s-sa__dial-value {
    display: block;
    max-width: 100%;
    height: 100%;
    border-radius: 999px;
    background: var(--p4s-sa-unknown);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}

.p4s-sa__dial--good .p4s-sa__dial-value { background: var(--p4s-sa-good); }
.p4s-sa__dial--work .p4s-sa__dial-value { background: var(--p4s-sa-work); }
.p4s-sa__card--work.is-limited .p4s-sa__dial-value { background: var(--p4s-sa-hatch-work); }
.p4s-sa__dial--early .p4s-sa__dial-value { background: var(--p4s-sa-hatch-early); }

.p4s-sa__dial-num {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--p4s-sa-ink);
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: isolate;
    text-align: end;
    white-space: nowrap;
}

.p4s-sa__card-meta {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
}

.p4s-sa__card-note {
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--p4s-sa-ink-mute);
    white-space: nowrap;
}

/* «بيانات محدودة»: neutral, with the same grey hatch every thin result uses. */
.p4s-sa__card-flag,
.p4s-sa__evidence-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    box-sizing: border-box;
    padding-inline: 8px 10px;
    border: 1px dashed rgba(246, 242, 233, .40);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    color: var(--p4s-sa-ink-soft);
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}

.p4s-sa__card-flag::before,
.p4s-sa__evidence-flag::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--p4s-sa-hatch-unknown-micro);
}

/* ------------------------------------------- notes and placeholder rows */

/* The early-signal footnote, aligned under the names. Its mark is a short
   teal-hatched swatch - the same texture as the early bars it explains - so it
   reads as a key, never as a control. */
.p4s-sa .p4s-sa__band .p4s-sa__band-note {
    position: relative;
    margin: 8px 0 0;
    padding-inline-start: 48px;
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.7;
    color: var(--p4s-sa-ink-mute);
}

.p4s-sa .p4s-sa__band .p4s-sa__band-note::before {
    content: "";
    position: absolute;
    inset-block-start: calc((1.7em - 6px) / 2);
    inset-inline-start: 8px;
    width: 16px;
    height: 6px;
    box-sizing: border-box;
    border: 0;
    border-radius: 999px;
    background: var(--p4s-sa-hatch-early-fine);
}

/* An empty group keeps the table's rhythm: one dashed placeholder row. */
.p4s-sa .p4s-sa__band .p4s-sa__band-head + .p4s-sa__band-note {
    display: flex;
    align-items: center;
    min-height: 52px;
    box-sizing: border-box;
    margin: 4px 0 0;
    margin-inline-start: 48px;
    padding: 12px 16px;
    border: 1px dashed var(--p4s-sa-line-strong);
    border-radius: var(--p4s-sa-radius-sm);
    font-size: .9rem;
    font-weight: 500;
    color: var(--p4s-sa-ink-soft);
}

.p4s-sa .p4s-sa__band .p4s-sa__band-head + .p4s-sa__band-note::before { content: none; }

/* ------------------------------------------------- the full-list fold */

.p4s-sa__all { margin-top: 8px; }

.p4s-sa__all > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    box-sizing: border-box;
    padding: 0 16px;
    border: 1px solid var(--p4s-sa-line-strong);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    color: var(--p4s-sa-ink);
    list-style: none;
    cursor: pointer;
    transition: background-color var(--p4s-sa-fast);
}

.p4s-sa__all > summary::-webkit-details-marker { display: none; }
.p4s-sa__all > summary:hover { background: rgba(255, 255, 255, .07); }

.p4s-sa__all > summary:focus-visible {
    outline: 2px solid var(--p4s-sa-focus);
    outline-offset: 2px;
}

.p4s-sa__all > summary span {
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--p4s-sa-ink);
}

.p4s-sa__all > summary b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    box-sizing: border-box;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: var(--p4s-sa-ink-soft);
    font-size: .8rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: isolate;
}

/* Chevron: points down when closed, up when open. */
.p4s-sa__all > summary::after {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin-inline-start: auto;
    margin-block-start: -4px;
    border-block-end: 2px solid var(--p4s-sa-ink-soft);
    border-inline-start: 2px solid var(--p4s-sa-ink-soft);
    transform: rotate(45deg);
    transition: transform 200ms var(--see-ease, ease), margin 200ms var(--see-ease, ease);
}

/* Open, the bar stays a whole rounded bar: the rows that follow are hairline
   rows on the board's shared axis, not a box hanging from it. */
.p4s-sa__all[open] > summary {
    margin-bottom: 8px;
    border-radius: 14px;
}

.p4s-sa__all[open] > summary::after {
    margin-block-start: 4px;
    transform: rotate(-135deg);
}

/* ------------------------------------------------------ full-list rows */

.p4s-sa__skill {
    min-height: 44px;
    padding: 8px 0;
    border-bottom: 1px solid var(--p4s-sa-hairline);
}

.p4s-sa__skill:last-child { border-bottom: 0; }

/* The tier glyph: shape and colour together, never colour alone. */
.p4s-sa__skill::before {
    content: "";
    grid-area: mark;
    justify-self: center;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    border-radius: 50%;
    background: var(--p4s-sa-unknown);
}

.p4s-sa__skill-name {
    grid-area: name;
    min-width: 0;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--p4s-sa-ink);
    text-align: start;
    overflow-wrap: break-word;
}

.p4s-sa__meter {
    grid-area: bar;
    display: block;
    min-width: 0;
}

.p4s-sa__track {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: var(--p4s-sa-track);
    overflow: hidden;
}

.p4s-sa__fill {
    display: block;
    max-width: 100%;
    height: 100%;
    border-radius: 999px;
    background: var(--p4s-sa-unknown);
}

.p4s-sa__pct {
    grid-area: pct;
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--p4s-sa-ink);
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: isolate;
    text-align: end;
    white-space: nowrap;
}

.p4s-sa__evidence {
    grid-area: meta;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
    font-size: .85rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--p4s-sa-ink-mute);
}

.p4s-sa__evidence > span:first-child { white-space: nowrap; }

.p4s-sa__skill--confirmed::before,
.p4s-sa__skill--confirmed .p4s-sa__fill { background: var(--p4s-sa-good); }

.p4s-sa__skill--developing::before {
    border: 2px solid var(--p4s-sa-good-deep);
    background: linear-gradient(270deg, var(--p4s-sa-good-deep) 50%, transparent 50%);
}
.p4s-sa__skill--developing .p4s-sa__fill { background: var(--p4s-sa-good-deep); }

/* A section's own best is neutral: a hollow ring and a grey bar, never green. */
.p4s-sa__skill--relative::before {
    border: 2px solid var(--p4s-sa-ink-soft);
    background: transparent;
}
.p4s-sa__skill--relative .p4s-sa__fill { background: var(--p4s-sa-unknown); }

.p4s-sa__skill--weak::before {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    background: var(--p4s-sa-work);
    transform: rotate(45deg);
}
.p4s-sa__skill--weak .p4s-sa__fill { background: var(--p4s-sa-work); }

.p4s-sa__skill--promising::before {
    border: 1.5px solid var(--p4s-sa-early);
    background: var(--p4s-sa-hatch-early-fine);
}
.p4s-sa__skill--promising .p4s-sa__fill { background: var(--p4s-sa-hatch-early); }

.p4s-sa__skill--limited::before {
    border: 1.5px solid var(--p4s-sa-unknown);
    background: var(--p4s-sa-hatch-unknown-fine);
}
.p4s-sa__skill--limited .p4s-sa__fill {
    background: var(--p4s-sa-hatch-unknown);
    box-shadow: inset 0 0 0 1px var(--p4s-sa-unknown);
}

/* --------------------------------------------------------- empty states */

.p4s-sa__empty {
    grid-column: 1 / -1;
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 48px 24px;
    border: 1px dashed var(--p4s-sa-line-strong);
    border-radius: var(--p4s-sa-radius);
    background: rgba(255, 255, 255, .02);
    text-align: center;
}

/* The "not measured" shape: a hollow dashed ring, never a 0%. */
.p4s-sa__empty::before {
    content: "";
    width: 44px;
    height: 44px;
    box-sizing: border-box;
    margin-bottom: 4px;
    border: 3px dashed var(--p4s-sa-unknown);
    border-radius: 50%;
}

.p4s-sa__empty strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--p4s-sa-ink);
}

.p4s-sa__empty span {
    display: block;
    max-width: 44ch;
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.7;
    color: var(--p4s-sa-ink-mute);
}

.p4s-sa__panel > .p4s-sa__empty { padding: 36px 20px; }

/* ============================ the dashboard CTA ======================== */

.p4s-sa-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 18px 0 4px;
    padding: 18px 24px;
    border-radius: 999px;
    border: 1px solid rgba(217, 180, 95, .34);
    background:
        radial-gradient(120% 220% at 100% 50%, rgba(53, 201, 139, .16), transparent 60%),
        rgba(255, 255, 255, .04);
    color: #f4efe4;
    text-decoration: none;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.p4s-sa-cta:hover,
.p4s-sa-cta:focus-visible {
    border-color: rgba(217, 180, 95, .8);
    background:
        radial-gradient(120% 220% at 100% 50%, rgba(53, 201, 139, .26), transparent 60%),
        rgba(255, 255, 255, .07);
    transform: translateY(-1px);
    color: #f4efe4;
}

.p4s-sa-cta:focus-visible { outline: 2px solid #d9b45f; outline-offset: 3px; }

.p4s-sa-cta__text strong {
    display: block;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: .01em;
}

.p4s-sa-cta__text span {
    display: block;
    margin-top: 3px;
    font-size: .84rem;
    color: rgba(244, 239, 228, .62);
}

.p4s-sa-cta__go {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(217, 180, 95, .45);
    background: rgba(217, 180, 95, .14);
    color: #d9b45f;
    font-size: 1.1rem;
    transition: background .2s ease, transform .2s ease;
}

.p4s-sa-cta:hover .p4s-sa__go,
.p4s-sa-cta:hover .p4s-sa-cta__go {
    background: rgba(217, 180, 95, .26);
    transform: translateX(-3px); /* RTL: arrow leads to the left */
}

/* ------------------------------------------------------------ responsive */

/* Just above the phone break the fixed columns would squeeze the name to about
   150px and wrap it: narrower mark, number and meta columns keep names on one
   line while every bar and % stays on one shared axis. The notes follow the
   narrower mark column so they still sit under the names. */
@media (min-width: 881px) and (max-width: 1100px) {
    .p4s-sa__card,
    .p4s-sa__skill {
        grid-template-columns: 28px minmax(0, 1.3fr) minmax(150px, 1.5fr) 48px 184px;
        column-gap: 12px;
    }

    .p4s-sa__dial {
        grid-template-columns: minmax(0, 1fr) 48px;
        gap: 12px;
    }

    .p4s-sa .p4s-sa__band .p4s-sa__band-note { padding-inline-start: 40px; }
    .p4s-sa .p4s-sa__band .p4s-sa__band-note::before { inset-inline-start: 6px; }
    .p4s-sa .p4s-sa__band .p4s-sa__band-head + .p4s-sa__band-note {
        margin-inline-start: 40px;
        padding-inline-start: 16px;
    }
}

/* One layout break: below 880px everything stacks and rows take the phone
   grid. Bars keep one fixed-width number column so they stay comparable. */
@media (max-width: 880px) {
    .see-adaptive-panel.see-adaptive-panel--skills { padding-top: 20px; }
    .see-adaptive-panel--skills .see-adaptive-panel__head h2 { font-size: 1.6rem; }
    .see-adaptive-panel--skills .see-adaptive-panel__head p {
        font-size: .85rem;
        line-height: 1.7;
    }

    .p4s-sa {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .p4s-sa__intro { grid-column: 1; grid-row: 1; }
    .p4s-sa__tabs { grid-column: 1; grid-row: 2; display: flex; }
    .p4s-sa__panels { grid-column: 1; grid-row: 3; }

    .p4s-sa .p4s-sa__intro h2 { font-size: 1.05rem; }
    .p4s-sa .p4s-sa__intro p {
        font-size: .85rem;
        line-height: 1.75;
    }

    .p4s-sa__tab {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 10px;
        font-size: .9rem;
    }

    /* The compact strip: title and total on one line, then the sentence,
       the bar and a single wrapping line of key chips. */
    .p4s-sa__hero {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title total"
            "text text"
            "bar bar"
            "key key";
        gap: 12px;
        padding: 16px;
    }

    .p4s-sa__hero-copy,
    .p4s-sa__mix,
    .p4s-sa__donut { display: contents; }

    .p4s-sa .p4s-sa__hero h3 {
        grid-area: title;
        margin: 0;
        font-size: 1.25rem;
    }

    .p4s-sa .p4s-sa__hero p {
        grid-area: text;
        font-size: .85rem;
    }

    .p4s-sa .p4s-sa__hero p b { font-size: .95rem; }

    .p4s-sa__donut-track {
        grid-area: bar;
        height: 12px;
    }

    .p4s-sa__donut-mid { grid-area: total; }

    .p4s-sa__hero-key {
        grid-area: key;
        display: flex;
        flex-wrap: wrap;
        gap: 8px 16px;
        margin: 0;
    }

    .p4s-sa__hero-item {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 0;
        border: 0;
        background: none;
    }

    .p4s-sa__hero-item b {
        font-size: .95rem;
        line-height: 1.3;
    }

    .p4s-sa__hero-item span { font-size: .75rem; }

    .p4s-sa__board { padding: 4px 16px 16px; }

    .p4s-sa__band-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .p4s-sa .p4s-sa__band-sub { padding-inline-start: 14px; }

    /* Featured row: the marker beside the name, bar and evidence under it. */
    .p4s-sa__card {
        grid-template-columns: 28px minmax(0, 1fr);
        grid-template-areas:
            "mark name"
            ". bar"
            ". meta";
        align-items: center;
        column-gap: 12px;
        row-gap: 6px;
        padding: 12px 0;
    }

    .p4s-sa__dial {
        grid-row: bar;
        grid-column: bar;
        grid-template-columns: minmax(0, 1fr) 48px;
        gap: 12px;
    }

    /* Full-list row: name and % on the first line, bar and question count
       under, and a «بيانات محدودة» badge (when there is one) on a line of its
       own under the count. The number column only has to hold a % or a count,
       so the name keeps the width and stays on one line. */
    .p4s-sa__skill {
        grid-template-columns: 24px minmax(0, 1fr) 72px;
        grid-template-areas:
            "mark name pct"
            ". bar meta";
        align-items: start;
        column-gap: 12px;
        row-gap: 6px;
        padding: 10px 0;
    }

    /* Top-aligned, so a wrapped badge never pulls the bar off its count. */
    .p4s-sa__skill::before { margin-top: 4px; }
    .p4s-sa__skill--weak::before { margin-top: 6px; }
    .p4s-sa__meter { margin-top: 6px; }
    .p4s-sa__pct { justify-self: end; }

    /* The evidence wrapper steps aside (its text styles still inherit), so the
       count and the badge can take their own cells. The badge row is implicit:
       rows without a badge keep their height. */
    .p4s-sa__evidence { display: contents; }

    .p4s-sa__evidence > span:first-child {
        grid-area: meta;
        justify-self: end;
        white-space: nowrap;
    }

    .p4s-sa__evidence-flag {
        grid-column: 2 / -1;
        grid-row: 3;
        justify-self: end;
    }

    .p4s-sa .p4s-sa__band .p4s-sa__band-note { padding-inline-start: 40px; }
    .p4s-sa .p4s-sa__band .p4s-sa__band-note::before { inset-inline-start: 6px; }
    .p4s-sa .p4s-sa__band .p4s-sa__band-head + .p4s-sa__band-note {
        margin-inline-start: 0;
        padding-inline-start: 16px;
    }

    .p4s-sa__empty { padding: 36px 20px; }
}

@media (max-width: 520px) {
    .see-adaptive-panel.see-adaptive-panel--skills { padding-inline: 13px; }
}

@media (max-width: 360px) {
    .p4s-sa__tabs { gap: 2px; }
    .p4s-sa__tab {
        gap: 4px;
        padding: 0 6px;
        font-size: .85rem;
    }
    .p4s-sa__tab-count {
        min-width: 20px;
        padding: 0 5px;
    }
}

/* On the narrowest phones a featured note and its «بيانات محدودة» badge no
   longer fit one line with room to spare, and a one-digit difference would
   decide whether a row wraps. The badge always takes its own line under the
   note instead, so neighbouring rows always lay out the same way. */
@media (max-width: 340px) {
    .p4s-sa__card-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 780px) {
    .p4s-sa-cta { border-radius: 22px; padding: 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .p4s-sa__tab,
    .p4s-sa__tab-count,
    .p4s-sa__all > summary,
    .p4s-sa__all > summary::after,
    .p4s-sa-cta,
    .p4s-sa-cta__go { transition: none; }
    .p4s-sa-cta:hover { transform: none; }
}

@media print {
    .see-adaptive-panel--skills .see-adaptive-panel__head h2 { color: #000; }
    .see-adaptive-panel--skills .see-adaptive-panel__head p { color: #444; }

    .p4s-sa {
        --p4s-sa-ink: #000;
        --p4s-sa-ink-soft: #222;
        --p4s-sa-ink-mute: #444;
        --p4s-sa-track: #e6e6e6;
    }

    .p4s-sa__hero,
    .p4s-sa__board {
        border: 1px solid #bbb;
        background: none;
        box-shadow: none;
    }

    .p4s-sa__donut-arc,
    .p4s-sa__hero-item i,
    .p4s-sa__dial-track,
    .p4s-sa__dial-value,
    .p4s-sa__track,
    .p4s-sa__fill,
    .p4s-sa__card::before,
    .p4s-sa__card::after,
    .p4s-sa__skill::before,
    .p4s-sa__card-flag::before,
    .p4s-sa__evidence-flag::before {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
