/* Schooledu Assistant responsive chat UI */
:root{--green:#128c4a;--green-dark:#08743a;--green-pale:#eaf8ef;--ink:#17231c;--muted:#68756d;--line:#e4ebe6;--chat:#f4f8f5}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--ink)}
body{background:#e9f0eb}
.app-shell{width:100%;max-width:960px;height:100dvh;min-height:540px;margin:auto;background:#fff;display:flex;flex-direction:column;box-shadow:0 8px 28px #10281912;overflow:hidden}
.app-header{display:flex;align-items:center;gap:12px;padding:13px 17px;background:linear-gradient(115deg,var(--green-dark),var(--green));color:#fff;flex-shrink:0}
.app-header small{display:block;opacity:.9;font-size:12px;margin-top:2px}
.brand-icon{width:44px;height:44px;flex:0 0 44px;border-radius:14px;background:#ffffff22;display:grid;place-items:center;font-size:23px}
.chat-area{flex:1;min-height:0;overflow:auto;padding:18px clamp(12px,3vw,25px);background:var(--chat);background-image:radial-gradient(#dce9df 1px,transparent 1px);background-size:20px 20px;scroll-behavior:smooth}
.welcome,.bubble{width:fit-content;max-width:min(90%,720px);padding:13px 16px;border-radius:16px;margin:10px 0;line-height:1.55;overflow-wrap:anywhere;box-shadow:0 2px 7px #1028190a}
.welcome,.bot{background:#fff;border:1px solid #edf1ee;border-top-left-radius:5px}
.user{background:#dff7e5;margin-left:auto;border:1px solid #d1efd9;border-top-right-radius:5px}
.chat-compose{display:flex;gap:10px;align-items:center;padding:11px 13px;padding-bottom:max(11px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fff;flex-shrink:0}
.chat-compose input{min-width:0;flex:1;border:1px solid #dce5df;border-radius:25px;padding:12px 16px;outline:none;background:#f9fbf9}
.chat-compose input:focus{border-color:var(--green);box-shadow:0 0 0 3px #128c4a18;background:#fff}
.chat-compose button{border:0;border-radius:24px;padding:0 22px;min-height:44px;background:var(--green);color:white;font-weight:650}
.chat-compose button:disabled{opacity:.55;cursor:wait}
.quick-replies{display:flex;flex-wrap:wrap;gap:7px;margin:8px 0 12px}
.quick-btn{border:1px solid #b8dfc5;border-radius:10px;background:#fff;color:#08743a;padding:8px 12px;font-size:13px;font-weight:650;cursor:pointer}
.quick-btn:hover{background:var(--green-pale)}
.muted{font-size:12px;color:var(--muted)}
.result-card{max-width:760px;background:#fff;border:1px solid var(--line);border-radius:15px;padding:14px;margin:10px 0;box-shadow:0 4px 14px #16301f08}
.result-card h3,.result-card h4{font-size:15px;margin:0 0 7px}
.result-card p{margin:5px 0;color:#536057;line-height:1.5}
.result-card a{color:#08743a;font-weight:650;text-decoration:none}
.result-card a:hover{text-decoration:underline}
.grant-card{width:100%;max-width:760px;margin:12px 0;padding:16px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 5px 18px #14321e0d}
.grant-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.grant-title{font-size:17px;font-weight:800;line-height:1.35;margin:0}
.verified-pill{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:30px;background:#eaf8ef;color:#08743a;font-size:11px;font-weight:750}
.school-panel{padding:13px;border-radius:13px;background:linear-gradient(120deg,#effaf2,#f7fbf8);border:1px solid #e0f1e5;margin-bottom:11px}
.school-name{font-size:18px;font-weight:800;margin:0 0 8px;overflow-wrap:anywhere}
.meta-chips{display:flex;flex-wrap:wrap;gap:6px}
.meta-chip{padding:5px 9px;border:1px solid #e1ebe4;border-radius:8px;background:#fff;color:#435249;font-size:11px;font-weight:650}
.stat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:11px 0}
.stat-box{padding:12px;border-radius:13px;background:#f6f8f6;border:1px solid #edf1ee;min-width:0}
.stat-label{display:block;color:var(--muted);font-size:10px;font-weight:750;letter-spacing:.06em;text-transform:uppercase;margin-bottom:5px}
.stat-value{display:block;color:#14251a;font-size:clamp(21px,4vw,27px);font-weight:850;line-height:1.15;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.stat-value.green{color:#078342}
.section-label{font-size:13px;font-weight:800;margin:15px 0 9px}
.allocation-list{display:grid;gap:11px}
.allocation-line{display:grid;grid-template-columns:1fr auto;gap:7px;align-items:center;font-size:13px}
.allocation-name{font-weight:650;color:#39483e}
.allocation-amount{font-weight:800;font-variant-numeric:tabular-nums}
.allocation-track{grid-column:1/-1;height:8px;background:#edf2ee;border-radius:20px;overflow:hidden}
.allocation-fill{height:100%;border-radius:20px;background:#16a05a}
.allocation-fill.blue{background:#4386df}.allocation-fill.amber{background:#d99725}
.detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;padding:13px 0;border-top:1px solid var(--line);margin-top:14px}
.detail-item{min-width:0}.detail-value{display:block;font-size:13px;font-weight:750;margin-top:3px;overflow-wrap:anywhere}
.grant-footer{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:11px;color:var(--muted);font-size:11px}
.grant-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:11px}
.grant-action{border:1px solid #dce8df;border-radius:9px;background:#fff;color:#24633d;padding:7px 11px;font-size:12px;font-weight:700;cursor:pointer}
.grant-action:hover{background:var(--green-pale)}
.chat-error{color:#a32929;background:#fff4f4;border:1px solid #f2d2d2;border-radius:12px;padding:10px 12px;margin:8px 0;font-size:13px}
.typing{display:inline-flex;gap:5px;padding:12px 14px;background:white;border:1px solid var(--line);border-radius:14px;margin:8px 0}
.typing i{width:6px;height:6px;background:#80b895;border-radius:50%;animation:pulse 1s infinite ease-in-out}
.typing i:nth-child(2){animation-delay:.15s}.typing i:nth-child(3){animation-delay:.3s}
@keyframes pulse{0%,60%,100%{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
@media(min-width:961px){.app-shell{height:94vh;min-height:620px;margin:3vh auto;border-radius:18px}}
@media(max-width:600px){.app-shell{height:100dvh;min-height:0}.app-header{padding:10px 12px}.chat-area{padding:12px 9px}.welcome,.bubble{max-width:96%;padding:11px 13px}.grant-card{padding:12px;border-radius:15px}.school-name{font-size:16px}.chat-compose{padding:9px}.chat-compose button{padding:0 17px}}
