/* ZuydChat — flat Zuyd-style layer over Tailwind. No build step. Mobile-first.
   Flat solid colors only: no gradients, no purple, borders instead of shadows. */
:root{
  --paper:#F4F6F8; --card:#FFFFFF;
  --ink:#1A2B3C; --muted:#5A6E82;
  --zuyd:#0B3D66; --zuyd-dark:#082E4F;
  --accent:#E94E1B; --accent-dark:#C93F13;
  --green:#1E8E5A;
  --line:#D8E0E8; --line-soft:#E5EBF1;
  --radius:14px;
}
*{ -webkit-tap-highlight-color: transparent; }
html{ color-scheme: light; }
body{ text-rendering: optimizeLegibility; background:var(--paper); }
[x-cloak]{ display:none !important; }
::selection{ background:#CFE0EE; }

/* ---------- background: flat, no decoration ---------- */
.bg-scene{ display:none; }
.orb,.grid-overlay,.noise-overlay{ display:none; }

/* ---------- type / helpers ---------- */
.eyebrow{ margin-top:0; display:inline-flex; align-items:center; gap:.5rem; font-size:12px; letter-spacing:.08em; text-transform:uppercase; font-weight:800; color:var(--zuyd); background:#E7EEF5; border:1px solid var(--line); padding:.4rem .7rem; border-radius:999px; }
.text-gradient{ color:var(--zuyd); }
.dot-live{ width:8px;height:8px;border-radius:99px;background:var(--green); display:inline-block; }
.reveal{ animation:rise .45s ease-out both; animation-delay:var(--d,0ms); }
@keyframes rise{ from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:none} }
.trust-chip{ display:inline-flex; align-items:center; gap:.35rem; background:var(--card); border:1px solid var(--line); color:var(--muted); font-weight:700; padding:.45rem .85rem; border-radius:999px; }
.profile-tag{ display:inline-block; font-size:11px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:var(--zuyd); background:#E7EEF5; border:1px solid var(--line); padding:.28rem .6rem; border-radius:6px; }
.avatar-ring{ border:2px solid var(--card); outline:2px solid var(--line); }

/* ---------- nav / buttons / fields ---------- */
.logo-mark{ width:40px;height:40px; display:grid; place-items:center; border-radius:10px; background:var(--zuyd); flex-shrink:0; }
.nav-link{ padding:.5rem .9rem; border-radius:8px; color:var(--ink); font-weight:700; }
.nav-link:hover{ background:#E7EEF5; }
.nav-link-muted{ border:1px solid var(--line); background:var(--card); font-size:13px; }
.btn-primary{ display:inline-flex; align-items:center; justify-content:center; gap:.4rem; background:var(--accent); color:#fff; font-weight:800; padding:.85rem 1.5rem; border-radius:10px; border:1px solid transparent; transition:background .15s ease; }
.btn-primary:hover{ background:var(--accent-dark); }
.btn-primary:disabled{ opacity:.6; cursor:wait; }
.btn-chat{ border-radius:10px; font-size:1rem; padding:1rem 1.5rem; }
.btn-ghost{ display:inline-flex; align-items:center; justify-content:center; gap:.4rem; padding:.85rem 1.3rem; border-radius:10px; border:1px solid var(--zuyd); background:var(--card); color:var(--zuyd); font-weight:800; transition:background .15s ease; }
.btn-ghost:hover{ background:#E7EEF5; }
.btn-sm{ padding:.55rem .95rem; font-size:.85rem; border-radius:8px; }
.btn-danger{ padding:.55rem .95rem; font-size:.85rem; border-radius:8px; border:1px solid #D9A79B; color:#93331A; background:#FDEEE7; font-weight:800; }
.btn-danger:hover{ background:#FADFD2; }
.icon-btn{ width:40px;height:40px; display:grid; place-items:center; border-radius:8px; border:1px solid var(--line); background:var(--card); color:var(--ink); font-weight:800; }
.icon-btn:hover{ background:#E7EEF5; }
.field-label{ display:block; font-size:13px; font-weight:800; color:var(--ink); margin-bottom:.4rem; }
.field-input{ width:100%; background:var(--card); border:1px solid var(--line); border-radius:10px; padding:.75rem .95rem; color:var(--ink); outline:none; transition:border .15s ease; font-weight:600; }
.field-input:focus{ border-color:var(--zuyd); box-shadow:0 0 0 3px #CFE0EE; }
.field-input::placeholder{ color:#8CA0B3; font-weight:500; }
.field-error{ border-color:#B3402A !important; }
.field-hint{ font-size:12px; color:var(--muted); margin-top:.35rem; }
.field-hint-error{ font-size:13px; color:#93331A; font-weight:700; }
.field-hint-ok{ font-size:13px; font-weight:700; color:#14532D; background:#E6F4EC; border:1px solid #B7DCC4; padding:.6rem .8rem; border-radius:10px; }
.file-input{ padding:.6rem; font-size:13px; }
.file-input::file-selector-button{ background:var(--zuyd); border:none; color:#fff; border-radius:8px; padding:.45rem .85rem; margin-right:.7rem; cursor:pointer; font-weight:700; }
.check{ display:flex; align-items:center; gap:.5rem; font-size:14px; font-weight:700; color:var(--ink); }
.check input{ width:18px;height:18px; accent-color:var(--zuyd); }
.flash{ display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.85rem 1rem; border-radius:12px; font-size:14px; font-weight:600; border:1px solid var(--line); background:var(--card); }
.flash-ok,.flash-success{ border-color:#B7DCC4; background:#E6F4EC; }
.flash-error{ border-color:#D9A79B; background:#FDEEE7; }
.flash-close{ opacity:.6; } .flash-close:hover{opacity:1}
.flash .flash-close{ flex-shrink:0; }

/* ---------- student cards: 2-col grid, flat, bordered, generous whitespace ---------- */
#persona-grid{ align-items:stretch; }
.persona-card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; transition:border-color .15s ease; display:flex; flex-direction:column; }
.persona-card:hover{ border-color:var(--zuyd); }
.persona-photo-wrap{ position:relative; aspect-ratio:4/3; overflow:hidden; background:#E7EEF5; border-bottom:1px solid var(--line-soft); }
.persona-photo{ width:100%; height:100%; object-fit:cover; display:block; }
.persona-gradient{ display:none; }
.persona-status{ position:absolute; left:.8rem; bottom:.8rem; z-index:2; display:inline-flex; align-items:center; gap:.45rem; font-size:12px; font-weight:800; color:#14532D; background:#fff; border:1px solid var(--line); padding:.4rem .7rem; border-radius:999px; }
.persona-intro{ margin-top:.5rem; font-size:.98rem; line-height:1.6; color:var(--muted); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; min-height:4.7em; }

/* ---------- hero demo card (kept for base compat) ---------- */
.hero-card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:1.1rem; }
.hero-card-head{ display:flex; align-items:center; justify-content:space-between; padding-bottom:.8rem; border-bottom:1px solid var(--line-soft); margin-bottom:.9rem; }
.hero-dots{ display:flex; gap:6px; } .hero-dots i{ width:10px;height:10px;border-radius:99px;background:#C4D2E0; display:block; }
.hero-dots i:first-child{ background:var(--accent); } .hero-dots i:nth-child(2){ background:#E9A13B; } .hero-dots i:last-child{ background:var(--green); }
.hero-bubble-row{ display:flex; margin-bottom:.6rem; }
.hero-typing{ display:flex; align-items:center; background:var(--paper); border:1px solid var(--line); width:fit-content; padding:.6rem .9rem; border-radius:12px; }
.hero-typing span, .typing-bubble span{ width:7px;height:7px;border-radius:99px;background:#8CA0B3; display:inline-block; margin-right:4px; animation:blink 1.2s infinite; }
.typing-bubble span:nth-child(2),.hero-typing span:nth-child(2){ animation-delay:.2s } .typing-bubble span:nth-child(3),.hero-typing span:nth-child(3){ animation-delay:.4s }
@keyframes blink{ 0%,100%{opacity:.3} 50%{opacity:1} }

/* ---------- how it works ---------- */
.how-grid{ display:grid; gap:1rem; grid-template-columns:1fr; }
@media(min-width:640px){ .how-grid{ grid-template-columns:repeat(3,1fr); } }
.how-step{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:1.4rem; }
.how-num{ width:34px;height:34px; display:grid; place-items:center; border-radius:8px; font-weight:800; font-size:1rem; background:var(--zuyd); color:#fff; margin-bottom:.8rem; }
.how-step:nth-child(3) .how-num{ background:var(--accent); }
.how-step h3{ font-weight:800; font-size:1.05rem; margin-bottom:.25rem; color:var(--ink); }
.how-step p{ font-size:.92rem; color:var(--muted); line-height:1.6; }

/* ---------- modal: bottom-sheet mobile, centered desktop ---------- */
.modal-backdrop{ position:fixed; inset:0; z-index:60; background:rgba(8,30,50,.55); display:flex; align-items:flex-end; justify-content:center; padding:0; }
@media(min-width:640px){ .modal-backdrop{ align-items:center; padding:1.5rem; } }
.modal-card{ position:relative; width:100%; max-width:27rem; background:var(--card); border:1px solid var(--line); border-radius:16px 16px 0 0; padding:1.4rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom)); max-height:92dvh; overflow-y:auto; }
@media(min-width:640px){ .modal-card{ border-radius:16px; padding:1.7rem; } }
.modal-handle{ width:44px; height:5px; border-radius:999px; background:var(--line); margin:0 auto .9rem; }
@media(min-width:640px){ .modal-handle{ display:none; } }
.modal-avatar{ width:44px; height:44px; display:grid; place-items:center; border-radius:10px; background:var(--zuyd); color:#fff; font-size:1.2rem; flex-shrink:0; }

/* ---------- chat ---------- */
.chat-page{ padding-bottom:env(safe-area-inset-bottom); }
.status-pill{ display:inline-flex; align-items:center; gap:.45rem; padding:.42rem .75rem; border-radius:999px; border:1px solid var(--line); background:var(--card); color:var(--muted); }
.status-dot{ width:8px;height:8px;border-radius:99px; background:#8CA0B3; }
.status-open .status-dot{ background:var(--green); }
.status-connecting .status-dot,.status-reconnecting .status-dot{ background:#E9A13B; }
.status-closed .status-dot{ background:#8CA0B3; }
.chat-notice{ margin-top:1.2rem; font-size:.88rem; color:var(--muted); background:var(--card); border:1px solid var(--line); border-radius:12px; padding:.85rem 1rem; line-height:1.6; }
.chat-notice strong{ color:var(--ink); }
.thread{ display:flex; flex-direction:column; gap:.7rem; padding:1.2rem 0 1rem; }
.msg-row{ display:flex; flex-direction:column; max-width:88%; }
@media(min-width:640px){ .msg-row{ max-width:72%; } }
.msg-mine-row{ align-self:flex-end; align-items:flex-end; }
.msg-them-row{ align-self:flex-start; align-items:flex-start; }
.bubble{ padding:.72rem 1rem; border-radius:16px; font-size:.96rem; line-height:1.5; word-break:break-word; white-space:pre-wrap; font-weight:500; }
.bubble-me{ background:var(--zuyd); color:#fff; border-bottom-right-radius:6px; }
.bubble-them{ background:var(--card); border:1px solid var(--line); color:var(--ink); border-bottom-left-radius:6px; }
.msg-time{ font-size:10px; color:#8CA0B3; margin-top:.25rem; }
.empty-thread{ text-align:center; padding:3rem 1.2rem; background:var(--card); border:1px solid var(--line); border-radius:var(--radius); color:var(--muted); }
.closed-box{ margin-top:1.5rem; background:var(--card); border:1px solid #D9A79B; border-radius:var(--radius); padding:1.5rem; }
.empty-box{ text-align:center; padding:2rem; background:var(--card); border:1px solid var(--line); border-radius:var(--radius); color:var(--muted); font-weight:600; }
.composer-bar{ position:fixed; left:0; right:0; bottom:0; z-index:30; background:var(--paper); border-top:1px solid var(--line); padding-top:.7rem; }
.composer-inner{ background:var(--card); border:1px solid var(--line); border-radius:12px; padding:.55rem; }
.composer-input{ flex:1; background:var(--paper); border:1px solid transparent; border-radius:8px; padding:.78rem .95rem; color:var(--ink); outline:none; min-width:0; font-weight:600; }
.composer-input:focus{ border-color:var(--zuyd); background:var(--card); }
.composer-send{ white-space:nowrap; border-radius:8px; }
.composer-hint{ font-size:11px; color:#8A5F00; padding:.2rem .4rem .5rem; font-weight:700; }

/* ---------- admin (flat, same shell) ---------- */
.admin-side{ padding:1.2rem 1rem; border-bottom:1px solid var(--line); background:var(--card); position:sticky; top:65px; z-index:20; }
@media(min-width:1024px){ .admin-side{ border-bottom:none; border-right:1px solid var(--line); min-height:calc(100vh - 0px); position:sticky; top:0; padding:1.6rem 1.2rem; display:flex; flex-direction:column; gap:1.4rem; } }
.admin-nav{ display:flex; gap:.4rem; margin-top:1rem; overflow-x:auto; }
@media(min-width:1024px){ .admin-nav{ flex-direction:column; } }
.admin-nav-link{ padding:.6rem .9rem; border-radius:8px; font-size:14px; font-weight:700; color:var(--muted); border:1px solid transparent; white-space:nowrap; }
.admin-nav-link:hover{ background:#E7EEF5; color:var(--ink); }
.admin-nav-link.is-active{ background:#E7EEF5; border-color:var(--zuyd); color:var(--zuyd); }
.admin-side-foot{ display:flex; gap:.3rem; margin-top:.5rem; }
@media(min-width:1024px){ .admin-side-foot{ margin-top:auto; flex-direction:column; } }
.admin-main{ padding:1.2rem 1rem 3rem; max-width:60rem; width:100%; }
@media(min-width:640px){ .admin-main{ padding:2rem 1.8rem 4rem; } }
.admin-top{ display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; }
.admin-count{ background:var(--card); border:1px solid var(--line); padding:.35rem .7rem; border-radius:999px; }
.admin-panel{ margin-top:1.2rem; background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:1.2rem; }
@media(min-width:640px){ .admin-panel{ padding:1.5rem; } }
.admin-panel-title{ font-weight:800; font-size:1.15rem; margin-bottom:1rem; color:var(--ink); }
.admin-form-grid{ display:grid; gap:.9rem; grid-template-columns:1fr; }
@media(min-width:640px){ .admin-form-grid{ grid-template-columns:1fr 1fr; } }
.admin-card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:1.1rem; }
@media(min-width:640px){ .admin-card{ padding:1.3rem; } }
.admin-auth-card{ background:var(--card); border:1px solid var(--line); border-radius:16px; padding:1.8rem; }
.admin-error:empty{ display:none; }
.admin-error:not(:empty){ margin-top:1rem; font-size:13px; font-weight:700; color:#93331A; background:#FDEEE7; border:1px solid #D9A79B; padding:.6rem .8rem; border-radius:10px; }
.admin-flash:empty{ display:none; }
.admin-flash:not(:empty){ margin-top:1rem; font-size:14px; font-weight:600; background:#E6F4EC; border:1px solid #B7DCC4; padding:.7rem .9rem; border-radius:12px; }
.admin-filter{ display:grid; gap:.6rem; grid-template-columns:1fr; margin-top:1rem; }
@media(min-width:640px){ .admin-filter{ grid-template-columns:1fr 180px auto; } }
.admin-table-wrap{ overflow-x:auto; border:1px solid var(--line); border-radius:12px; background:var(--card); }
.admin-table{ width:100%; border-collapse:collapse; font-size:14px; min-width:640px; }
.admin-table th{ text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.08em; font-weight:800; color:var(--muted); padding:.8rem 1rem; border-bottom:1px solid var(--line); background:var(--paper); }
.admin-table td{ padding:.9rem 1rem; border-bottom:1px solid var(--line-soft); vertical-align:top; }
.admin-table tr:last-child td{ border-bottom:none; }
.badge{ font-size:11px; font-weight:800; padding:.28rem .65rem; border-radius:999px; border:1px solid var(--line); background:var(--paper); color:var(--muted); text-transform:lowercase; }
.badge-active,.badge-online{ border-color:#B7DCC4; color:#14532D; background:#E6F4EC; }
.badge-pending{ border-color:#E5C877; color:#6E4E00; background:#FBF3DC; }
.badge-closed,.badge-offline{ color:var(--muted); }
.admin-meta{ display:grid; grid-template-columns:1fr 1fr; gap:.4rem .9rem; margin-top:.7rem; font-size:13px; }
.admin-meta dt{ color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.08em; font-weight:800; }
.admin-meta dd{ color:var(--ink); font-weight:600; }
.irc-hint{ font-size:13px; color:var(--ink); background:#E7EEF5; border:1px solid var(--line); border-radius:10px; padding:.7rem .9rem; line-height:1.6; }
.irc-hint strong{ color:var(--ink); }
.switch{ position:relative; display:inline-block; }
.switch input{ position:absolute; opacity:0; }
.switch span{ display:block; width:40px; height:22px; border-radius:99px; background:#C4D2E0; border:1px solid var(--line); position:relative; }
.switch span::after{ content:""; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:99px; background:#fff; transition:left .2s ease; }
.switch input:checked + span{ background:var(--green); border-color:var(--green); }
.switch input:checked + span::after{ left:20px; }

/* focus visibility */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{ outline:2px solid var(--zuyd); outline-offset:2px; }

/* reduced motion */
@media (prefers-reduced-motion: reduce){ .reveal{animation:none} .hero-typing span,.typing-bubble span{ animation:none } *{ transition-duration:.01ms !important; animation-duration:.01ms !important; } }
