/* 강화·증폭 내역 (style_reinforce_history.css) */

.reinforce-history-container {
    padding-bottom: 24px;
}

.rh-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--pland-brand-border, rgba(110, 132, 255, 0.38));
    background: var(--pland-brand-muted, rgba(110, 132, 255, 0.14));
    color: var(--pland-body-text, #374151);
    font-size: 0.9rem;
    line-height: 1.55;
}

.rh-notice i {
    margin-top: 2px;
    color: var(--pland-brand, #6e84ff);
    flex-shrink: 0;
}

/* 증폭/강화 탭: 인디케이터 슬라이드 애니메이션 제거 (새로고침·조회 시 밑줄이 움직이는 현상 방지) */
#rhModeTabs .statistics-tab-indicator {
    transition: none;
}

[data-theme='dark'] .rh-notice {
    border-color: #334155;
    background: #1e293b;
    color: #e2e8f0;
}

[data-theme='dark'] .rh-notice i {
    color: #60a5fa;
}

/* ===== 결과 워크벤치: 좌 캐릭터 / 우 요약·필터·표 ===== */
.rh-workbench {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

/* 높이는 캐릭터 목록 기준으로 두고, 데이터 없을 때 오른쪽에 끌려 짜부러지지 않게 */
.rh-side {
    background: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-height: calc(100vh - 140px);
    min-height: min(420px, calc(100vh - 140px));
}

.rh-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #edf0f7;
    background: #f8fafc;
    flex-shrink: 0;
}

.rh-side-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rh-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.rh-char-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.12s ease, opacity 0.12s ease;
}

.rh-char-row:last-child {
    border-bottom: none;
}

.rh-char-row:hover {
    background: #f7f8fa;
}

.rh-char-row.is-selected {
    background: transparent;
}

.rh-char-row:not(.is-selected) {
    opacity: 0.55;
}

.rh-char-row:not(.is-selected):hover {
    opacity: 0.85;
}

.rh-char-row.is-selected .rh-char-name {
    font-weight: 700;
}

.rh-char-check,
.reinforce-master-check {
    position: relative;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
}

.rh-char-check input,
.reinforce-master-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.rh-check-ui {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.rh-check-ui::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    margin-top: -1px;
    transition: transform 0.12s ease;
}

.rh-char-check:hover .rh-check-ui,
.reinforce-master-check:hover .rh-check-ui {
    border-color: var(--pland-brand-solid, #6e84ff);
}

.rh-char-check input:checked + .rh-check-ui,
.reinforce-master-check input:checked + .rh-check-ui {
    background: var(--pland-brand-solid, #6e84ff);
    border-color: var(--pland-brand-solid, #6e84ff);
    box-shadow: none;
}

.rh-char-check input:checked + .rh-check-ui::after,
.reinforce-master-check input:checked + .rh-check-ui::after {
    transform: rotate(45deg) scale(1);
}

.rh-char-check input:indeterminate + .rh-check-ui,
.reinforce-master-check input:indeterminate + .rh-check-ui {
    background: var(--pland-brand-solid, #6e84ff);
    border-color: var(--pland-brand-solid, #6e84ff);
}

.rh-char-check input:indeterminate + .rh-check-ui::after,
.reinforce-master-check input:indeterminate + .rh-check-ui::after {
    width: 8px;
    height: 2px;
    border: 0;
    background: #fff;
    border-radius: 1px;
    transform: none;
    margin-top: 0;
}

.rh-master-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--pland-body-text, #374151);
}

.rh-char-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.rh-char-img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 0.75rem;
}

.rh-char-img img {
    width: 170%;
    height: 170%;
    object-fit: cover;
    object-position: top center;
    position: absolute;
    left: -35%;
}

.rh-char-text {
    min-width: 0;
}

.rh-char-name-row {
    display: flex;
    align-items: center;
    min-width: 0;
}

.rh-char-new-mark {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    margin-right: 4px;
}

.rh-char-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1 1 auto;
}

.rh-char-meta {
    font-size: 0.68rem;
    color: var(--pland-muted-text, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rh-char-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--pland-muted-text, #6b7280);
    background: #f1f5f9;
    border-radius: 4px;
    padding: 1px 6px;
    flex-shrink: 0;
}

.rh-char-history-btn,
.rh-char-sync-btn {
    padding: 0 4px !important;
    color: var(--pland-muted-text, #6b7280) !important;
    flex-shrink: 0;
    line-height: 1;
}

.rh-char-history-btn:hover,
.rh-char-sync-btn:hover {
    color: var(--pland-brand, #6e84ff) !important;
}

.rh-char-sync-btn.is-syncing,
.rh-char-sync-btn:disabled {
    color: var(--pland-brand, #6e84ff) !important;
    opacity: 0.85;
    pointer-events: none;
}

.rh-summary-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.rh-stat {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    min-width: 0;
}

.rh-stat-levels {
    align-items: flex-start;
}

.rh-stat-main.is-amp,
.rh-stat-main.is-enf {
    border-color: var(--pland-border-color, #e5e7eb);
}

.rh-stat-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.rh-stat-body-full {
    gap: 8px;
}

.rh-stat-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.rh-stat-label {
    font-size: 0.7rem;
    color: var(--pland-muted-text, #6b7280);
    font-weight: 600;
}

.rh-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--pland-body-text, #374151);
    line-height: 1.15;
}

.rh-stat-value-sm {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rh-stat-sub {
    font-size: 0.7rem;
    color: var(--pland-muted-text, #6b7280);
}

.rh-level-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rh-level-chips-empty {
    font-size: 0.8rem;
}

.rh-level-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 5px 8px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    line-height: 1.15;
}

.rh-level-chip-lvl {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--pland-muted-text, #6b7280);
}

.rh-level-chip-lvl.is-amp,
.rh-log-level.is-amp,
.rh-matrix-lvl.is-amp {
    color: #ff00ff;
    font-weight: 700;
}

.rh-level-chip-lvl.is-enf,
.rh-log-level.is-enf,
.rh-matrix-lvl.is-enf {
    color: #68d5ed;
    font-weight: 700;
}

.rh-level-chip-rate {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 1px 0;
    color: var(--pland-muted-text, #6b7280);
}

.rh-level-chip-rate.rate-high { color: var(--pland-brand, #6e84ff) !important; }
.rh-level-chip-rate.rate-mid { color: #62ad83 !important; }
.rh-level-chip-rate.rate-low { color: var(--pland-muted-text, #6b7280) !important; }

.rh-level-chip-cnt {
    font-size: 0.62rem;
    color: var(--pland-muted-text, #6b7280);
}

.rh-stat-value-sm.rate-high { color: var(--pland-brand, #6e84ff) !important; }
.rh-stat-value-sm.rate-mid { color: #62ad83 !important; }
.rh-stat-value-sm.rate-low { color: var(--pland-muted-text, #6b7280) !important; }

.rh-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 8px;
}

.rh-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    min-width: 0;
    width: 100%;
}

.rh-period-filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.rh-period-season-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.rh-period-season-row .rh-filter-label {
    flex-shrink: 0;
}

.rh-period-dates-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.rh-season-btn-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.rh-filter-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pland-muted-text, #6b7280);
    white-space: nowrap;
    flex-shrink: 0;
}

.rh-season-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    color: var(--pland-body-text, #374151);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    line-height: 1.35;
    border-radius: 999px;
    white-space: nowrap;
}

.rh-season-btn:hover {
    border-color: var(--pland-brand, #6e84ff);
    color: var(--pland-body-text, #374151);
    background: #f8fafc;
}

.rh-season-btn.is-active {
    border-color: var(--pland-brand-solid, #6e84ff);
    background: var(--pland-brand-solid, #6e84ff);
    color: #fff;
}

.rh-season-btn.is-active:hover {
    border-color: var(--pland-brand-solid-hover, #5a73e6);
    background: var(--pland-brand-solid-hover, #5a73e6);
    color: #fff;
}

.rh-filter-dates {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 14rem;
    width: auto;
}

.rh-filter-tilde {
    flex-shrink: 0;
    line-height: 1;
}

.rh-filter-group .form-control-sm {
    width: auto;
    min-width: 110px;
    height: calc(1.5em + 0.4rem + 2px);
    padding: 0.2rem 0.45rem;
    font-size: 0.8rem;
}

.rh-filter-dates input[type="date"].form-control-sm {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    text-align: center;
}

.rh-filter-dates input[type="date"].form-control-sm::-webkit-datetime-edit {
    text-align: center;
}

.rh-date-clear-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 검색 대상: 서약 관리와 동일 톤 */
#reinforceSearchRow .search-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

#rhSearchBtn,
#rhSyncBtn {
    height: 31px !important;
    min-height: 31px !important;
    padding: 0 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

#rhSearchBtn i,
#rhSyncBtn i {
    font-size: 12px !important;
    line-height: 1 !important;
}

.rh-matrix-block {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    min-height: 480px;
}

/* ===== 매트릭스 테이블 (얇은 격자) ===== */
.reinforce-matrix-table {
    font-size: 0.78rem;
    margin-bottom: 0;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
}

.reinforce-matrix-table th,
.reinforce-matrix-table td {
    vertical-align: middle;
    padding: 1px 4px;
    white-space: nowrap;
    border: 0;
    border-right: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/* td min-height는 브라우저마다 안 먹어서 행 height로 빈 칸(-) 높이 보장 */
.reinforce-matrix-table thead th {
    height: 30px;
}

.reinforce-matrix-table tbody td,
.reinforce-matrix-table tbody th.matrix-slot-name,
.reinforce-matrix-table tfoot td,
.reinforce-matrix-table tfoot th.matrix-slot-name {
    height: 34px;
}

.reinforce-matrix-table th:last-child,
.reinforce-matrix-table td:last-child {
    border-right: 0;
}

.reinforce-matrix-table tbody tr:last-child th,
.reinforce-matrix-table tbody tr:last-child td {
    border-bottom: 0;
}

.reinforce-matrix-table .matrix-slot-name {
    position: relative;
    font-weight: 700;
    color: #333;
    background: #f8fafc;
    text-align: center;
    width: 5.25rem;
    min-width: 5.25rem;
    max-width: 5.25rem;
    padding: 1px 3px;
    vertical-align: middle;
    line-height: 1.25;
}

.reinforce-matrix-table .matrix-corner {
    font-weight: 700;
    color: #333;
    background: #f8fafc;
    text-align: center;
    width: 5.25rem;
    min-width: 5.25rem;
    max-width: 5.25rem;
    padding: 1px 3px;
}

.matrix-slot-label {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 26px 0 2px;
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.rh-matrix-history-btn {
    position: absolute;
    right: 3px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 30px;
    padding: 0 !important;
    margin: 0;
    min-width: 22px;
    min-height: 30px !important;
    color: var(--pland-muted-text, #6b7280) !important;
    background: #fff !important;
    line-height: 1 !important;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: none;
    text-decoration: none !important;
}

.rh-matrix-history-btn i {
    display: block;
    font-size: 0.82rem;
    line-height: 1;
}

.rh-matrix-history-btn:hover {
    color: var(--pland-brand, #6e84ff) !important;
    background: #f8fafc !important;
    border-color: var(--pland-brand, #6e84ff);
    text-decoration: none !important;
}

/* site.css button:active scale(0.97)이 absolute 중앙 정렬 transform을 덮어 클릭 시 버튼이 아래로 튀는 현상 방지 */
.reinforce-history-container button:active:not(.rh-matrix-history-btn),
.reinforce-history-container .btn:active:not(.rh-matrix-history-btn) {
    transform: none;
}

.reinforce-history-container .rh-matrix-history-btn:active,
.reinforce-history-container .rh-matrix-history-btn:focus,
.reinforce-history-container .rh-matrix-history-btn.focus {
    transform: translateY(-50%) !important;
    box-shadow: none;
}

/* 수치 열: 남은 폭을 균등 분배 */
.reinforce-matrix-table thead th:not(.matrix-corner),
.reinforce-matrix-table tbody td,
.reinforce-matrix-table tfoot td {
    width: auto;
    text-align: center;
}

.reinforce-matrix-table thead th {
    font-weight: 700;
    background: #f8fafc;
    color: #333;
    border-bottom: 1px solid #e5e7eb;
}

/* 합계 행: 배경으로 구분 */
.reinforce-matrix-table tfoot tr.matrix-total-row th,
.reinforce-matrix-table tfoot tr.matrix-total-row td {
    border-top: 1px solid #d1d5db;
    border-bottom: 0;
    font-weight: 700;
    background: #eef1f6;
}

.reinforce-matrix-table tfoot tr.matrix-total-row .matrix-slot-name {
    background: #e8ecf3;
    color: var(--pland-body-text, #374151);
}

.matrix-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    line-height: 1.15;
}

.matrix-empty {
    color: #cbd5e1;
}

.matrix-rate {
    font-weight: 700;
    font-size: 0.82rem;
}

.matrix-rate.rate-high { color: var(--pland-brand, #6e84ff); }
.matrix-rate.rate-mid { color: #62ad83; }
.matrix-rate.rate-low { color: var(--pland-muted-text, #6b7280); }

.matrix-count {
    font-size: 0.65rem;
    color: var(--pland-muted-text, #6b7280);
}

/* ===== 로그 / 결과 뱃지 ===== */
#rhHistoryModal .modal-header {
    padding: 8px 12px;
    align-items: center;
}

#rhHistoryModal .modal-header .close {
    padding: 0;
    margin: 0 0 0 auto;
    font-size: 1.25rem;
    line-height: 1;
}

#rhHistoryModal .modal-title {
    font-size: 0.95rem;
    line-height: 1.3;
}

#rhHistoryModal .modal-footer {
    padding: 6px 12px;
    gap: 8px;
}

#rhHistoryModal .modal-footer > * {
    margin: 0;
}

.rh-log-list {
    padding: 4px 0;
}

.rh-log-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #edf0f7;
}

.rh-log-row:last-child {
    border-bottom: none;
}

.rh-log-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 0.85rem;
}

.rh-log-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rh-log-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    text-align: left;
}

.rh-log-name {
    font-size: calc(0.88rem - 1pt);
    font-weight: 600;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    width: 100%;
    text-align: left;
}

.rh-log-meta {
    font-size: 0.75rem;
    color: var(--pland-muted-text, #6b7280);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    line-height: 1.35;
    width: 100%;
    text-align: left;
}

.rh-log-meta-part + .rh-log-meta-part::before {
    content: '·';
    margin: 0 3px;
    color: #cbd5e1;
}

.rh-log-dot {
    margin: 0 3px;
    color: #cbd5e1;
}

.rh-log-result {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 52px;
}

.rh-log-level {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.rh-log-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.rh-log-status.is-success {
    background: var(--pland-brand-solid, #6e84ff);
    color: #fff;
}

.rh-log-status.is-fail {
    background: #9ca3af;
    color: #fff;
}

.reinforce-matrix-table thead th.rh-matrix-lvl {
    font-weight: 700;
}

/* ===== 반응형 ===== */
@media (max-width: 991px) {
    .rh-workbench {
        grid-template-columns: 1fr;
    }

    .rh-side {
        height: auto;
        min-height: 0;
        max-height: 280px;
    }

    .rh-summary-strip {
        grid-template-columns: 1fr 1fr;
    }

    .rh-stat-levels {
        grid-column: 1 / -1;
    }

    .rh-recent-last-success {
        display: none !important;
    }
}

@media (max-width: 767px) {
    #reinforceSearchRow .search-input-container {
        width: 100%;
    }

    #reinforceSearchRow #rhSearchType,
    #reinforceSearchRow #rhSearchValue {
        width: 100% !important;
        flex: 1 1 100% !important;
        min-width: 0 !important;
    }

    #reinforceSearchRow .rh-search-actions {
        width: 100%;
        display: flex !important;
    }

    #reinforceSearchRow .rh-search-actions .btn {
        flex: 1 1 0;
    }

    .rh-period-season-row {
        flex-wrap: wrap;
    }

    .rh-period-dates-row {
        flex-wrap: nowrap;
    }

    .rh-filter-dates {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        flex-wrap: nowrap;
    }

    .rh-period-dates-row .rh-date-clear-btn {
        flex-shrink: 0;
    }

    .rh-filter-dates input[type="date"].form-control-sm {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        width: 0; /* flex로 균등 분배 */
        font-size: 0.75rem;
        padding-left: 0.3rem;
        padding-right: 0.3rem;
    }

    .rh-filter-tilde {
        flex-shrink: 0;
        display: inline-block;
    }
}

/* ===== 다크 모드 ===== */
html[data-theme='dark'] .rh-side,
html[data-theme='dark'] .rh-stat,
html[data-theme='dark'] .rh-filter-bar,
html[data-theme='dark'] .rh-matrix-block,
body[data-theme='dark'] .rh-side,
body[data-theme='dark'] .rh-stat,
body[data-theme='dark'] .rh-filter-bar,
body[data-theme='dark'] .rh-matrix-block {
    background: var(--pland-card-bg, #151b26) !important;
    border-color: var(--pland-border-color, #2a3444) !important;
}

html[data-theme='dark'] .rh-stat-main.is-amp,
body[data-theme='dark'] .rh-stat-main.is-amp,
html[data-theme='dark'] .rh-stat-main.is-enf,
body[data-theme='dark'] .rh-stat-main.is-enf {
    border-color: var(--pland-border-color, #2a3444) !important;
}

html[data-theme='dark'] .rh-stat-label,
html[data-theme='dark'] .rh-stat-sub,
html[data-theme='dark'] .rh-filter-label,
html[data-theme='dark'] .rh-char-meta,
html[data-theme='dark'] .rh-side-count,
body[data-theme='dark'] .rh-stat-label,
body[data-theme='dark'] .rh-stat-sub,
body[data-theme='dark'] .rh-filter-label,
body[data-theme='dark'] .rh-char-meta,
body[data-theme='dark'] .rh-side-count {
    color: var(--pland-muted-text, #8b96a8) !important;
}

html[data-theme='dark'] .rh-season-btn,
body[data-theme='dark'] .rh-season-btn {
    border-color: var(--pland-border-color, #2a3444) !important;
    background: var(--pland-section-head-bg, #101620) !important;
    color: var(--pland-body-text, #e8ecf4) !important;
}

html[data-theme='dark'] .rh-season-btn:hover,
body[data-theme='dark'] .rh-season-btn:hover {
    border-color: var(--pland-brand, #95a7ff) !important;
    background: var(--pland-card-elevated, #1c2432) !important;
}

html[data-theme='dark'] .rh-season-btn.is-active,
body[data-theme='dark'] .rh-season-btn.is-active {
    border-color: var(--pland-brand-solid, #5868d8) !important;
    background: var(--pland-brand-solid, #5868d8) !important;
    color: #fff !important;
}

html[data-theme='dark'] .rh-stat-value:not(.rate-high):not(.rate-mid):not(.rate-low),
html[data-theme='dark'] .rh-master-label,
body[data-theme='dark'] .rh-stat-value:not(.rate-high):not(.rate-mid):not(.rate-low),
body[data-theme='dark'] .rh-master-label {
    color: var(--pland-body-text, #e8ecf4) !important;
}

html[data-theme='dark'] .rh-level-chip,
body[data-theme='dark'] .rh-level-chip {
    background: var(--pland-section-head-bg, #101620) !important;
    border-color: var(--pland-border-color, #2a3444) !important;
}

html[data-theme='dark'] .rh-level-chip-lvl,
html[data-theme='dark'] .rh-level-chip-cnt,
body[data-theme='dark'] .rh-level-chip-lvl,
body[data-theme='dark'] .rh-level-chip-cnt {
    color: var(--pland-muted-text, #8b96a8) !important;
}

html[data-theme='dark'] .rh-level-chip-rate.rate-high,
html[data-theme='dark'] .rh-stat-value.rate-high,
html[data-theme='dark'] .rh-stat-value-sm.rate-high,
html[data-theme='dark'] .reinforce-matrix-table .matrix-rate.rate-high,
body[data-theme='dark'] .rh-level-chip-rate.rate-high,
body[data-theme='dark'] .rh-stat-value.rate-high,
body[data-theme='dark'] .rh-stat-value-sm.rate-high,
body[data-theme='dark'] .reinforce-matrix-table .matrix-rate.rate-high {
    color: var(--pland-brand, #95a7ff) !important;
}

html[data-theme='dark'] .rh-level-chip-rate.rate-mid,
html[data-theme='dark'] .rh-stat-value.rate-mid,
html[data-theme='dark'] .rh-stat-value-sm.rate-mid,
html[data-theme='dark'] .reinforce-matrix-table .matrix-rate.rate-mid,
body[data-theme='dark'] .rh-level-chip-rate.rate-mid,
body[data-theme='dark'] .rh-stat-value.rate-mid,
body[data-theme='dark'] .rh-stat-value-sm.rate-mid,
body[data-theme='dark'] .reinforce-matrix-table .matrix-rate.rate-mid {
    color: #7dcea0 !important;
}

html[data-theme='dark'] .rh-level-chip-rate.rate-low,
html[data-theme='dark'] .rh-stat-value.rate-low,
html[data-theme='dark'] .rh-stat-value-sm.rate-low,
html[data-theme='dark'] .reinforce-matrix-table .matrix-rate.rate-low,
body[data-theme='dark'] .rh-level-chip-rate.rate-low,
body[data-theme='dark'] .rh-stat-value.rate-low,
body[data-theme='dark'] .rh-stat-value-sm.rate-low,
body[data-theme='dark'] .reinforce-matrix-table .matrix-rate.rate-low {
    color: var(--pland-muted-text, #8b96a8) !important;
}

/* 캐릭터 목록 */
html[data-theme='dark'] .rh-side-head,
body[data-theme='dark'] .rh-side-head {
    background: var(--pland-section-head-bg, #101620) !important;
    border-bottom-color: var(--pland-border-color, #2a3444) !important;
}

html[data-theme='dark'] .rh-side-list,
body[data-theme='dark'] .rh-side-list {
    background: var(--pland-card-bg, #151b26) !important;
}

html[data-theme='dark'] .rh-char-row,
body[data-theme='dark'] .rh-char-row {
    background: transparent !important;
    border-bottom-color: var(--pland-border-subtle, #1f2836) !important;
}

html[data-theme='dark'] .rh-char-row:hover,
body[data-theme='dark'] .rh-char-row:hover {
    background: var(--pland-hover-bg, #252f40) !important;
}

html[data-theme='dark'] .rh-char-row.is-selected,
body[data-theme='dark'] .rh-char-row.is-selected {
    background: transparent !important;
}

html[data-theme='dark'] .rh-char-row:not(.is-selected),
body[data-theme='dark'] .rh-char-row:not(.is-selected) {
    opacity: 0.58;
}

html[data-theme='dark'] .rh-char-row:not(.is-selected):hover,
body[data-theme='dark'] .rh-char-row:not(.is-selected):hover {
    opacity: 0.88;
}

html[data-theme='dark'] .rh-char-name,
body[data-theme='dark'] .rh-char-name {
    color: var(--pland-body-text, #e8ecf4) !important;
}

html[data-theme='dark'] .rh-char-img,
body[data-theme='dark'] .rh-char-img {
    background: var(--pland-card-image-bg, #0a0e16) !important;
    border-color: var(--pland-border-color, #2a3444) !important;
    color: var(--pland-muted-text, #8b96a8) !important;
}

html[data-theme='dark'] .rh-char-count,
body[data-theme='dark'] .rh-char-count {
    background: var(--pland-section-head-bg, #101620) !important;
    color: var(--pland-muted-text, #8b96a8) !important;
}

html[data-theme='dark'] .rh-check-ui,
body[data-theme='dark'] .rh-check-ui {
    background: var(--pland-input-bg, #1a2230) !important;
    border-color: var(--pland-border-color, #2a3444) !important;
    box-shadow: none;
}

html[data-theme='dark'] .rh-char-check:hover .rh-check-ui,
html[data-theme='dark'] .reinforce-master-check:hover .rh-check-ui,
body[data-theme='dark'] .rh-char-check:hover .rh-check-ui,
body[data-theme='dark'] .reinforce-master-check:hover .rh-check-ui {
    border-color: var(--pland-brand, #95a7ff) !important;
    box-shadow: none !important;
}

html[data-theme='dark'] .rh-char-check input:checked + .rh-check-ui,
html[data-theme='dark'] .reinforce-master-check input:checked + .rh-check-ui,
html[data-theme='dark'] .rh-char-check input:indeterminate + .rh-check-ui,
html[data-theme='dark'] .reinforce-master-check input:indeterminate + .rh-check-ui,
body[data-theme='dark'] .rh-char-check input:checked + .rh-check-ui,
body[data-theme='dark'] .reinforce-master-check input:checked + .rh-check-ui,
body[data-theme='dark'] .rh-char-check input:indeterminate + .rh-check-ui,
body[data-theme='dark'] .reinforce-master-check input:indeterminate + .rh-check-ui {
    background: var(--pland-brand-solid, #5868d8) !important;
    border-color: var(--pland-brand-solid, #5868d8) !important;
}

html[data-theme='dark'] .rh-char-history-btn,
html[data-theme='dark'] .rh-char-sync-btn,
body[data-theme='dark'] .rh-char-history-btn,
body[data-theme='dark'] .rh-char-sync-btn {
    color: var(--pland-muted-text, #8b96a8) !important;
}

html[data-theme='dark'] .rh-char-history-btn:hover,
html[data-theme='dark'] .rh-char-sync-btn:hover,
body[data-theme='dark'] .rh-char-history-btn:hover,
body[data-theme='dark'] .rh-char-sync-btn:hover {
    color: var(--pland-brand, #95a7ff) !important;
}

html[data-theme='dark'] .rh-matrix-history-btn,
body[data-theme='dark'] .rh-matrix-history-btn {
    color: var(--pland-muted-text, #8b96a8) !important;
    background: var(--pland-section-head-bg, #101620) !important;
    border-color: var(--pland-border-color, #2a3444) !important;
    box-shadow: none;
}

html[data-theme='dark'] .rh-matrix-history-btn:hover,
body[data-theme='dark'] .rh-matrix-history-btn:hover {
    color: var(--pland-brand, #95a7ff) !important;
    background: var(--pland-card-elevated, #1c2432) !important;
    border-color: var(--pland-brand, #95a7ff) !important;
}

/* 교차표 */
html[data-theme='dark'] .reinforce-matrix-table,
html[data-theme='dark'] .reinforce-matrix-table th,
html[data-theme='dark'] .reinforce-matrix-table td,
body[data-theme='dark'] .reinforce-matrix-table,
body[data-theme='dark'] .reinforce-matrix-table th,
body[data-theme='dark'] .reinforce-matrix-table td {
    background: var(--pland-card-bg, #151b26) !important;
    border-color: var(--pland-border-subtle, #1f2836) !important;
    color: var(--pland-body-text, #e8ecf4);
}

html[data-theme='dark'] .reinforce-matrix-table .matrix-corner,
html[data-theme='dark'] .reinforce-matrix-table .matrix-slot-name,
html[data-theme='dark'] .reinforce-matrix-table thead th,
body[data-theme='dark'] .reinforce-matrix-table .matrix-corner,
body[data-theme='dark'] .reinforce-matrix-table .matrix-slot-name,
body[data-theme='dark'] .reinforce-matrix-table thead th {
    background: var(--pland-section-head-bg, #101620) !important;
    color: var(--pland-body-text, #e8ecf4) !important;
    border-bottom-color: var(--pland-border-color, #2a3444) !important;
}

html[data-theme='dark'] .reinforce-matrix-table tfoot tr.matrix-total-row th,
html[data-theme='dark'] .reinforce-matrix-table tfoot tr.matrix-total-row td,
body[data-theme='dark'] .reinforce-matrix-table tfoot tr.matrix-total-row th,
body[data-theme='dark'] .reinforce-matrix-table tfoot tr.matrix-total-row td {
    background: var(--pland-card-elevated, #1c2432) !important;
    border-top-color: var(--pland-border-color, #2a3444) !important;
}

html[data-theme='dark'] .reinforce-matrix-table tfoot tr.matrix-total-row .matrix-slot-name,
body[data-theme='dark'] .reinforce-matrix-table tfoot tr.matrix-total-row .matrix-slot-name {
    background: var(--pland-card-elevated, #1c2432) !important;
}

html[data-theme='dark'] .matrix-count,
body[data-theme='dark'] .matrix-count {
    color: var(--pland-muted-text, #8b96a8) !important;
}

html[data-theme='dark'] .matrix-empty,
body[data-theme='dark'] .matrix-empty {
    color: #4a5568 !important;
}

html[data-theme='dark'] .rh-log-row,
body[data-theme='dark'] .rh-log-row {
    border-bottom-color: var(--pland-border-subtle, #1f2836) !important;
}

html[data-theme='dark'] .rh-log-icon,
body[data-theme='dark'] .rh-log-icon {
    background: var(--pland-section-head-bg, #101620) !important;
    border-color: var(--pland-border-color, #2a3444) !important;
    color: var(--pland-muted-text, #8b96a8) !important;
}

html[data-theme='dark'] .rh-log-name,
body[data-theme='dark'] .rh-log-name {
    color: #d1d5db !important;
}

html[data-theme='dark'] .rh-log-meta,
body[data-theme='dark'] .rh-log-meta {
    color: var(--pland-muted-text, #8b96a8) !important;
}

html[data-theme='dark'] .rh-level-chip-lvl.is-amp,
html[data-theme='dark'] .rh-log-level.is-amp,
html[data-theme='dark'] .rh-matrix-lvl.is-amp,
body[data-theme='dark'] .rh-level-chip-lvl.is-amp,
body[data-theme='dark'] .rh-log-level.is-amp,
body[data-theme='dark'] .rh-matrix-lvl.is-amp {
    color: #ff66ff !important;
}

html[data-theme='dark'] .rh-level-chip-lvl.is-enf,
html[data-theme='dark'] .rh-log-level.is-enf,
html[data-theme='dark'] .rh-matrix-lvl.is-enf,
body[data-theme='dark'] .rh-level-chip-lvl.is-enf,
body[data-theme='dark'] .rh-log-level.is-enf,
body[data-theme='dark'] .rh-matrix-lvl.is-enf {
    color: #68d5ed !important;
}

html[data-theme='dark'] .rh-log-status.is-success,
body[data-theme='dark'] .rh-log-status.is-success {
    background: var(--pland-brand-solid, #5868d8);
    color: #fff;
}

html[data-theme='dark'] .rh-log-status.is-fail,
body[data-theme='dark'] .rh-log-status.is-fail {
    background: #94a3b8;
    color: #fff;
}
