:root {
    --ink: #0d1426;
    --navy: #0b1326;
    --navy-2: #152743;
    --option-navy: #1d3355;
    --blue: #3f759f;
    --blue-light: #8fb4d0;
    --blue-soft: #eef4f9;
    --blue-muted: #5d7187;
    --paper: #f8fbfd;
    --white: #ffffff;
    --line: rgba(93, 113, 135, 0.22);
    --shadow: 0 18px 50px rgba(13, 20, 38, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

h1,
h2 {
    margin: 0;
    line-height: 1;
}

h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.7rem, 7vw, 5.5rem);
    letter-spacing: 0;
}

a {
    color: inherit;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
}

.hero-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 40px;
    color: var(--white);
    background: var(--navy);
    border-radius: 8px;
}

.eyebrow {
    margin: 0 0 14px;
    color: #9ebbd1;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.lead {
    margin: 18px 0 0;
    color: #c8d7e6;
    font-size: 1.15rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    color: var(--white);
    background: var(--blue);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary {
    color: var(--navy);
    background: var(--blue-soft);
}

.button.danger {
    background: #a84242;
}

.question-grid,
.qr-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.question-card,
.qr-card,
.admin-login,
.danger-zone,
.notice {
    padding: 24px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.question-card h2,
.qr-card h2 {
    font-size: 1.3rem;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.vote-shell {
    min-height: 100vh;
    padding: clamp(18px, 5vw, 64px);
    background: var(--navy);
}

.vote-card {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - clamp(36px, 10vw, 128px));
    max-width: 1660px;
    margin: 0 auto;
    padding: clamp(12px, 3vw, 42px);
    color: var(--white);
    background: var(--navy);
}

.question-header {
    padding: clamp(8px, 2vw, 24px) 0 clamp(28px, 6vw, 74px);
}

.question-header h1 {
    max-width: 1500px;
    color: var(--white);
    font-size: clamp(2.25rem, 4.2vw, 5.1rem);
    font-style: italic;
    font-weight: 500;
    line-height: 1.15;
}

.vote-form {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.question-content {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.question-content[hidden],
.vote-form[hidden] {
    display: none;
}

.options {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(16px, 2.3vw, 26px);
}

.option-button {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: clamp(76px, 8vw, 108px);
    padding: clamp(12px, 1.9vw, 22px) clamp(18px, 2.7vw, 36px);
    color: var(--white);
    background: var(--option-navy);
    border: 2px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-size: clamp(1.15rem, 2.2vw, 2.25rem);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.option-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.option-button.selected {
    border-color: var(--blue-light);
    background: #29476f;
    box-shadow: 0 0 0 4px rgba(143, 180, 208, 0.16);
}

.option-button:has(input:focus-visible) {
    outline: 3px solid rgba(63, 117, 159, 0.28);
    outline-offset: 2px;
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: clamp(50px, 5vw, 68px);
    height: clamp(50px, 5vw, 68px);
    color: var(--white);
    background: var(--blue);
    border-radius: 50%;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    font-weight: 800;
}

.option-label {
    line-height: 1.32;
}

.submit-panel {
    margin-top: auto;
    padding-top: clamp(22px, 4vw, 42px);
}

.submit-button {
    width: 100%;
    min-height: clamp(58px, 7vw, 78px);
    border: 2px solid #b8d4e8;
    border-radius: 8px;
    color: var(--navy);
    background: #d7edf9;
    font: inherit;
    font-size: clamp(1.05rem, 2vw, 1.45rem);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(143, 180, 208, 0.22);
}

.submit-button:disabled {
    border-color: rgba(143, 180, 208, 0.22);
    color: #6f8496;
    background: #233750;
    box-shadow: none;
    cursor: not-allowed;
}

.status-text {
    margin: 16px 0 0;
    color: var(--blue-light);
    font-size: 0.95rem;
    line-height: 1.45;
}

.thank-you-panel {
    display: grid;
    align-content: center;
    flex: 1;
    min-height: calc(100vh - clamp(36px, 10vw, 128px));
    padding: clamp(28px, 7vw, 72px);
    text-align: center;
    background: var(--option-navy);
    border: 2px solid rgba(143, 180, 208, 0.3);
    border-radius: 8px;
}

.thank-you-panel[hidden] {
    display: none;
}

.thank-you-panel h2 {
    color: var(--white);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 12vw, 6.4rem);
    font-style: italic;
    font-weight: 500;
}

.thank-you-panel p {
    margin: 18px 0 0;
    color: var(--blue-light);
    font-size: clamp(1.05rem, 4vw, 1.6rem);
    font-weight: 700;
}

.graph-page {
    min-height: 100vh;
    color: var(--white);
    background: var(--navy);
}

.graph-shell {
    width: min(1220px, calc(100% - 56px));
    margin: 0 auto;
    padding: 52px 0;
}

.graph-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.graph-header h1 {
    max-width: 980px;
    font-size: clamp(1.3rem, 2.2vw, 1.8rem);
    font-weight: 700;
    line-height: 1.25;
}

.total-box {
    min-width: 110px;
    padding: 12px 16px;
    text-align: center;
    background: var(--navy-2);
    border-radius: 8px;
    flex-shrink: 0;
}

.total-box span {
    display: block;
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
}

.total-box small {
    color: #bdd0df;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.result-card,
.chart-card {
    display: grid;
    gap: 18px;
}

.chart-card {
    padding: 28px;
    background: var(--navy-2);
    border-radius: 8px;
}

.chart-row {
    display: grid;
    grid-template-columns: minmax(240px, 0.42fr) minmax(320px, 1fr);
    align-items: center;
    gap: 22px;
}

.chart-label {
    display: grid;
    grid-template-columns: 56px 1fr;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.chart-label strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    color: var(--white);
    background: var(--blue);
    border-radius: 50%;
    font-size: 1.45rem;
}

.chart-label span {
    min-width: 0;
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.25;
}

.chart-track {
    position: relative;
    height: 54px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.11);
    border-radius: 999px;
}

.chart-fill {
    width: 0;
    height: 100%;
    min-width: 0;
    background: linear-gradient(90deg, #5f95bd, #b9dcf1);
    border-radius: inherit;
    transition: width 420ms ease;
}

.chart-value {
    position: absolute;
    top: 50%;
    right: 18px;
    color: var(--white);
    font-style: normal;
    font-size: 1.08rem;
    font-weight: 900;
    text-shadow: 0 1px 8px rgba(11, 19, 38, 0.55);
    transform: translateY(-50%);
}

.graph-content-layout {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 32px;
    align-items: start;
}

/* Vertical Column Chart Styles */
.chart-card-vertical {
    padding: 40px 32px 32px 32px;
    background: var(--navy-2);
    border-radius: 12px;
    margin-bottom: 28px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.vertical-chart-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 380px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.chart-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 120px;
    height: 100%;
    justify-content: flex-end;
}

.chart-track-vertical {
    position: relative;
    width: 48px;
    height: calc(100% - 64px);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px 6px 0 0;
    margin-bottom: 16px;
}

.chart-fill-vertical {
    width: 100%;
    height: 0;
    background: linear-gradient(180deg, #9ecbeb, #4a7fa5);
    border-radius: 6px 6px 0 0;
    transition: height 500ms cubic-bezier(0.25, 1, 0.5, 1);
    position: absolute;
    bottom: 0;
    left: 0;
    box-shadow: 0 0 12px rgba(158, 203, 235, 0.2);
}

.chart-fill-vertical .vote-percent {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.column-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--white);
    background: var(--blue);
    border-radius: 50%;
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.column-count {
    color: #bdd0df;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Legend Styling */
.legend-card {
    padding: 24px;
    background: var(--navy-2);
    border-radius: 8px;
    margin-bottom: 24px;
}

.legend-card h2 {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 18px;
    color: var(--white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.legend-grid {
    display: grid;
    gap: 12px;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.legend-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    color: var(--white);
    background: var(--blue);
    border-radius: 50%;
    font-size: 0.95rem;
    font-weight: 700;
}

.legend-text {
    color: var(--white);
    font-size: 1rem;
    line-height: 1.35;
}

.bar-row {
    padding: 22px;
    background: var(--navy-2);
    border-radius: 8px;
}

.bar-meta {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.bar-meta strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--blue);
    border-radius: 50%;
    font-size: 1.45rem;
}

.bar-meta span {
    font-size: 1.35rem;
    font-weight: 800;
}

.bar-meta em {
    color: #bdd0df;
    font-style: normal;
    font-size: 1.25rem;
}

.bar-track {
    height: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.11);
    border-radius: 999px;
}

.bar-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #5f95bd, #a8cce3);
    border-radius: inherit;
    transition: width 420ms ease;
}

.qr-card {
    text-align: center;
}

.qr-card img {
    display: block;
    width: min(100%, 300px);
    height: auto;
    margin: 18px auto;
}

.qr-card p {
    overflow-wrap: anywhere;
    color: var(--blue-muted);
}

.admin-login {
    display: grid;
    gap: 12px;
    max-width: 520px;
    margin-top: 24px;
}

.admin-login input {
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

.danger-zone,
.notice {
    margin-top: 24px;
}

@media (max-width: 820px) {
    .graph-content-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .shell,
    .graph-shell {
        width: min(100% - 24px, 1180px);
        padding: 24px 0;
    }

    .hero-panel,
    .graph-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .graph-shell {
        width: min(100% - 28px, 560px);
        padding: 24px 0;
    }

    .graph-header {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: end;
        gap: 18px;
        margin-bottom: 22px;
    }

    .graph-header .eyebrow {
        margin-bottom: 8px;
        font-size: 0.72rem;
        letter-spacing: 0.22em;
    }

    .graph-header h1 {
        font-size: clamp(1.75rem, 7vw, 2.45rem);
        line-height: 1.14;
    }

    .total-box {
        min-width: 86px;
        padding: 13px 14px;
        border-radius: 8px;
    }

    .total-box span {
        font-size: 2.45rem;
    }

    .total-box small {
        font-size: 0.62rem;
        letter-spacing: 0.12em;
    }

    .result-card {
        gap: 16px;
    }

    .chart-card {
        gap: 18px;
        padding: 18px;
    }

    .chart-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .chart-label {
        grid-template-columns: 46px 1fr;
        gap: 12px;
    }

    .chart-label strong {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }

    .chart-label span {
        font-size: 1.02rem;
    }

    .chart-track {
        height: 42px;
    }

    .chart-value {
        right: 14px;
        font-size: 0.98rem;
    }

    .bar-row {
        padding: 16px;
    }

    .question-grid,
    .qr-grid {
        grid-template-columns: 1fr;
    }

    .vote-shell {
        padding: 18px;
    }

    .vote-card {
        min-height: calc(100vh - 36px);
        padding: 0;
    }

    .question-header {
        padding: 4px 0 26px;
    }

    .question-header h1 {
        font-size: clamp(2rem, 8.8vw, 3rem);
        line-height: 1.16;
    }

    .option-button {
        min-height: 66px;
        padding: 12px 14px;
        font-size: 1.08rem;
    }

    .option-letter {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .bar-meta {
        grid-template-columns: 48px 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }

    .bar-meta strong {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .bar-meta span {
        font-size: 1.08rem;
        line-height: 1.28;
    }

    .bar-meta em {
        grid-column: 2;
        font-size: 1rem;
        white-space: nowrap;
    }

    .bar-track {
        height: 16px;
    }
}
