/* ============================================================
   홈 도구 허브 (메인 영역)
   - tm-shell.css 의 --tm-* 토큰을 사용
   - oklch 미지원 브라우저를 위해 hex 를 먼저, oklch 를 뒤에 선언
   ============================================================ */

.tm-hub {
    padding: 28px 32px 72px;
    max-width: 1180px;
}

/* ---------- 헤더 ---------- */
.tm-hub-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tm-hub-headline h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #1b1e24;
    color: var(--tm-ink);
}

.tm-hub-headline p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    color: var(--tm-muted);
}

.tm-filters {
    display: flex;
    gap: 6px;
}

.tm-filter {
    padding: 7px 13px;
    font-size: 12.5px;
    font-family: inherit;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #dfe3ea;
    background: #fff;
    color: #4b525c;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.tm-filter:hover { border-color: #c3c9d4; }

.tm-filter.is-active {
    background: #3b6fe0;
    background: var(--tm-accent);
    border-color: #3b6fe0;
    border-color: var(--tm-accent);
    color: #fff;
}

/* ---------- 섹션 ---------- */
.tm-section { margin-bottom: 34px; }
.tm-section[hidden] { display: none; }

.tm-section-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.tm-section-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1b1e24;
    color: var(--tm-ink);
}

.tm-section-fav .tm-section-head,
.tm-section-recent .tm-section-head {
    align-items: center;
    margin-bottom: 12px;
}

.tm-section-fav .tm-section-head h2,
.tm-section-recent .tm-section-head h2 { font-size: 14px; }

.tm-section-note {
    font-size: 11px;
    color: #9aa1ac;
    color: var(--tm-faint-2);
}

.tm-section-count {
    font-size: 11.5px;
    color: #9aa1ac;
    color: var(--tm-faint-2);
    font-variant-numeric: tabular-nums;
}

.tm-section .tm-dot {
    width: 8px;
    height: 8px;
    border-radius: 3px;
    display: inline-block;
    flex: none;
}

.tm-section-blurb {
    margin: 0 0 12px 18px;
    font-size: 12px;
    color: #8a919c;
    color: var(--tm-faint);
}

/* ---------- 카드 그리드 ---------- */
.tm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
    gap: 10px;
}

.tm-card {
    position: relative;
    display: flex;
    gap: 11px;
    padding: 13px 14px;
    background: #fff;
    background: var(--tm-surface);
    border: 1px solid #e5e8ed;
    border: 1px solid var(--tm-border);
    border-radius: 11px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.tm-card[hidden] { display: none; }

.tm-card:hover {
    border-color: #3b6fe0;
    border-color: var(--tm-accent);
    box-shadow: 0 2px 10px rgba(20, 30, 60, 0.07);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}

.tm-card-mark {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
}

.tm-card-body {
    min-width: 0;
    padding-right: 14px;
    display: block;
}

.tm-card-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.tm-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1b1e24;
    color: var(--tm-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tm-card-desc {
    display: block;
    font-size: 11.5px;
    color: #6b7280;
    color: var(--tm-muted);
    line-height: 1.45;
}

.tm-badge {
    flex: none;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 2px 5px;
    border-radius: 4px;
}

.tm-badge-new {
    color: #2f9e5f;
    color: var(--tm-new-fg);
    background: #e9f7ee;
    background: var(--tm-new-bg);
}

.tm-badge-popular {
    color: #c06a2b;
    color: var(--tm-hot-fg);
    background: #fdf0e3;
    background: var(--tm-hot-bg);
}

.tm-card-star {
    position: absolute;
    top: 7px;
    right: 8px;
    border: 0;
    background: transparent;
    padding: 2px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    color: #c9ced7;
    color: var(--tm-star-off);
}

.tm-card-star.is-on {
    color: #e8a33d;
    color: var(--tm-star-on);
}

/* ---------- 즐겨찾기 빈 상태 ---------- */
.tm-empty {
    padding: 18px 16px;
    border: 1px dashed #d8dce4;
    border: 1px dashed var(--tm-border-dash);
    border-radius: 11px;
    font-size: 12.5px;
    color: #8a919c;
    color: var(--tm-faint);
}

.tm-empty[hidden] { display: none; }

/* ---------- 최근 사용 pill ---------- */
.tm-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tm-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 8px;
    background: #fff;
    background: var(--tm-surface);
    border: 1px solid #e5e8ed;
    border: 1px solid var(--tm-border);
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    color: #1b1e24;
    color: var(--tm-ink);
    text-decoration: none;
}

.tm-pill:hover {
    border-color: #c3c9d4;
    text-decoration: none;
    color: #1b1e24;
    color: var(--tm-ink);
}

.tm-pill-mark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
}

/* ---------- 검색 결과 없음 ---------- */
.tm-noresult {
    padding: 60px 0;
    text-align: center;
    font-size: 13px;
    color: #8a919c;
    color: var(--tm-faint);
}

.tm-noresult[hidden] { display: none; }

/* ---------- CTA ---------- */
.tm-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 24px 26px;
    background: #fff;
    background: var(--tm-surface);
    border: 1px solid #e5e8ed;
    border: 1px solid var(--tm-border);
    border-radius: 14px;
}

.tm-cta-text h2 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #1b1e24;
    color: var(--tm-ink);
}

.tm-cta-text p {
    margin: 0;
    font-size: 12.5px;
    color: #6b7280;
    color: var(--tm-muted);
}

.tm-cta-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.tm-btn-primary {
    background: #3b6fe0;
    background: var(--tm-accent);
    color: #fff;
    border: 1px solid #3b6fe0;
    border: 1px solid var(--tm-accent);
}

.tm-btn-primary:hover {
    background: #2c56b8;
    background: var(--tm-accent-strong);
    color: #fff;
    text-decoration: none;
}

.tm-btn-ghost {
    background: #fff;
    color: #4b525c;
    border: 1px solid #dfe3ea;
}

.tm-btn-ghost:hover { border-color: #c3c9d4; color: #1b1e24; text-decoration: none; }

/* ---------- 반응형 ---------- */
@media (max-width: 991.98px) {
    .tm-hub { padding: 22px 18px 56px; }
}

@media (max-width: 575.98px) {
    .tm-hub { padding: 18px 14px 48px; }
    .tm-hub-headline h1 { font-size: 20px; }
    .tm-grid { grid-template-columns: minmax(0, 1fr); }
    .tm-hub-head { align-items: flex-start; gap: 14px; }
    .tm-cta { padding: 20px; }
}
