/* tools/print-sizes.css
   Photo print sizes + DPI calculator: the photo card (the shared
   .tool-settings look) beside a summary tile, the size table across the
   width, then the calculator. Verdict colours: green, blue, amber, red,
   each as a quiet tint on the dark ground. */

.tool-content.ps-page {
    grid-template-rows: auto;
    --ps-excellent: #4ade80;
    --ps-good: #7cc4ff;
    --ps-fair: #fbbf24;
    --ps-poor: #f87171;
}

.ps-page .tool-settings {
    max-width: none;
    margin: 0;
}

.ps-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

.ps-page .settings-reset[hidden] {
    display: none;
}

/* Drop tile: the album's add tile */
.ps-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 150px;
    padding: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ps-drop:hover,
.ps-drop.is-over {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.ps-drop:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.ps-drop-plus {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #1D1B20;
    display: grid;
    place-items: center;
    font-size: 26px;
    line-height: 1;
    font-weight: 400;
    margin-bottom: 4px;
}

.ps-drop-text {
    font-size: 0.98rem;
    color: #fff;
}

.ps-drop-sub {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
}

.ps-file-name {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    overflow-wrap: anywhere;
}

.ps-file-name:empty {
    display: none;
}

.ps-or {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 12px;
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.ps-or::before,
.ps-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.ps-px-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.ps-px-row .ps-field {
    flex: 1;
    min-width: 0;
}

.ps-times {
    padding-bottom: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.ps-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ps-field > span,
.ps-field > label {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.ps-page input[type="number"],
.ps-page .ps-unit-row select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}

.ps-page input[type="number"]::-webkit-outer-spin-button,
.ps-page input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ps-page input[type="number"]::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.ps-page input[type="number"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.09);
}

.ps-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ps-presets button,
.ps-filter button,
.ps-solve button {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 7px 13px;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ps-presets button:hover,
.ps-filter button:hover,
.ps-solve button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.45);
}

.ps-filter button.is-active,
.ps-solve button.is-active {
    background: rgba(255, 255, 255, 0.95);
    color: #1D1B20;
    border-color: transparent;
    font-weight: 600;
}

/* Summary tile */
.ps-summary {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--tile-fill);
    border: 1px solid var(--tile-border);
    border-radius: var(--tile-radius);
    padding: 22px 20px 18px;
    box-sizing: border-box;
    min-width: 0;
}

.ps-example {
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.ps-example[hidden] {
    display: none;
}

.ps-summary-dims {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.ps-summary-sub {
    margin: 4px 0 18px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.6);
}

.ps-max {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: auto;
}

.ps-max-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-top: 3px solid var(--ps-c, #fff);
    min-width: 0;
}

.ps-max-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
}

.ps-max-size {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.ps-max-cm {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
}

.ps-summary-note {
    margin: 12px 0 0;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.5);
}

.ps-summary.is-example .ps-summary-dims,
.ps-summary.is-example .ps-max {
    opacity: 0.7;
}

/* Verdict colours */
.ps-v-excellent { --ps-c: var(--ps-excellent); }
.ps-v-good { --ps-c: var(--ps-good); }
.ps-v-fair { --ps-c: var(--ps-fair); }
.ps-v-poor { --ps-c: var(--ps-poor); }

.ps-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ps-c);
    background: color-mix(in srgb, var(--ps-c) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--ps-c) 35%, transparent);
    white-space: nowrap;
}

/* Results table */
.ps-results {
    background: var(--tile-fill);
    border: 1px solid var(--tile-border);
    border-radius: var(--tile-radius);
    padding: 18px 20px;
    min-width: 0;
}

.ps-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.ps-results-head h2,
.ps-calc .tool-settings-head h2 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.ps-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ps-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ps-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.ps-table th,
.ps-table td {
    text-align: left;
    padding: 11px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    vertical-align: middle;
}

.ps-table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    padding-top: 6px;
}

.ps-table tbody tr:last-child th,
.ps-table tbody tr:last-child td {
    border-bottom: 0;
}

.ps-table tbody th {
    font-weight: 500;
}

.ps-size-name {
    display: block;
    color: #fff;
    font-size: 0.95rem;
}

.ps-size-dims {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.ps-dpi {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ps-c);
}

.ps-dpi-v {
    display: none;
    font-size: 0.72rem;
    font-weight: 500;
}

.ps-crop {
    min-width: 150px;
}

.ps-crop-text {
    display: block;
    font-size: 0.88rem;
    color: #fff;
}

.ps-crop.is-none .ps-crop-text {
    color: rgba(255, 255, 255, 0.7);
}

.ps-crop-note {
    display: block;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
}

.ps-crop-bar {
    display: block;
    width: 100%;
    max-width: 140px;
    height: 4px;
    margin: 5px 0 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.ps-crop-bar i {
    display: block;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
}

.ps-crop.is-none .ps-crop-bar {
    display: none;
}

.ps-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
}

.ps-legend-note {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Calculator */
.ps-calc-intro {
    margin: 0 0 12px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.65);
}

.ps-solve {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

.ps-solve-label {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    margin-right: 4px;
}

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

.ps-unit-row {
    display: flex;
    gap: 8px;
}

.ps-unit-row input {
    flex: 1;
    min-width: 0;
}

.ps-page .ps-unit-row select {
    width: auto;
    flex: none;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.ps-unit-row select option {
    background: #1D1B20;
    color: #fff;
}

.ps-field.is-output input {
    background: rgba(255, 255, 255, 0.95);
    color: #1D1B20;
    border-color: transparent;
    font-weight: 600;
}

.ps-calc-out {
    margin: 14px 0 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

.ps-calc-out strong {
    color: #fff;
}

/* Reference chart in the page copy */
.ps-ref-wrap {
    background: var(--tile-fill);
    border: 1px solid var(--tile-border);
    border-radius: var(--tile-radius);
    padding: 6px 14px;
    margin-bottom: 18px;
}

.ps-ref th,
.ps-ref td {
    font-size: 0.92rem;
    white-space: nowrap;
}

.ps-ref tbody th {
    color: #fff;
}

.ps-ref td {
    color: rgba(255, 255, 255, 0.75);
}

.tool-seo-content .ps-after-table {
    margin-bottom: 56px;
}

@media (max-width: 900px) {
    .ps-top {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .ps-results {
        padding: 14px 12px;
    }

    .ps-table th,
    .ps-table td {
        padding: 10px 6px;
    }

    .ps-table thead th:nth-child(3),
    .ps-table tbody td:nth-child(3) {
        display: none;
    }

    .ps-crop {
        min-width: 0;
    }

    .ps-dpi-v {
        display: block;
    }

    .ps-max {
        grid-template-columns: minmax(0, 1fr);
    }

    .ps-max-item {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        column-gap: 10px;
    }

    .ps-max-label {
        flex-basis: 100%;
    }

    .ps-calc-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ps-summary-dims {
        font-size: 1.6rem;
    }

    .ps-ref th,
    .ps-ref td {
        font-size: 0.82rem;
        padding: 9px 8px;
    }
}

/* The body centres its children as flex items, so the copy section would
   grow to the chart's full width on a phone; let the chart scroll instead. */
.tool-seo-content {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* culler.css puts a direct .tool-settings child in the album's card slot
   (two columns, rows 2-3); here the calculator is a full-width row in order. */
.tool-content.ps-page > .tool-settings {
    grid-column: 1 / -1;
    grid-row: auto;
    display: block;
}

/* Lab names (4R, 5R...) beside the size, and the chart caption. */
.ps-ref .ps-alias {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
}

.ps-ref-caption {
    caption-side: top;
    text-align: left;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    padding: 8px 0 4px;
}
