:root {
    --primary: #007c89;
    --primary-dark: #07535b;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --bg: #edf6f7;
    --text: #172033;
    --muted: #64748b;
    --border: #d6e4e7;
    --surface: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(0,124,137,0.18), rgba(237,246,247,0) 260px),
        var(--bg);
}

.app-shell {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: max(18px, env(safe-area-inset-top)) 16px 28px;
}

.hero {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px 0 18px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--success));
    box-shadow: 0 12px 28px rgba(0, 124, 137, 0.24);
    flex: 0 0 auto;
    font-size: 1.45rem;
}

.hero p {
    margin: 0 0 4px;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.12;
}

.lookup-card,
.result-card,
.message {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.1);
}

.lookup-card { padding: 18px; }

label {
    display: block;
    margin: 0 0 7px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #334155;
}

select,
input,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 12px;
    margin-bottom: 15px;
    font-size: 1rem;
    background: #fff;
    color: var(--text);
    outline: none;
}

select:focus,
input:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 124, 137, 0.14);
}

button {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0, 124, 137, 0.2);
}

button:disabled {
    opacity: 0.58;
    cursor: wait;
}

.message {
    margin-top: 14px;
    padding: 14px;
    color: #075985;
    background: #e8f6ff;
    border-color: #bae6fd;
    font-weight: 700;
}

.message.error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.result-card {
    margin-top: 14px;
    padding: 0;
    overflow: hidden;
}

.result-head {
    padding: 16px 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.result-head .status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.17);
    font-size: 0.82rem;
    font-weight: 800;
}

.result-head h2 {
    margin: 0;
    font-size: 1.35rem;
}

.result-head p {
    margin: 5px 0 0;
    color: rgba(255,255,255,0.84);
    font-weight: 700;
}

.info-section {
    border-bottom: 1px solid #eef2f6;
}

.info-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 15px 18px 0;
    color: var(--primary-dark);
    font-size: 1rem;
}

.info-grid {
    padding: 12px 18px 16px;
    display: grid;
    gap: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid #eef2f6;
    padding-bottom: 10px;
}

.info-item:last-child { border-bottom: 0; padding-bottom: 0; }

.info-item span {
    color: var(--muted);
    font-size: 0.9rem;
}

.info-item strong {
    text-align: right;
    font-size: 0.94rem;
    max-width: 64%;
    overflow-wrap: anywhere;
}

.score-strip {
    margin: 16px 18px;
    padding: 13px;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.score-strip div {
    display: grid;
    gap: 3px;
}

.score-strip span {
    color: #166534;
    font-size: 0.82rem;
    font-weight: 800;
}

.score-strip strong {
    color: #14532d;
    font-size: 1.08rem;
}

.doc-list {
    display: grid;
    gap: 8px;
    padding: 12px 18px 16px;
}

.doc-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 11px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    color: var(--muted);
    background: #f8fafc;
    font-size: 0.92rem;
    font-weight: 700;
}

.doc-pill.ok {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.doc-pill.missing {
    color: #94a3b8;
}

.note {
    margin: 0 18px 18px;
    padding: 12px;
    border-left: 4px solid var(--warning);
    background: #fffbeb;
    color: #713f12;
    font-size: 0.9rem;
}

.school-notice {
    margin: 16px 18px 18px;
    padding: 14px;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #713f12;
}

.notice-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    font-weight: 800;
}

.notice-body {
    line-height: 1.45;
    font-size: 0.92rem;
}


.supplement-body {
    padding: 12px 18px 16px;
}

.supplement-empty {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 8px;
    color: #075985;
    background: #e8f6ff;
    border: 1px solid #bae6fd;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
}

.supplement-list {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.supplement-upload {
    padding: 12px;
    border: 1px solid #d6e4e7;
    border-radius: 8px;
    background: #f8fafc;
}

.supplement-upload label,
.supplement-body > form > label {
    margin-bottom: 8px;
    color: #0f4f58;
}

.supplement-upload input[type="file"] {
    margin-bottom: 0;
    padding: 10px;
    background: #fff;
}

.supplement-current {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 9px;
    color: var(--primary-dark);
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
    overflow-wrap: anywhere;
}

textarea {
    min-height: 92px;
    resize: vertical;
    line-height: 1.4;
    font-family: inherit;
}

.supplement-status {
    margin: 0 0 12px;
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.35;
}

.supplement-status.success {
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.supplement-status.error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.supplement-status.info {
    color: #075985;
    background: #e8f6ff;
    border: 1px solid #bae6fd;
}

@media (min-width: 520px) {
    .app-shell { padding-top: 32px; }
}
