:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: #182230;
    background: #f4f6f8;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100dvh;
    background: #f4f6f8;
}

button,
textarea,
input {
    font: inherit;
}

.page-shell {
    width: min(100%, 720px);
    margin: 0 auto;
    padding: max(22px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.page-header {
    padding: 8px 2px 22px;
}

.page-kicker {
    margin: 0 0 6px;
    color: #1266d4;
    font-size: 14px;
    font-weight: 700;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.18;
    letter-spacing: -0.03em;
}

.page-header > p:last-child,
.section-heading p {
    color: #5b6877;
    line-height: 1.55;
}

.page-header > p:last-child {
    max-width: 42rem;
    margin-bottom: 0;
    font-size: 15px;
}

#broadcast-form {
    display: grid;
    gap: 12px;
}

.form-section {
    padding: 20px;
    border: 1px solid #dbe1e8;
    border-radius: 12px;
    background: #ffffff;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin-bottom: 4px;
    font-size: 17px;
    line-height: 1.35;
}

.section-heading p {
    margin-bottom: 0;
    font-size: 13px;
}

.count {
    flex: none;
    color: #6b7785;
    font-size: 12px;
}

.class-list,
.option-grid {
    display: grid;
    gap: 10px;
}

.class-option,
.choice-card {
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #ced6df;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
}

.class-option:has(input:checked),
.choice-card:has(input:checked) {
    border-color: #1266d4;
    background: #f1f7ff;
}

input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    flex: none;
    accent-color: #1266d4;
}

.choice-card strong,
.choice-card small {
    display: block;
}

.choice-card strong {
    margin-bottom: 3px;
    font-size: 15px;
}

.choice-card small {
    color: #647181;
    font-size: 12px;
    line-height: 1.4;
}

textarea {
    display: block;
    width: 100%;
    min-height: 138px;
    resize: vertical;
    padding: 14px;
    border: 1px solid #b8c2ce;
    border-radius: 12px;
    color: #182230;
    background: #ffffff;
    line-height: 1.6;
    outline: none;
}

textarea::placeholder {
    color: #657384;
}

textarea:focus,
button:focus-visible,
input:focus-visible {
    outline: 3px solid rgb(18 102 212 / 24%);
    outline-offset: 2px;
}

.duration-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.duration-options label {
    position: relative;
}

.duration-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.duration-options span {
    display: grid;
    min-height: 48px;
    place-items: center;
    border: 1px solid #ced6df;
    border-radius: 12px;
    background: #ffffff;
    font-weight: 650;
    cursor: pointer;
}

.duration-options input:checked + span {
    border-color: #1266d4;
    color: #0c57b4;
    background: #f1f7ff;
}

.duration-options input:focus-visible + span {
    outline: 3px solid rgb(18 102 212 / 24%);
    outline-offset: 2px;
}

.submit-button {
    min-height: 52px;
    margin-top: 4px;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    background: #1266d4;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.submit-button:active:not(:disabled),
.text-button:active {
    transform: translateY(1px);
}

.submit-button:disabled {
    color: #7d8996;
    background: #dce2e8;
    cursor: not-allowed;
}

.text-button {
    min-height: 40px;
    padding: 0 4px;
    border: 0;
    color: #0c57b4;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}

.message,
.empty-state,
.field-error {
    border-radius: 12px;
    line-height: 1.5;
}

.message {
    margin-bottom: 12px;
    padding: 13px 15px;
    border: 1px solid #b9d4f6;
    color: #174d8f;
    background: #edf5ff;
}

.message.error {
    border-color: #f1b4ae;
    color: #8e1b12;
    background: #fff1ef;
}

.message.success {
    border-color: #a9d7bd;
    color: #17613a;
    background: #effaf3;
}

.empty-state {
    margin-bottom: 0;
    padding: 18px;
    color: #586575;
    background: #f5f7f9;
    text-align: center;
}

.field-error {
    margin: 10px 0 0;
    color: #a51d14;
    font-size: 13px;
}

.class-loading {
    display: grid;
    gap: 10px;
}

.class-loading span {
    display: block;
    height: 52px;
    border-radius: 12px;
    background: #edf0f3;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

@media (min-width: 620px) {
    .page-shell {
        padding-right: 24px;
        padding-left: 24px;
    }

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}
