.thr-capability-studio {
    --thr-primary: #2f63a2;
    --thr-secondary: #6d5bd0;
    --thr-success: #0f9f6e;
    --thr-warning: #d97706;
    --thr-danger: #dc2626;
    --thr-surface: #ffffff;
    --thr-muted-surface: #f6f8fb;
    --thr-border: #d9e2ef;
    --thr-text: #07142d;
    --thr-muted: #526780;
    max-width: 1880px;
    margin: 0 auto;
    padding: 28px;
    background: #f4f7fb;
}

.thr-capability-studio *,
.thr-capability-studio *::before,
.thr-capability-studio *::after {
    box-sizing: border-box;
}

.thr-studio-header,
.thr-studio-person-card,
.thr-studio-section,
.thr-studio-side-card,
.thr-capability-card,
.thr-functional-option,
.thr-extra-placeholder {
    background: var(--thr-surface);
    border: 1px solid var(--thr-border);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.thr-studio-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 24px 0 18px;
    padding: 26px;
}

.thr-studio-header h1 {
    margin: 6px 0 8px;
    color: var(--thr-text);
    font-size: 30px;
    line-height: 1.15;
}

.thr-studio-header p,
.thr-studio-person-card p,
.thr-studio-section p,
.thr-capability-card p,
.thr-functional-option p {
    color: var(--thr-muted);
}

.thr-studio-context-switcher {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.thr-studio-context-switcher label,
.thr-manager-extra-form label,
.thr-studio-notes-grid label {
    display: grid;
    gap: 8px;
    color: var(--thr-muted);
    font-weight: 700;
}

.thr-studio-context-switcher select,
.thr-manager-extra-form select,
.thr-manager-extra-form textarea,
.thr-studio-notes-grid textarea {
    width: 100%;
    border: 1px solid var(--thr-border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--thr-text);
    background: #fff;
}

.thr-studio-person-card {
    display: grid;
    grid-template-columns: auto minmax(220px, 1.1fr) minmax(240px, 1fr) minmax(220px, 1fr);
    gap: 22px;
    align-items: center;
    padding: 24px;
    margin-bottom: 18px;
}

.thr-studio-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--thr-primary), var(--thr-secondary));
    color: #fff;
    font-size: 28px;
    font-weight: 800;
}

.thr-studio-person-card h2 {
    margin: 4px 0;
    font-size: 22px;
}

.thr-studio-shell {
    display: grid;
    grid-template-columns: minmax(0, 72fr) minmax(320px, 28fr);
    gap: 22px;
    align-items: start;
    margin-top: 22px;
}

.thr-studio-main {
    display: grid;
    gap: 22px;
}

.thr-studio-sidebar {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 18px;
}

.thr-studio-section {
    padding: 24px;
}

.thr-studio-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.thr-studio-section-head h2,
.thr-studio-side-card h2,
.thr-capability-card h3 {
    margin: 6px 0 8px;
    color: var(--thr-text);
}

.thr-capability-card-list {
    display: grid;
    gap: 18px;
}

.thr-capability-card {
    padding: 22px;
}

.thr-capability-card.is-rated {
    border-color: rgba(15, 159, 110, 0.45);
}

.thr-capability-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 20px;
    align-items: start;
}

.thr-studio-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef4ff;
    color: #164d91;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.thr-studio-chip.is-success {
    background: #e8fbf4;
    color: var(--thr-success);
}

.thr-studio-chip.is-warning {
    background: #fff7ed;
    color: var(--thr-warning);
}

.thr-expected-badge {
    display: grid;
    gap: 6px;
    border: 1px solid #b7d4ff;
    border-radius: 12px;
    background: #edf6ff;
    padding: 14px;
    color: #163a63;
}

.thr-expected-badge span {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.thr-expected-badge strong {
    font-size: 28px;
    color: var(--thr-primary);
}

.thr-expected-badge small {
    color: var(--thr-text);
    line-height: 1.35;
}

.thr-level-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.thr-level-option {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    gap: 7px;
    min-height: 190px;
    border: 1px solid var(--thr-border);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.thr-level-option:hover,
.thr-level-option:has(input:checked),
.thr-level-option.is-selected {
    border-color: var(--thr-primary);
    background: #edf6ff;
    box-shadow: 0 8px 18px rgba(47, 99, 162, 0.15);
}

.thr-level-option.is-expected {
    outline: 2px solid rgba(15, 159, 110, 0.18);
}

.thr-level-option input {
    justify-self: end;
}

.thr-level-option .thr-level-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #e8eef6;
    color: var(--thr-primary);
    font-weight: 800;
}

.thr-level-option strong {
    font-size: 24px;
    color: var(--thr-text);
}

.thr-level-option b {
    color: var(--thr-text);
}

.thr-level-option em {
    color: var(--thr-muted);
    font-style: normal;
    font-size: 13px;
    line-height: 1.35;
}

.thr-level-option mark {
    width: fit-content;
    border-radius: 999px;
    padding: 4px 8px;
    background: #fff8db;
    color: #8a5a00;
    font-size: 12px;
    font-weight: 800;
}

.thr-studio-gap {
    margin-top: 16px;
    border-radius: 12px;
    padding: 13px 16px;
    font-weight: 800;
}

.thr-studio-gap.is-below {
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #b45309;
}

.thr-studio-gap.is-met {
    border: 1px solid #bbf7d0;
    background: #ecfdf5;
    color: #047857;
}

.thr-studio-gap.is-above {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.thr-level-details {
    margin-top: 16px;
    border: 1px solid var(--thr-border);
    border-radius: 12px;
    overflow: hidden;
}

.thr-level-details summary {
    padding: 14px 16px;
    background: #eef3f9;
    color: #164d91;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
}

.thr-level-detail-list {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.thr-level-detail-list div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--thr-border);
    border-radius: 10px;
    background: #fff;
}

.thr-level-detail-list div.is-expected {
    border-color: #9ec5ff;
    background: #f0f7ff;
}

.thr-level-detail-list span {
    color: var(--thr-muted);
}

.thr-studio-notes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.thr-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 16px;
}

.thr-functional-selection-form {
    display: grid;
    gap: 16px;
}

.thr-functional-editor {
    border: 1px solid var(--thr-border);
    border-radius: 16px;
    background: #fbfdff;
    overflow: hidden;
    margin-bottom: 18px;
}

.thr-functional-editor summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    background: #eef4ff;
    color: var(--thr-text);
    cursor: pointer;
    font-weight: 900;
}

.thr-functional-editor summary strong {
    color: var(--thr-primary);
}

.thr-functional-editor[open] summary {
    border-bottom: 1px solid var(--thr-border);
}

.thr-functional-editor .thr-functional-selection-form {
    padding: 18px;
}

.thr-functional-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.thr-functional-option {
    display: grid;
    gap: 10px;
    padding: 18px;
    cursor: pointer;
}

.thr-functional-option.is-selected,
.thr-functional-option:has(input:checked) {
    border-color: var(--thr-primary);
    background: #f0f7ff;
}

.thr-functional-option input {
    justify-self: end;
}

.thr-functional-option strong {
    color: var(--thr-text);
    font-size: 18px;
}

.thr-functional-option small {
    color: var(--thr-muted);
    font-weight: 800;
}

.thr-extra-placeholder {
    display: grid;
    gap: 16px;
    border-style: dashed;
    padding: 22px;
    background: #fbfdff;
}

.thr-extra-placeholder > strong {
    color: var(--thr-primary);
    font-size: 18px;
}

.thr-manager-extra-form {
    display: grid;
}

.thr-studio-side-card {
    padding: 20px;
}

.thr-studio-side-card dl {
    display: grid;
    gap: 12px;
    margin: 14px 0 0;
}

.thr-studio-side-card dl div {
    display: grid;
    gap: 4px;
}

.thr-studio-side-card dt {
    color: var(--thr-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.thr-studio-side-card dd {
    margin: 0;
    color: var(--thr-text);
    font-weight: 800;
}

.thr-studio-progress-number {
    margin: 8px 0 10px;
    color: var(--thr-primary);
    font-size: 36px;
    font-weight: 900;
}

.thr-studio-progress-list,
.thr-studio-checklist ul {
    display: grid;
    gap: 9px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.thr-studio-progress-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--thr-border);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fbfdff;
}

.thr-studio-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.thr-studio-actions .thr-button {
    width: 100%;
    justify-content: center;
}

.thr-studio-checklist {
    margin-top: 16px;
    border-radius: 12px;
    padding: 14px;
    background: #fff7ed;
    color: #9a3412;
}

.thr-studio-checklist li {
    padding-left: 18px;
    position: relative;
}

.thr-studio-checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--thr-warning);
}

.thr-studio-alert,
.thr-studio-empty,
.thr-studio-muted-box {
    border-left: 4px solid var(--thr-primary);
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    color: var(--thr-text);
}

.thr-studio-alert.is-success {
    border-left-color: var(--thr-success);
}

.thr-studio-empty,
.thr-studio-muted-box {
    border: 1px solid var(--thr-border);
    border-left: 4px solid var(--thr-border);
    box-shadow: none;
    color: var(--thr-muted);
}

.thr-remove-extra-form {
    margin-top: 12px;
}

.thr-button.thr-button-danger {
    background: #fff1f2;
    color: var(--thr-danger);
    border: 1px solid #fecdd3;
}

@media (max-width: 1180px) {
    .thr-studio-shell {
        grid-template-columns: 1fr;
    }

    .thr-studio-sidebar {
        position: static;
    }

    .thr-level-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .thr-functional-option-grid,
    .thr-studio-notes-grid,
    .thr-capability-card-head,
    .thr-studio-person-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .thr-capability-studio {
        padding: 16px;
    }

    .thr-studio-header,
    .thr-studio-section-head,
    .thr-card-actions,
    .thr-studio-context-switcher {
        display: grid;
        align-items: stretch;
    }

    .thr-level-grid {
        grid-template-columns: 1fr;
    }
}
