/* Kalkulator ciąży — layout only */

.pbn-tool-kalkulator-ciazy .pbn-tool-ui {
    max-width: 640px;
    margin: 0 auto;
}

/* Context banner */
.kc-context {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color, #e91e63);
    border-radius: var(--radius-sm, 4px);
    background: rgba(233, 30, 99, 0.05);
}

.kc-context-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--primary-color, #e91e63);
    color: #fff;
    font-weight: 700;
    font-size: 1.1em;
}

.kc-context-text {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.4;
}

/* Form */
.kc-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.kc-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.kc-mode-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    font-size: 0.9em;
    transition: border-color 0.15s;
}

.kc-mode-option:has(input:checked) {
    border-color: var(--primary-color, #e91e63);
    background: rgba(233, 30, 99, 0.05);
}

.kc-mode-option input {
    margin: 0;
}

.kc-field {
    display: block;
}

.kc-label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.9em;
}

.kc-form input[type="date"] {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color, #ccc);
    border-radius: var(--radius-sm, 4px);
    background: transparent;
    color: inherit;
    font: inherit;
    box-sizing: border-box;
}

.kc-submit {
    width: 100%;
    padding: 0.75rem;
    border: 0;
    border-radius: var(--radius-sm, 4px);
    background: var(--primary-color, #e91e63);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.kc-submit:hover {
    opacity: 0.85;
}

.kc-error {
    margin: 0;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm, 4px);
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    font-size: 0.9em;
}

.kc-error[hidden] {
    display: none;
}

/* Results */
.kc-results {
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color, #eee);
    border-radius: var(--radius-md, 8px);
    background: #fff;
}

.kc-results[hidden] {
    display: none;
}

.kc-results-main {
    text-align: center;
    margin-bottom: 1.5rem;
}

.kc-week-display {
    margin-bottom: 1rem;
}

.kc-week-number {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary-color, #e91e63);
}

.kc-week-label {
    font-size: 0.95em;
    opacity: 0.7;
}

.kc-progress {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.kc-progress-bar {
    height: 100%;
    background: var(--primary-color, #e91e63);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0;
}

.kc-gestational {
    margin: 0;
    font-size: 0.9em;
    opacity: 0.7;
}

.kc-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.kc-detail {
    text-align: center;
}

.kc-detail-label {
    display: block;
    font-size: 0.8em;
    opacity: 0.6;
    margin-bottom: 0.2rem;
}

.kc-detail-value {
    display: block;
    font-weight: 600;
    font-size: 1.05em;
}

/* Week grid navigation */
.kc-weeks-nav {
    margin-bottom: 2rem;
}

.kc-nav-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.kc-week-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.kc-week-link {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 1px solid var(--border-color, #ddd);
    border-radius: var(--radius-sm, 4px);
    text-decoration: none;
    color: inherit;
    font-size: 0.85em;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
}

.kc-week-link:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--primary-color, #e91e63);
}

.kc-week-link[aria-current="page"],
.kc-week-link--active {
    background: var(--primary-color, #e91e63);
    border-color: var(--primary-color, #e91e63);
    color: #fff;
}

/* Trimester nav */
.kc-trimester-nav {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.kc-trimester-link {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: var(--radius-sm, 4px);
    text-align: center;
    text-decoration: none;
    color: inherit;
    font-size: 0.9em;
    font-weight: 500;
    transition: border-color 0.15s, background 0.15s;
}

.kc-trimester-link:hover {
    border-color: var(--primary-color, #e91e63);
    background: rgba(233, 30, 99, 0.04);
}

.kc-trimester-link[aria-current="page"] {
    border-color: var(--primary-color, #e91e63);
    background: rgba(233, 30, 99, 0.08);
    font-weight: 700;
}

/* Responsive */
@media (max-width: 600px) {
    .kc-week-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .kc-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .kc-mode {
        flex-direction: column;
    }

    .kc-trimester-nav {
        flex-direction: column;
    }

    .kc-trimester-link {
        min-width: 0;
    }
}
