.rep-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rep-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.rep-sub {
    margin: 0;
    font-size: 12.5px;
    color: var(--color-text-secondary, #9db8b0);
}

.rep-mode {
    display: flex;
    gap: 6px;
    padding: 3px;
    border: 1px solid var(--color-border-tertiary);
    border-radius: 10px;
    background: var(--color-background-primary);
}

.rep-mode-btn {
    flex: 1;
    min-width: 0;
    padding: 7px 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-secondary, #9db8b0);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.rep-mode-btn.act {
    background: var(--color-border-primary);
    color: var(--color-text-primary);
}

.rep-range {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rep-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border-tertiary);
    border-radius: 8px;
    background: var(--color-background-primary);
    color: var(--color-text-primary);
    cursor: pointer;
}

.rep-nav:hover:not(:disabled) {
    border-color: var(--color-border-primary);
}

.rep-pill-wrap {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 130px;
}

.rep-pill {
    display: flex;
    align-items: stretch;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 45;
    border: 1px solid var(--color-border-tertiary);
    border-radius: 8px;
    background: var(--color-background-primary);
    overflow: hidden;
}

.rep-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    padding: 7px 8px;
    border: 0;
    background: transparent;
    color: var(--color-text-primary);
    font-size: 13px;
    cursor: pointer;
}

.rep-pill-seg {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rep-pill-x {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    border: 0;
    border-left: 1px solid var(--color-border-tertiary);
    background: transparent;
    color: var(--color-text-secondary, #9db8b0);
    cursor: pointer;
}

.rep-pill-x:hover {
    color: var(--color-text-primary);
}

.rep-pop-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.rep-pop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: max-content;
    min-width: 100%;
    max-width: 330px;
    z-index: 50;
    display: flex;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--color-border-primary);
    border-radius: 10px;
    background: var(--color-background-primary);
}

.rep-pop.up {
    top: auto;
    bottom: calc(100% + 6px);
}

.rep-pop-col {
    flex: 1;
    min-width: 118px;
    max-width: 152px;
}

.rep-pop-h {
    padding: 2px 6px 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--color-text-secondary, #9db8b0);
}

.rep-pop-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 256px;
    overflow-y: auto;
}

.rep-pop-opt {
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-primary);
    font-size: 12.5px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.rep-pop-opt:hover {
    background: var(--color-border-tertiary);
}

.rep-pop-opt.sel {
    background: var(--color-border-primary);
    font-weight: 600;
}

.rep-pop-input {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--color-border-tertiary);
    border-radius: 6px;
    background: var(--color-background-primary);
    color: var(--color-text-primary);
    font-size: 13px;
}

.rep-today-btn,
.rep-prev-btn {
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    background: var(--color-border-primary);
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.rep-err {
    padding: 8px 10px;
    border: 1px solid rgba(244, 42, 65, 0.5);
    border-radius: 8px;
    background: rgba(244, 42, 65, 0.1);
    color: var(--color-text-primary);
    font-size: 13px;
}

.rep-loading {
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-secondary, #9db8b0);
}

.rep-empty {
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-secondary, #9db8b0);
}

.rep-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--color-border-tertiary);
    border-radius: 12px;
    background: var(--color-background-primary);
}

.rep-card-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary, #9db8b0);
}

.rep-scroll {
    overflow-x: auto;
}

.rep-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--color-text-primary);
}

.rep-tbl th {
    padding: 6px 10px 6px 0;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-secondary, #9db8b0);
    border-bottom: 1px solid var(--color-border-tertiary);
    white-space: nowrap;
}

.rep-tbl td {
    padding: 7px 10px 7px 0;
    border-bottom: 1px solid var(--color-border-tertiary);
    white-space: nowrap;
}

.rep-tbl tr:last-child td {
    border-bottom: 0;
}

.rep-tot td {
    font-weight: 700;
    border-top: 1px solid var(--color-border-primary);
}

.rep-actions-row {
    display: flex;
    gap: 8px;
}

.rep-exp-wrap {
    position: relative;
}

.rep-exp-btn {
    position: relative;
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--color-border-tertiary);
    border-radius: 8px;
    background: var(--pomodoro-color);
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.rep-exp-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.rep-exp-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: max-content;
    min-width: 100%;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--color-border-primary);
    border-radius: 10px;
    background: var(--color-background-primary);
}

.rep-exp-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-primary);
    font-size: 12.5px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.rep-exp-item:hover,
.rep-exp-item.hl {
    background: var(--color-border-tertiary);
}

.rep-exp-item svg.rep-exp-item-ico {
    flex-shrink: 0;
}

.rep-exp-item-label {
    flex: 1;
}

.rep-exp-item-hint {
    font-size: 11px;
    color: var(--color-text-secondary, #9db8b0);
}

.tile-ov {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.rep-main .tile {
    text-align: left;
    padding: 12px;
}

.rep-main .tile-ic {
    display: none;
}

.rep-main .tile-lbl {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rep-ov-l {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-secondary, #9db8ae);
}

.rep-ov-v {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text-primary);
}

.rep-dim {
    opacity: 0.5;
    pointer-events: none;
}

.rep-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-border-tertiary);
    border-top-color: var(--color-text-primary);
    border-radius: 50%;
    animation: rep-spin 0.8s linear infinite;
}

@keyframes rep-spin {
    to {
        transform: rotate(360deg);
    }
}

.rep-tbl th:first-child,
.rep-tbl td:first-child {
    position: sticky;
    left: 0;
    background: var(--color-background-primary);
}

.rep-matrix .rep-mx-h {
    text-align: center;
}

.rep-matrix td {
    text-align: center;
}

.rep-matrix td:first-child {
    text-align: left;
}

.rep-mx.l1 {
    background: rgba(64, 145, 120, 0.25);
}

.rep-mx.l2 {
    background: rgba(64, 145, 120, 0.45);
}

.rep-mx.l3 {
    background: rgba(64, 145, 120, 0.65);
}

.rep-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rep-duo {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rep-rail {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rep-rail-label {
    display: none;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--color-text-secondary, #9db8b0);
}

.rep-head {
    display: contents;
}

.rep-head-txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rep-x-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin-left: auto;
    border: 1px solid var(--color-border-tertiary);
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-secondary, #9db8b0);
    cursor: pointer;
}

.rep-x-hint {
    display: none;
    font-size: 11px;
    color: var(--color-text-secondary, #9db8b0);
}

.tbl-open .rep-x-btn svg {
    transform: rotate(180deg);
}

@media (max-width: 959.98px) {
    .rep-body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px 8px;
        align-items: start;
    }

    .rep-rail,
    .rep-main,
    .rep-head {
        display: contents;
    }

    .rep-head-txt {
        grid-area: 1 / 1;
    }

    .rep-actions-row {
        grid-area: 1 / 2;
        display: flex;
        justify-content: flex-end;
    }

    .rep-mode,
    .rep-range,
    .rep-err,
    .rep-loading,
    .rep-cards,
    .rep-empty {
        grid-column: 1 / -1;
    }

    .rep-today-btn,
    .rep-prev-btn {
        flex: 1 1 40%;
    }

    .rep-exp-btn {
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
    }

    .rep-exp-btn > span,
    .rep-exp-btn > svg:last-child {
        display: none;
    }

    .rep-exp-menu {
        left: auto;
        right: 0;
        min-width: 210px;
        max-width: calc(100vw - 24px);
    }

    .rep-card:not(.tbl-open) .c-date,
    .rep-card:not(.tbl-open) .c-sb,
    .rep-card:not(.tbl-open) .c-lb,
    .rep-card:not(.tbl-open) .c-bt,
    .rep-card:not(.tbl-open) .c-tk {
        display: none;
    }

    .rep-card:not(.tbl-open) .rep-scroll {
        overflow-x: hidden;
    }

    .rep-card.tbl-open .rep-scroll {
        overflow-x: auto;
    }

    .rep-x-btn {
        display: inline-flex;
    }

    .rep-card.tbl-open .rep-x-hint {
        display: block;
    }

    .rep-card.mx-fit .rep-scroll {
        overflow-x: visible;
    }

    .rep-card.mx-fit .rep-matrix {
        table-layout: fixed;
        width: 100%;
    }

    .rep-card.mx-fit .rep-matrix th:first-child,
    .rep-card.mx-fit .rep-matrix td:first-child {
        width: 34%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rep-card.mx-fit .rep-matrix th,
    .rep-card.mx-fit .rep-matrix td {
        padding-right: 6px;
        font-size: 12px;
    }
}

@media (min-width: 960px) {
    .rep-body {
        display: grid;
        grid-template-columns: 260px minmax(0, 822px);
        grid-template-rows: auto 1fr;
        gap: 18px;
        align-items: start;
        min-height: 100%;
    }

    .rep-rail {
        grid-column: 1;
        grid-row: 1 / 3;
        position: sticky;
        top: 0;
        height: 100%;
        padding: 16px;
        background: var(--color-background-secondary);
        border-right: 1px solid var(--color-border-tertiary);
        z-index: 10;
    }

    .rep-head-txt {
        grid-column: 2;
        grid-row: 1;
    }

    .rep-main {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        gap: 14px;
        min-width: 0;
    }

    .rep-rail-label {
        display: block;
    }

    .rep-mode {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 0 0 14px;
        border: 0;
        border-bottom: 1px solid var(--color-border-tertiary);
        border-radius: 0;
        background: transparent;
    }

    .rep-mode-btn {
        flex: none;
        padding: 8px 10px;
        text-align: left;
        border: 1px solid transparent;
        border-radius: 8px;
    }

    .rep-mode-btn.act {
        background: var(--color-background-tertiary);
        border-color: var(--color-border-primary);
    }

    .rep-today-btn,
    .rep-prev-btn {
        flex: 1;
    }

    .rep-exp-wrap {
        flex: 1;
    }

    .rep-exp-btn {
        width: 100%;
        justify-content: center;
    }

    .rep-main .tiles {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1120px) {
    .rep-duo {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        align-items: start;
    }
}

@media print {
    body:has(.rep-body) .app-header,
    body:has(.rep-body) .mobile-nav,
    body:has(.rep-body) .app-toast {
        display: none !important;
    }

    .rep-rail,
    .rep-mode,
    .rep-actions-row,
    .rep-exp-wrap,
    .rep-exp-btn,
    .rep-exp-menu,
    .rep-range,
    .rep-x-btn,
    .rep-x-hint,
    .rep-pop-backdrop,
    .rep-pop,
    .rep-spinner,
    .rep-err,
    .rep-dim {
        display: none !important;
    }

    .rep-body,
    .rep-body * {
        color: #1f2328 !important;
    }

    .rep-body {
        display: block;
        gap: 10px;
    }

    .rep-main {
        display: block;
    }

    .rep-scroll {
        overflow: visible;
    }

    .rep-tbl th:first-child,
    .rep-tbl td:first-child {
        position: static;
    }

    .rep-card,
    .tile,
    .rep-tbl tr {
        break-inside: avoid;
    }

    .rep-tbl th,
    .rep-tbl td {
        white-space: normal;
    }
}
