.homework-container {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
}

.homework-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.homework-header h1 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.homework-header-title-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hw-help-btn--title {
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
}

.homework-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

.homework-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.homework-overview {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.85rem;
    background: #fff;
}

.homework-overview__meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.homework-overview__headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.8rem;
    min-width: 0;
}

.homework-overview__title-group {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
}

.homework-overview__adventure {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    text-align: left;
    word-break: keep-all;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.homework-overview__actions-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    flex-shrink: 0;
}

.homework-overview__settings {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.homework-overview__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    flex-shrink: 0;
}

.homework-overview__settings-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    flex-shrink: 0;
}

.homework-overview__toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.65rem;
}

.homework-raid-mode-banner {
    margin: 0 0 0.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    background: #eef2ff;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    color: #4338ca;
}

[data-theme='dark'] .homework-raid-mode-banner {
    background: rgba(99, 102, 241, 0.14);
    color: #a5b4fc;
}

#hwSettingPanel.is-raid-ticket-mode .homework-raid-mode-banner,
.homework-grid-section.is-raid-ticket-mode .homework-raid-mode-banner {
    color: #4338ca;
}

[data-theme='dark'] #hwSettingPanel.is-raid-ticket-mode .homework-raid-mode-banner,
[data-theme='dark'] .homework-grid-section.is-raid-ticket-mode .homework-raid-mode-banner {
    color: #a5b4fc;
}

.homework-grid-actions #hwRaidTicketModeBtn {
    min-width: 7.6rem;
}

/* PC: 1행 모험단명 / 2행 설정+액션 버튼 */
@media (min-width: 992px) {
    .homework-overview {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 0.55rem 0.75rem;
    }

    .homework-overview__top {
        flex: 1 1 100%;
        min-width: 0;
    }

    .homework-overview__meta {
        gap: 0;
    }

    .homework-overview__headline {
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .homework-overview__settings {
        display: flex;
        flex: 1 1 auto;
        flex-wrap: nowrap;
        align-items: flex-end;
        margin-top: 0;
        min-width: 0;
        gap: 0.55rem 0.75rem;
    }

    .homework-setting-field--mercenary {
        flex: 0 0 148px;
        min-width: 128px;
        grid-column: unset;
        grid-row: unset;
    }

    .homework-setting-field--mercenary .homework-setting-input {
        max-width: none;
        width: 100%;
    }

    .homework-setting-field:not(.homework-setting-field--mercenary) {
        flex: 0 0 108px;
        min-width: 96px;
        grid-column: unset;
        grid-row: unset;
    }

    .homework-setting-field:not(.homework-setting-field--mercenary) .homework-setting-input {
        max-width: none;
        width: 100%;
    }

    .homework-overview__settings-actions {
        margin-left: 0;
        flex: 0 0 auto;
        align-self: flex-end;
        flex-wrap: nowrap;
        display: flex;
        grid-template-columns: none;
        grid-column: unset;
        grid-row: unset;
        width: auto;
    }

    .homework-overview__settings-actions .btn {
        width: auto;
        height: auto;
        min-height: 0;
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
        line-height: 1.5;
        display: inline-block;
        border-radius: 0.2rem;
        box-sizing: border-box;
    }

    .homework-overview__settings-actions #hwResetMercenaryBtn {
        width: auto;
        min-width: 0;
        padding: 0.25rem 0.5rem;
    }

    .homework-overview__settings-actions #hwResetMercenaryBtn .hw-reset-btn-label {
        display: inline;
    }

    .homework-overview__settings-actions #hwResetMercenaryBtn i {
        margin-right: 0.25rem;
        font-size: inherit;
    }

    .homework-overview__settings-actions #hwSaveSettingBtn {
        width: auto;
    }

    .homework-overview__settings-actions .btn i {
        font-size: inherit;
        margin-right: 0.25rem;
    }

    .homework-overview__settings .homework-setting-input {
        height: auto;
        min-height: 0;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        font-size: 0.84rem;
        line-height: 1.5;
        box-sizing: border-box;
    }

    .homework-overview__toolbar {
        display: flex;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        margin-top: 0;
        margin-left: auto;
        gap: 0.5rem;
    }

    .homework-grid-actions {
        display: flex;
        flex-wrap: nowrap;
        white-space: nowrap;
    }
}

.homework-setting-field {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    margin: 0;
    min-width: 132px;
}

.homework-setting-field__label {
    font-size: 0.74rem;
    color: #6b7280;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.hw-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    background-color: #9ca3af;
    border: none;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.hw-help-btn:hover,
.hw-help-btn:focus {
    outline: none;
    background-color: #6b7280;
    color: #fff;
}

[data-theme='dark'] .hw-help-btn:hover,
[data-theme='dark'] .hw-help-btn:focus {
    background-color: #334155;
    color: #e2e8f0;
}

.hw-help-modal__panel {
    width: min(520px, calc(100vw - 32px));
}

/* 확인·선택 — 항목설정/안내용 대형 패널(height 600px)과 구분 */
.hw-confirm-modal.show,
.hw-mercenary-level-modal.show {
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
}

.hw-confirm-modal .detail-grid-prefs-modal__panel,
.hw-mercenary-level-modal .detail-grid-prefs-modal__panel {
    width: min(320px, calc(100vw - 32px));
    height: auto;
    max-height: min(72vh, 420px);
    padding: 14px 16px 12px;
    overflow: visible;
}

.hw-confirm-modal .detail-grid-prefs-modal__head,
.hw-mercenary-level-modal .detail-grid-prefs-modal__head {
    margin-bottom: 4px;
}

.hw-confirm-modal .detail-grid-prefs-modal__head h4,
.hw-mercenary-level-modal .detail-grid-prefs-modal__head h4 {
    font-size: 15px;
}

.hw-confirm-modal__body {
    margin: 0;
    padding: 0.35rem 0 0;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.5;
}

.hw-confirm-modal .detail-grid-prefs-modal__foot {
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #eef0f3;
}

.hw-mercenary-level-modal .detail-grid-prefs-modal__hint {
    margin-bottom: 8px;
    font-size: 0.8rem;
}

.hw-mercenary-level-modal .detail-grid-prefs-modal__panel {
    width: min(300px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hw-mercenary-level-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(48vh, 320px);
    overflow-y: auto;
    padding: 0;
    margin: 0;
    -webkit-overflow-scrolling: touch;
}

.homework-mercenary-level-btn {
    text-align: left;
    cursor: pointer;
    background-color: #fff;
}

.homework-mercenary-level-btn::after {
    content: '\f078';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    float: right;
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 0.15rem;
}

.hw-mercenary-level-option {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hw-mercenary-level-option:hover,
.hw-mercenary-level-option:focus-visible {
    border-color: var(--pland-brand-solid, #6e84ff);
    background: var(--pland-brand-muted, rgba(110, 132, 255, 0.14));
    color: var(--pland-brand-solid, #6e84ff);
    outline: none;
}

.hw-mercenary-level-option.is-selected {
    border-color: var(--pland-brand-solid, #6e84ff);
    background: var(--pland-brand-muted, rgba(110, 132, 255, 0.14));
    color: var(--pland-brand-solid, #6e84ff);
    font-weight: 600;
}

.hw-help-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.9rem 1rem 1rem;
    color: #374151;
    font-size: 0.86rem;
    line-height: 1.45;
}

.hw-help-modal__body ul {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
}

.hw-help-modal__body li + li {
    margin-top: 0.28rem;
}

.hw-help-modal__body h6 {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0.8rem 0 0.35rem;
    color: #111827;
}

[data-theme='dark'] .hw-help-modal__body h6 {
    color: #e5e7eb;
}

.homework-setting-input {
    max-width: 168px;
    border-color: #d1d5db;
    border-radius: 6px;
    font-size: 0.84rem;
}

.homework-setting-input:focus {
    border-color: var(--pland-brand-solid, #6e84ff);
    box-shadow: 0 0 0 0.15rem rgba(110, 132, 255, 0.18);
}

.homework-overview__hint {
    margin: 0.65rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px solid #f0f1f3;
    font-size: 0.74rem;
    color: #9ca3af;
    line-height: 1.45;
}

.homework-setting-field--mercenary {
    min-width: 168px;
    flex: 0 1 200px;
}

.homework-setting-field--mercenary .homework-setting-input {
    max-width: 200px;
    width: 100%;
}

.homework-mercenary-top-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    flex-shrink: 0;
    padding: 0.28rem 0.55rem;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    border-color: #d1d5db;
    color: #4b5563;
    border-radius: 6px;
}

.homework-mercenary-top-btn i {
    font-size: 0.72rem;
    color: var(--pland-brand-solid, #6e84ff);
}

.homework-mercenary-top-btn:hover,
.homework-mercenary-top-btn:focus {
    border-color: var(--pland-brand-solid, #6e84ff);
    color: var(--pland-brand-solid, #6e84ff);
    background: var(--pland-brand-muted, rgba(110, 132, 255, 0.08));
}

.hw-mercenary-top-modal__panel {
    width: min(560px, calc(100vw - 32px));
    height: min(640px, calc(100vh - 88px));
    max-height: calc(100vh - 88px);
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.hw-mercenary-top-modal__head {
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid #f0f1f3;
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}

.hw-mercenary-top-modal__title-wrap {
    min-width: 0;
}

.hw-mercenary-top-modal__title-wrap h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

.hw-mercenary-top-modal__subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.74rem;
    color: #6b7280;
    line-height: 1.35;
}

.hw-mercenary-top-modal__close {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #9ca3af;
    transition: background 0.15s ease, color 0.15s ease;
}

.hw-mercenary-top-modal__close:hover,
.hw-mercenary-top-modal__close:focus {
    background: #f3f4f6;
    color: #374151;
}

.hw-mercenary-top-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem 1rem 1rem;
    overflow: hidden;
}

.hw-mercenary-top-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    flex-shrink: 0;
}

.hw-mercenary-top-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0.6rem;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    background: #f8fafc;
    min-width: 0;
}

.hw-mercenary-top-stat--accent {
    border-color: rgba(110, 132, 255, 0.28);
    background: var(--pland-brand-muted, rgba(110, 132, 255, 0.1));
}

.hw-mercenary-top-stat__label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: -0.01em;
}

.hw-mercenary-top-stat__value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    word-break: break-all;
}

.hw-mercenary-top-stat--accent .hw-mercenary-top-stat__value {
    color: var(--pland-brand-solid, #6e84ff);
}

.hw-mercenary-top-stat__unit {
    margin-left: 0.1rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #9ca3af;
}

.hw-mercenary-top-stat__sub {
    display: block;
    margin-top: 0.12rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.hw-mercenary-top-list-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #eceff3;
    border-radius: 10px;
    background: #fff;
}

.hw-mercenary-top-list-head {
    flex: 0 0 auto;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    z-index: 2;
}

.hw-mercenary-top-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    scrollbar-gutter: stable;
}

.hw-mercenary-top-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.82rem;
}

.hw-mercenary-top-table--head {
    margin: 0;
}

.hw-mercenary-top-col-rank {
    width: 3.25rem;
}

.hw-mercenary-top-col-point {
    width: 5.75rem;
}

.hw-mercenary-top-table thead th {
    padding: 0.5rem 0.65rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #6b7280;
    background: #f9fafb;
    white-space: nowrap;
}

.hw-mercenary-top-table__rank {
    width: 3.25rem;
    text-align: center;
}

.hw-mercenary-top-table tbody td.hw-mercenary-top-table__rank {
    text-align: center;
}

.hw-mercenary-top-table__job {
    width: 28%;
}

.hw-mercenary-top-table tbody tr {
    transition: background 0.12s ease;
}

.hw-mercenary-top-table tbody tr:hover {
    background: #f8fafc;
}

.hw-mercenary-top-table tbody td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    vertical-align: middle;
}

.hw-mercenary-top-table tbody tr:last-child td {
    border-bottom: none;
}

.hw-mercenary-top-table__point,
.hw-mercenary-top-table .hw-mercenary-top-point {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--pland-brand-solid, #6e84ff);
    white-space: nowrap;
}

.hw-mercenary-top-point__bonus {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #6b7280;
    line-height: 1.2;
}

.hw-mercenary-top-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #6b7280;
    background: #f3f4f6;
}

.hw-mercenary-top-rank--1 {
    color: #92400e;
    background: #fef3c7;
}

.hw-mercenary-top-rank--2 {
    color: #475569;
    background: #e2e8f0;
}

.hw-mercenary-top-rank--3 {
    color: #9a3412;
    background: #ffedd5;
}

.hw-mercenary-top-name {
    font-weight: 600;
    color: #111827;
    word-break: keep-all;
}

.hw-mercenary-top-char__name {
    font-weight: 600;
    color: #111827;
    line-height: 1.25;
}

.hw-mercenary-top-char__job {
    margin-top: 0.12rem;
    font-size: 0.74rem;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.2;
    word-break: keep-all;
}

.hw-mercenary-top-job {
    color: #6b7280;
    font-size: 0.78rem;
    word-break: keep-all;
}

.hw-mercenary-top-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 180px;
    padding: 1.5rem 1rem;
    text-align: center;
    color: #9ca3af;
}

.hw-mercenary-top-empty i {
    font-size: 1.5rem;
    opacity: 0.65;
}

.hw-mercenary-top-empty p {
    margin: 0;
    font-size: 0.84rem;
    color: #6b7280;
}

.hw-row-account .hw-raid-summary {
    display: inline;
    font-size: 0.68rem;
    color: #4f46e5;
    font-weight: 600;
    margin-left: 0.35rem;
}

.hw-account-cell .hw-char-name {
    margin-bottom: 0;
}

.hw-account-col-summary {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    white-space: nowrap;
}

.hw-row-account td.hw-col-task {
    text-align: center;
    vertical-align: middle;
}

.hw-row-account td.hw-account-col-summary-cell--superior {
    background: #eef2ff;
    border-bottom: 1px solid #c7d2fe;
}

.hw-account-col-summary--covenant {
    color: #7c3aed;
}

.hw-account-col-summary--superior {
    color: #4338ca;
}

.hw-account-col-summary--legion {
    color: #047857;
}

.homework-matrix thead th.hw-head-group {
    text-align: center;
    vertical-align: middle;
    padding: 0.4rem 0.3rem;
    white-space: nowrap;
}

.homework-matrix thead th.hw-head-group--superior {
    background: #eef2ff;
    border-bottom: 1px solid #a5b4fc;
}

.homework-matrix thead th.hw-head-group--superior .hw-head-group-label {
    color: #3730a3;
}

.homework-matrix thead th.hw-head-group--superior .hw-head-group-hint {
    color: #6366f1;
}

.homework-matrix thead th.hw-head-group--legion {
    background: #ecfdf5;
    border-bottom: 1px solid #6ee7b7;
}

.homework-matrix thead th.hw-head-group--legion .hw-head-group-label {
    color: #047857;
}

.homework-matrix thead th.hw-head-group--legion .hw-head-group-hint {
    color: #10b981;
}

.homework-matrix thead th.hw-head-group--raid {
    background: #fff1f2;
    border-bottom: 1px solid #fda4af;
}

.homework-matrix thead th.hw-head-group--raid .hw-head-group-label {
    color: #be123c;
}

.homework-matrix thead th.hw-head-group--raid .hw-head-group-hint {
    color: #f43f5e;
}

.homework-matrix thead th.hw-head-group .hw-head-group-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.homework-matrix thead th.hw-head-group .hw-head-group-label {
    font-size: 0.74rem;
    font-weight: 700;
}

.homework-matrix thead th.hw-head-group .hw-head-group-hint {
    font-size: 0.64rem;
    font-weight: 600;
}

.homework-matrix thead th.hw-head-sub,
.homework-matrix tbody td.hw-col-task {
    min-width: 3.65rem;
    padding: 0.3rem 0.4rem;
    font-size: 0.74rem;
    line-height: 1.2;
}

.homework-matrix tbody td.hw-col-task--ticket {
    min-width: 4.75rem;
}

.homework-matrix tbody td.hw-col-task--selected {
    background: var(--pland-brand-muted, rgba(110, 132, 255, 0.14)) !important;
}

.homework-matrix tbody td.hw-col-task--checkable:not(.hw-col-task--locked):not(.hw-col-task--group-limit):not(.hw-col-task--weekly-char-limit):not(.hw-col-task--raid-mode-blocked) {
    cursor: pointer;
}

.homework-matrix thead th:not(.hw-col-name):not(.hw-head-sub) {
    min-width: 3.65rem;
}

.homework-matrix thead th.hw-head-sub--superior {
    background: #f8f9ff;
}

.homework-matrix thead th.hw-head-sub--legion {
    background: #f3fcf7;
}

.homework-matrix thead th.hw-head-sub--raid {
    background: #fff8f8;
}

.homework-matrix .hw-group-start.hw-head-group--superior,
.homework-matrix .hw-group-start.hw-head-sub--superior,
.homework-matrix .hw-col-task--superior.hw-group-start {
    border-left: 1px solid #a5b4fc;
}

.homework-matrix .hw-group-start.hw-head-group--legion,
.homework-matrix .hw-group-start.hw-head-sub--legion,
.homework-matrix .hw-col-task--legion.hw-group-start {
    border-left: 1px solid #6ee7b7;
}

.homework-matrix .hw-group-start.hw-head-group--raid,
.homework-matrix .hw-group-start.hw-head-sub--raid,
.homework-matrix .hw-col-task--raid.hw-group-start {
    border-left: 1px solid #fda4af;
}

.homework-matrix thead th.hw-head-sub {
    font-size: 0.74rem;
    line-height: 1.2;
}

.homework-matrix thead th .hw-task-head-ticket {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
}

.hw-cell-ticket-wrap {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    min-width: 0;
    width: 100%;
}

.hw-cell-ticket-wrap.is-applied-state {
    gap: 0.15rem;
}

.hw-cell-ticket-wrap--readonly {
    pointer-events: none;
}

.hw-cell-count.is-readonly {
    cursor: default;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.hw-cell-count.is-readonly:hover {
    border-color: transparent;
    background: transparent;
}

.hw-ticket-applied-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    padding: 0.08rem 0.22rem;
    border-radius: 4px;
    background: var(--pland-brand-solid, #6e84ff);
    border: none;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
    white-space: nowrap;
}

.hw-ticket-btn {
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 4px;
    font-size: 0.64rem;
    font-weight: 600;
    padding: 0.1rem 0.32rem;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.15;
    display: none;
}

.homework-grid-section.is-raid-ticket-mode .hw-ticket-btn {
    display: inline-block;
}

.hw-ticket-btn:hover {
    background: #e0e7ff;
    border-color: #818cf8;
}

.hw-ticket-btn.is-remove {
    background: #fff;
    border-color: #d1d5db;
    color: #6b7280;
}

.hw-ticket-btn.is-remove:hover {
    border-color: #9ca3af;
    color: #374151;
}

.hw-ticket-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: #4338ca;
}

.hw-ticket-badge.is-applied {
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: #e0e7ff;
}

.hw-char-cell {
    line-height: 1.25;
}

.hw-char-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: #111827;
    word-break: keep-all;
}

.hw-char-sub {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 400;
    word-break: keep-all;
    line-height: 1.2;
}

.hw-char-sep {
    opacity: 0.75;
}

#hwTaskPrefsModal .hw-task-prefs-group-header {
    padding: 8px 10px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

#hwTaskPrefsModal .hw-task-prefs-group-header:not(:first-child) {
    border-top: 1px solid #e8e8e8;
}

[data-theme='dark'] #hwTaskPrefsModal .hw-task-prefs-group-header {
    color: #94a3b8;
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme='dark'] #hwTaskPrefsModal .hw-task-prefs-group-header:not(:first-child) {
    border-top-color: #334155;
}

.homework-grid-section {
    margin-bottom: 0.25rem;
}

/* 매니저(#grid)와 동일: 세로는 페이지 스크롤, 가로만 표 내부 스크롤 */
.manage-main-content .homework-grid-section,
.manage-main-content .homework-table-wrap {
    overflow: visible !important;
}

.homework-grid-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0;
    min-height: 1.75rem;
}

.homework-grid-actions-hint {
    margin-right: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4338ca;
}

/* 그리드·설정 액션 outline 버튼 — 호버 시 흰 글자 방지 */
.homework-grid-actions .btn.btn-outline-secondary,
.homework-overview__settings-actions .btn.btn-outline-secondary {
    color: #6c757d;
    background-color: #fff;
    border-color: #ced4da;
}

.homework-grid-actions .btn.btn-outline-secondary:hover:not(:disabled),
.homework-grid-actions .btn.btn-outline-secondary:focus:not(:disabled),
.homework-grid-actions .btn.btn-outline-secondary:focus-visible:not(:disabled),
.homework-grid-actions .btn.btn-outline-secondary:active:not(:disabled),
.homework-overview__settings-actions .btn.btn-outline-secondary:hover:not(:disabled),
.homework-overview__settings-actions .btn.btn-outline-secondary:focus:not(:disabled),
.homework-overview__settings-actions .btn.btn-outline-secondary:focus-visible:not(:disabled),
.homework-overview__settings-actions .btn.btn-outline-secondary:active:not(:disabled) {
    color: #495057 !important;
    background-color: #f1f3f5 !important;
    border-color: #adb5bd !important;
    box-shadow: none;
}

.homework-grid-actions .btn.btn-outline-secondary i,
.homework-overview__settings-actions .btn.btn-outline-secondary i {
    color: inherit;
}

/* 토벌권 모드 버튼 — 활성: 브랜드 블루 유지 (모든 상호작용 상태) */
.homework-grid-actions #hwRaidTicketModeBtn.btn-primary,
.homework-grid-actions #hwRaidTicketModeBtn.btn-primary:hover,
.homework-grid-actions #hwRaidTicketModeBtn.btn-primary:focus,
.homework-grid-actions #hwRaidTicketModeBtn.btn-primary:focus-visible,
.homework-grid-actions #hwRaidTicketModeBtn.btn-primary:active {
    color: #fff !important;
    background-color: var(--pland-brand-solid, #6e84ff) !important;
    border-color: var(--pland-brand-solid, #6e84ff) !important;
    box-shadow: none;
}

.homework-grid-actions #hwRaidTicketModeBtn.btn-primary:hover,
.homework-grid-actions #hwRaidTicketModeBtn.btn-primary:focus,
.homework-grid-actions #hwRaidTicketModeBtn.btn-primary:focus-visible,
.homework-grid-actions #hwRaidTicketModeBtn.btn-primary:active {
    background-color: var(--pland-brand-solid-hover, #5a73e6) !important;
    border-color: var(--pland-brand-solid-hover, #5a73e6) !important;
}

.homework-grid-actions #hwRaidTicketModeBtn.btn-primary i {
    color: #fff !important;
}

#hwSettingPanel.is-raid-ticket-mode .homework-grid-actions-hint,
.homework-grid-section.is-raid-ticket-mode .homework-grid-actions-hint {
    color: #4338ca;
}

[data-theme='dark'] .homework-grid-actions .btn.btn-outline-secondary,
[data-theme='dark'] .homework-overview__settings-actions .btn.btn-outline-secondary {
    color: #cbd5e1;
    background-color: var(--pland-card-elevated, #1c2432) !important;
    border-color: var(--pland-border-color, #334155) !important;
}

[data-theme='dark'] .homework-grid-actions .btn.btn-outline-secondary:hover:not(:disabled),
[data-theme='dark'] .homework-grid-actions .btn.btn-outline-secondary:focus:not(:disabled),
[data-theme='dark'] .homework-grid-actions .btn.btn-outline-secondary:focus-visible:not(:disabled),
[data-theme='dark'] .homework-grid-actions .btn.btn-outline-secondary:active:not(:disabled),
[data-theme='dark'] .homework-overview__settings-actions .btn.btn-outline-secondary:hover:not(:disabled),
[data-theme='dark'] .homework-overview__settings-actions .btn.btn-outline-secondary:focus:not(:disabled),
[data-theme='dark'] .homework-overview__settings-actions .btn.btn-outline-secondary:focus-visible:not(:disabled),
[data-theme='dark'] .homework-overview__settings-actions .btn.btn-outline-secondary:active:not(:disabled) {
    color: #e2e8f0 !important;
    background-color: #334155 !important;
    border-color: #475569 !important;
    box-shadow: none;
}

[data-theme='dark'] .homework-grid-actions #hwRaidTicketModeBtn.btn-primary,
[data-theme='dark'] .homework-grid-actions #hwRaidTicketModeBtn.btn-primary:hover,
[data-theme='dark'] .homework-grid-actions #hwRaidTicketModeBtn.btn-primary:focus,
[data-theme='dark'] .homework-grid-actions #hwRaidTicketModeBtn.btn-primary:focus-visible,
[data-theme='dark'] .homework-grid-actions #hwRaidTicketModeBtn.btn-primary:active {
    color: #fff !important;
    background-color: var(--pland-brand-solid, #5868d8) !important;
    border-color: var(--pland-brand-solid, #5868d8) !important;
    box-shadow: none;
}

[data-theme='dark'] .homework-grid-actions #hwRaidTicketModeBtn.btn-primary:hover,
[data-theme='dark'] .homework-grid-actions #hwRaidTicketModeBtn.btn-primary:focus,
[data-theme='dark'] .homework-grid-actions #hwRaidTicketModeBtn.btn-primary:focus-visible,
[data-theme='dark'] .homework-grid-actions #hwRaidTicketModeBtn.btn-primary:active {
    background-color: var(--pland-brand-solid-hover, #6574e3) !important;
    border-color: var(--pland-brand-solid-hover, #6574e3) !important;
}

[data-theme='dark'] .homework-grid-actions #hwRaidTicketModeBtn.btn-primary i {
    color: #fff !important;
}

.homework-table-wrap {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    --hw-sticky-head-bg: #f3f4f6;
    --hw-sticky-body-bg: #fff;
    --hw-sticky-body-account-bg: #f1f5f9;
    --hw-sticky-pin-shadow: 4px 0 8px -3px rgba(15, 23, 42, 0.12);
}

/* Tabulator 헤더처럼 overflow 밖에서 viewport 기준 sticky */
.homework-table-head-sticky {
    position: sticky;
    top: var(--hw-head-sticky-top, calc(var(--pland-menubar-height, 48px) + var(--pland-topbar-height, 100px)));
    z-index: 1025;
    background: var(--hw-sticky-head-bg, #f3f4f6);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 1px 0 #d1d5db;
}

body.pland-header-scrolled .homework-table-head-sticky {
    top: var(--pland-topbar-height, 76px);
}

.homework-table-head-scroll {
    overflow: hidden;
    width: 100%;
    border-radius: 8px 8px 0 0;
    background: var(--hw-sticky-head-bg, #f3f4f6);
}

.homework-table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 8px 8px;
}

/* 토벌권 모드: 선택 가능 셀은 커서만 (배경 강조 없음) */
.homework-grid-section.is-raid-ticket-mode td.hw-col-task--ticket-managed.hw-col-task--ticket-eligible:not(.hw-col-task--locked):not(.hw-col-task--group-limit),
.homework-grid-section.is-raid-ticket-mode td.hw-col-task--ticket-managed.hw-col-task--ticket-applied:not(.hw-col-task--locked),
.homework-grid-section.is-raid-ticket-mode td.hw-col-task--ticket-managed.hw-col-task--ticket-removable:not(.hw-col-task--locked) {
    cursor: pointer;
}

.hw-cell-ticket-wrap--raid-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1.35rem;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
}

.hw-cell-ticket-wrap--raid-mode.is-pickable {
    min-height: 1.15rem;
}

.hw-cell-ticket-wrap--raid-mode .hw-check-input--raid-ticket {
    pointer-events: none;
    cursor: inherit;
}

.homework-grid-section.is-raid-ticket-mode .hw-ticket-btn.is-remove {
    pointer-events: auto;
}

/* 토벌권 모드: 토벌권 대상이 아닌 숙제(베누스·나벨 등) 선택 불가 표시 */
.homework-grid-section.is-raid-ticket-mode td.hw-col-task--raid-mode-blocked {
    cursor: not-allowed;
    opacity: 0.55;
}

.hw-raid-mode-skip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 1.15rem;
    color: #9ca3af;
    font-size: 0.78rem;
    cursor: not-allowed;
}

.hw-raid-mode-skip i {
    opacity: 0.85;
}

/* 토벌권 모드: 선택 가능 셀 (다크) */
[data-theme='dark'] .homework-grid-section.is-raid-ticket-mode td.hw-col-task--ticket-managed.hw-col-task--ticket-eligible:not(.hw-col-task--locked):not(.hw-col-task--group-limit),
[data-theme='dark'] .homework-grid-section.is-raid-ticket-mode td.hw-col-task--ticket-managed.hw-col-task--ticket-applied:not(.hw-col-task--locked),
[data-theme='dark'] .homework-grid-section.is-raid-ticket-mode td.hw-col-task--ticket-managed.hw-col-task--ticket-removable:not(.hw-col-task--locked) {
    cursor: pointer;
}

[data-theme='dark'] .homework-grid-section.is-raid-ticket-mode td.hw-col-task--raid-mode-blocked {
    opacity: 0.45;
}

[data-theme='dark'] .hw-raid-mode-skip {
    color: #6b7280;
}

.homework-matrix {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.homework-matrix--head,
.homework-matrix--body {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 0;
}

.homework-matrix--head {
    margin-bottom: 0;
}

.homework-matrix--body {
    margin-top: 0;
}

.homework-matrix--head thead th,
.homework-matrix--body tbody td {
    box-sizing: border-box;
}

.homework-matrix--head thead th {
    border-right: 1px solid #f0f1f3;
}

.homework-matrix--head .hw-head-row-single th:last-child,
.homework-matrix--head .hw-head-row-2 th:last-child {
    border-right: none;
}

.homework-matrix--head thead th.hw-head-sub,
.homework-matrix--head .hw-head-row-single th:not(.hw-col-name):not(.hw-col-char-meta):not(.hw-col-fame-score):not(.hw-col-fame-only):not(.hw-col-dun-dealer):not(.hw-col-dun-buff):not(.hw-col-char-num):not(.hw-col-char-image),
.homework-matrix--body tbody td.hw-col-task {
    padding: 0.3rem 0.4rem;
}

.homework-matrix--head thead th.hw-col-name,
.homework-matrix--body tbody td.hw-col-name {
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}

.homework-matrix--head thead th.hw-col-char-meta:not(.hw-col-char-image):not(.hw-col-char-num),
.homework-matrix--head thead th.hw-col-fame-score,
.homework-matrix--head thead th.hw-col-fame-only,
.homework-matrix--head thead th.hw-col-dun-dealer,
.homework-matrix--head thead th.hw-col-dun-buff,
.homework-matrix--body tbody td.hw-col-char-meta:not(.hw-col-char-image):not(.hw-col-char-num),
.homework-matrix--body tbody td.hw-col-fame-score,
.homework-matrix--body tbody td.hw-col-fame-only,
.homework-matrix--body tbody td.hw-col-dun-dealer,
.homework-matrix--body tbody td.hw-col-dun-buff {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.homework-matrix thead tr.hw-head-row-single,
.homework-matrix thead tr.hw-head-row-1,
.homework-matrix thead tr.hw-head-row-2 {
    background: #f3f4f6;
}

.homework-table-head-sticky .homework-matrix thead tr.hw-head-row-single,
.homework-table-head-sticky .homework-matrix thead tr.hw-head-row-1,
.homework-table-head-sticky .homework-matrix thead tr.hw-head-row-2 {
    box-shadow: none;
}

.homework-matrix thead th {
    background: #f3f4f6;
    border-bottom: 1px solid #d1d5db;
    padding: 0.4rem 0.35rem;
    text-align: center;
    vertical-align: middle;
    font-weight: 600;
    color: #374151;
    line-height: 1.25;
}

.homework-matrix tbody td {
    border-bottom: 1px solid #eef0f2;
    border-right: 1px solid #f0f1f3;
    padding: 0.28rem 0.35rem;
    text-align: center;
    vertical-align: middle;
    background: #fff;
}

.homework-matrix thead th.hw-col-name {
    position: sticky;
    left: 0;
    z-index: 12;
    isolation: isolate;
    min-width: 148px;
    text-align: center;
    vertical-align: middle;
    padding: 0.4rem 0.45rem;
    background-color: var(--hw-sticky-head-bg, #f3f4f6) !important;
    box-shadow: var(--hw-sticky-pin-shadow);
    white-space: nowrap;
    font-size: 0.78rem;
}

.homework-table-head-sticky .homework-matrix thead th.hw-col-name {
    z-index: 14;
}

.homework-matrix.hw-matrix--lead-number thead th.hw-col-char-num,
.homework-matrix.hw-matrix--lead-number tbody td.hw-col-char-num {
    position: sticky;
    left: 0;
    z-index: 11;
    isolation: isolate;
    background-color: var(--hw-sticky-head-bg, #f3f4f6) !important;
    border-right: 1px solid #e5e7eb;
}

.homework-matrix.hw-matrix--lead-number tbody td.hw-col-char-num {
    z-index: 5;
    background-color: var(--hw-sticky-body-bg, #fff) !important;
}

.homework-matrix.hw-matrix--lead-number thead th.hw-col-name,
.homework-matrix.hw-matrix--lead-number tbody td.hw-col-name {
    left: 26px;
}

.homework-table-head-sticky .homework-matrix.hw-matrix--lead-number thead th.hw-col-char-num {
    z-index: 13;
}

.homework-matrix tbody td.hw-col-name {
    position: sticky;
    left: 0;
    z-index: 6;
    isolation: isolate;
    text-align: left;
    padding: 0.3rem 0.65rem;
    background-color: var(--hw-sticky-body-bg, #fff) !important;
    box-shadow: var(--hw-sticky-pin-shadow);
    border-right: 1px solid #e5e7eb;
    font-weight: 500;
    color: #111827;
    min-width: 148px;
    white-space: normal;
}

.homework-matrix thead th.hw-col-char-meta,
.homework-matrix thead th.hw-col-fame-score,
.homework-matrix thead th.hw-col-fame-only,
.homework-matrix thead th.hw-col-dun-dealer,
.homework-matrix thead th.hw-col-dun-buff {
    min-width: 6.25rem;
    text-align: center;
    vertical-align: middle;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    background: #f3f4f6;
    white-space: nowrap;
    font-size: 0.68rem;
    line-height: 1.2;
}

/* 2단 헤더(그룹+하위) 밖 단독 rowspan 라벨 — 장비점수·단일 숙제 열 */
.homework-matrix thead th[rowspan]:not(.hw-col-name):not(.hw-col-char-meta):not(.hw-col-fame-score):not(.hw-col-fame-only):not(.hw-col-dun-dealer):not(.hw-col-dun-buff):not(.hw-col-char-num):not(.hw-col-char-image),
.homework-matrix thead tr.hw-head-row-single th:not(.hw-col-name):not(.hw-col-char-meta):not(.hw-col-fame-score):not(.hw-col-fame-only):not(.hw-col-dun-dealer):not(.hw-col-dun-buff):not(.hw-col-char-num):not(.hw-col-char-image) {
    font-size: 0.72rem;
    line-height: 1.2;
}

.homework-matrix tbody td.hw-col-char-meta:not(.hw-col-char-image):not(.hw-col-char-num),
.homework-matrix tbody td.hw-col-fame-score,
.homework-matrix tbody td.hw-col-fame-only,
.homework-matrix tbody td.hw-col-dun-dealer,
.homework-matrix tbody td.hw-col-dun-buff {
    text-align: left;
    padding: 0.28rem 0.45rem;
    background: #fff;
    vertical-align: middle;
    min-width: 6.25rem;
}

.homework-matrix thead th.hw-col-char-num,
.homework-matrix tbody td.hw-col-char-num {
    min-width: 26px;
    width: 26px;
    max-width: 26px;
    text-align: center;
    padding: 0.28rem 0;
    vertical-align: middle;
}

.homework-matrix .hw-char-order-num {
    display: inline-block;
    width: auto;
    min-width: 0;
    margin: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: rgb(107, 107, 107);
    line-height: 1.2;
}

.homework-matrix thead th.hw-col-char-image,
.homework-matrix tbody td.hw-col-char-image {
    min-width: 40px;
    width: 40px;
    max-width: 40px;
    padding: 0 !important;
    margin: 0;
    text-align: center;
    vertical-align: top;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
    box-sizing: border-box;
}

.homework-matrix tbody td.hw-char-image-cell {
    background-repeat: no-repeat;
    background-size: 119px auto;
    background-color: transparent;
    background-origin: border-box;
    background-clip: border-box;
    cursor: pointer;
    min-height: 50px;
    height: 100%;
}

.homework-matrix .hw-col-fame-only .fame,
.homework-matrix .hw-col-dun-dealer,
.homework-matrix .hw-col-dun-buff {
    font-size: 12px;
    line-height: 1.2;
}

.homework-matrix thead th.hw-col-dun-dealer,
.homework-matrix thead th.hw-col-dun-buff,
.homework-matrix tbody td.hw-col-dun-dealer,
.homework-matrix tbody td.hw-col-dun-buff {
    text-align: right;
}

.homework-matrix thead th.hw-col-sortable {
    cursor: pointer;
    user-select: none;
}

.homework-matrix thead th.hw-col-sortable:hover {
    background: #e9ecef;
}

.homework-matrix thead th.hw-col-sortable .hw-col-sort-indicator::after {
    content: '⇅';
    opacity: 0.35;
    margin-left: 0.15rem;
    font-size: 0.62rem;
}

.homework-matrix thead th.hw-col-sort--asc .hw-col-sort-indicator::after {
    content: '▲';
    opacity: 0.85;
}

.homework-matrix thead th.hw-col-sort--desc .hw-col-sort-indicator::after {
    content: '▼';
    opacity: 0.85;
}

.homework-matrix .hw-col-fame-score .fame-score-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
    padding-left: 5px;
}

.homework-matrix .hw-col-char-meta .fame,
.homework-matrix .hw-col-char-meta .score-info,
.homework-matrix .hw-col-fame-score .fame,
.homework-matrix .hw-col-fame-score .score-info {
    font-size: 12px;
    line-height: 1.2;
    height: auto;
    margin: 0;
    font-weight: 400;
    text-align: left;
}

.homework-matrix .hw-col-char-meta .fame,
.homework-matrix .hw-col-fame-score .fame {
    color: #333;
}

.homework-matrix .hw-col-char-meta .score-info,
.homework-matrix .hw-col-fame-score .score-info {
    color: #2196f3;
}

.homework-matrix .hw-col-char-meta .fame::before,
.homework-matrix .hw-col-fame-score .fame::before,
.homework-matrix .hw-col-fame-only .fame::before {
    content: '';
    display: inline-block;
    background-image: url('/img/ico_fame.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    vertical-align: middle;
    width: 14px;
    height: 14px;
    margin-right: 2px;
    margin-top: -2px;
}

.homework-matrix .hw-col-char-meta .score-info::before,
.homework-matrix .hw-col-fame-score .score-info::before {
    content: '';
    display: inline-block;
    background-image: url('https://resource.df.nexon.com/ui/img/world/ico_equi.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    vertical-align: middle;
    width: 15px;
    height: 15px;
    margin-right: 2px;
    margin-top: -2px;
}

.homework-matrix .hw-col-char-meta .score-buff-info::before,
.homework-matrix .hw-col-fame-score .score-buff-info::before {
    background-image: url('https://resource.df.nexon.com/ui/img/world/ico_buff.png');
}

.homework-matrix tbody tr.hw-row-account td {
    background: #f8fafc;
}

.homework-matrix tbody tr.hw-row-account td.hw-col-name {
    background-color: var(--hw-sticky-body-account-bg, #f1f5f9) !important;
    z-index: 5;
    font-weight: 700;
    color: #1e40af;
}

.hw-task-head-name {
    display: block;
    word-break: keep-all;
    line-height: 1.2;
    font-size: 0.74rem;
    letter-spacing: -0.01em;
}

.homework-matrix thead th.hw-head-group .hw-head-group-api {
    margin-top: 0;
}

.hw-task-head-api {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--pland-brand-solid, #6e84ff);
    border: none;
    color: #fff;
}

[data-theme='dark'] .hw-task-head-api {
    background: var(--pland-brand-solid, #5868d8);
    color: #fff;
}

.hw-cell-empty {
    color: #d1d5db;
    user-select: none;
}

.hw-cell-muted {
    color: #9ca3af;
    font-size: 0.75rem;
    user-select: none;
}

.hw-cell-checkbox-wrap {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
}

.hw-cell-locked {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: #9ca3af;
    font-size: 0.72rem;
    cursor: not-allowed;
}

.homework-matrix tbody td.hw-col-task--locked {
    background: #f9fafb;
    opacity: 0.85;
}

.hw-cell-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    padding: 0.12rem 0.35rem;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-weight: 600;
    font-size: 0.72rem;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.hw-cell-count:hover {
    border-color: #6e84ff;
    color: #4338ca;
}

.hw-cell-count.is-done {
    background: #eef2ff;
    border-color: #818cf8;
    color: #3730a3;
}

.hw-check-input {
    width: 0.9rem;
    height: 0.9rem;
    cursor: pointer;
    accent-color: var(--pland-brand-solid, #6e84ff);
}

.hw-check-input:disabled,
.hw-check-input.is-group-limited {
    opacity: 0.35;
    cursor: not-allowed;
}

.homework-matrix tbody td.hw-col-task--group-limit {
    background: #f9fafb;
}

.homework-matrix tbody td.hw-col-task--covenant-pool-full {
    cursor: not-allowed;
}

.homework-matrix tbody td.hw-col-task--weekly-char-limit {
    cursor: not-allowed;
    background: #f9fafb;
}

.homework-matrix tbody td.hw-col-task--covenant-pool-full .hw-check-input {
    cursor: not-allowed;
}

.hw-check-input.is-weekly-char-limited {
    opacity: 0.35;
    cursor: not-allowed;
}

.hw-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
}

.hw-loading-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.hw-loading-message {
    font-weight: 600;
    color: #374151;
}

.homework-empty {
    text-align: center;
    padding: 2rem 1rem;
}

[data-theme='dark'] .homework-container {
    background: #1e1e2e;
    box-shadow: none;
}

[data-theme='dark'] .homework-header h1 {
    color: #e5e7eb;
}

[data-theme='dark'] .homework-header p,
[data-theme='dark'] .homework-empty {
    color: #9ca3af;
}

[data-theme='dark'] .homework-overview {
    background: #252536;
    border-color: #3f3f50;
}

[data-theme='dark'] .homework-overview__settings,
[data-theme='dark'] .homework-overview__toolbar {
    border-top-color: #3f3f50;
}

[data-theme='dark'] .homework-overview__adventure {
    color: #e5e7eb;
}

[data-theme='dark'] .homework-overview__hint {
    color: #94a3b8;
    border-top-color: #334155;
}

[data-theme='dark'] .hw-help-btn {
    background-color: #475569;
    border: none;
    color: #cbd5e1;
}

[data-theme='dark'] .homework-mercenary-top-btn i {
    color: #a5b4fc;
}

[data-theme='dark'] .homework-mercenary-top-btn:hover,
[data-theme='dark'] .homework-mercenary-top-btn:focus {
    border-color: #818cf8;
    color: #c7d2fe;
}

[data-theme='dark'] .hw-mercenary-top-modal__panel {
    border-color: #334155;
    background: #1e293b;
}

[data-theme='dark'] .hw-mercenary-top-modal__head {
    border-bottom-color: #334155;
    background: linear-gradient(180deg, #1f2937 0%, #1e293b 100%);
}

[data-theme='dark'] .hw-mercenary-top-modal__title-wrap h4 {
    color: #f1f5f9;
}

[data-theme='dark'] .hw-mercenary-top-modal__subtitle {
    color: #94a3b8;
}

[data-theme='dark'] .hw-mercenary-top-modal__close:hover,
[data-theme='dark'] .hw-mercenary-top-modal__close:focus {
    background: #334155;
    color: #e2e8f0;
}

[data-theme='dark'] .hw-mercenary-top-stat {
    background: #0f172a;
    border-color: #334155;
}

[data-theme='dark'] .hw-mercenary-top-stat--accent {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(129, 140, 248, 0.35);
}

[data-theme='dark'] .hw-mercenary-top-stat__label {
    color: #94a3b8;
}

[data-theme='dark'] .hw-mercenary-top-stat__value {
    color: #f1f5f9;
}

[data-theme='dark'] .hw-mercenary-top-stat--accent .hw-mercenary-top-stat__value {
    color: #a5b4fc;
}

[data-theme='dark'] .hw-mercenary-top-stat__unit {
    color: #64748b;
}

[data-theme='dark'] .hw-mercenary-top-stat__sub {
    color: #94a3b8;
}

[data-theme='dark'] .hw-mercenary-top-list-wrap {
    border-color: #334155;
    background: #0f172a;
}

[data-theme='dark'] .hw-mercenary-top-list-head {
    background: #1e293b;
    border-bottom-color: #334155;
}

[data-theme='dark'] .hw-mercenary-top-list-scroll {
    background: #0f172a;
}

[data-theme='dark'] .hw-mercenary-top-table thead th {
    background: #1e293b;
    border-bottom-color: #334155;
    color: #94a3b8;
    box-shadow: none;
}

[data-theme='dark'] .hw-mercenary-top-table tbody td {
    border-bottom-color: #334155;
    color: #e2e8f0;
}

[data-theme='dark'] .hw-mercenary-top-table tbody tr:hover {
    background: #1e293b;
}

[data-theme='dark'] .hw-mercenary-top-name,
[data-theme='dark'] .hw-mercenary-top-char__name {
    color: #f1f5f9;
}

[data-theme='dark'] .hw-mercenary-top-job,
[data-theme='dark'] .hw-mercenary-top-char__job {
    color: #94a3b8;
}

[data-theme='dark'] .hw-mercenary-top-rank {
    color: #94a3b8;
    background: #334155;
}

[data-theme='dark'] .hw-mercenary-top-rank--1 {
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.16);
}

[data-theme='dark'] .hw-mercenary-top-rank--2 {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.18);
}

[data-theme='dark'] .hw-mercenary-top-rank--3 {
    color: #fdba74;
    background: rgba(251, 146, 60, 0.16);
}

[data-theme='dark'] .hw-mercenary-top-table .hw-mercenary-top-point {
    color: #a5b4fc;
}

[data-theme='dark'] .hw-mercenary-top-point__bonus {
    color: #94a3b8;
}

[data-theme='dark'] .hw-mercenary-top-empty {
    color: #64748b;
}

[data-theme='dark'] .hw-mercenary-top-empty p {
    color: #94a3b8;
}

[data-theme='dark'] .homework-setting-field__label {
    color: #94a3b8;
}

[data-theme='dark'] .homework-setting-input {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme='dark'] .homework-table-wrap {
    border-color: #3f3f50;
    background: #1e1e2e;
    --hw-sticky-head-bg: #2a2a3d;
    --hw-sticky-body-bg: #1e1e2e;
    --hw-sticky-body-account-bg: #252536;
    --hw-sticky-pin-shadow: 4px 0 10px -3px rgba(0, 0, 0, 0.42);
}

[data-theme='dark'] .homework-table-head-sticky {
    background: var(--hw-sticky-head-bg, #2a2a3d);
    box-shadow: 0 1px 0 #3f3f50;
}

[data-theme='dark'] .homework-table-head-scroll {
    background: var(--hw-sticky-head-bg, #2a2a3d);
}

[data-theme='dark'] .homework-table-scroll {
    background: #1e1e2e;
}

[data-theme='dark'] .homework-matrix thead th.hw-head-group--superior {
    background: #1e1b4b;
    border-bottom-color: #4338ca;
}

[data-theme='dark'] .homework-matrix thead th.hw-head-group--superior .hw-head-group-label {
    color: #c7d2fe;
}

[data-theme='dark'] .homework-matrix thead th.hw-head-group--superior .hw-head-group-hint {
    color: #a5b4fc;
}

[data-theme='dark'] .homework-matrix thead th.hw-head-group--legion {
    background: #052e16;
    border-bottom-color: #059669;
}

[data-theme='dark'] .homework-matrix thead th.hw-head-group--legion .hw-head-group-label {
    color: #a7f3d0;
}

[data-theme='dark'] .homework-matrix thead th.hw-head-group--raid {
    background: #4c0519;
    border-bottom-color: #e11d48;
}

[data-theme='dark'] .homework-matrix thead th.hw-head-group--raid .hw-head-group-label {
    color: #fecdd3;
}

[data-theme='dark'] .homework-matrix .hw-group-start.hw-head-group--superior,
[data-theme='dark'] .homework-matrix .hw-group-start.hw-head-sub--superior,
[data-theme='dark'] .homework-matrix .hw-col-task--superior.hw-group-start {
    border-left-color: #4338ca;
}

[data-theme='dark'] .homework-matrix .hw-group-start.hw-head-group--legion,
[data-theme='dark'] .homework-matrix .hw-group-start.hw-head-sub--legion,
[data-theme='dark'] .homework-matrix .hw-col-task--legion.hw-group-start {
    border-left-color: #059669;
}

[data-theme='dark'] .homework-matrix .hw-group-start.hw-head-group--raid,
[data-theme='dark'] .homework-matrix .hw-group-start.hw-head-sub--raid,
[data-theme='dark'] .homework-matrix .hw-col-task--raid.hw-group-start {
    border-left-color: #e11d48;
}

[data-theme='dark'] .homework-matrix thead th.hw-head-sub--superior {
    background: #252547;
}

[data-theme='dark'] .homework-matrix thead th.hw-head-sub--legion {
    background: #1a2e24;
}

[data-theme='dark'] .homework-matrix thead th.hw-head-sub--raid {
    background: #2e1a22;
}

[data-theme='dark'] .homework-matrix tbody td.hw-col-task--selected {
    background: var(--pland-brand-muted, rgba(149, 167, 255, 0.18)) !important;
}

[data-theme='dark'] .homework-matrix thead th {
    background: #2a2a3d;
    color: #e5e7eb;
    border-bottom-color: #3f3f50;
}

[data-theme='dark'] .homework-matrix thead tr.hw-head-row-single,
[data-theme='dark'] .homework-matrix thead tr.hw-head-row-1,
[data-theme='dark'] .homework-matrix thead tr.hw-head-row-2 {
    background: #2a2a3d;
    box-shadow: 0 1px 0 #3f3f50;
}

[data-theme='dark'] .homework-matrix thead th.hw-col-name {
    background-color: var(--hw-sticky-head-bg, #2a2a3d) !important;
    border-right-color: #3f3f50;
}

[data-theme='dark'] .homework-matrix thead th.hw-col-char-meta,
[data-theme='dark'] .homework-matrix thead th.hw-col-fame-score,
[data-theme='dark'] .homework-matrix thead th.hw-col-fame-only,
[data-theme='dark'] .homework-matrix thead th.hw-col-dun-dealer,
[data-theme='dark'] .homework-matrix thead th.hw-col-dun-buff {
    background: #2a2a3d;
}

[data-theme='dark'] .homework-matrix .hw-col-char-meta .fame,
[data-theme='dark'] .homework-matrix .hw-col-fame-score .fame,
[data-theme='dark'] .homework-matrix .hw-col-fame-only .fame {
    color: #e5e7eb;
}

[data-theme='dark'] .homework-matrix .hw-col-char-meta .score-info,
[data-theme='dark'] .homework-matrix .hw-col-fame-score .score-info {
    color: #60a5fa;
}

[data-theme='dark'] .hw-char-sub {
    color: #9ca3af;
}

[data-theme='dark'] .homework-matrix tbody td {
    background: #1e1e2e;
    border-color: #2f2f42;
}

[data-theme='dark'] .homework-matrix--body tbody td {
    background: #1e1e2e;
}

[data-theme='dark'] .homework-matrix tbody td.hw-col-name {
    background-color: var(--hw-sticky-body-bg, #1e1e2e) !important;
    color: #f3f4f6;
    border-right-color: #3f3f50;
}

[data-theme='dark'] .homework-matrix tbody tr.hw-row-account td.hw-col-name {
    background-color: var(--hw-sticky-body-account-bg, #252536) !important;
    color: #93c5fd;
}

[data-theme='dark'] .homework-matrix tbody td.hw-col-char-image,
[data-theme='dark'] .homework-matrix tbody td.hw-col-char-num {
    background-color: #1e1e2e !important;
}

[data-theme='dark'] .homework-matrix.hw-matrix--lead-number tbody td.hw-col-char-num {
    background-color: var(--hw-sticky-body-bg, #1e1e2e) !important;
    border-right-color: #3f3f50;
}

[data-theme='dark'] .homework-matrix tbody tr.hw-row-account td.hw-col-char-image,
[data-theme='dark'] .homework-matrix tbody tr.hw-row-account td.hw-col-char-num {
    background-color: var(--hw-sticky-body-account-bg, #252536) !important;
}

[data-theme='dark'] .homework-matrix.hw-matrix--lead-number tbody tr.hw-row-account td.hw-col-char-num {
    background-color: var(--hw-sticky-body-account-bg, #252536) !important;
}

[data-theme='dark'] .homework-matrix thead th.hw-col-char-image,
[data-theme='dark'] .homework-matrix thead th.hw-col-char-num {
    background-color: var(--hw-sticky-head-bg, #2a2a3d) !important;
    border-right-color: #3f3f50;
}

[data-theme='dark'] .homework-matrix.hw-matrix--lead-number thead th.hw-col-char-num {
    background-color: var(--hw-sticky-head-bg, #2a2a3d) !important;
}

[data-theme='dark'] .homework-matrix .hw-char-order-num {
    color: #9ca3af;
}

[data-theme='dark'] .homework-matrix tbody td.hw-char-image-cell {
    background-color: transparent !important;
    filter: none;
    opacity: 1;
}

[data-theme='dark'] .homework-matrix tbody td.hw-col-char-meta,
[data-theme='dark'] .homework-matrix tbody td.hw-col-fame-score,
[data-theme='dark'] .homework-matrix tbody td.hw-col-fame-only,
[data-theme='dark'] .homework-matrix tbody td.hw-col-dun-dealer,
[data-theme='dark'] .homework-matrix tbody td.hw-col-dun-buff {
    background: #1e1e2e;
}

[data-theme='dark'] .homework-matrix thead th.hw-col-sortable:hover {
    background: #353548;
}

[data-theme='dark'] .homework-matrix tbody tr.hw-row-account td {
    background: #252536;
    color: #93c5fd;
}

[data-theme='dark'] .hw-account-col-summary--covenant {
    color: #c4b5fd;
}

[data-theme='dark'] .hw-account-col-summary--superior {
    color: #a5b4fc;
}

[data-theme='dark'] .hw-account-col-summary--legion {
    color: #6ee7b7;
}

[data-theme='dark'] .hw-row-account td.hw-account-col-summary-cell--superior {
    background: #1e1b4b;
    border-bottom-color: #4338ca;
}

[data-theme='dark'] .hw-ticket-applied-label {
    background: var(--pland-brand-solid, #5868d8);
    color: #fff;
}

[data-theme='dark'] .hw-cell-count {
    background: #252536;
    border-color: #4b5563;
    color: #e5e7eb;
}

[data-theme='dark'] .hw-cell-count.is-done {
    background: #312e81;
    border-color: #6366f1;
    color: #e0e7ff;
}

[data-theme='dark'] .hw-help-modal__body {
    color: #cbd5e1;
}

[data-theme='dark'] .hw-help-modal__panel .detail-grid-prefs-modal__head h4 {
    color: #f1f5f9;
}

[data-theme='dark'] .hw-help-modal__panel .detail-grid-prefs-modal__close {
    color: #94a3b8;
}

[data-theme='dark'] .hw-confirm-modal__body {
    color: #cbd5e1;
}

[data-theme='dark'] .hw-confirm-modal .detail-grid-prefs-modal__foot {
    border-top-color: #334155;
}

[data-theme='dark'] .homework-mercenary-level-btn {
    background-color: #1a2230;
    color: #e8ecf4;
    border-color: #2a3444;
}

[data-theme='dark'] .homework-mercenary-level-btn::after {
    color: #8b96a8;
}

[data-theme='dark'] .hw-mercenary-level-option {
    background: #1a2230;
    border-color: #2a3444;
    color: #e8ecf4;
}

[data-theme='dark'] .hw-mercenary-level-option:hover,
[data-theme='dark'] .hw-mercenary-level-option:focus-visible,
[data-theme='dark'] .hw-mercenary-level-option.is-selected {
    background: var(--pland-brand-muted, rgba(149, 167, 255, 0.18));
    border-color: var(--pland-brand-border, rgba(149, 167, 255, 0.42));
    color: var(--pland-brand, #95a7ff);
}

[data-theme='dark'] .hw-loading-card {
    background: #1e293b;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

[data-theme='dark'] .hw-loading-message {
    color: #e2e8f0;
}

[data-theme='dark'] .homework-grid-actions-hint {
    color: #a5b4fc;
}

[data-theme='dark'] .homework-mercenary-top-btn {
    color: #cbd5e1;
    border-color: #475569;
    background-color: #1e293b;
}

[data-theme='dark'] .hw-char-name {
    color: #f3f4f6;
}

[data-theme='dark'] .hw-account-cell .hw-char-name {
    color: #93c5fd;
}

[data-theme='dark'] .hw-row-account .hw-raid-summary {
    color: #a5b4fc;
}

[data-theme='dark'] .hw-cell-empty {
    color: #4b5563;
}

[data-theme='dark'] .hw-cell-muted,
[data-theme='dark'] .hw-cell-locked {
    color: #6b7280;
}

[data-theme='dark'] .homework-matrix tbody td.hw-col-task--locked,
[data-theme='dark'] .homework-matrix tbody td.hw-col-task--group-limit {
    background: #252536;
}

[data-theme='dark'] .hw-ticket-btn {
    background: #312e81;
    border-color: #6366f1;
    color: #e0e7ff;
}

[data-theme='dark'] .hw-ticket-btn:hover {
    background: #3730a3;
    border-color: #818cf8;
}

[data-theme='dark'] .hw-ticket-btn.is-remove {
    background: #1e293b;
    border-color: #475569;
    color: #94a3b8;
}

[data-theme='dark'] .hw-ticket-btn.is-remove:hover {
    border-color: #64748b;
    color: #e2e8f0;
}

[data-theme='dark'] .hw-ticket-badge {
    color: #a5b4fc;
}

[data-theme='dark'] .hw-ticket-badge.is-applied {
    background: rgba(99, 102, 241, 0.25);
}

[data-theme='dark'] .homework-matrix thead th .hw-task-head-ticket {
    color: #94a3b8;
}

[data-theme='dark'] .homework-setting-input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 0.15rem rgba(129, 140, 248, 0.22);
}

[data-theme='dark'] .hw-cell-count:hover {
    border-color: #818cf8;
    color: #c7d2fe;
}

[data-theme='dark'] .homework-matrix--head thead th {
    border-right-color: #3f3f50;
}

[data-theme='dark'] .hw-row-account td.hw-account-col-summary-cell--legion,
[data-theme='dark'] .hw-row-account td.hw-account-col-summary-cell--covenant {
    background: #252536;
    border-bottom-color: #3f3f50;
}

@media (max-width: 991px) {
    .homework-header h1 {
        font-size: 1.25rem;
        margin-bottom: 0;
    }

    .homework-header p {
        display: none;
    }

    .homework-grid-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
        gap: 0.35rem;
        flex-wrap: nowrap;
        justify-content: stretch;
    }

    .homework-grid-actions-hint {
        grid-column: 1 / -1;
        order: unset;
        flex: unset;
        width: auto;
        margin-right: 0;
        margin-bottom: 0;
        line-height: 1.35;
        font-size: 0.72rem;
    }

    .homework-grid-actions .btn {
        width: 100%;
        min-width: 0;
        margin: 0;
        height: var(--hw-setting-control-height);
        min-height: var(--hw-setting-control-height);
        padding: 0 0.15rem;
        font-size: clamp(0.76rem, 3.1vw, 0.82rem);
        line-height: 1.15;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        border-radius: 6px;
    }

    .homework-grid-actions .btn i {
        font-size: 0.95em;
        margin-right: 0.12rem;
    }

    .homework-grid-actions #hwRaidTicketModeBtn {
        min-width: 0;
    }

    .homework-matrix thead th {
        text-align: center;
        vertical-align: middle;
    }

    .homework-matrix thead th.hw-col-name {
        min-width: 100px;
        max-width: 100px;
        text-align: center;
        vertical-align: middle;
        padding: 0.22rem 0.3rem;
    }

    .homework-matrix tbody td.hw-col-name {
        min-width: 100px;
        max-width: 100px;
        padding: 0.22rem 0.38rem;
    }

    .homework-matrix thead th.hw-col-char-meta,
    .homework-matrix thead th.hw-col-fame-score,
    .homework-matrix thead th.hw-col-fame-only,
    .homework-matrix thead th.hw-col-dun-dealer,
    .homework-matrix thead th.hw-col-dun-buff {
        text-align: center;
        vertical-align: middle;
        font-size: 0.62rem;
        line-height: 1.15;
    }

    .homework-matrix thead th[rowspan]:not(.hw-col-name):not(.hw-col-char-meta):not(.hw-col-fame-score):not(.hw-col-fame-only):not(.hw-col-dun-dealer):not(.hw-col-dun-buff):not(.hw-col-char-num):not(.hw-col-char-image),
    .homework-matrix thead tr.hw-head-row-single th:not(.hw-col-name):not(.hw-col-char-meta):not(.hw-col-fame-score):not(.hw-col-fame-only):not(.hw-col-dun-dealer):not(.hw-col-dun-buff):not(.hw-col-char-num):not(.hw-col-char-image) {
        font-size: 0.62rem;
        line-height: 1.15;
    }

    .homework-matrix thead th.hw-head-sub,
    .homework-matrix tbody td.hw-col-task {
        min-width: 2.95rem;
        padding: 0.22rem 0.18rem;
        font-size: 0.68rem;
    }

    .homework-matrix tbody td.hw-col-task--ticket {
        min-width: 3.35rem;
    }

    .homework-matrix thead th.hw-col-char-meta:not(.hw-col-char-image):not(.hw-col-char-num),
    .homework-matrix thead th.hw-col-fame-score,
    .homework-matrix thead th.hw-col-fame-only,
    .homework-matrix thead th.hw-col-dun-dealer,
    .homework-matrix thead th.hw-col-dun-buff,
    .homework-matrix tbody td.hw-col-char-meta:not(.hw-col-char-image):not(.hw-col-char-num),
    .homework-matrix tbody td.hw-col-fame-score,
    .homework-matrix tbody td.hw-col-fame-only,
    .homework-matrix tbody td.hw-col-dun-dealer,
    .homework-matrix tbody td.hw-col-dun-buff {
        min-width: 5.35rem;
        max-width: 5.35rem;
        padding-left: 0.2rem;
        padding-right: 0.2rem;
    }

    .homework-matrix thead th.hw-col-char-num,
    .homework-matrix tbody td.hw-col-char-num {
        min-width: 22px;
        width: 22px;
        max-width: 22px;
        padding-left: 0;
        padding-right: 0;
    }

    .homework-matrix.hw-matrix--lead-number thead th.hw-col-name,
    .homework-matrix.hw-matrix--lead-number tbody td.hw-col-name {
        left: 22px;
    }

    .homework-matrix .hw-char-order-num {
        font-size: 12px;
    }

    .homework-matrix thead th.hw-col-char-image,
    .homework-matrix tbody td.hw-col-char-image {
        min-width: 34px;
        width: 34px;
        max-width: 34px;
        padding: 0 !important;
    }

    .homework-matrix tbody td.hw-char-image-cell {
        min-height: 50px;
        background-size: 101px auto;
    }

    .homework-matrix .hw-col-fame-score .fame,
    .homework-matrix .hw-col-fame-score .score-info {
        font-size: 0.68rem;
    }

    .homework-matrix .hw-col-fame-score .fame::before,
    .homework-matrix .hw-col-fame-score .score-info::before {
        width: 12px;
        height: 12px;
        margin-right: 1px;
    }

    .hw-char-name {
        font-size: 0.72rem;
    }

    .hw-char-sub {
        font-size: 0.62rem;
        margin-top: 0.05rem;
        line-height: 1.15;
    }

    .hw-cell-ticket-wrap {
        flex-direction: column;
        gap: 0.12rem;
    }

    .hw-task-head-name {
        font-size: 0.68rem;
    }

    .homework-matrix .hw-task-head-api__text {
        display: none;
    }

    .homework-matrix .hw-task-head-api {
        margin-top: 0.15rem;
        padding: 0.12rem 0.28rem;
        line-height: 1;
    }

    .homework-matrix .hw-task-head-api i {
        font-size: 0.62rem;
    }

    .hw-account-col-summary {
        font-size: 0.64rem;
    }

    .hw-ticket-btn {
        font-size: 0.58rem;
        padding: 0.08rem 0.22rem;
    }

    .homework-container {
        padding: 0.85rem 0.65rem 1rem;
    }

    .homework-header {
        margin-bottom: 0.65rem;
    }

    .homework-overview {
        padding: 0.65rem 0.75rem;
        margin-bottom: 0.65rem;
        --hw-setting-control-height: calc(1.5em + 0.5rem + 2px);
    }

    .homework-overview__top {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding-bottom: 0.35rem;
    }

    .homework-overview__meta {
        gap: 0.22rem;
        width: 100%;
    }

    .homework-overview__headline {
        gap: 0.35rem 0.4rem;
        flex-wrap: wrap;
    }

    .homework-overview__adventure {
        font-size: 1.06rem;
    }

    .homework-overview__title-group {
        gap: 0.35rem;
    }

    .homework-overview__settings {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem 0.4rem;
        margin-top: 0.35rem;
        padding-top: 0.7rem;
        padding-bottom: 0.35rem;
        border-top: 1px solid #e5e7eb;
        align-items: end;
    }

    .homework-overview__settings .homework-setting-field__label {
        font-size: 0.68rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .homework-setting-field--mercenary {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        flex: unset;
    }

    .homework-setting-field--mercenary .homework-setting-input {
        max-width: none;
    }

    .homework-setting-field:not(.homework-setting-field--mercenary) {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .homework-mercenary-top-btn {
        padding: 0.28rem 0.45rem;
        font-size: 0.72rem;
    }

    .homework-overview__settings-actions {
        grid-column: 3;
        grid-row: 1;
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 0.35rem;
        width: 100%;
        margin-left: 0;
        align-self: end;
    }

    .homework-overview__settings-actions .btn {
        width: 100%;
        min-width: 0;
        margin: 0;
        height: var(--hw-setting-control-height);
        min-height: var(--hw-setting-control-height);
        padding: 0 0.18rem;
        font-size: 0.84rem;
        line-height: 1.5;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        border-radius: 6px;
    }

    .homework-overview__settings-actions #hwResetMercenaryBtn {
        width: var(--hw-setting-control-height);
        min-width: var(--hw-setting-control-height);
        padding: 0;
    }

    .homework-overview__settings-actions #hwResetMercenaryBtn .hw-reset-btn-label {
        display: none;
    }

    .homework-overview__settings-actions #hwResetMercenaryBtn i {
        margin-right: 0;
        font-size: 0.95em;
    }

    .homework-overview__settings-actions #hwSaveSettingBtn {
        width: 100%;
    }

    .homework-overview__settings-actions .btn i {
        font-size: 0.9em;
        margin-right: 0.08rem;
    }

    .homework-overview__toolbar {
        margin-top: 0.35rem;
        padding-top: 0.7rem;
        padding-bottom: 0.1rem;
        border-top: 1px solid #e5e7eb;
    }

    .homework-raid-mode-banner {
        font-size: 0.72rem;
        margin-bottom: 0.4rem;
    }

    .homework-setting-input {
        max-width: none;
        width: 100%;
        height: var(--hw-setting-control-height);
        min-height: var(--hw-setting-control-height);
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
        font-size: 0.84rem;
        line-height: 1.5;
        box-sizing: border-box;
    }

    .homework-setting-field {
        flex: unset;
        min-width: 0;
        width: auto;
    }

    .homework-setting-field:not(.homework-setting-field--mercenary) .homework-setting-input {
        padding-left: 0.45rem;
        padding-right: 0.45rem;
    }

    .homework-overview__hint {
        display: none;
    }

    .hw-mercenary-top-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hw-mercenary-top-stat:nth-child(1),
    .hw-mercenary-top-stat:nth-child(2) {
        display: none;
    }
}
