@charset "utf-8";
:root {
  --navy: #14305a;
  --navy-dark: #0c1f3d;
  --gold: #8a6f1f;
  --gold-soft: #e3c365;
  --cream: #f8f3e4;
  --paper: #ffffff;
  --ink: #1b2a44;
  --muted: #5b6b86;
  --line: #e1d6b3;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --arabic: "Amiri", "Noto Naskh Arabic", "Scheherazade New", "Traditional Arabic", serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--cream); line-height: 1.55; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button:focus-visible, textarea:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #9cc4ee; outline-offset: 2px; }

/* chat page: a full-height chat box */
body.chat { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background-color: var(--cream); background-image: url("/img/pattern.svg"); }
.chat-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--navy); color: #fff; box-shadow: 0 2px 10px rgba(12, 31, 61, 0.25); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name { font-family: var(--serif); font-size: 1.2rem; line-height: 1.15; }
.brand-sub { font-size: 0.8rem; color: #cbd9ee; }
.head-actions { display: flex; gap: 8px; flex: none; }
.hbtn { font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; border-radius: 999px; padding: 7px 15px; color: #fff; background: transparent; border: 1.5px solid rgba(255, 255, 255, 0.5); }
.hbtn:hover { background: rgba(255, 255, 255, 0.12); }
.hbtn.gold { background: var(--gold-soft); border-color: var(--gold-soft); color: var(--navy-dark); }
.hbtn.gold:hover { background: #ecd07f; }

.chat-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 14px 8px; }
.chat-col { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.welcome { text-align: center; padding: 6px 0 4px; }
.arabic { font-family: var(--arabic); font-size: 1.9rem; margin: 0; line-height: 1.7; color: var(--navy); }
.translit { margin: 0; font-family: var(--serif); font-style: italic; font-size: 0.98rem; color: var(--gold); }

.log { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: flex-end; gap: 9px; }
.row.me { justify-content: flex-end; }
.row.note { justify-content: center; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; }
.bubble { max-width: min(86%, 600px); padding: 10px 15px; border-radius: 18px; overflow-wrap: anywhere; }
.bubble p { margin: 0; white-space: pre-wrap; }
.bubble p + p { margin-top: 0.7em; }
.row.bot .bubble { background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: 0 1px 3px rgba(20, 48, 90, 0.07); }
.row.me .bubble { background: var(--navy); color: #fff; border-bottom-right-radius: 5px; }
.row.note .bubble { max-width: 92%; background: #fff7de; border: 1px solid var(--line); font-size: 0.92rem; text-align: center; border-radius: 14px; }
.bubble.dots { display: flex; gap: 5px; padding: 14px 16px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out both; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: 0.6; } }

.starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 2px 0 10px; }
.starters[hidden] { display: none; }
.chip { font: inherit; font-size: 0.92rem; cursor: pointer; color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; }
.chip:hover { background: #fff7de; border-color: var(--gold); }

.chat-foot { flex: none; padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: rgba(248, 243, 228, 0.97); border-top: 1px solid var(--line); }
.composer { max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 6px 6px 6px 16px; box-shadow: 0 2px 8px rgba(20, 48, 90, 0.08); }
.composer:focus-within { border-color: var(--gold); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); padding: 8px 0; max-height: 150px; line-height: 1.45; }
.send { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer; background: var(--navy); color: #fff; }
.send:hover { background: var(--navy-dark); }
.send:disabled { opacity: 0.45; cursor: default; }
.fineprint { max-width: 760px; margin: 8px auto 0; font-size: 0.76rem; line-height: 1.45; color: var(--muted); text-align: center; }

@media (max-width: 560px) {
  .brand-sub { display: none; }
  .hbtn { padding: 7px 12px; font-size: 0.85rem; }
  .hbtn .long { display: none; }
  .arabic { font-size: 1.6rem; }
  .bubble { max-width: 90%; }
}

/* team review pages */
body.review { background: var(--cream); }
.rv { max-width: 860px; margin: 0 auto; padding: 22px 18px 50px; }
.rv h1 { font-size: 1.5rem; color: var(--navy); margin: 16px 0; }
.rvnav { display: flex; flex-wrap: wrap; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rvtable { width: 100%; border-collapse: collapse; background: #fff; }
.rvtable th, .rvtable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.rvmsg { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 10px 0; list-style: none; }
.rvmsg span { color: #5b6b86; font-size: 0.85rem; }
.rvmsg p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.rvuser { background: #eef4fb; }
.rvlist { padding: 0; }
.rvnote { font-size: 0.9rem; color: #5b6b86; }
.rvform { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rvform input[type="text"], .rvform textarea { flex: 1 1 260px; border: 1px solid var(--line); border-radius: 8px; padding: 7px; font: inherit; }
.rvform button { font: inherit; border-radius: 8px; padding: 6px 12px; border: 1px solid var(--gold); background: var(--gold); color: #fff; cursor: pointer; }
.rvform button.ghost { background: #fff; color: var(--gold); }
.tagfix { color: #9b2c1f; font-style: normal; font-weight: 600; }
.taggood { color: #1f6b3b; font-style: normal; font-weight: 600; }
.rvh2 { font-size: 1.2rem; color: var(--navy); margin: 26px 0 10px; }
.rvmeter { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.rvadd { display: flex; flex-direction: column; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.rvadd label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 0.92rem; }
.rvadd input[type="text"], .rvadd select, .rvadd textarea { font: inherit; font-weight: 400; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.rvadd button { align-self: flex-start; font: inherit; border-radius: 8px; padding: 8px 16px; border: 1px solid var(--gold); background: var(--gold); color: #fff; cursor: pointer; }
.rvhint { margin: 0; font-size: 0.88rem; color: var(--muted); }
.rvdoc { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 70vh; overflow-y: auto; }
.rvsure { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.rvtable td .rvform { margin-top: 4px; }

/* mentor request dialog */
.mentor-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; border: 0; border-radius: 20px; padding: 22px 22px 18px; background: #fff; color: var(--ink); box-shadow: 0 20px 60px rgba(12, 31, 61, 0.4); }
.mentor-dialog::backdrop { background: rgba(12, 31, 61, 0.55); }
.mentor-dialog h2 { font-size: 1.4rem; color: var(--navy); margin-bottom: 6px; }
.mhelp { margin: 0 0 14px; font-size: 0.92rem; color: var(--muted); }
.mentor-dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: 600; margin-bottom: 12px; }
.mentor-dialog input[type="text"], .mentor-dialog select, .mentor-dialog textarea { font: inherit; font-weight: 400; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; width: 100%; }
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.mentor-dialog label.consent { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 0.88rem; background: #fff7de; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.consent input { margin-top: 3px; flex: none; }
.merror { margin: 0 0 10px; color: #9b2c1f; font-size: 0.92rem; }
.mactions { display: flex; justify-content: flex-end; gap: 10px; }
.mbtn { font: inherit; font-weight: 600; cursor: pointer; border-radius: 999px; padding: 9px 20px; border: 1.5px solid var(--navy); background: #fff; color: var(--navy); }
.mbtn.primary { background: var(--navy); color: #fff; }
.mbtn:disabled { opacity: 0.55; cursor: default; }
@media (max-width: 520px) { .mgrid { grid-template-columns: 1fr; } }
