:root {
    --bg-gradient: linear-gradient(135deg, #00c6ff, #0072ff);
    --card-bg: #ffffff;
    --card-soft-bg: rgba(255, 255, 255, 0.96);
    --accent: #00c2d5;
    --accent-strong: #006dff;
    --accent-soft: #e9f6ff;
    --accent-soft-2: #f3f9ff;
    --danger: #ff4d4d;
    --text-main: #0b2840;
    --text-muted: #6d7a8a;
    --slider-track: #d9e4ff;
    --slider-fill: #4c9aff;
    --slider-thumb: #ffffff;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.16);
    --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.06);
    --shadow-chip: 0 8px 20px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.page {
    width: 100%;
    max-width: 1220px;
    margin: 18px auto;
    padding: 16px;
}

/* HEADER */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-wrap img {
    height: 40px;
    width: auto;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-tagline {
    font-size: 13px;
    font-weight: 500;
    color: #f3fbff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-sub {
    font-size: 13px;
    color: #d7f6ff;
}

/* MAIN SHELL */

.converter-shell {
    background: radial-gradient(circle at top left, #f6fbff, #ffffff 55%);
    border-radius: 40px;
    padding: 26px 24px 30px;
    box-shadow: var(--shadow-soft);
}

/* LAYOUT
   Desktop: input | arrow | output
*/

.converter-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 70px minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

/* PANELS */

.panel {
    background: var(--card-soft-bg);
    border-radius: var(--radius-xl);
    padding: 20px 20px 22px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.panel-head h1,
.panel-head h2 {
    font-size: 20px;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}

.panel-head p {
    font-size: 13px;
    color: var(--text-muted);
}

.panel-input {
    background: linear-gradient(145deg, #ffffff, #f3f9ff);
}

.panel-output {
    background: linear-gradient(145deg, #fdfdff, #f5f8ff);
}

/* EYE GRID */

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

.eye-card {
    border-radius: 22px;
    background: #ffffff;
    padding: 14px 14px 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.eye-card-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Chips */

.eye-chip,
.toric-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: var(--shadow-chip);
}

.eye-chip-left,
.toric-chip-left {
    background: linear-gradient(135deg, #ff8aa2, #ff4b73);
    color: #fff;
}

.eye-chip-right,
.toric-chip-right {
    background: linear-gradient(135deg, #4acbff, #007bff);
    color: #fff;
}

/* SLIDERS */

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slider-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 4px;
}

.slider-label-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.slider-label {
    font-size: 13px;
    font-weight: 600;
}

.slider-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.slider-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-strong);

}

.slider-scale {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Click-to-edit value styles */
.slider-value span {
    cursor: pointer;
}

.inline-input {
    width: 70px;
    font: inherit;
    font-size: 13px;
    text-align: right;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    background: transparent;
    outline: none;
    padding: 0;
}

/* Make editable values look editable everywhere */
.editable-label {
    position: relative;
    padding-left: 16px;
    /* room for icon on the left */
    border-bottom: 1px dotted rgba(0, 0, 0, 0.3);
}

/* tiny pencil/icon hint on the left */
.editable-label::before {
    content: "✎";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-48%);
    font-size: 11px;
    opacity: 0.7;
}


.tap-hint {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

/* If you want it mobile-only, you can hide it on large screens: */
@media (min-width: 721px) {
    .tap-hint {
        display: none;
    }
}

/* If you want it mobile-only, you can hide it on large screens: */
@media (max-width: 721px) {
    .slider-instructions {
        display: none;
    }
}




/* RANGE INPUT */

.range-input {
    width: 100%;
    margin-top: 4px;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: var(--slider-track);
    outline: none;
    cursor: pointer;
}

/* WebKit thumb */

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--slider-thumb);
    border: 2px solid var(--slider-fill);
    box-shadow: 0 0 0 4px rgba(76, 154, 255, 0.2);
    margin-top: -6px;
}

/* Firefox */

.range-input::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: var(--slider-track);
}

.range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--slider-thumb);
    border: 2px solid var(--slider-fill);
    box-shadow: 0 0 0 4px rgba(76, 154, 255, 0.2);
}

/* FLOW INDICATOR (middle column on desktop) */

.flow-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
    gap: 6px;
}

.flow-indicator-circle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #ffffff, #c4ecff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent-strong);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* CHANGED: make text darker for readability */
.flow-indicator-text {
    font-size: 11px;
    color: #003a6a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* TORIC OUTPUT – side-by-side circles (stack on small screens) */

/* TORIC OUTPUT – side-by-side circles (stack on small screens) */

.toric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.toric-card {
    padding: 10px 10px 14px;
    border-radius: 22px;
    background: var(--accent-soft-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* SMALLER CIRCLES ON DESKTOP/TABLET */
.toric-circle {
    width: 100%;
    max-width: 180px;
    /* was 220px */
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    margin: 0 auto;
    background: radial-gradient(circle at 25% 20%, #ffffff, #e0ecff);
    box-shadow: 0 16px 32px rgba(88, 126, 188, 0.3);
    padding: 16px 14px;
    /* slightly less padding */
    display: flex;
    align-items: center;
    justify-content: center;
}

.toric-inner {
    width: 100%;
}

.toric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    margin: 4px 0;
}


.toric-label {
    color: var(--text-muted);
}

.toric-value {
    font-weight: 600;
    color: var(--text-main);
}

/* SAVE BUTTON */

/* CHANGED: center the button in the result panel */
.save-button {
    margin-top: 10px;
    align-self: center;
    padding: 9px 16px;
    border-radius: 999px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, #00c2d5, #006dff);
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 125, 255, 0.4);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.save-button::after {
    content: "⬇";
    font-size: 14px;
}

.save-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0, 125, 255, 0.45);
}

.save-button:active {
    transform: translateY(0);
    box-shadow: 0 8px 20px rgba(0, 125, 255, 0.35);
}

/* STATUS */

.status {
    margin-top: 10px;
    font-size: 12px;
    color: var(--danger);
}

/* GLOBAL DISCLAIMER */

.global-disclaimer {
    margin-top: 8px;
    font-size: 11px;
    color: #e9f6ff;
    text-align: center;
}

/* RESPONSIVE */

@media (max-width: 960px) {
    .converter-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .flow-indicator {
        display: none;
    }

    .panel-output {
        margin-top: 10px;
    }
}

@media (max-width: 720px) {
    .converter-shell {
        padding: 20px 16px 22px;
        border-radius: 28px;
    }

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

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .brand-sub {
        font-size: 12px;
    }

    .panel-head h1,
    .panel-head h2 {
        font-size: 18px;
    }

    .toric-card {
        align-items: center;
    }

    .toric-circle {
        max-width: 150px;
        /* NEW: smaller on tablets/large phones */
        padding: 14px 12px;
    }

    /* stack circles vertically on smaller screens */
    .toric-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 480px) {
    .page {
        padding: 10px;
    }

    .converter-shell {
        padding: 16px 12px 20px;
    }

    .panel {
        padding: 14px 12px 16px;
    }

    .toric-circle {
        max-width: 130px;
        /* even smaller on small phones */
        padding: 12px 10px;
    }
}