canvas {
    /* 画面の幅に応じてサイズを変更する */
    width: 100% !important;
    height: auto !important;
    max-width: 300px;
    max-height: 300px;
}

.highlight {
        background-color: yellow;
    }

.table .custom-dark {
        background-color: var(--color-surface-muted);
}

.start-btna {
        color:var(--color-warning);
        background-color: var(--color-navy);
}

.subhome-question-tab-content,
.subhome-category-tab-content {
    min-height: 100px; /* 最小の高さを500pxに設定。コンテンツに合わせて調整すること。 */
    overflow-x: hidden;
    overflow-y: auto;  /* 内容が指定した高さを超えた場合、縦方向にスクロールバーを表示 */
}


.question-card {
    padding-left: 0;
    overflow-x: hidden;
    transition: all 0.3s; /* smooth transition */
}

.question-card-header {
    background-color: transparent;
    height: 100%; /* 高さ30px */
    width: 100%; /* 親要素の幅に合わせる */
    display: flex; /* Flexboxを使用 */
    justify-content: center; /* 水平方向の中央揃え */
    align-items: center; /* 垂直方向の中央揃え */
    top: 0;
    left: 0;
}

/* .test1-box内のテキストスタイル */
.question-card p {
    margin: 0; /* デフォルトのマージンを削除 */
    /* その他のテキストスタイル */
}



.progress {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    height: 10px;
    width: 70%;
}

.progress-bar{
    background-color: var(--color-border-soft);
    height: 8px; 
    width: 70%;
}


/* 2階層目カテゴリタブ */
.category-tabs {
    --category-active-bg: var(--color-main-alpha-30);
    --category-active-border: var(--color-main-alpha-10);
    --category-active-text: var(--color-white);
    --category-bg: var(--color-surface);
    --category-border: var(--color-border-soft);
    --category-text: var(--color-text);
}

.category-tab {
    background-color: var(--category-bg) !important;
    color: var(--category-text) !important;
    border: 1px solid var(--category-border) !important;
    border-radius: 5px;
    min-width: 72px;
    box-shadow: none !important;
}

.category-tab.active {
    background-color: var(--category-active-bg) !important;
    color: var(--category-active-text) !important;
    border-color: var(--category-active-border) !important;
}

.category-tab:focus,
.category-tab:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.subhome-section-shell {
    margin-top: 0;
    --subhome-ink: var(--color-navy);
    --subhome-accent: var(--color-main);
    --subhome-accent-strong: var(--color-secondary);
    --subhome-accent-soft: var(--color-main-soft);
    --subhome-border: var(--color-border-soft);
    --subhome-muted: var(--color-muted);
}

.page-title {
    font-size: 1.35rem;
    line-height: 1.3;
}

@media (max-width: 767.98px) {
    .page-title {
        font-size: 1.2rem;
    }
}

.subhome-section-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--subhome-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.subhome-section-tabs .nav-item {
    flex: 1 1 0;
    min-width: 0;
}

.subhome-section-tabs .nav-link {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-right: 1px solid var(--subhome-border);
    border-radius: 0;
    background: var(--color-surface);
    color: var(--subhome-muted);
    font-weight: 700;
    padding: 0.14rem 0.62rem 0.16rem;
    position: relative;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.subhome-section-tabs .nav-item:last-child .nav-link {
    border-right: 0;
}

.subhome-section-tab-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    width: 100%;
    min-width: 0;
}

.subhome-section-tab-icon {
    color: inherit;
    font-size: 0.96rem;
    line-height: 1;
    flex: 0 0 auto;
}

.subhome-section-tab-label {
    color: inherit;
    font-size: 0.82rem;
    line-height: 1.05;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subhome-section-tabs .nav-link:hover {
    background: var(--subhome-accent-soft);
    color: var(--subhome-ink);
}

.subhome-section-tabs .nav-link.active {
    background: var(--color-surface);
    color: var(--subhome-accent);
    box-shadow: inset 0 -4px 0 var(--subhome-accent);
}

.subhome-section-tabs .nav-link.active:hover {
    background: var(--color-surface);
    color: var(--subhome-accent-strong);
}

.subhome-section-tabs .nav-link:focus,
.subhome-section-tabs .nav-link:focus-visible {
    box-shadow: inset 0 -4px 0 var(--subhome-accent), 0 0 0 3px var(--color-main-alpha-12);
    outline: none;
}

.subhome-section-shell #myTabs,
.subhome-section-shell .category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 1px !important;
    border: 1px solid var(--subhome-border);
    border-radius: 8px;
    background: var(--subhome-border);
    box-shadow: var(--shadow-card);
    margin-top: 0.8rem !important;
    margin-bottom: 0.75rem !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.subhome-section-shell #myTabs {
    border-bottom: 1px solid var(--subhome-border);
}

.subhome-section-shell #myTabs > .nav-item,
.subhome-section-shell .category-tabs > .nav-item {
    flex: 1 1 9.5rem !important;
    min-width: 0;
    padding: 0;
}

.subhome-section-shell #myTabs .nav-link,
.subhome-section-shell .category-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    border: 0 !important;
    border-bottom: 1px solid var(--color-border) !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    background: var(--color-surface) !important;
    color: var(--subhome-muted) !important;
    font-weight: 700;
    line-height: 1.05;
    padding: 0.14rem 0.62rem 0.16rem !important;
    position: relative;
    box-shadow: none !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.subhome-section-shell #myTabs > .nav-item:last-child .nav-link,
.subhome-section-shell .category-tabs > .nav-item:last-child .nav-link {
    border-right: 0 !important;
}

.subhome-section-shell #myTabs .nav-link,
.subhome-section-shell .category-tabs .nav-link,
.subhome-section-shell .category-tabs .nav-link > span {
    font-size: 0.92rem;
    letter-spacing: 0;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: keep-all;
    text-overflow: clip;
}

.subhome-section-shell #myTabs .nav-link:hover,
.subhome-section-shell .category-tabs .nav-link:hover {
    background: var(--subhome-accent-soft) !important;
    color: var(--subhome-ink) !important;
    filter: none;
}

.subhome-section-shell #myTabs .nav-link.active,
.subhome-section-shell .category-tabs .nav-link.active {
    background: var(--color-surface) !important;
    color: var(--subhome-muted) !important;
    box-shadow: inset 0 -4px 0 var(--subhome-accent) !important;
}

.subhome-section-shell #myTabs .nav-link.active:hover,
.subhome-section-shell .category-tabs .nav-link.active:hover {
    background: var(--color-surface) !important;
    color: var(--subhome-muted) !important;
}

.subhome-section-shell #myTabs .nav-link:focus,
.subhome-section-shell #myTabs .nav-link:focus-visible,
.subhome-section-shell .category-tabs .nav-link:focus,
.subhome-section-shell .category-tabs .nav-link:focus-visible {
    box-shadow: inset 0 -4px 0 var(--subhome-accent), 0 0 0 3px var(--color-main-alpha-12) !important;
    outline: none;
}

.subhome-section-pane {
    padding-bottom: 0.5rem;
}

.subhome-preview-panel {
    margin-top: 1.25rem;
    background: linear-gradient(180deg, var(--color-surface-hover) 0%, var(--color-surface) 42%);
    border: 1px solid var(--color-main-alpha-14);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: var(--shadow-card);
}

.subhome-disclosure-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
}

.subhome-disclosure-summary::-webkit-details-marker {
    display: none;
}

.subhome-disclosure-summary-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.subhome-disclosure-icon {
    color: var(--subhome-muted);
    font-size: 0.82rem;
    transition: transform 0.18s ease;
}

details[open] > .subhome-disclosure-summary .subhome-disclosure-icon {
    transform: rotate(180deg);
}

details:not([open]) > .subhome-preview-header,
details:not([open]) > .subhome-bookmark-header {
    margin-bottom: 0;
}

.subhome-bookmark-panel {
    margin-top: 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-main-alpha-14);
    border-radius: 16px;
    padding: 0.95rem;
    box-shadow: var(--shadow-card);
}

.subhome-bookmark-header {
    margin-bottom: 0.75rem;
}

.subhome-bookmark-content,
.subhome-preview-content {
    margin-top: 0.75rem;
}

.subhome-bookmark-title {
    margin: 0;
    color: var(--subhome-ink);
    font-size: 1rem;
    font-weight: 700;
}

.subhome-bookmark-count {
    color: var(--subhome-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.subhome-bookmark-list,
.subhome-preview-question-list {
    display: grid;
    gap: 0.54rem;
}

.subhome-bookmark-empty {
    margin: 0;
    color: var(--subhome-muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.subhome-bookmark-item,
.subhome-preview-question-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--color-main-alpha-10);
    border-radius: 12px;
    padding: 0.58rem 0.68rem;
    background: var(--color-surface);
    min-width: 0;
    box-shadow: none;
}

.subhome-bookmark-item-body,
.subhome-preview-question-item-body {
    min-width: 0;
}

.subhome-bookmark-item-meta {
    margin: 0 0 0.16rem;
    color: var(--subhome-accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
}

.subhome-bookmark-item-text {
    display: -webkit-box;
    margin: 0;
    color: var(--subhome-ink);
    font-size: 0.8rem;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.subhome-bookmark-item-text.has-ruby {
    display: block;
    line-height: 1.72;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
    white-space: pre-wrap;
}

.subhome-bookmark-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.42rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.subhome-bookmark-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.36rem 0.78rem;
    border: 1px solid var(--color-main-alpha-16);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--subhome-accent-strong);
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.subhome-bookmark-open:hover,
.subhome-bookmark-open:focus {
    background: var(--subhome-accent-soft);
    color: var(--subhome-ink);
    text-decoration: none;
}

@media (max-width: 575.98px) {
    .subhome-bookmark-item,
    .subhome-preview-question-item {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .subhome-bookmark-item-actions {
        justify-self: start;
        margin-left: 0;
    }
}

.subhome-preview-header {
    margin-bottom: 0.95rem;
}

.subhome-preview-title {
    margin: 0;
    color: var(--subhome-ink);
    font-size: 1.08rem;
    font-weight: 700;
}

.subhome-preview-subtitle {
    margin: 0.35rem 0 0;
    color: var(--subhome-muted);
    font-size: 0.88rem;
}

.subhome-preview-shell {
    display: grid;
    gap: 0.62rem;
}

.subhome-preview-tabs {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
}

.subhome-preview-tabs::-webkit-scrollbar {
    display: none;
}

.subhome-preview-tabs[data-preview-top-tabs],
.subhome-preview-tabs[data-preview-category-tabs] {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    overflow: visible;
}

.subhome-preview-tab-button {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--color-main-alpha-12);
    background: var(--color-surface);
    color: var(--subhome-muted);
    border-radius: 8px;
    padding: 0.42rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.2;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    flex: 0 0 auto;
    min-height: 2rem;
    white-space: nowrap;
    box-shadow: none;
    width: 100%;
    text-align: center;
}

.subhome-preview-tab-button:hover {
    background: var(--subhome-accent-soft);
    color: var(--subhome-ink);
}

.subhome-preview-tab-button.is-active {
    background: var(--color-main-alpha-14);
    border-color: var(--color-main-alpha-18);
    color: var(--subhome-ink);
    font-weight: 600;
}

.subhome-preview-tab-button.is-secondary {
    border-radius: 8px;
    min-height: 1.95rem;
    font-size: 0.76rem;
}

.subhome-preview-tab-button:focus,
.subhome-preview-tab-button:focus-visible {
    outline: 2px solid var(--color-main-alpha-24);
    outline-offset: 1px;
    box-shadow: none;
}

.subhome-preview-topic-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
    gap: 0.46rem;
}

.subhome-preview-topic-button {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    text-align: left;
    border: 1px solid var(--color-main-alpha-12);
    background: var(--color-surface);
    border-radius: 8px;
    padding: 0.52rem 0.68rem;
    min-width: 0;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    box-shadow: none;
}

.subhome-preview-topic-button:hover {
    background: var(--color-surface-hover);
}

.subhome-preview-topic-button.is-active {
    border-color: var(--color-main-alpha-22);
    background: var(--subhome-accent-soft);
}

.subhome-preview-topic-button:focus,
.subhome-preview-topic-button:focus-visible {
    outline: 2px solid var(--color-main-alpha-24);
    outline-offset: 1px;
    box-shadow: none;
}

.subhome-preview-topic-title {
    color: var(--subhome-ink);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.subhome-preview-topic-meta {
    color: var(--subhome-muted);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    flex: 0 0 auto;
}

.subhome-preview-feedback {
    min-height: 1.4rem;
}

.subhome-preview-empty,
.subhome-preview-loading {
    margin: 0;
    color: var(--subhome-muted);
    font-size: 0.88rem;
}

.subhome-preview-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
}

.subhome-preview-column {
    border: 1px solid var(--color-main-alpha-10);
    background: var(--color-surface);
    border-radius: 16px;
    padding: 0.82rem;
    box-shadow: var(--shadow-card);
    min-width: 0;
}

.subhome-preview-column-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.72rem;
}

.subhome-preview-column-title {
    margin: 0;
    color: var(--subhome-ink);
    font-size: 0.95rem;
    font-weight: 700;
}

.subhome-preview-column-meta {
    color: var(--subhome-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.subhome-preview-question-list {
    max-height: min(82vh, 1020px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.18rem;
    scrollbar-gutter: stable;
}

.subhome-preview-question-item {
    text-align: left;
    cursor: default;
}

.subhome-preview-question-item.is-featured {
    gap: 0.42rem;
    background: var(--color-surface-soft);
    border-color: var(--color-main-alpha-16);
    border-radius: 18px;
    padding: 0.78rem 0.92rem 0.88rem;
}

.subhome-preview-question-item.is-placeholder {
    padding: 0.8rem 0.92rem;
}

.subhome-preview-question-item.is-active {
    background: var(--color-surface);
    border-color: var(--color-main-alpha-10);
}

.subhome-preview-question-item:focus,
.subhome-preview-question-item:focus-visible {
    outline: 2px solid var(--color-main-alpha-24);
    outline-offset: 1px;
    box-shadow: none;
}

.subhome-preview-question-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
    flex-wrap: nowrap;
}

.subhome-preview-question-item-label {
    flex: 0 0 auto;
}

.subhome-preview-question-item.is-featured .subhome-preview-question-item-label {
    font-size: 0.86rem;
}

.subhome-preview-question-item-actions {
    align-self: center;
}

.subhome-preview-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.45rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.subhome-preview-status-badge.is-correct {
    background: var(--color-main-alpha-14);
    color: var(--subhome-accent-strong);
}

.subhome-preview-status-badge.is-incorrect {
    background: var(--color-warning-soft);
    color: var(--color-warning-text);
}

.subhome-preview-status-badge.is-unanswered {
    background: var(--color-muted-alpha-12);
    color: var(--subhome-muted);
}

.subhome-preview-question-item.is-featured .subhome-preview-question-item-text {
    display: block;
    font-size: 0.95rem;
    line-height: 1.72;
    -webkit-line-clamp: unset;
    -webkit-box-orient: initial;
    overflow: visible;
    max-height: none;
    margin: 0.05rem 0 0;
}

.subhome-preview-question-item.is-placeholder .subhome-preview-detail-placeholder {
    margin: 0;
    font-size: 0.86rem;
}

.subhome-preview-practice-inline {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0;
}

.subhome-preview-practice-toggle,
.subhome-preview-practice-submit,
.subhome-preview-practice-choice {
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}

.subhome-preview-practice-toggle,
.subhome-preview-practice-submit {
    border: 1px solid var(--color-main-alpha-16);
    background: var(--color-surface);
    color: var(--subhome-accent-strong);
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
}

.subhome-preview-practice-toggle {
    padding: 0.36rem 0.78rem;
    font-size: 0.76rem;
    line-height: 1.2;
    text-decoration: none;
}

.subhome-preview-practice-submit {
    padding: 0.36rem 0.78rem;
    font-size: 0.76rem;
    line-height: 1.2;
}

.subhome-preview-practice-host {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.64rem;
    padding-top: 0.68rem;
    border-top: 1px solid var(--color-main-alpha-10);
}

.subhome-preview-practice-message,
.subhome-preview-practice-question-body,
.subhome-preview-practice-content,
.subhome-preview-practice-explanation {
    margin: 0;
    color: var(--subhome-ink);
    font-size: 0.83rem;
    line-height: 1.6;
}

.subhome-preview-practice-message {
    color: var(--subhome-muted);
}

.subhome-preview-practice-choice-list {
    display: grid;
    gap: 0.42rem;
}

.subhome-preview-practice-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.56rem;
    width: 100%;
    border: 1px solid var(--color-main-alpha-12);
    background: var(--color-surface);
    border-radius: 12px;
    padding: 0.56rem 0.64rem;
    text-align: left;
}

.subhome-preview-practice-choice.is-selected {
    background: var(--color-main-alpha-10);
    border-color: var(--color-main-alpha-20);
}

.subhome-preview-practice-choice:disabled {
    opacity: 0.72;
}

.subhome-preview-practice-choice-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1.5rem;
    min-height: 1.5rem;
    border-radius: 999px;
    background: var(--color-main-alpha-12);
    color: var(--subhome-accent-strong);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.subhome-preview-practice-choice-text {
    min-width: 0;
    color: var(--subhome-ink);
    font-size: 0.82rem;
    line-height: 1.5;
    word-break: break-word;
}

.subhome-preview-practice-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.48rem;
}

.subhome-preview-practice-feedback {
    padding: 0.52rem 0.66rem;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.4;
}

.subhome-preview-practice-feedback.is-correct {
    background: var(--color-main-alpha-12);
    color: var(--subhome-accent-strong);
}

.subhome-preview-practice-feedback.is-incorrect {
    background: var(--color-warning-soft);
    color: var(--color-warning-text);
}

.subhome-preview-practice-explanation-label,
.subhome-preview-practice-question-title {
    margin: 0;
    color: var(--subhome-muted);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.35;
}

.subhome-preview-practice-question-group,
.subhome-preview-practice-subresult {
    display: grid;
    gap: 0.44rem;
}

.subhome-preview-practice-result {
    display: grid;
    gap: 0.48rem;
}

.subhome-preview-practice-content,
.subhome-preview-practice-question-body,
.subhome-preview-practice-choice-text,
.subhome-preview-practice-explanation {
    white-space: pre-wrap;
}

.subhome-preview-practice-content ruby,
.subhome-preview-practice-question-body ruby,
.subhome-preview-practice-choice-text ruby,
.subhome-preview-practice-explanation ruby {
    ruby-align: center;
}

.subhome-preview-practice-content rt,
.subhome-preview-practice-question-body rt,
.subhome-preview-practice-choice-text rt,
.subhome-preview-practice-explanation rt {
    font-size: 0.62em;
    line-height: 1;
}

.subhome-preview-detail {
    min-height: 240px;
}

.subhome-preview-detail-badge-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.subhome-preview-detail-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 0.3rem 0.58rem;
    border-radius: 999px;
    background: var(--color-main-alpha-14);
    color: var(--subhome-accent-strong);
    font-size: 0.74rem;
    font-weight: 700;
}

.subhome-preview-detail-text,
.subhome-preview-detail-placeholder {
    margin: 0.82rem 0 0;
    color: var(--subhome-ink);
    font-size: 0.92rem;
    line-height: 1.75;
    white-space: pre-wrap;
}

.subhome-preview-detail-placeholder {
    color: var(--subhome-muted);
}

.subhome-preview-detail-subheading {
    margin: 0.95rem 0 0.42rem;
    color: var(--subhome-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.subhome-preview-detail-subquestions {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--subhome-ink);
    font-size: 0.86rem;
    line-height: 1.65;
}

.subhome-preview-question-item-text ruby,
.subhome-preview-detail-text ruby,
.subhome-preview-detail-subquestions ruby {
    ruby-align: center;
}

.subhome-preview-question-item-text rt,
.subhome-preview-detail-text rt,
.subhome-preview-detail-subquestions rt {
    font-size: 0.62em;
    line-height: 1;
}

.subhome-progress-panel {
    background: linear-gradient(180deg, var(--color-surface-hover) 0%, var(--color-surface) 38%);
    border: 1px solid var(--color-main-alpha-14);
    border-radius: 18px;
    padding: 1.25rem;
}

.subhome-progress-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.subhome-progress-panel-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--subhome-ink);
}

.subhome-progress-panel-subtitle {
    margin: 0.35rem 0 0;
    color: var(--subhome-muted);
    font-size: 0.9rem;
}

.subhome-progress-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.subhome-progress-card-overview,
.subhome-progress-card-tracks {
    grid-column: 1 / -1;
}

.subhome-progress-card {
    background: var(--color-surface);
    border: 1px solid var(--color-main-alpha-10);
    border-radius: 16px;
    padding: 0.95rem 1rem;
    box-shadow: var(--shadow-card);
}

.subhome-progress-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.subhome-progress-card-head h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--subhome-ink);
}

.subhome-progress-overview {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
}

.subhome-progress-ring {
    --progress-value: 0;
    width: 198px;
    height: 198px;
    margin: 0 auto;
    border-radius: 50%;
    background:
        conic-gradient(
            from 0deg,
            var(--subhome-accent) 0%,
            var(--subhome-accent-strong) calc(var(--progress-value) * 1%),
            var(--color-border-soft) 0
        );
    padding: 14px;
}

.subhome-progress-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: inset 0 0 0 1px var(--color-border-soft);
}

.subhome-progress-ring-label {
    color: var(--subhome-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.subhome-progress-ring-value {
    color: var(--subhome-ink);
    font-size: 2.3rem;
    line-height: 1;
    margin-top: 0.3rem;
}

.subhome-progress-ring-caption {
    color: var(--subhome-muted);
    font-size: 0.88rem;
    margin-top: 0.45rem;
}

.subhome-progress-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.subhome-progress-metric-card {
    border-radius: 14px;
    background: var(--subhome-accent-soft);
    border: 1px solid var(--color-main-alpha-12);
    padding: 0.68rem 0.78rem 0.64rem;
}

.subhome-progress-metric-label {
    display: block;
    color: var(--subhome-muted);
    font-size: 0.78rem;
    line-height: 1.25;
    margin-bottom: 0.22rem;
}

.subhome-progress-metric-value {
    color: var(--subhome-ink);
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.15;
}

.subhome-progress-track-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    max-height: min(48vh, 440px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.2rem;
    scrollbar-gutter: stable;
}

.subhome-progress-track-item {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.72rem 0.82rem;
    border: 1px solid var(--color-main-alpha-11);
    border-radius: 8px;
    background: var(--color-surface-hover);
}

.subhome-progress-track-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.85rem;
    min-width: 0;
}

.subhome-progress-track-name {
    color: var(--subhome-ink);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subhome-progress-track-bar {
    height: 10px;
    background: var(--color-border-soft);
    border-radius: 999px;
    overflow: hidden;
}

.subhome-progress-track-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--subhome-accent) 0%, var(--subhome-accent-strong) 100%);
    border-radius: inherit;
}

.subhome-progress-track-percent {
    display: inline-block;
    color: var(--subhome-ink);
    font-weight: 700;
    white-space: nowrap;
    flex: 0 0 auto;
}

.subhome-progress-track-detail {
    display: flex;
    align-items: center;
    gap: 0.55rem 1rem;
    flex-wrap: wrap;
    min-width: 0;
}

.subhome-progress-track-count {
    display: inline-block;
    color: var(--subhome-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.subhome-progress-history-list {
    display: grid;
    gap: 0.38rem;
}

.subhome-progress-history-content {
    margin-top: 0.62rem;
}

details:not([open]).subhome-progress-card-history > .subhome-progress-card-head {
    margin-bottom: 0;
}

.subhome-progress-history-item {
    min-width: 0;
}

.subhome-progress-history-main {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    min-width: 0;
    line-height: 1.35;
}

.subhome-progress-history-time {
    display: inline;
    color: var(--subhome-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.subhome-progress-history-title {
    display: inline;
    color: var(--subhome-ink);
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subhome-progress-history-detail {
    display: inline;
    color: var(--subhome-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.subhome-progress-history-title::before,
.subhome-progress-history-detail::before {
    content: "/";
    color: var(--color-muted-light);
    font-weight: 500;
    margin-right: 0.42rem;
}

.subhome-progress-empty {
    color: var(--subhome-muted);
    font-size: 0.9rem;
    margin: 0;
}

.subhome-progress-card-weekly {
    margin-top: 1rem;
}

.subhome-progress-weekly-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    color: var(--subhome-ink);
    font-size: 0.9rem;
    font-weight: 700;
}

.subhome-progress-week-chart {
    position: relative;
    min-height: 260px;
    height: 260px;
    padding-top: 0.2rem;
    min-width: 0;
}

.subhome-progress-week-chart canvas {
    width: 100%;
    height: 100%;
    max-width: none !important;
    max-height: none !important;
}

@media (max-width: 1080px) {
    .subhome-section-shell #myTabs .nav-link,
    .subhome-section-shell .category-tabs .nav-link,
    .subhome-section-tabs .nav-link {
        min-height: 44px;
        padding-left: 0.52rem;
        padding-right: 0.52rem;
    }

    .subhome-section-shell #myTabs .nav-link,
    .subhome-section-shell .category-tabs .nav-link,
    .subhome-section-shell .category-tabs .nav-link > span,
    .subhome-section-tab-label {
        font-size: 0.86rem;
    }
}

@media (max-width: 767px) {
    .subhome-section-tabs {
        border-radius: 6px;
        margin-bottom: 0.65rem;
    }

    .subhome-section-shell #myTabs,
    .subhome-section-shell .category-tabs {
        border-radius: 6px;
        margin-bottom: 0.65rem !important;
    }

    .subhome-progress-panel {
        padding: 0.95rem;
    }

    .subhome-preview-panel {
        padding: 0.85rem;
        margin-top: 1rem;
    }

    .subhome-section-shell #myTabs .nav-link,
    .subhome-section-shell .category-tabs .nav-link,
    .subhome-section-tabs .nav-link {
        min-height: 40px;
        padding: 0.08rem 0.34rem 0.1rem;
    }

    .subhome-section-tab-inner {
        gap: 0.28rem;
    }

    .subhome-section-tab-icon {
        font-size: 0.82rem;
    }

    .subhome-section-shell #myTabs .nav-link,
    .subhome-section-shell .category-tabs .nav-link,
    .subhome-section-shell .category-tabs .nav-link > span,
    .subhome-section-tab-label {
        font-size: 0.76rem;
    }

    .subhome-progress-grid {
        grid-template-columns: 1fr;
    }

    .subhome-progress-track-list {
        grid-template-columns: 1fr;
        max-height: min(58vh, 520px);
        gap: 0.75rem;
    }

    .subhome-preview-tabs {
        gap: 0.42rem;
    }

    .subhome-preview-tabs[data-preview-top-tabs],
    .subhome-preview-tabs[data-preview-category-tabs] {
        display: flex;
        overflow-x: auto;
    }

    .subhome-preview-tab-button {
        min-height: 2rem;
        padding: 0.38rem 0.68rem;
        font-size: 0.74rem;
        width: auto;
    }

    .subhome-preview-topic-strip {
        grid-template-columns: 1fr;
    }

    .subhome-preview-topic-button {
        padding: 0.54rem 0.62rem;
    }

    .subhome-preview-body {
        grid-template-columns: 1fr;
    }

    .subhome-preview-question-list {
        max-height: min(78vh, 780px);
    }

    .subhome-progress-overview {
        grid-template-columns: 1fr;
    }

    .subhome-progress-ring {
        width: 176px;
        height: 176px;
    }

    .subhome-progress-track-detail {
        gap: 0.35rem 0.8rem;
    }

    .subhome-progress-week-chart {
        min-height: 220px;
        height: 220px;
    }
}
