html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: #f4f6f8;
    color: #1d2622;
    font-family: Arial, Helvetica, sans-serif;
    -webkit-text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
}

button,
input {
    font-family: inherit;
}

.mobile-shell {
    max-width: 520px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 16px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 8px 0 14px 0;
}

.topbar > div:first-child {
    padding-right: 12px;
}

.eyebrow {
    margin: 0 0 4px 0;
    color: #66726d;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0;
}

.topbar h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1;
}

.topbar-actions {
    flex: 0 0 auto;
    text-align: right;
}

.status-pill,
.back-link {
    display: inline-block;
    min-height: 34px;
    padding: 8px 10px;
    border: 2px solid #1d2622;
    background: #ffffff;
    color: #1d2622;
    font-size: 13px;
    font-weight: bold;
    line-height: 1;
    text-decoration: none;
}

.back-link {
    margin-top: 6px;
}

.main-stack {
    padding-bottom: 24px;
}

.card {
    margin-bottom: 14px;
    border: 2px solid #1d2622;
    background: #ffffff;
    padding: 14px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1;
}

.card-head span {
    margin-left: 12px;
    color: #52605a;
    font-weight: bold;
}

.poll-question {
    margin: 0 0 12px 0;
    color: #1d2622;
    font-size: 20px;
    line-height: 1.15;
}

.option-list {
    min-height: 232px;
}

.poll-button {
    display: block;
    width: 100%;
    min-height: 56px;
    margin: 0 0 10px 0;
    padding: 10px 12px;
    border: 2px solid #1d2622;
    background: #f8fafb;
    color: #1d2622;
    font-size: 18px;
    font-weight: bold;
    text-align: left;
    touch-action: manipulation;
}

.poll-button:active {
    background: #dfe9fb;
}

.poll-button.selected {
    color: #ffffff;
}

.poll-name {
    display: block;
    overflow: hidden;
    line-height: 1.15;
    text-overflow: ellipsis;
}

.poll-count {
    display: block;
    margin-top: 4px;
    color: #52605a;
    font-size: 13px;
    font-weight: bold;
}

.poll-button.selected .poll-count {
    color: #dfe9fb;
}

.status-text {
    min-height: 20px;
    margin: 8px 0 0 0;
    color: #52605a;
    font-size: 14px;
    font-weight: bold;
}

.random-button,
.secondary-button,
.primary-button,
.ghost-button {
    min-height: 48px;
    border: 2px solid #1d2622;
    font-size: 16px;
    font-weight: bold;
    touch-action: manipulation;
}

.random-button {
    width: auto;
    min-height: 36px;
    margin: 10px 0 0 0;
    border: 1px solid #9aa7a1;
    padding: 6px 12px;
    background: #f4f6f8;
    color: #52605a;
    font-size: 14px;
    font-weight: bold;
}

.secondary-button {
    width: 100%;
    background: #d66a2c;
    color: #ffffff;
}

.primary-button {
    flex: 1 1 auto;
    background: #179366;
    color: #ffffff;
}

.ghost-button {
    flex: 0 0 108px;
    background: #ffffff;
    color: #1d2622;
}

.setup-form {
    display: none;
    margin-top: 14px;
}

.setup-field {
    margin-bottom: 10px;
}

.setup-field label {
    display: block;
    margin-bottom: 4px;
    color: #52605a;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.setup-field input {
    width: 100%;
    min-height: 46px;
    border: 2px solid #1d2622;
    padding: 8px 10px;
    background: #f8fafb;
    color: #1d2622;
    font-size: 16px;
}

.form-actions {
    display: flex;
    margin-top: 12px;
}

.form-actions .primary-button {
    margin-right: 10px;
}

.confirm-overlay {
    display: none;
    position: fixed;
    z-index: 20;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(29, 38, 34, 0.54);
}

.confirm-overlay.open {
    display: flex;
}

.confirm-dialog {
    width: 100%;
    max-width: 420px;
    border: 2px solid #1d2622;
    background: #ffffff;
    padding: 16px;
}

.confirm-dialog h2 {
    margin: 0 0 8px 0;
    color: #1d2622;
    font-size: 22px;
    line-height: 1.1;
}

.confirm-dialog p {
    margin: 0 0 14px 0;
    color: #52605a;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.3;
}

.confirm-actions {
    display: flex;
}

.confirm-actions .primary-button {
    margin-right: 10px;
}

@media (max-width: 360px) {
    .mobile-shell {
        padding: 10px;
    }

    .topbar {
        display: block;
    }

    .topbar-actions {
        margin-top: 10px;
        text-align: left;
    }

    .poll-button {
        font-size: 16px;
    }
}
