/*
 * Project shapes — iOS 26 skin.
 *
 * The new-project wizard, the shape settings, the gate modal and the shape
 * panels of projects and tasks. Built only on the platform's --ios26-* tokens
 * (app.all.css), which already carry their light and dark values, so nothing
 * here is theme-specific. Scoped to .nz-shapes26 (plus the two badges that sit
 * in legacy markup). Tabs stay the standard .nav-tabs (ios26-tabs.js).
 */

.nz-shapes26 {
    --nz-s26-tint: var(--ios26-accent);
    --nz-s26-tint-soft: var(--ios26-accent-soft);
    color: var(--ios26-text);
}

/* the shape modals scroll natively (shape-gates.js keeps perfect-scrollbar's wheel
   handler out of them): lift its overflow lock and hide its rails */
.modal-body.nz-shapes26.ps,
.modal-body.nz-shapes26 {
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-body.nz-shapes26 > .ps__rail-x,
.modal-body.nz-shapes26 > .ps__rail-y {
    display: none !important;
}

/* ------------------------------------------------------------ titles */

.nz-shapes26 .nz-s26-hero {
    padding: 4px 0 14px;
}

.nz-shapes26 .nz-s26-hero h3,
.nz-shapes26 .nz-s26-hero h4 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 4px;
    color: var(--ios26-text);
}

.nz-shapes26 .nz-s26-hero p,
.nz-shapes26 .nz-s26-help {
    color: var(--ios26-muted);
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.nz-shapes26 .nz-s26-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ios26-muted);
    margin: 18px 4px 8px;
}

/* ------------------------------------------------------------ choice cards */

.nz-shapes26 .nz-s26-choices {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin: 6px 0 4px;
}

.nz-shapes26 .nz-s26-choice {
    --nz-s26-tint: var(--ios26-accent);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    min-height: 118px;
    border-radius: var(--ios26-radius-lg);
    background: var(--ios26-surface);
    border: 1px solid var(--ios26-hairline);
    box-shadow: var(--ios26-shadow-1), var(--ios26-inset);
    backdrop-filter: var(--ios26-blur-sm);
    -webkit-backdrop-filter: var(--ios26-blur-sm);
    color: var(--ios26-text);
    text-decoration: none;
    cursor: pointer;
    transition: transform .25s var(--ios26-spring), box-shadow .2s var(--ios26-ease), border-color .2s var(--ios26-ease);
}

.nz-shapes26 .nz-s26-choice:hover,
.nz-shapes26 .nz-s26-choice:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--ios26-shadow-2), var(--ios26-inset);
    border-color: color-mix(in srgb, var(--nz-s26-tint) 45%, var(--ios26-hairline));
    color: var(--ios26-text);
    outline: none;
}

.nz-shapes26 .nz-s26-choice.is-selected {
    border-color: var(--nz-s26-tint);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nz-s26-tint) 28%, transparent), var(--ios26-shadow-1);
}

.nz-shapes26 .nz-s26-choice.is-selected::after {
    content: "\2713";
    position: absolute;
    top: 12px;
    right: 14px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--nz-s26-tint);
    color: #fff;
    font-size: 13px;
    line-height: 22px;
    text-align: center;
}

.nz-shapes26 .nz-s26-choice-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--nz-s26-tint);
    background: color-mix(in srgb, var(--nz-s26-tint) 15%, transparent);
    margin-bottom: 2px;
}

.nz-shapes26 .nz-s26-choice-title {
    font-weight: 650;
    font-size: 15px;
}

.nz-shapes26 .nz-s26-choice-about {
    color: var(--ios26-muted);
    font-size: 13px;
    line-height: 1.4;
}

.nz-shapes26 .nz-s26-choice-meta {
    margin-top: auto;
    font-size: 12px;
    color: var(--ios26-muted);
}

.nz-shapes26 .nz-s26-choice.is-quiet {
    background: var(--ios26-surface-soft);
    box-shadow: none;
    border-style: dashed;
}

/* ------------------------------------------------------------ grouped rows (iOS settings) */

.nz-shapes26 .nz-s26-group {
    border-radius: var(--ios26-radius-lg);
    background: var(--ios26-surface);
    border: 1px solid var(--ios26-hairline);
    box-shadow: var(--ios26-inset);
    overflow: hidden;
    margin-bottom: 14px;
}

.nz-shapes26 .nz-s26-group > .nz-s26-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--ios26-hairline);
}

.nz-shapes26 .nz-s26-group > .nz-s26-row:first-child {
    border-top: 0;
}

.nz-shapes26 .nz-s26-row-label {
    flex: 0 0 38%;
    color: var(--ios26-muted);
    font-size: 13px;
    padding-top: 1px;
}

.nz-shapes26 .nz-s26-row-value {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.nz-shapes26 .nz-s26-group .form-group {
    margin: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--ios26-hairline);
}

.nz-shapes26 .nz-s26-group .form-group:first-child {
    border-top: 0;
}

/* ------------------------------------------------------------ callouts */

.nz-shapes26 .nz-s26-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--ios26-radius);
    background: var(--nz-s26-tint-soft);
    color: var(--ios26-text);
    font-size: 13.5px;
    line-height: 1.45;
    margin: 10px 0;
}

.nz-shapes26 .nz-s26-note.is-warning {
    background: color-mix(in srgb, #f59e0b 16%, transparent);
}

.nz-shapes26 .nz-s26-note.is-success {
    background: color-mix(in srgb, #10b981 15%, transparent);
}

.nz-shapes26 .nz-s26-note i {
    margin-top: 2px;
}

/* ------------------------------------------------------------ the "describe it" panel */

.nz-shapes26 .nz-s26-ai textarea {
    min-height: 110px;
    border-radius: var(--ios26-radius);
    font-size: 15px;
}

.nz-shapes26 .nz-s26-ai-result {
    border-radius: var(--ios26-radius-lg);
    padding: 16px;
    margin-top: 14px;
    background: radial-gradient(120% 140% at 10% 0%, var(--nz-s26-tint-soft), transparent 60%), var(--ios26-surface);
    border: 1px solid var(--ios26-hairline);
    box-shadow: var(--ios26-shadow-1), var(--ios26-inset);
}

/* ------------------------------------------------------------ the timeline */

.nz-shapes26 .nz-s26-timeline {
    position: relative;
    border-radius: var(--ios26-radius-lg);
    background: var(--ios26-surface);
    border: 1px solid var(--ios26-hairline);
    padding: 14px 16px 10px;
}

.nz-shapes26 .nz-s26-tl-row {
    display: grid;
    grid-template-columns: minmax(120px, 30%) 1fr;
    gap: 12px;
    align-items: center;
    padding: 7px 0;
}

.nz-shapes26 .nz-s26-tl-name {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.25;
}

.nz-shapes26 .nz-s26-tl-name small {
    display: block;
    font-weight: 400;
    color: var(--ios26-muted);
    font-size: 12px;
}

.nz-shapes26 .nz-s26-tl-track {
    position: relative;
    height: 26px;
    border-radius: var(--ios26-pill);
    background: var(--ios26-fill);
}

.nz-shapes26 .nz-s26-tl-bar {
    position: absolute;
    top: 3px;
    bottom: 3px;
    min-width: 8px;
    border-radius: var(--ios26-pill);
    background: linear-gradient(90deg, var(--nz-s26-tint), color-mix(in srgb, var(--nz-s26-tint) 70%, #fff));
    box-shadow: 0 1px 4px color-mix(in srgb, var(--nz-s26-tint) 35%, transparent);
}

.nz-shapes26 .nz-s26-tl-deadline {
    position: absolute;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #ef4444;
    border-radius: 2px;
    pointer-events: none;
}

.nz-shapes26 .nz-s26-tl-deadline::before {
    content: attr(data-label);
    position: absolute;
    top: -2px;
    left: 6px;
    font-size: 11px;
    color: #ef4444;
    white-space: nowrap;
}

/* the label sits once, above the first row; near the right edge it flips to the left of the line */
.nz-shapes26 .nz-s26-tl-deadline:not([data-label])::before {
    content: none;
}

.nz-shapes26 .nz-s26-tl-deadline::before {
    top: -18px;
}

.nz-shapes26 .nz-s26-tl-deadline.is-right::before {
    left: auto;
    right: 6px;
}

.nz-shapes26 .nz-s26-tl-row:first-child {
    padding-top: 18px;
}

.nz-shapes26 .nz-s26-tl-axis {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ios26-muted);
    margin: 6px 0 0 calc(min(30%, 9999px) + 12px);
}

/* ------------------------------------------------------------ review */

.nz-shapes26 .nz-s26-summary {
    font-size: 15px;
    line-height: 1.6;
    padding: 16px 18px;
    border-radius: var(--ios26-radius-lg);
    background: var(--ios26-surface);
    border: 1px solid var(--ios26-hairline);
    box-shadow: var(--ios26-inset);
}

.nz-shapes26 .nz-s26-summary strong {
    font-weight: 650;
}

.nz-shapes26 .nz-s26-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.nz-shapes26 .nz-s26-stat {
    flex: 1 1 110px;
    padding: 12px 14px;
    border-radius: var(--ios26-radius);
    background: var(--nz-s26-tint-soft);
    text-align: center;
}

.nz-shapes26 .nz-s26-stat b {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--nz-s26-tint);
    letter-spacing: -0.02em;
}

.nz-shapes26 .nz-s26-stat span {
    font-size: 12px;
    color: var(--ios26-muted);
}

/* ------------------------------------------------------------ gate modal */

.nz-shapes26 .nz-s26-missing {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}

.nz-shapes26 .nz-s26-missing li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 9px 12px;
    border-radius: var(--ios26-radius-sm);
    background: var(--ios26-fill);
    margin-bottom: 6px;
}

.nz-shapes26 .nz-s26-missing li i {
    color: #f59e0b;
}

/* ------------------------------------------------------------ settings pages */

.nz-shapes26.card > .card-header,
.nz-shapes26 .nz-s26-page-header {
    border-bottom: 1px solid var(--ios26-hairline);
}

.nz-shapes26 .nz-s26-page-header h4 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nz-shapes26 .nz-s26-shape-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    vertical-align: middle;
    margin-right: 10px;
    color: var(--nz-s26-tint);
    background: color-mix(in srgb, var(--nz-s26-tint) 15%, transparent);
}

.nz-shapes26 .shape-field-row.card {
    border-radius: var(--ios26-radius);
    background: var(--ios26-surface);
    border: 1px solid var(--ios26-hairline);
    box-shadow: var(--ios26-inset);
}

/* ------------------------------------------------------------ badges in legacy markup */

.project-shape-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
    font-size: 12px !important;
    font-weight: 600;
    padding: 5px 10px !important;
    border-radius: var(--ios26-pill) !important;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

.nz-shapes26 .nz-s26-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--ios26-pill);
    background: var(--ios26-fill);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ios26-text);
}

/* ------------------------------------------------------------ phones */

@media (max-width: 767px) {
    .nz-shapes26 .nz-s26-choices {
        grid-template-columns: 1fr;
    }

    .nz-shapes26 .nz-s26-tl-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .nz-shapes26 .nz-s26-tl-axis {
        margin-left: 0;
    }

    .nz-shapes26 .nz-s26-row-label {
        flex-basis: 45%;
    }
}
