:root {
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --indigo-50: #eef2ff;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;
    --indigo-800: #3730a3;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --ink: #0f172a;
    --navy: #1e3a8a;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --green-600: #16a34a;
    --green-700: #15803d;
    --red-400: #f87171;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --yellow-400: #facc15;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #f4f6fb;
    overflow-x: hidden;
}

input[type="text"],
input[type="password"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
}

.font-display,
h1, h2, h3 {
    font-family: Outfit, Inter, sans-serif;
    word-wrap: break-word;
}

a { color: var(--blue-600); text-decoration: none; }

.site-header {
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 55%, #172554 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    color: #fff;
    text-align: center;
    padding: 22px 16px 26px;
}

.brand-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    max-width: 920px;
    margin: 0 auto;
}

.brand-logo {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: #fff;
    padding: 6px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 10px 22px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    flex-shrink: 0;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    display: block;
    background: #fff;
}

.brand-copy {
    text-align: left;
    min-width: 0;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    display: grid;
    place-items: center;
}

.site-header h1 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
}

.header-sub {
    margin: 6px 0 0;
    color: #dbeafe;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    font-size: clamp(0.78rem, 1.6vw, 0.95rem);
    line-height: 1.35;
}

.header-place {
    margin: 6px 0 0;
    color: #facc15;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.header-rule {
    width: 48px;
    height: 2px;
    background: var(--yellow-400);
    margin: 10px auto 0;
    border-radius: 99px;
}

.admin-link-wrap {
    width: min(1152px, calc(100% - 32px));
    margin: 12px auto 0;
    display: flex;
    justify-content: flex-end;
}

.admin-link {
    color: var(--slate-500);
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.admin-link:hover { color: var(--blue-600); }

html {
    -webkit-text-size-adjust: 100%;
}

.wrap {
    width: min(1152px, 100%);
    margin: 0 auto;
    padding: 24px 16px 48px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(48px, env(safe-area-inset-bottom));
}

.card-head > div {
    min-width: 0;
    flex: 1 1 220px;
}

.page-title {
    text-align: center;
    margin-bottom: 24px;
}

.page-title h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2.5vw, 1.7rem);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0;
}

.page-title p {
    margin: 8px 0 0;
    color: var(--slate-600);
    font-size: 0.95rem;
    font-weight: 500;
}

.page-note {
    margin: 14px auto 0 !important;
    max-width: 52rem;
    padding: 12px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    color: #1e3a8a !important;
    font-size: clamp(0.92rem, 2vw, 1.05rem) !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em;
    line-height: 1.45;
    text-transform: uppercase;
    text-align: center;
}

.contact-query {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 16px auto 0;
    max-width: 36rem;
    width: 100%;
    padding: 14px 20px;
    background: #fff;
    border: 2px solid #1e3a8a;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    text-align: center;
}

.contact-query-label {
    margin: 0;
    color: #1e3a8a;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.contact-query-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.contact-btn svg {
    flex-shrink: 0;
}

.contact-call {
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #93c5fd;
}

.contact-call:hover {
    background: #dbeafe;
}

.contact-wa {
    color: #fff;
    background: #16a34a;
    border: 1px solid #15803d;
}

.contact-wa:hover {
    background: #15803d;
}

.field-label {
    display: block;
    font-family: Inter, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--slate-700);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.card-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0;
}

.muted {
    margin: 4px 0 0;
    color: var(--slate-600);
    font-size: 0.875rem;
    font-weight: 500;
}

.total-pill {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: none;
}

input::placeholder,
input::-webkit-input-placeholder,
input::-moz-placeholder {
    color: #64748b !important;
    opacity: 1 !important;
    font-weight: 500 !important;
    text-transform: none !important;
}

select:invalid,
.row-competition:invalid {
    color: #64748b;
    font-weight: 500;
}

.student-table thead th {
    background: #1e3a8a;
    color: #fff !important;
    text-align: left;
    padding: 12px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 0;
    white-space: nowrap;
}

.student-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    color: var(--ink);
}

.sr-no {
    color: var(--navy);
    font-weight: 800;
    text-align: center;
    width: 64px;
}

.summary-head h3 {
    margin: 0;
    color: var(--ink);
    font-weight: 700;
    font-size: 1.05rem;
}
.summary-head p {
    margin: 4px 0 0;
    color: var(--slate-600);
    font-size: 0.875rem;
    font-weight: 500;
}

.summary-table th {
    background: #312e81;
    color: #fff;
    text-align: left;
    padding: 14px 16px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.summary-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    color: var(--ink);
    font-weight: 600;
}

.summary-table .name { font-weight: 800; color: var(--navy); }

.summary-foot {
    padding: 12px 24px;
    background: var(--indigo-50);
    text-align: right;
    color: #312e81;
    font-weight: 800;
    font-size: 0.95rem;
}

.preview-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

.preview-pager {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-pager span {
    font-size: 0.82rem;
    font-weight: 700;
    color: #312e81;
}

.btn-soft {
    background: #fff;
    color: #1e3a8a;
    border: 1px solid #93c5fd;
}

.btn-soft:hover { background: #eff6ff; }

.btn-tiny {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 8px;
    padding: 7px 10px;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
}

.btn-tiny:hover { background: #dbeafe; }

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.summary-table input,
.summary-table select {
    width: 100%;
    min-width: 0;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.9rem;
    font-weight: 700;
}

.summary-table tr.is-editing { background: #eff6ff; }

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    margin-bottom: 20px;
    overflow: hidden;
}

.section-card {
    border: 2px solid #1e3a8a;
    box-shadow: 0 10px 28px rgba(30, 58, 138, 0.1);
}

.school-card .field-label {
    margin-top: 4px;
}

.school-help {
    margin: 0 0 14px;
    color: #1e3a8a;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.4;
}

.school-entry-note {
    margin-bottom: 16px;
}

.school-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}

.school-grid-full {
    grid-column: 1 / -1;
}

.school-card input {
    border: 2px solid #1e3a8a;
    border-radius: 10px;
    min-height: 48px;
    font-weight: 700;
    background: #f8fafc;
}

.school-card input:focus {
    border-color: #1d4ed8;
    background: #fff;
}

.section-badge {
    display: inline-block;
    background: #1e3a8a;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.or-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 4px 0 20px;
    color: #1e3a8a;
    font-weight: 800;
    letter-spacing: 0.18em;
    font-size: 0.95rem;
}

.or-divider::before,
.or-divider::after {
    content: "";
    flex: 1;
    height: 2px;
    background: #1e3a8a;
    opacity: 0.25;
}

.or-divider span {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border: 2px solid #1e3a8a;
    border-radius: 50%;
    background: #fff;
    letter-spacing: 0.08em;
}

.card-pad { padding: 24px; }

.paste-body {
    padding: 20px 24px 24px;
}

.comp-spell-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 16px;
}

.comp-spell-item {
    border: 1px solid #1e3a8a;
    border-radius: 8px;
    padding: 10px 8px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-align: center;
    color: #1e3a8a;
    background: #eff6ff;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.paste-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

.paste-field-grow {
    min-width: 0;
}

.paste-box {
    min-height: 180px;
    width: 100%;
    resize: vertical;
    line-height: 1.55;
    font-weight: 600;
    text-transform: uppercase;
    background: #fff;
    border: 2px solid #1e3a8a;
    border-radius: 12px;
    font-family: ui-monospace, "Cascadia Mono", "Segoe UI", monospace;
    letter-spacing: 0.01em;
}

.paste-example {
    margin: 0 0 12px;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #1e3a8a;
    border-radius: 12px;
}

.paste-example-title {
    margin: 0 0 10px;
    color: #1e3a8a;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

.paste-example-head,
.paste-example-row {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 8px;
    align-items: center;
}

.team-select {
    min-height: 52px;
    border: 2px solid #1e3a8a;
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.admin-link {
    display: inline-block;
    margin-top: 12px;
    color: #1e3a8a;
    font-size: 0.82rem;
    font-weight: 700;
}

.paste-example-head {
    padding: 0 8px 8px;
    border-bottom: 1px solid #bfdbfe;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.paste-example-row {
    padding: 8px;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
}

.paste-example-row + .paste-example-row {
    border-top: 1px dashed #cbd5e1;
}

.paste-note {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 2px solid #dc2626;
    border-radius: 10px;
    color: #b91c1c;
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.45;
    text-transform: uppercase;
    text-align: center;
}

.format-pill {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.paste-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.paste-hints span {
    background: #f1f5f9;
    color: #334155;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.paste-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.paste-status {
    margin: 0;
    flex: 1 1 180px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #15803d;
}

.paste-status.is-error {
    color: #b91c1c;
}

.req { color: var(--red-500); }

#school_name,
.row-name,
.row-std {
    text-transform: uppercase;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--red-400);
    background: #fef2f2;
}

.field-error {
    color: var(--red-500);
    font-size: 0.75rem;
    margin: 6px 0 0;
}

.card-head {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.student-table,
.summary-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.student-table tbody tr:hover { background: rgba(239, 246, 255, 0.45); }

.student-table input,
.student-table select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
}

.icon-btn {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover { background: #fee2e2; color: #991b1b; }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.card-foot {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.btn {
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-blue {
    background: #1d4ed8;
    color: #fff;
    box-shadow: none;
}

.btn-blue:hover { background: #1e40af; }

.btn-green {
    background: #15803d;
    color: #fff;
    font-family: Inter, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 28px;
    border-radius: 8px;
    box-shadow: none;
}

.btn-green:hover { background: #166534; }

.submit-wrap {
    display: flex;
    justify-content: center;
    padding-bottom: 32px;
}

.summary-head {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: var(--indigo-50);
}

.summary-table tbody tr:nth-child(even) { background: #f8fafc; }

.alert {
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 0.875rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.alert-error ul { margin: 8px 0 0; padding-left: 18px; }

.hidden { display: none !important; }

.mobile-rows { display: none; padding: 16px; }

.mobile-card {
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 16px;
    background: #f8fafc;
    margin-bottom: 16px;
}

.mobile-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mobile-card-head span {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mobile-card .stack { display: grid; gap: 8px; }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: grid;
    place-items: center;
    z-index: 50;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.modal {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
    max-width: 28rem;
    width: 100%;
    padding: 32px;
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 999px;
    background: #dcfce7;
    color: var(--green-600);
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
}

.modal h3 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 800;
}

.success-box {
    background: #f0fdf4;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
}

.success-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.success-row span { color: var(--slate-500); }
.success-row strong { color: var(--slate-800); }
.count-lg { color: var(--green-700); font-size: 1.125rem; }

.missing-modal h3 {
    color: #b91c1c;
    font-size: 1.25rem;
}

.missing-modal p {
    color: #334155;
    font-weight: 600;
    margin: 0 0 12px;
}

.missing-modal ul {
    text-align: left;
    margin: 0 0 20px;
    padding: 12px 12px 12px 32px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
    font-weight: 700;
    max-height: 40vh;
    overflow: auto;
}

.missing-modal li { margin: 6px 0; }

@media (max-width: 1024px) {
    .wrap { padding-top: 20px; padding-bottom: max(40px, env(safe-area-inset-bottom)); }
    .header-sub { letter-spacing: 0.04em; }
    .btn-green { padding: 14px 28px; font-size: 1.05rem; }
    .page-note,
    .paste-note {
        font-size: 0.92rem !important;
        letter-spacing: 0.03em;
        padding: 12px 14px;
    }
    .card-head { align-items: flex-start; }
    .desktop-table { display: none; }
    .mobile-rows { display: block; padding: 16px; }
    .student-table { min-width: 0; }
    .summary-table { min-width: 0; }
    .paste-box { min-height: 160px; font-size: 16px; }
    input[type="text"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px;
    }
    .btn-blue,
    .btn-green,
    #add-student,
    #apply-paste,
    #paste-another,
    #download-btn,
    #submit-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
    .total-pill,
    .format-pill {
        width: 100%;
        text-align: center;
    }
    .paste-actions { align-items: stretch; }
    .paste-status { flex-basis: 100%; }

    .summary-table thead { display: none; }
    .summary-table, .summary-table tbody, .summary-table tr, .summary-table td {
        display: block;
        width: 100%;
    }
    .summary-table tr {
        border: 1px solid var(--slate-200);
        border-radius: 12px;
        margin: 10px;
        padding: 8px 10px;
        background: #fff;
    }
    .summary-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 4px;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }
    .summary-table td:last-child { border-bottom: 0; }
    .summary-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--slate-500);
        text-align: left;
        flex-shrink: 0;
    }
    .comp-spell-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .comp-spell-item { font-size: 0.7rem; padding: 10px 8px; }
    .format-pill {
        white-space: normal;
        line-height: 1.3;
    }
    .paste-hints span {
        width: 100%;
        text-align: center;
    }
    .missing-modal h3 { font-size: 1.05rem; }
    .missing-modal ul { font-size: 0.82rem; padding-left: 24px; }
    .mobile-card input,
    .mobile-card select {
        font-size: 16px;
        min-height: 44px;
    }
    .page-title h2 {
        padding: 0 4px;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 767px) {
    .site-header { padding: 18px 12px 22px; }
    .brand-block { flex-direction: column; gap: 12px; text-align: center; }
    .brand-copy { text-align: center; }
    .brand-logo { width: 84px; height: 84px; }
    .brand-row { flex-wrap: wrap; gap: 8px; }
    .site-header h1 { font-size: 1.35rem; letter-spacing: 0.01em; }
    .header-sub { font-size: 0.8rem; letter-spacing: 0.02em; }
    .header-place { font-size: 0.7rem; }
    .wrap { padding: 16px 12px 32px; }
    .page-title { margin-bottom: 16px; }
    .page-title h2 { font-size: 1.2rem; }
    .contact-query {
        max-width: 100%;
        padding: 12px 14px;
    }
    .contact-btn {
        flex: 1 1 160px;
        font-size: 0.9rem;
    }
    .page-note,
    .paste-note {
        font-size: 0.82rem !important;
        letter-spacing: 0.02em;
        padding: 10px 12px;
        text-align: left;
    }
    .card-pad, .card-head, .card-foot, .summary-head, .summary-foot, .paste-body { padding: 14px; }
    .mobile-rows { padding: 12px; }
    .submit-wrap { padding: 0 0 24px; }
    .success-row { flex-direction: column; gap: 4px; }
    .modal { padding: 24px 16px; border-radius: 18px; max-width: 100%; }
    .or-divider span { width: 48px; height: 48px; font-size: 0.85rem; }
    .muted { font-size: 0.82rem; }
    .school-grid { grid-template-columns: 1fr; }
    .paste-example-head { display: none; }
    .paste-example-row {
        grid-template-columns: 1fr;
        gap: 4px;
        margin-bottom: 8px;
        padding: 10px;
        border: 1px solid #93c5fd;
        border-radius: 10px;
        background: #fff;
    }
    .paste-example-row + .paste-example-row {
        border-top: 1px solid #93c5fd;
    }
    .paste-example-row span {
        display: grid;
        grid-template-columns: 7.5rem 1fr;
        gap: 8px;
        align-items: start;
        overflow-wrap: anywhere;
    }
    .paste-example-row span::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.68rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
}

@media (max-width: 479px) {
    .total-pill { width: 100%; text-align: center; }
    .brand-mark { width: 32px; height: 32px; }
    .brand-logo { width: 72px; height: 72px; }
    .page-title h2 { font-size: 1.05rem; }
    .card { border-radius: 10px; margin-bottom: 14px; }
    .or-divider { gap: 10px; margin: 0 0 14px; }
    .comp-spell-grid { grid-template-columns: 1fr; }
    .section-card { border-width: 2px; }
    .paste-box { min-height: 160px; }
}
