/* AI 모델 지도 (/ai-model-map/). 이 페이지에서만 불러온다.
   흑백 바탕에 강조는 --accent 하나. 쓰임새는 색이 아니라 번호 라벨과 테두리로 가른다.
   한글이 섞이는 글자는 전부 --font-body(Pretendard), 숫자·영문 전용 자리에만 --font-heading을 쓴다. */
.model-map {
    background: #fff;
    color: #000;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.58;
}

.model-map *,
.model-map *::before,
.model-map *::after {
    box-sizing: border-box;
}

.model-map [hidden] {
    display: none !important;
}

.model-map a {
    color: inherit;
}

.model-map .map-wrap {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
}

.model-map a:focus-visible,
.model-map button:focus-visible,
.model-map input:focus-visible,
.model-map select:focus-visible,
.model-map summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* 머리 */
.model-map .map-hero {
    padding: 28px 0 30px;
    border-bottom: 8px solid #000;
}

.model-map .map-mast {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #000;
    font-size: 0.83rem;
    font-weight: 700;
    color: #555;
}

.model-map .map-mast span {
    font-family: var(--font-condensed);
    letter-spacing: 0.08em;
    color: #000;
}

.model-map h1 {
    margin: 22px 0 10px;
    font-family: var(--font-body);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -0.05em;
    text-transform: none;
    word-break: keep-all;
}

.model-map .map-intro {
    max-width: 710px;
    margin: 0;
    font-size: 1.04rem;
    color: #111;
    word-break: keep-all;
}

.model-map .map-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin: 16px 0 0;
    font-size: 0.92rem;
    font-weight: 700;
}

.model-map .map-metrics strong {
    margin-right: 6px;
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 400;
    line-height: 1;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.model-map .map-body {
    padding: 28px 0 56px;
}

.model-map .section-heading {
    margin: 0 0 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 800;
    text-transform: none;
}

/* 쓰임새 타일 */
.model-map .map-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 22px;
    border-top: 1px solid #000;
    border-left: 1px solid #000;
}

.model-map .tile {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px 9px;
    min-width: 0;
    padding: 13px 12px;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    background: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}

.model-map .tile-no,
.model-map .lane-no {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1;
    color: var(--accent);
}

.model-map .tile-no {
    font-size: 1.1rem;
}

.model-map .tile-count {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.model-map .tile-bar {
    grid-column: 1 / -1;
    height: 4px;
    background: #e5e5e5;
    overflow: hidden;
}

.model-map .tile-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: #000;
}

.model-map .tile:hover {
    background: #f5f5f5;
}

.model-map .tile[aria-current="true"] {
    background: #000;
    color: #fff;
}

.model-map .tile[aria-current="true"] .tile-bar span {
    background: var(--accent);
}

/* 필터 */
.model-map .filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #000;
    background: #f5f5f5;
}

.model-map .filters label {
    display: grid;
    gap: 4px;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #111;
}

.model-map .filters label:first-child {
    grid-column: span 4;
}

.model-map .filters input,
.model-map .filters select,
.model-map .filters button {
    width: 100%;
    min-height: 44px;
    padding: 7px 9px;
    border: 1px solid #000;
    border-radius: 0;
    background: #fff;
    color: #000;
    font: inherit;
    font-size: 1rem;
}

.model-map .filters select {
    appearance: none;
    padding-right: 28px;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-size: 5px 5px;
    background-repeat: no-repeat;
    background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
}

.model-map .filters button {
    cursor: pointer;
    font-weight: 800;
    white-space: nowrap;
}

.model-map .filters button:hover {
    background: #000;
    color: #fff;
}

.model-map .results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.model-map .status {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.model-map .view-switch {
    display: flex;
    border: 1px solid #000;
}

.model-map .view-switch button {
    min-height: 36px;
    padding: 6px 14px;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #000;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.model-map .view-switch button[aria-pressed="true"] {
    background: #000;
    color: #fff;
}

.model-map .filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.model-map .filter-summary button {
    padding: 4px 10px;
    border: 1px solid #000;
    border-radius: 0;
    background: #fff;
    color: #000;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.model-map .filter-summary button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.model-map .map-note {
    margin: 0 0 22px;
    font-size: 0.87rem;
    color: #555;
}

.model-map .map-note p {
    max-width: 82ch;
    margin: 6px 0 0;
}

.model-map .map-note summary,
.model-map .model summary {
    cursor: pointer;
    font-weight: 700;
}

.model-map .empty {
    padding: 22px;
    border: 1px solid #000;
}

.model-map .empty p {
    margin: 0 0 8px;
}

.model-map .empty button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

/* 쓰임새 구역 */
.model-map .lane {
    margin: 0 0 30px;
    scroll-margin-top: 80px;
}

.model-map .lane-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-top: 4px solid #000;
    border-bottom: 1px solid #000;
}

.model-map .lane-no {
    font-size: 2.2rem;
}

.model-map .lane-head > div {
    flex: 1;
    min-width: 0;
}

.model-map .lane-head h2 {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.44rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.3;
    text-transform: none;
}

.model-map .lane-head p {
    margin: 0;
    font-size: 0.84rem;
    color: #555;
}

.model-map .lane-count {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* 카드 보기 */
.model-map .cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.model-map .model {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid #000;
    background: #fff;
}

.model-map .owner {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #555;
}

.model-map .kind {
    margin-left: 6px;
    padding: 1px 5px;
    border: 1px solid #767676;
    font-size: 0.75rem;
    font-weight: 600;
}

.model-map .model h3 {
    margin: 3px 0 6px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.38;
    text-transform: none;
    overflow-wrap: anywhere;
}

.model-map .overview {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: #111;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.model-map .badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: auto 0 0;
    padding: 5px 0;
    list-style: none;
}

/* 배지: 공개 가중치는 검정, API는 테두리, 계보는 주황 밑줄, 나머지는 회색 */
.model-map .badges li {
    padding: 2px 6px;
    border: 1px solid #e5e5e5;
    background: #f5f5f5;
    color: #555;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
}

.model-map .badges .weight {
    border-color: #000;
    background: #000;
    color: #fff;
}

.model-map .badges .api {
    border-color: #000;
    background: #fff;
    color: #000;
}

.model-map .badges .origin {
    border-color: transparent;
    border-bottom: 2px solid var(--accent);
    background: none;
    color: #000;
}

.model-map .model details {
    margin-top: 6px;
    padding-top: 7px;
    border-top: 1px solid #e5e5e5;
    font-size: 0.88rem;
    color: #555;
}

.model-map .model details p {
    margin: 5px 0;
}

.model-map .links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
}

.model-map .links a {
    color: #000;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.model-map .links a:hover {
    color: var(--accent);
}

/* 목록 보기 (기본) */
.model-map.list-mode .cards {
    display: block;
    margin-top: 0;
}

.model-map.list-mode .model {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr) minmax(0, 1.75fr) minmax(0, 1.05fr);
    align-items: start;
    gap: 7px 16px;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid #e5e5e5;
}

.model-map.list-mode .model h3,
.model-map.list-mode .model .overview,
.model-map.list-mode .model .badges {
    margin: 0;
    padding: 0;
}

.model-map.list-mode .model details {
    grid-column: 2 / -1;
    margin: 0;
    padding: 0;
    border: 0;
}

/* 추가 확인 · 꼬리 */
.model-map .model-map-extra {
    margin-top: 34px;
    padding-top: 16px;
    border-top: 4px solid #000;
}

.model-map .model-map-extra h2 {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 900;
    text-transform: none;
}

.model-map .model-map-extra ul {
    padding-left: 18px;
}

.model-map .model-map-extra li {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.model-map .model-map-extra .links {
    font-size: 0.82rem;
}

.model-map .map-foot,
.model-map .map-empty-note {
    margin: 24px 0 0;
    padding-top: 14px;
    border-top: 1px solid #e5e5e5;
    font-size: 0.85rem;
    color: #555;
}

@media (max-width: 900px) {
    .model-map .filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .model-map .filters label:first-child {
        grid-column: span 2;
    }

    .model-map .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .model-map.list-mode .model {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr);
    }

    .model-map.list-mode .model .overview {
        grid-column: 2;
        grid-row: 2;
    }

    .model-map.list-mode .model .badges {
        grid-column: 3;
        grid-row: 1 / 3;
    }

    .model-map.list-mode .model details {
        grid-column: 2 / -1;
    }
}

@media (max-width: 560px) {
    .model-map .map-wrap {
        width: calc(100% - 28px);
    }

    .model-map .map-hero {
        padding: 20px 0 24px;
    }

    .model-map .map-intro {
        font-size: 0.95rem;
    }

    .model-map .map-body {
        padding-top: 20px;
    }

    .model-map .map-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .model-map .tile {
        padding: 10px 8px;
        font-size: 0.82rem;
        gap: 6px 7px;
    }

    .model-map .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 10px;
    }

    .model-map .filters label:first-child {
        grid-column: 1 / -1;
    }

    .model-map .cards {
        grid-template-columns: 1fr;
    }

    .model-map .lane-head h2 {
        font-size: 1.25rem;
    }

    /* 좁은 화면의 목록은 격자를 풀고 위에서 아래로 쌓는다 */
    .model-map.list-mode .model {
        display: block;
    }

    .model-map.list-mode .model .overview,
    .model-map.list-mode .model .badges {
        margin: 4px 0;
    }
}

@media print {
    .model-map .filters,
    .model-map .results-bar,
    .model-map .filter-summary,
    .model-map .empty {
        display: none;
    }

    .model-map .model {
        break-inside: avoid;
    }

    .model-map .lane-head {
        break-after: avoid;
    }
}
