.cdrt-wrap {
    max-width: 1120px;
    margin: 0 auto 40px;
    color: #2d123f;
}

.cdrt-access-banner {
    margin: 18px 0;
    padding: 18px;
    border: 1px solid #d8c4df;
    border-radius: 12px;
    background: #fbf7fc;
}

.cdrt-access-banner h3,
.cdrt-access-banner p {
    margin-top: 0;
}

.cdrt-access-banner p:last-child,
.cdrt-renewal-form {
    margin-bottom: 0;
}

.cdrt-access-active {
    border-left: 5px solid #6b2182;
}

.cdrt-access-expired {
    border-left: 5px solid #a44a3f;
    background: #fff8f6;
}

.cdrt-access-countdown,
.cdrt-access-card-status {
    font-weight: 700;
}

.cdrt-access-card-expired {
    color: #8a3028;
}

.cdrt-is-readonly .cdrt-responsive-table-wrap,
.cdrt-is-readonly .cdrt-reflection-box {
    opacity: .92;
}

.cdrt-is-readonly :disabled {
    cursor: not-allowed;
}

.cdrt-purchase-choice {
    margin: 16px 0;
    padding: 16px;
    border: 1px solid #d8c4df;
    border-radius: 10px;
    background: #fbf7fc;
}

.cdrt-purchase-choice legend {
    padding: 0 6px;
    font-weight: 700;
}

.cdrt-purchase-choice > label {
    display: block;
    margin: 9px 0;
}

.cdrt-renew-instance-select {
    display: block;
    width: 100%;
    margin-top: 6px;
}

.cdrt-choice-renew-button {
    margin-top: 10px;
    border: 0;
    cursor: pointer;
}

.cdrt-choice-error {
    min-height: 1.4em;
    margin: 7px 0 0;
    color: #8a3028;
    font-weight: 700;
}

form.cart.cdrt-renew-mode .single_add_to_cart_button,
form.cart.cdrt-renew-mode .quantity {
    display: none !important;
}

.cdrt-renewal-form .cdrt-button {
    margin-top: 8px;
}

.cdrt-wrap * {
    box-sizing: border-box;
}

.cdrt-list-wrap h2,
.cdrt-tracker-wrap h2 {
    margin: 0 0 10px;
    color: #2d123f;
}

.cdrt-muted {
    color: #6d6074;
    font-size: 14px;
    margin: 4px 0 10px;
}

.cdrt-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.cdrt-card,
.cdrt-meta-box,
.cdrt-instructions-box,
.cdrt-reflection-box,
.cdrt-summary-box {
    background: #ffffff;
    border: 1px solid #eadcf0;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(45,18,63,0.08);
}

.cdrt-card {
    padding: 22px;
}

.cdrt-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #2d123f;
}

.cdrt-button,
.cdrt-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 700;
    line-height: 1.2;
}

.cdrt-button {
    background: #6b2182;
    color: #ffffff !important;
}

.cdrt-button:hover {
    background: #4f1861;
    color: #ffffff !important;
}

.cdrt-secondary-button {
    background: #f5eafa;
    color: #6b2182 !important;
    border: 1px solid #eadcf0;
}

.cdrt-secondary-button:hover {
    color: #4f1861 !important;
    background: #efe0f6;
}

.cdrt-tracker-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.cdrt-meta-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cdrt-instructions-box {
    padding: 20px 22px;
    margin: 0 0 24px;
}

.cdrt-instructions-box h3 {
    margin: 0 0 10px;
    font-size: 20px;
}

.cdrt-instructions-content > :first-child {
    margin-top: 0;
}

.cdrt-instructions-content > :last-child {
    margin-bottom: 0;
}

.cdrt-meta-input,
.cdrt-text-input,
.cdrt-textarea,
.cdrt-tracker-table select {
    width: 100%;
    max-width: 100%;
    border: 1px solid #d9c8e2;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 14px;
    background: #ffffff;
    color: #2d123f;
}

.cdrt-meta-input {
    width: auto;
}

.cdrt-save-status {
    min-width: 90px;
    font-size: 13px;
    color: #6b2182;
}

.cdrt-responsive-table-wrap {
    width: 100%;
    overflow-x: auto;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(45,18,63,0.08);
    border: 1px solid #eadcf0;
}

.cdrt-tracker-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
    background: #ffffff;
}

.cdrt-tracker-table th,
.cdrt-tracker-table td {
    border: 1px solid #eadcf0;
    padding: 10px;
    vertical-align: middle;
    text-align: center;
}

.cdrt-tracker-table thead th {
    background: #f5eafa;
    color: #2d123f;
    font-weight: 800;
    position: sticky;
    top: 0;
    z-index: 1;
}

.cdrt-day-col,
.cdrt-day-cell {
    width: 58px;
    min-width: 58px;
}

.cdrt-day-cell {
    background: #fcf8ff;
    font-weight: 800;
    color: #2d123f;
}

.cdrt-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
}

.cdrt-checkbox-wrap input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cdrt-checkbox-wrap span {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 2px solid #c9aacd;
    background: #ffffff;
    display: inline-block;
    position: relative;
}

.cdrt-checkbox-wrap input:checked + span {
    background: #6b2182;
    border-color: #6b2182;
}

.cdrt-checkbox-wrap input:checked + span::after {
    content: "✓";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 900;
    font-size: 18px;
}

.cdrt-segmented {
    display: inline-flex;
    border: 1px solid #d9c8e2;
    border-radius: 999px;
    padding: 2px;
    background: #faf5fc;
    gap: 2px;
}

.cdrt-segment-button {
    border: 0;
    background: transparent;
    color: #2d123f;
    font-weight: 700;
    border-radius: 999px;
    padding: 7px 11px;
    cursor: pointer;
}

.cdrt-segment-button.is-active {
    background: #6b2182;
    color: #ffffff;
}

.cdrt-multi-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    text-align: left;
}

.cdrt-visual-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.cdrt-visual-option {
    width: 42px;
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid #d9c8e2;
    background: #ffffff;
    cursor: pointer;
    padding: 4px;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.cdrt-visual-option:hover {
    transform: translateY(-1px);
    border-color: #6b2182;
}

.cdrt-visual-option.is-active {
    border-color: #6b2182;
    box-shadow: 0 0 0 3px rgba(107,33,130,0.16);
    background: #f5eafa;
}

.cdrt-visual-option img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.cdrt-emoji {
    font-size: 24px;
    line-height: 1;
}

.cdrt-reflection-box,
.cdrt-summary-box {
    padding: 22px;
    margin-top: 24px;
}

.cdrt-reflection-box h3,
.cdrt-summary-box h3 {
    margin-top: 0;
}

.cdrt-reflection-field {
    margin-bottom: 16px;
}

.cdrt-reflection-field label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
}

.cdrt-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.cdrt-summary-card {
    background: #fcf8ff;
    border: 1px solid #eadcf0;
    border-radius: 12px;
    padding: 14px;
}

.cdrt-summary-card h4 {
    margin: 0 0 10px;
    font-size: 15px;
}

.cdrt-summary-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cdrt-summary-card li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid #eadcf0;
}

.cdrt-summary-card li:last-child {
    border-bottom: 0;
}

@media (max-width: 900px) {
    .cdrt-card-grid,
    .cdrt-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .cdrt-card-grid,
    .cdrt-summary-grid {
        grid-template-columns: 1fr;
    }

    .cdrt-tracker-header {
        display: block;
    }

    .cdrt-secondary-button {
        margin-top: 12px;
        width: 100%;
    }

    .cdrt-responsive-table-wrap {
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .cdrt-tracker-table {
        min-width: 0;
        border: 0;
        display: block;
        background: transparent;
    }

    .cdrt-tracker-table thead {
        display: none;
    }

    .cdrt-tracker-table tbody,
    .cdrt-tracker-table tr,
    .cdrt-tracker-table th,
    .cdrt-tracker-table td {
        display: block;
        width: 100%;
    }

    .cdrt-tracker-table tr {
        margin-bottom: 16px;
        background: #ffffff;
        border: 1px solid #eadcf0;
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 4px 18px rgba(45,18,63,0.08);
    }

    .cdrt-tracker-table th,
    .cdrt-tracker-table td {
        border: 0;
        border-bottom: 1px solid #eadcf0;
        text-align: left;
        padding: 12px 14px;
    }

    .cdrt-tracker-table td:last-child {
        border-bottom: 0;
    }

    .cdrt-day-cell {
        background: #6b2182;
        color: #ffffff;
        font-size: 16px;
    }

    .cdrt-tracker-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 800;
        color: #2d123f;
        margin-bottom: 8px;
    }

    .cdrt-visual-options,
    .cdrt-segmented {
        justify-content: flex-start;
    }

    .cdrt-visual-option {
        width: 48px;
        height: 48px;
    }

    .cdrt-emoji {
        font-size: 27px;
    }
}

.cdrt-portal-card {
    max-width: 760px;
    margin: 24px auto 28px;
    padding: 22px;
    display: block;
    background: #ffffff;
    border: 1px solid #eadcf0;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(45,18,63,0.08);
    text-align: left;
}

.cdrt-portal-card h3 {
    margin: 0 0 8px;
    color: #2d123f;
    font-size: 22px;
}

.cdrt-portal-card p {
    margin: 0 0 8px;
}

.cdrt-portal-tracker-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.cdrt-portal-tracker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px;
    border: 1px solid #eadcf0;
    border-radius: 10px;
    background: #fcf8ff;
}

.cdrt-portal-tracker-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.cdrt-portal-tracker-row .cdrt-button {
    flex: 0 0 auto;
}

@media (max-width: 767px) {
    .cdrt-portal-card {
        display: block;
        padding: 18px;
        text-align: center;
    }

    .cdrt-portal-tracker-row {
        display: block;
        text-align: left;
    }

    .cdrt-portal-tracker-name {
        display: block;
        margin-bottom: 12px;
    }

    .cdrt-portal-tracker-row .cdrt-button {
        width: 100%;
    }
}

.cdrt-actions-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid #eadcf0;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(45,18,63,0.08);
}

.cdrt-print-range-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.cdrt-print-range-form label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #2d123f;
}

.cdrt-print-range-form input[type="month"] {
    border: 1px solid #d9c8e2;
    border-radius: 8px;
    padding: 8px 10px;
    color: #2d123f;
    background: #ffffff;
}

.cdrt-day-label {
    display: inline-block;
    white-space: nowrap;
}

@media (min-width: 701px) {
    .cdrt-day-label {
        font-size: 0;
    }
    .cdrt-day-label::after {
        content: attr(data-day-number);
        font-size: 16px;
    }
}

@media (max-width: 700px) {
    .cdrt-actions-box,
    .cdrt-print-range-form {
        display: block;
    }

    .cdrt-actions-box .cdrt-button,
    .cdrt-actions-box .cdrt-secondary-button,
    .cdrt-print-range-form button {
        width: 100%;
        margin: 6px 0;
    }

    .cdrt-print-range-form label {
        display: block;
        margin: 10px 0;
    }

    .cdrt-print-range-form input[type="month"] {
        width: 100%;
        margin-top: 6px;
    }

    .cdrt-day-cell {
        display: block !important;
        background: #6b2182 !important;
        color: #ffffff !important;
        font-size: 18px !important;
        font-weight: 900 !important;
        text-align: left !important;
        padding: 13px 16px !important;
    }

    .cdrt-day-label {
        color: #ffffff !important;
    }
}

.cdrt-summary-actions {
    margin-top: 18px;
    text-align: right;
}

.cdrt-summary-actions .cdrt-secondary-button {
    margin-top: 0;
}

@media (max-width: 700px) {
    .cdrt-summary-actions {
        text-align: left;
    }

    .cdrt-summary-actions .cdrt-secondary-button {
        width: 100%;
    }
}
