/*
 * =====================================================
 * ICD-10-GM SYSTEMATIK – BASIS
 * =====================================================
 *
 * Enthält ausschließlich die allgemeine Desktop- und
 * Basisdarstellung.
 *
 * Responsive Anpassungen befinden sich in:
 * icd-tree-responsive.css
 */


/*
 * =====================================================
 * SEITENGRUNDLAGE
 * =====================================================
 */

.icd-tree-page {
    background: #f5f7fa;
}


/*
 * =====================================================
 * HERO UND ANSICHTSWECHSEL
 * =====================================================
 */

.icd-tree-hero-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 24px;
}

.icd-tree-hero-copy {
    flex: 1 1 auto;
    min-width: 0;
}

/*
 * =====================================================
 * HERO-BESCHREIBUNG UND ICD-HINWEIS
 * =====================================================
 */

.icd-tree-hero-copy .icd-hero-description {
    width: 100%;
    max-width: none;

    margin: 0;

    color: #555555;

    font-size: 15px;
    line-height: 1.6;
}

.icd-hero-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    width: 100%;
    max-width: none;

    margin-top: 14px;
    padding: 11px 13px;

    border: 1px solid #d4e2f1;
    border-radius: 4px;

    background: #eef4fb;
    color: #344054;

    font-size: 13px;
    line-height: 1.5;
}

.icd-hero-notice i {
    flex: 0 0 auto;

    margin-top: 3px;

    color: #1f5f9f;
}

.icd-tree-subtitle {
    margin: -4px 0 16px;

    color: #333333;

    font-size: 36px;
    line-height: 1.15;
    font-weight: 700;
}

.icd-tree-view-switch {
    display: inline-flex;
    flex-shrink: 0;

    margin-top: 6px;

    overflow: hidden;

    border: 1px solid #d7e0ea;
    border-radius: 4px;

    background: #ffffff;
}

.icd-tree-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 150px;
    min-height: 46px;

    padding: 0 16px;

    border: 0;

    background: #ffffff;
    color: #333333;

    font-weight: 600;
    text-align: center;
    text-decoration: none;

    transition:
        background-color .15s ease,
        color .15s ease;
}

.icd-tree-view-button:hover {
    background: #f3f8fd;
    color: #1f5f9f;
}

.icd-tree-view-button.is-active {
    background: #1f5f9f;
    color: #ffffff;
}

.icd-tree-view-button.is-active:hover {
    background: #1f5f9f;
    color: #ffffff;
}

.icd-tree-view-button:focus-visible {
    position: relative;
    z-index: 2;

    outline: 2px solid rgba(31, 95, 159, .3);
    outline-offset: -2px;
}

.icd-hero .icd-tree-view-switch {
    margin-top: 6px;
}


/*
 * =====================================================
 * SYSTEMATIK-BEREICH
 * =====================================================
 */

.icd-tree-section {
    padding: 28px 0 42px;
}


/*
 * =====================================================
 * TOOLBAR
 * =====================================================
 */

.icd-tree-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 16px;

    margin-bottom: 16px;
}

.icd-tree-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;

    align-self: start;

    margin-top: 30px;
    padding: 0;
}

.icd-tree-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 52px;

    padding: 0 16px;

    border: 1px solid #cfd9e5;
    border-radius: 4px;

    background: #ffffff;
    color: #1f5f9f;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        color .15s ease;
}

.icd-tree-action-button:hover {
    border-color: #bdd2e8;

    background: #f3f8fd;
    color: #174f86;
}

.icd-tree-action-button:focus-visible {
    outline: 2px solid rgba(31, 95, 159, .22);
    outline-offset: 2px;
}


/*
 * =====================================================
 * SUCHE
 * =====================================================
 */

.icd-tree-search-wrap {
    position: relative;
    min-width: 0;
}

.icd-tree-search-label {
    display: block;

    height: 20px;
    margin-bottom: 10px;

    color: #333333;

    font-size: 15px;
    line-height: 20px;
    font-weight: 600;
}

.icd-tree-search-box {
    position: relative;
}

.icd-tree-search-box > i {
    position: absolute;
    top: 50%;
    left: 14px;

    transform: translateY(-50%);

    color: #667085;

    font-size: 18px;

    pointer-events: none;
}

.icd-tree-search-input {
    width: 100%;
    min-height: 52px;

    padding: 0 44px;

    border: 1px solid #cfd9e5;
    border-radius: 4px;

    background: #ffffff;
    color: #333333;

    font-size: 17px;

    transition:
        border-color .15s ease,
        outline-color .15s ease;
}

.icd-tree-search-input::placeholder {
    color: #98a2b3;
}

.icd-tree-search-input:hover {
    border-color: #b9c8d8;
}

.icd-tree-search-input:focus {
    border-color: #1f5f9f;

    outline: 2px solid rgba(31, 95, 159, .14);
}

.icd-tree-search-clear {
    position: absolute;
    top: 50%;
    right: 8px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    transform: translateY(-50%);

    border: 0;
    border-radius: 4px;

    background: transparent;
    color: #667085;

    cursor: pointer;

    transition:
        background-color .15s ease,
        color .15s ease;
}

.icd-tree-search-clear:hover {
    background: #eef4fb;
    color: #1f5f9f;
}

.icd-tree-search-clear:focus-visible {
    outline: 2px solid rgba(31, 95, 159, .22);
    outline-offset: 1px;
}

.icd-tree-search-status {
    margin-top: 10px;

    color: #667085;

    font-size: 14px;
    line-height: 1.45;
}


/*
 * =====================================================
 * SUCHERGEBNISSE
 * =====================================================
 */

.icd-tree-search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 30;

    max-height: 430px;

    overflow-y: auto;

    border: 1px solid #dfe6ee;
    border-radius: 4px;

    background: #ffffff;

    box-shadow: 0 14px 34px rgba(15, 35, 55, .08);
}

.icd-tree-search-empty {
    padding: 14px 16px;

    color: #667085;

    line-height: 1.5;
}

.icd-tree-search-result {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;

    width: 100%;

    padding: 12px 14px;

    border: 0;
    border-bottom: 1px solid #eef2f6;

    background: #ffffff;

    text-align: left;

    cursor: pointer;

    transition: background-color .15s ease;
}

.icd-tree-search-result:last-child {
    border-bottom: 0;
}

.icd-tree-search-result:hover {
    background: #f8fbff;
}

.icd-tree-search-result:focus-visible {
    position: relative;
    z-index: 2;

    outline: 2px solid rgba(31, 95, 159, .22);
    outline-offset: -2px;
}

.icd-tree-search-result-code {
    color: #1f5f9f;

    font-weight: 700;

    white-space: nowrap;
}

.icd-tree-search-result-title {
    min-width: 0;

    color: #333333;

    line-height: 1.45;
}

.icd-tree-search-result-kind {
    padding-top: 2px;

    color: #667085;

    font-size: 12px;

    white-space: nowrap;
}


/*
 * =====================================================
 * HAUPTLAYOUT
 * =====================================================
 */

.icd-tree-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1.7fr)
        minmax(340px, .9fr);

    align-items: start;
    gap: 18px;
}

.icd-tree-panel,
.icd-tree-detail-panel {
    min-width: 0;

    border: 1px solid #dfe6ee;
    border-radius: 4px;

    background: #ffffff;

    box-shadow: 0 8px 24px rgba(15, 35, 55, .05);
}

.icd-tree-panel-inner,
.icd-tree-detail {
    padding: 18px;
}


/*
 * =====================================================
 * LADE-, LEER- UND FEHLERZUSTÄNDE
 * =====================================================
 */

.icd-tree-loading,
.icd-tree-inline-loading,
.icd-tree-inline-empty,
.icd-tree-detail-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;

    color: #667085;

    line-height: 1.5;
}

.icd-tree-loading,
.icd-tree-detail-placeholder {
    flex-direction: column;
    justify-content: center;

    min-height: 240px;

    text-align: center;
}

.icd-tree-loading i,
.icd-tree-detail-placeholder i {
    color: #9fb1c5;

    font-size: 34px;
}

.icd-tree-detail-placeholder h2 {
    margin: 0;

    color: #333333;

    font-size: 22px;
}

.icd-tree-detail-placeholder p {
    margin: 0;

    max-width: 420px;
}

.icd-tree-loading.is-error,
.icd-tree-inline-empty.is-error {
    color: #b42318;
}

.icd-tree-inline-loading,
.icd-tree-inline-empty {
    min-height: 40px;

    padding: 8px 10px;

    font-size: 13px;
}


/*
 * =====================================================
 * BAUM – GRUNDSTRUKTUR
 * =====================================================
 */

.icd-tree-root {
    min-height: 300px;
}

.icd-tree-list {
    margin: 0;
    padding: 0;

    list-style: none;
}

.icd-tree-node {
    position: relative;

    margin: 0;
}

.icd-tree-node-row {
    position: relative;

    display: flex;
    align-items: stretch;

    min-width: 0;

    padding-left: 0;
}


/*
 * =====================================================
 * BAUM – VERBINDUNGSLINIEN
 * =====================================================
 */

.icd-tree-children {
    position: relative;

    margin-left: 17px;
    padding: 2px 0 4px 17px;

    border-left: 1px dashed #c6d2df;
}

.icd-tree-children
> .icd-tree-list
> .icd-tree-node
> .icd-tree-node-row::before {
    content: '';

    position: absolute;
    top: 22px;
    left: -17px;

    width: 17px;

    border-top: 1px dashed #c6d2df;

    pointer-events: none;
}

.icd-tree-children
> .icd-tree-list
> .icd-tree-node:last-child::after {
    content: '';

    position: absolute;
    top: 23px;
    bottom: 0;
    left: -18px;

    width: 3px;

    background: #ffffff;

    pointer-events: none;
}


/*
 * =====================================================
 * BAUM – CHEVRON
 * =====================================================
 */

.icd-tree-toggle {
    position: relative;
    z-index: 2;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    min-width: 34px;
    height: 34px;

    margin: 4px 4px 0 0;

    border: 1px solid transparent;
    border-radius: 4px;

    background: transparent;
    color: #344054;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        color .15s ease;
}

.icd-tree-toggle:hover:not(.is-empty),
.icd-tree-node.is-expanded
> .icd-tree-node-row
> .icd-tree-toggle {
    border-color: #d4e2f1;

    background: #eef4fb;
    color: #1f5f9f;
}

.icd-tree-toggle:focus-visible {
    outline: 2px solid rgba(31, 95, 159, .22);
    outline-offset: 1px;
}

.icd-tree-toggle.is-empty {
    border-color: transparent;

    background: transparent;

    opacity: 0;

    cursor: default;
    pointer-events: none;
}


/*
 * =====================================================
 * BAUM – EINTRAGSZEILE
 * =====================================================
 */

.icd-tree-node-button {
    display: grid;
    grid-template-columns:
        88px
        minmax(0, 1fr)
        auto;

    align-items: start;
    gap: 12px;

    flex: 1 1 auto;
    min-width: 0;

    padding: 9px 10px;

    border: 1px solid transparent;
    border-radius: 4px;

    background: transparent;

    text-align: left;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease;
}

.icd-tree-node-button:hover {
    border-color: #e1e8f0;

    background: #f5f8fb;
}

.icd-tree-node-button:focus-visible {
    outline: 2px solid rgba(31, 95, 159, .22);
    outline-offset: -2px;
}

.icd-tree-node-button.is-selected {
    border-color: #c6daed;

    background: #eaf2fb;
}

.icd-tree-node-button.is-selected
.icd-tree-node-code,
.icd-tree-node-button.is-selected
.icd-tree-node-title {
    color: #174f86;
}

.icd-tree-node-code {
    color: #1f5f9f;

    font-weight: 700;

    white-space: nowrap;
}

.icd-tree-node-title {
    min-width: 0;

    color: #333333;

    line-height: 1.45;
}

.icd-tree-node-kind {
    padding-top: 2px;

    color: #667085;

    font-size: 12px;

    white-space: nowrap;
}

.icd-tree-node-mobile-label {
    display: none;
}


/*
 * =====================================================
 * DETAILANSICHT
 * =====================================================
 */

.icd-tree-detail-head {
    margin-bottom: 20px;
    padding-bottom: 18px;

    border-bottom: 1px solid #dfe6ee;
}

.icd-tree-detail-code {
    margin-bottom: 10px;

    color: #1f5f9f;

    font-size: 32px;
    line-height: 1;
    font-weight: 700;
}

.icd-tree-detail-title {
    margin: 0 0 12px;

    color: #333333;

    font-size: 28px;
    line-height: 1.3;
    font-weight: 700;
}

.icd-tree-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}


/*
 * =====================================================
 * UNTERGEORDNETE DETAIL-EINTRÄGE
 * =====================================================
 */

.icd-tree-detail-children {
    display: grid;
    gap: 8px;
}

.icd-tree-detail-child {
    display: flex;
    flex-direction: column;
    gap: 4px;

    width: 100%;

    padding: 10px 12px;

    border: 1px solid #dfe6ee;
    border-radius: 4px;

    background: #ffffff;
    color: #333333;

    text-align: left;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease;
}

.icd-tree-detail-child strong {
    color: #1f5f9f;
}

.icd-tree-detail-child:hover {
    border-color: #bdd2e8;

    background: #f8fbff;
}

.icd-tree-detail-child:focus-visible {
    outline: 2px solid rgba(31, 95, 159, .22);
    outline-offset: 1px;
}


/*
 * =====================================================
 * NACH-OBEN-BUTTON
 * =====================================================
 */

.icd-scroll-top {
    --icd-scroll-top-gap: 24px;
    --icd-scroll-top-footer-offset: 0px;

    position: fixed;
    right: 24px;
    bottom: calc(
        var(--icd-scroll-top-gap)
        + var(--icd-scroll-top-footer-offset)
    );
    z-index: 50;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;

    border: 1px solid #174f86;
    border-radius: 4px;

    background: #1f5f9f;
    color: #ffffff;

    font-size: 18px;

    cursor: pointer;

    box-shadow: 0 8px 24px rgba(15, 35, 55, .22);

    opacity: 1;
    transform: translateY(0);

    transition:
        bottom .12s ease-out,
        background-color .18s ease,
        opacity .18s ease,
        transform .18s ease;
}

.icd-scroll-top:hover {
    background: #174f86;
    transform: translateY(-2px);
}

.icd-scroll-top:focus-visible {
    outline: 3px solid rgba(31, 95, 159, .25);
    outline-offset: 3px;
}

.icd-scroll-top[hidden] {
    display: none;
}