.asl-election-kiosk {
    min-height: 100vh;
    margin: 0;
    background: #f8fafc;
}

.asl-election-kiosk main {
    min-height: 100vh;
}

.asl-election-app {
    --asl-red: #b91c1c;
    --asl-red-dark: #7f1d1d;
    --asl-ink: #17202a;
    --asl-muted: #64748b;
    --asl-line: #dce2e8;
    box-sizing: border-box;
    width: min(1120px, calc(100% - 32px));
    margin: 32px auto;
    color: var(--asl-ink);
    font-family: "Sarabun", system-ui, sans-serif;
}

.asl-election-app *,
.asl-election-app *::before,
.asl-election-app *::after {
    box-sizing: inherit;
}

.asl-election-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--asl-line);
}

.asl-brand-mark {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    background: var(--asl-red);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
}

.asl-election-header h1 {
    margin: 0;
    font-size: clamp(22px, 3vw, 34px);
    line-height: 1.25;
    letter-spacing: 0;
}

.asl-election-header p {
    margin: 5px 0 0;
    color: var(--asl-muted);
}

.asl-login-view {
    display: grid;
    min-height: 520px;
    place-items: center;
}

.asl-login-panel {
    width: min(440px, 100%);
    padding: 32px;
    border: 1px solid var(--asl-line);
    border-top: 5px solid var(--asl-red);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 18px 45px rgb(15 23 42 / 10%);
}

.asl-login-panel h2 {
    margin: 0 0 8px;
    font-size: 26px;
    letter-spacing: 0;
}

.asl-login-panel > p {
    margin: 0 0 24px;
    color: var(--asl-muted);
}

.asl-login-panel label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.asl-login-panel input {
    width: 100%;
    height: 58px;
    border: 1px solid #aeb8c3;
    border-radius: 5px;
    font-size: 28px;
    text-align: center;
    letter-spacing: 0;
}

.asl-login-panel button,
.asl-candidate button,
.asl-confirm-dialog button {
    border: 0;
    border-radius: 5px;
    background: var(--asl-red);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.asl-login-panel button {
    width: 100%;
    min-height: 50px;
    margin-top: 14px;
}

.asl-login-panel button:disabled,
.asl-confirm-dialog button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.asl-message {
    margin-top: 16px;
    padding: 12px;
    border-left: 4px solid var(--asl-red);
    background: #fef2f2;
    color: var(--asl-red-dark);
}

.asl-voter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 24px 0;
    padding: 16px 20px;
    background: #f1f5f9;
    border-left: 4px solid var(--asl-red);
}

.asl-ballot-dialog {
    width: min(1180px, calc(100vw - 24px));
    height: min(760px, calc(100vh - 24px));
    max-width: none;
    max-height: none;
    padding: 18px 24px 24px;
    overflow: hidden;
    border: 0;
    border-radius: 6px;
    background: #f8fafc;
    color: var(--asl-ink);
    box-shadow: 0 24px 80px rgb(0 0 0 / 30%);
}

.asl-ballot-dialog::backdrop {
    background: rgb(15 23 42 / 72%);
}

.asl-ballot-dialog .asl-voter-bar {
    margin: 0 0 12px;
}

.asl-ballot-dialog > h2 {
    margin: 0 0 12px;
    font-size: 23px;
    text-align: center;
}

.asl-ballot-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    height: calc(100% - 112px);
}

.asl-choice-card {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto minmax(48px, auto) 58px;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--asl-line);
    border-radius: 6px;
    background: #fff;
}

.asl-choice-card img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center top;
}

.asl-choice-number {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    background: var(--asl-red);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}

.asl-choice-card h3 {
    margin: 0;
    padding: 12px 14px 6px;
    font-size: 20px;
    line-height: 1.25;
    text-align: center;
}

.asl-choice-card p {
    margin: 0;
    padding: 0 14px 10px;
    overflow: hidden;
    color: #475569;
    font-size: 15px;
    line-height: 1.35;
    text-align: center;
}

.asl-choice-card button {
    width: 100%;
    min-height: 58px;
    border: 0;
    background: var(--asl-red);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 18px;
    font-weight: 800;
}

.asl-vote-no-card {
    grid-template-rows: minmax(0, 1fr) auto minmax(48px, auto) 58px;
    border: 2px solid #475569;
    background: #f1f5f9;
}

.asl-vote-no-symbol {
    display: grid;
    width: min(170px, 55%);
    aspect-ratio: 1;
    margin: auto;
    place-items: center;
    border: 10px solid #64748b;
    border-radius: 50%;
    color: #475569;
    font-size: 72px;
    font-weight: 800;
}

.asl-vote-no-card button {
    background: #334155;
}

.asl-voter-bar span,
.asl-voter-bar small {
    display: block;
    color: var(--asl-muted);
}

.asl-voter-bar strong {
    display: block;
    font-size: 20px;
}

.asl-voter-bar button {
    border: 0;
    background: transparent;
    color: var(--asl-red);
    cursor: pointer;
    font-weight: 700;
}

.asl-ballot-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 12px;
}

.asl-ballot-heading h2 {
    margin: 0;
    font-size: 24px;
}

.asl-ballot-heading span {
    color: var(--asl-muted);
    font-weight: 700;
}

.asl-candidate-viewer {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    align-items: stretch;
    gap: 12px;
}

.asl-candidate-stage {
    min-height: 380px;
}

.asl-candidate-nav {
    min-width: 64px;
    border: 1px solid var(--asl-line);
    border-radius: 5px;
    background: #f8fafc;
    color: var(--asl-red);
    cursor: pointer;
    font-size: 46px;
    font-weight: 400;
}

.asl-candidate-nav:disabled {
    cursor: default;
    color: #cbd5e1;
}

.asl-candidate {
    display: grid;
    grid-template-columns: minmax(220px, 36%) 1fr;
    position: relative;
    overflow: hidden;
    min-height: 380px;
    border: 1px solid var(--asl-line);
    border-radius: 6px;
    background: #fff;
}

.asl-candidate img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 380px;
    object-fit: cover;
}

.asl-candidate-number {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    background: var(--asl-red);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}

.asl-candidate > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 34px;
}

.asl-candidate h3 {
    margin: 0 0 10px;
    font-size: 26px;
    letter-spacing: 0;
}

.asl-candidate p {
    min-height: 84px;
    margin: 0 0 24px;
    color: #475569;
    font-size: 18px;
    line-height: 1.6;
}

.asl-candidate button {
    width: 100%;
    min-height: 58px;
    font-size: 18px;
}

.asl-candidate-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding-top: 12px;
}

.asl-candidate-tabs button {
    width: 44px;
    height: 44px;
    border: 1px solid #94a3b8;
    border-radius: 50%;
    background: #fff;
    color: #334155;
    cursor: pointer;
    font-size: 17px;
    font-weight: 800;
}

.asl-candidate-tabs button.is-active {
    border-color: var(--asl-red);
    background: var(--asl-red);
    color: #fff;
}

.asl-abstain {
    display: block;
    width: min(680px, 100%);
    min-height: 68px;
    margin: 16px auto 28px;
    padding: 8px 24px;
    border: 2px solid #334155;
    border-radius: 5px;
    background: #334155;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    font-weight: 700;
}

.asl-confirm-dialog {
    width: min(440px, calc(100% - 32px));
    padding: 28px;
    border: 0;
    border-radius: 6px;
    box-shadow: 0 24px 70px rgb(0 0 0 / 25%);
}

.asl-confirm-dialog::backdrop {
    background: rgb(15 23 42 / 65%);
}

.asl-confirm-dialog h2 {
    margin-top: 0;
    letter-spacing: 0;
}

.asl-confirm-dialog strong {
    display: block;
    min-height: 64px;
    padding: 16px;
    background: #f8fafc;
    font-size: 19px;
}

.asl-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 22px;
}

.asl-confirm-dialog button {
    min-height: 44px;
}

.asl-confirm-dialog .asl-secondary {
    border: 1px solid #94a3b8;
    background: #fff;
    color: #334155;
}

.asl-success-view {
    min-height: 520px;
    padding-top: 120px;
    text-align: center;
}

.asl-success-icon {
    display: grid;
    width: 84px;
    height: 84px;
    margin: 0 auto 20px;
    place-items: center;
    border-radius: 50%;
    background: #15803d;
    color: #fff;
    font-size: 46px;
    font-weight: 800;
}

@media (max-width: 640px) {
    .asl-election-app {
        width: min(100% - 20px, 1120px);
        margin-top: 10px;
    }

    .asl-election-header {
        align-items: flex-start;
    }

    .asl-login-view {
        min-height: 430px;
    }

    .asl-login-panel {
        padding: 24px 18px;
    }

    .asl-voter-bar {
        align-items: flex-start;
    }

    .asl-ballot-dialog {
        width: calc(100vw - 12px);
        height: calc(100vh - 12px);
        padding: 10px;
    }

    .asl-ballot-choices {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        height: calc(100% - 105px);
    }

    .asl-choice-card h3 {
        padding: 7px 5px 3px;
        font-size: 14px;
    }

    .asl-choice-card p {
        padding: 0 5px 5px;
        font-size: 11px;
    }

    .asl-choice-card button {
        min-height: 50px;
        padding: 4px;
        font-size: 13px;
    }

    .asl-choice-number {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .asl-vote-no-symbol {
        border-width: 7px;
        font-size: 48px;
    }

    .asl-candidate-viewer {
        grid-template-columns: 46px minmax(0, 1fr) 46px;
        gap: 6px;
    }

    .asl-candidate-nav {
        min-width: 46px;
        font-size: 36px;
    }

    .asl-candidate {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .asl-candidate img {
        height: 260px;
        min-height: 260px;
    }

    .asl-candidate > div {
        padding: 18px;
    }

    .asl-candidate h3 {
        font-size: 20px;
    }

    .asl-candidate p {
        min-height: 0;
        font-size: 16px;
    }
}

@media (min-width: 641px) and (max-height: 820px) {
    .asl-election-app {
        margin-top: 8px;
    }

    .asl-election-header {
        padding: 10px 0;
    }

    .asl-voter-bar {
        margin: 10px 0;
        padding: 10px 16px;
    }

    .asl-ballot-heading {
        margin-top: 8px;
    }

    .asl-candidate-stage,
    .asl-candidate,
    .asl-candidate img {
        min-height: 310px;
    }

    .asl-candidate {
        height: 310px;
    }

    .asl-candidate-tabs {
        padding-top: 7px;
    }

    .asl-abstain {
        min-height: 58px;
        margin-top: 8px;
        margin-bottom: 8px;
    }
}
