/* Pagina nuova: estrazioni a sinistra e cerchio ciclometrico a destra. */
.ciclo-page {
    background: #f8fafc;
}

.ciclo-wide-container {
    max-width: 1760px;
}

.ciclo-page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.25rem;
}

.ciclo-page-head h1 {
    font-size: clamp(1.7rem, 2.8vw, 2.65rem);
    line-height: 1.1;
    margin-bottom: .55rem;
    color: #0f172a;
}

.ciclo-page-head p {
    max-width: 900px;
    color: #475569;
}

.ciclo-help-simple,
.ciclo-selection-guide,
.ciclo-year-box,
.ciclo-tool-card,
.ciclo-draw-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.ciclo-help-simple {
    padding: 1rem;
    color: #334155;
}

.ciclo-workspace {
    display: grid;
    grid-template-columns: minmax(520px, 1.08fr) minmax(520px, .92fr);
    gap: 1.25rem;
    align-items: start;
}

.ciclo-left-panel,
.ciclo-right-panel {
    min-width: 0;
}

.ciclo-right-panel {
    position: sticky;
    top: 105px;
}

.ciclo-year-box,
.ciclo-selection-guide {
    padding: 1rem;
    margin-bottom: 1rem;
}

.ciclo-year-box h2,
.ciclo-selection-guide h2 {
    font-size: 1.05rem;
    margin-bottom: .45rem;
}

.ciclo-year-box p,
.ciclo-selection-guide li {
    color: #475569;
    font-size: .94rem;
}

.ciclo-selection-guide ul {
    margin: .35rem 0 0 1.1rem;
}

.ciclo-year-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: .5rem;
    max-height: 175px;
    overflow: auto;
    padding-right: .15rem;
}

.ciclo-year-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    padding: .45rem .7rem;
    text-decoration: none;
    color: #1e3a8a;
    font-weight: 800;
    background: #ffffff;
}

.ciclo-year-link.active {
    background: #1e3a8a;
    color: #ffffff;
    border-color: #1e3a8a;
}

.ciclo-year-link small {
    font-weight: 900;
}

.ciclo-draw-card {
    overflow: hidden;
    margin-bottom: 1rem;
}

.ciclo-draw-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: .95rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.ciclo-draw-head h2 {
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    margin: .1rem 0 0;
    color: #0f172a;
}

.ciclo-small-action {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 999px;
    padding: .45rem .7rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.ciclo-table-wrap {
    overflow: auto;
}

.ciclo-draw-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 620px;
}

.ciclo-draw-table th,
.ciclo-draw-table td {
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
    padding: .55rem .45rem;
}

.ciclo-draw-table thead th {
    background: #1e3a8a;
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.ciclo-draw-table thead th:first-child {
    background: #f8fafc;
    color: #0f172a;
    text-align: left;
}

.ciclo-draw-table tbody th {
    background: #f8fafc;
    text-align: left;
    min-width: 150px;
}

.ciclo-col-btn,
.ciclo-row-btn,
.ciclo-number-btn {
    font: inherit;
    cursor: pointer;
}

.ciclo-col-btn {
    border: 0;
    background: transparent;
    color: inherit;
    font-weight: 900;
    width: 100%;
    padding: .25rem;
}

.ciclo-row-btn {
    border: 0;
    background: transparent;
    color: #0f172a;
    font-weight: 900;
    text-align: left;
    width: 100%;
    padding: .2rem;
}

.ciclo-number-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 900;
}

.ciclo-number-btn:hover,
.ciclo-number-btn.active {
    background: #f59e0b;
    border-color: #f97316;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
}

.ciclo-number-empty {
    color: #94a3b8;
}

.ciclo-tool-card {
    padding: 1rem;
}

.ciclo-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

.ciclo-main-tool {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
    align-items: start;
}

.ciclo-canvas-shell {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.25rem;
    border-radius: 8px;
    min-width: 0;
}

#cicloCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: #ffffff;
    border-radius: 8px;
}

.ciclo-side-info {
    display: grid;
    gap: 1rem;
}

.ciclo-suggestions {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.ciclo-suggestions h3 {
    margin: 0 0 .45rem;
    color: #0f172a;
}

.ciclo-suggestion-list,
.ciclo-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .55rem;
}

.ciclo-chip,
.ciclo-suggestion-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: .42rem .65rem;
    font-weight: 900;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.ciclo-suggestion-chip {
    border-color: #86efac;
    background: #ecfdf5;
    color: #166534;
    cursor: pointer;
}

.ciclo-next {
    border-left: 4px solid #16a34a;
    padding: .55rem .75rem;
    background: #f0fdf4;
    border-radius: 8px;
    margin-top: .7rem;
}

.ciclo-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.ciclo-actions .btn {
    width: 100%;
    justify-content: center;
}

.distanze-list {
    margin: .65rem 0 0 1rem;
    color: #334155;
}

.distanze-list li {
    margin-bottom: .25rem;
}

@media (max-width: 1250px) {
    .ciclo-workspace {
        grid-template-columns: 1fr;
    }

    .ciclo-right-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .ciclo-page-head,
    .ciclo-main-tool {
        grid-template-columns: 1fr;
    }

    .ciclo-page-head {
        align-items: start;
    }

    .ciclo-year-list {
        max-height: none;
    }

    .ciclo-canvas-shell {
        padding: .65rem;
    }
}

@media (max-width: 560px) {
    .ciclo-page {
        padding-top: 2rem;
    }

    .ciclo-draw-head {
        display: block;
    }

    .ciclo-small-action {
        margin-top: .65rem;
        width: 100%;
    }

    .ciclo-draw-table {
        min-width: 540px;
    }

    .ciclo-number-btn {
        min-width: 2rem;
        height: 2rem;
        font-size: .9rem;
    }

    .ciclo-actions {
        grid-template-columns: 1fr;
    }
}
