/*
 * Community Cat Colony Multiplication Table
 * Layout-only. Fonts, colors, and element styles inherited from theme.
 */

/* ── Wrapper ─────────────────────────────────────────────── */
.ccct-wrapper {
    width: 100%;
    max-width: 100%;
}

.ccct-wrapper *,
.ccct-wrapper *::before,
.ccct-wrapper *::after {
    box-sizing: border-box;
}

.ccct-instructions {
    margin-bottom: 1.5em;
}

/* ── Primary inputs — single column stack ────────────────── */
.ccct-primary-inputs {
    margin-bottom: 1.5em;
}

/* ── Fields ──────────────────────────────────────────────── */
.ccct-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0.75em;
}

.ccct-field label {
    font-weight: 600;
}

.ccct-field input[type="text"],
.ccct-field input[type="number"],
.ccct-field input[type="email"] {
    width: 100%;
    min-width: 0;
}

.ccct-desc {
    font-size: 0.8em;
    opacity: 0.7;
    margin-bottom: 2px;
}

/* ── Percentage wrapper ──────────────────────────────────── */
.ccct-pct-wrap {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px;
}

.ccct-pct-wrap input[type="number"] {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0;
    max-width: calc(100% - 2em);
}

.ccct-pct-label {
    font-weight: 600;
    flex-shrink: 0 !important;
    width: auto !important;
}

/* ── Variables accordion ─────────────────────────────────── */
.ccct-variables {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1.5em;
}

.ccct-variables summary {
    cursor: pointer;
    padding: 0.75em 1em;
    font-weight: 600;
    list-style: none;
    user-select: none;
}

.ccct-variables summary::-webkit-details-marker { display: none; }
.ccct-variables summary::before { content: '\25b6\00a0'; font-size: 0.75em; }
.ccct-variables[open] summary::before { content: '\25bc\00a0'; }

.ccct-hint {
    font-weight: 400;
    font-size: 0.85em;
    opacity: 0.7;
}

.ccct-variables-list {
    padding: 1em 1em 1.25em;
    border-top: 1px solid #eee;
}

.ccct-var-group {
    margin-bottom: 1em;
}

.ccct-var-group h3 {
    margin: 0 0 0.75em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #eee;
    font-size: 1em;
}

/* ── Results heading ─────────────────────────────────────── */
.ccct-results h2 {
    font-size: 1.4em;
    margin-bottom: 0.4em;
}

.ccct-table-note {
    font-size: 0.8em;
    opacity: 0.7;
    margin-bottom: 0.75em;
}

/* ── Scrollable table wrapper ────────────────────────────── */
.ccct-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.75em;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ── Table ───────────────────────────────────────────────── */
.ccct-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    font-size: 0.875em;
}

.ccct-table thead th {
    padding: 0.6em 0.75em;
    text-align: center;
    font-weight: 700;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
}

.ccct-table thead th:first-child {
    text-align: left;
}

.ccct-table tbody tr:nth-child(even) {
    background: rgba(0,0,0,0.03);
}

.ccct-table tbody tr.ccct-year-zero {
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.ccct-table tbody th,
.ccct-table tbody td {
    padding: 0.5em 0.75em;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.ccct-table tbody th {
    text-align: left;
    font-weight: 600;
}

.ccct-table .ccct-total-col {
    font-weight: 700;
}

.ccct-disclaimer {
    font-size: 0.9em;
    font-style: italic;
    opacity: 0.75;
    margin-top: 0.5em;
}

/* ── Save section ────────────────────────────────────────── */
.ccct-save-section {
    border-top: 1px solid #ddd;
    padding-top: 1.25em;
    margin-top: 0.5em;
}

.ccct-save-option {
    margin-bottom: 1.5em;
}

.ccct-save-option:first-of-type {
    padding-bottom: 1.5em;
    border-bottom: 1px solid #eee;
}

.ccct-save-option p {
    margin: 0 0 0.6em;
    font-size: 0.9em;
}

.ccct-email-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5em;
}

.ccct-email-row input[type="email"] {
    width: 100%;
    min-width: 0;
}

.ccct-email-status {
    margin-top: 0.25em;
    font-size: 0.9em;
    min-height: 1.4em;
}

.ccct-email-status.ccct-success { color: green; }
.ccct-email-status.ccct-error   { color: #c0392b; }
