.home-page {
    min-height: 100vh;
    width: min(100%, 1040px);
    margin: 0 auto;
    padding: 24px 20px 48px;
    color: #0f172a;
}

.home-page *,
.home-page *::before,
.home-page *::after {
    box-sizing: border-box;
}

.home-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin: 4px 0 18px;
}

.home-title {
    min-width: 0;
}

.home-kicker,
.section-label {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    color: #0369a1;
    background: #e0f2fe;
    font-size: 0.72rem;
    font-weight: 900;
}

.home-title h1 {
    margin: 10px 0 0;
    font-size: clamp(1.8rem, 4vw, 2.45rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
}

.home-title p:last-child {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.92rem;
    font-weight: 700;
}

.home-session {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.user-chip,
.logout-button {
    min-height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.user-chip {
    max-width: 12rem;
    padding: 0 13px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 900;
    text-overflow: ellipsis;
}

.logout-button {
    gap: 7px;
    padding: 0 13px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 900;
    transition: background 0.18s ease, transform 0.18s ease;
}

.logout-button:hover,
.logout-button:focus-visible {
    background: #e2e8f0;
}

.home-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.resume-card {
    padding: 18px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.resume-card h2 {
    margin: 10px 0 4px;
    color: #0f172a;
    font-size: clamp(1.18rem, 3vw, 1.55rem);
    font-weight: 900;
    line-height: 1.18;
}

.resume-card p {
    margin: 0;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 700;
}

.primary-action {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    color: #ffffff;
    background: #0ea5e9;
    font-size: 0.84rem;
    font-weight: 900;
    text-decoration: none;
    transition: transform 0.18s ease, background 0.18s ease;
}

.primary-action:hover,
.primary-action:focus-visible {
    background: #0284c7;
    transform: translateY(-1px);
}

.home-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.category-tabs {
    min-width: 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tabs a {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: #334155;
    background: rgba(255, 255, 255, 0.84);
    font-size: 0.82rem;
    font-weight: 900;
    text-decoration: none;
}

.category-action {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    flex-shrink: 0;
    color: #334155;
    background: #ffffff;
    font-size: 0.8rem;
    font-weight: 900;
    cursor: pointer;
}

.category-action:hover,
.category-action:focus-visible {
    color: #0ea5e9;
    border-color: #bae6fd;
}

.category-block {
    scroll-margin-top: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.035);
}

.category-heading {
    width: 100%;
    min-height: 54px;
    padding: 0 14px;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: inherit;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.category-heading:hover,
.category-heading:focus-visible {
    background: #f8fafc;
}

.category-title {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.category-title strong {
    margin: 0;
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.25;
}

.category-title small {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

.category-chevron {
    color: #94a3b8;
    font-size: 0.82rem;
    transition: transform 0.18s ease;
}

.category-block.is-collapsed .category-chevron {
    transform: rotate(-90deg);
}

.study-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 14px 14px;
}

.study-list[hidden] {
    display: none;
}

.study-item {
    min-height: 82px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    color: inherit;
    background: #ffffff;
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.study-item:hover,
.study-item:focus-visible {
    border-color: #bae6fd;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.item-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.item-copy {
    min-width: 0;
}

.item-copy strong,
.item-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-copy strong {
    color: #0f172a;
    font-size: 0.93rem;
    font-weight: 900;
    line-height: 1.3;
    white-space: nowrap;
}

.item-copy small {
    margin-top: 3px;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.item-status {
    min-width: 74px;
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
}

.item-meta {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 900;
    white-space: nowrap;
}

.mini-progress {
    width: 62px;
    height: 5px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}

.mini-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #0ea5e9;
}

.tone-sky .item-icon { color: #0369a1; background: #e0f2fe; }
.tone-indigo .item-icon { color: #4338ca; background: #e0e7ff; }
.tone-violet .item-icon { color: #6d28d9; background: #ede9fe; }
.tone-emerald .item-icon { color: #047857; background: #d1fae5; }
.tone-amber .item-icon { color: #92400e; background: #fef3c7; }
.tone-rose .item-icon { color: #be123c; background: #ffe4e6; }
.tone-slate .item-icon { color: #475569; background: #f1f5f9; }

.empty-state {
    min-height: 16rem;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
}

.module-card:focus-visible,
.study-item:focus-visible,
.primary-action:focus-visible,
.category-tabs a:focus-visible,
.category-action:focus-visible,
.category-heading:focus-visible,
.logout-button:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.35);
    outline-offset: 3px;
}

@media (min-width: 1024px) {
    .study-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .home-page {
        padding: 18px 14px 34px;
    }

    .home-header {
        flex-direction: column;
        gap: 14px;
    }

    .home-session {
        width: 100%;
        justify-content: space-between;
    }

    .user-chip {
        max-width: min(15rem, 62vw);
    }

    .resume-card {
        align-items: stretch;
        flex-direction: column;
    }

    .primary-action {
        width: 100%;
    }

    .home-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .category-action {
        width: 100%;
    }

    .study-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .study-item {
        grid-template-columns: 34px minmax(0, 1fr);
        align-items: start;
    }

    .item-icon {
        width: 34px;
        height: 34px;
    }

    .item-status {
        grid-column: 2;
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .logout-button span {
        display: none;
    }

    .logout-button {
        width: 38px;
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page *,
    .home-page *::before,
    .home-page *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
