:root {
  --accent: #1E3A6E;
  --bg: #FBF8F2;
  --card: #FFFFFF;
  --text: #22201C;
  --muted: #5E5A52;
  --line: #E4DED2;
  --soft: #F6F2EA;
  --whatsapp: #1F7A4C;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Lora, Georgia, serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--accent); }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 20px; }
.ar { font-family: Amiri, serif; }
.desktop-only { display: none; }

/* ---------- Phone layout (default) ---------- */

/* Header */
header { padding-top: 4px; }
.names { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.name-ar { font-family: Amiri, serif; font-size: 19px; color: var(--accent); line-height: 1.2; }
.name-en { font-size: 17px; font-weight: 600; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--line); }
.head-name { font-family: Amiri, serif; font-size: 19px; color: var(--accent); padding-bottom: 8px; }
nav {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin: 4px 0 0;
}
nav a:first-child { padding-left: 0; }
nav a { padding: 10px 12px; text-decoration: none; color: var(--muted); font-size: 15px; }
nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); margin-bottom: -1px; }

main.wrap { padding: 22px 20px 32px; display: flex; flex-direction: column; gap: 16px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: #EFEAE0; flex-shrink: 0; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.label { font-size: 13px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
h1 { margin: 0; font-size: 22px; font-weight: 600; }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 48px; border-radius: 10px;
  background: var(--accent); color: #fff; text-decoration: none; font-size: 16px; font-weight: 500;
}
.btn.btn-outline { background: var(--card); color: var(--text); border: 1px solid #D9D2C4; font-size: 15px; font-weight: 400; }
.btn .star { color: #B7791F; }
.trust { font-size: 14px; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, white); border-radius: 999px; padding: 6px 14px; }

/* Home */
.hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.hero-actions .btn-outline { font-size: 16px; }
.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 20px; }
.hero .photo { width: 72px; height: 72px; }
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); text-decoration: none; }
.rating .stars { color: #1E8F5F; letter-spacing: 1px; }
.rating strong { font-weight: 600; }
.hero-body { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.hero-body p { margin: 0; }
.hero-ar { font-family: Amiri, serif; font-size: 28px; line-height: 1.3; color: var(--accent); }
.lead { font-size: 17px; }
.subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.tile .ar { font-size: 18px; color: var(--accent); }
.tile div:last-child { font-size: 14px; }

/* About */
.about-grid { display: flex; flex-direction: column; gap: 16px; }
.about-side { display: flex; flex-direction: column; gap: 16px; }
.about-actions { display: flex; flex-direction: column; gap: 10px; }
.bio { display: flex; gap: 16px; align-items: center; }
.bio .photo { width: 72px; height: 72px; }
.bio p { margin: 0; font-size: 15px; }
.bio-name { display: none; }
.bio-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 4px; }
.bio-title strong { font-size: 16px; font-weight: 600; }
.bio-title .ar { font-size: 18px; color: var(--accent); }
.ticks { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ticks li { padding-left: 28px; position: relative; font-size: 15px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 7px;
  border-left: 2.2px solid var(--accent); border-bottom: 2.2px solid var(--accent); transform: rotate(-45deg);
}
.rows { margin-top: 10px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #F0EBE1; font-size: 15px; }
.row:last-child { border-bottom: 0; }
.row span:last-child { color: var(--muted); text-align: right; }

/* Book */
.pay-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.pay-text { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.pay-label { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pay-title { font-size: 16px; font-weight: 600; }
.pay-price .amount { font-size: 20px; font-weight: 600; }
.pay-small { font-size: 13px; color: var(--muted); padding-top: 10px; border-top: 1px solid #F0EBE1; }
.pay-card .pay { background: rgba(255,255,255,0.6); margin-top: 4px; }
.title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.book-grid { display: flex; flex-direction: column; gap: 16px; }
.book-side { display: flex; flex-direction: column; gap: 14px; }
#cal-inline { width: 100%; min-height: 560px; overflow: auto; }
.cal-card { padding: 8px; }
.pay { background: var(--soft); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.account { font-family: ui-monospace, Menlo, monospace; font-size: 14px; word-break: break-all; }
.notes { text-align: center; margin: 0; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 16px 0; font-size: 13px; color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
footer a { text-decoration: none; font-weight: 500; }

/* ---------- Desktop layout ---------- */
@media (min-width: 900px) {
  .wrap { max-width: 1120px; padding: 0 40px; }
  .desktop-only { display: block; }

  header { padding-top: 0; border-bottom: 1px solid var(--line); }
  .head { align-items: center; padding-top: 12px; padding-bottom: 12px; border-bottom: 0; }
  .head-name { font-size: 24px; padding-bottom: 0; }
  .hero-actions { display: flex; flex-wrap: wrap; gap: 12px; width: auto; }
  .hero-actions .btn { min-width: 160px; }
  .lessons .rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .lessons .row { flex-direction: column; justify-content: flex-start; gap: 2px; border: 0; padding: 0; }
  .lessons .row span:first-child { font-size: 14px; color: var(--muted); }
  .lessons .row span:last-child { text-align: left; color: var(--text); font-size: 17px; }
  .names { justify-content: flex-start; }
  .name-ar { font-size: 24px; }
  .name-en { font-size: 20px; }
  nav { margin: 0; border-bottom: 0; gap: 4px; }
  nav a, nav a:first-child { padding: 10px 14px; }

  main.wrap { padding: 32px 40px; gap: 20px; }
  h1 { font-size: 32px; font-weight: 500; }

  /* Home */
  .hero { text-align: left; padding: 32px 40px; border-radius: 20px; }
  .hero .photo { width: 200px; height: 200px; }
  .rating { font-size: 15px; }
  .rating .stars { font-size: 17px; }
  .hero-body { align-items: flex-start; gap: 12px; }
  .hero-ar { font-size: 34px; }
  .lead { font-size: 20px; line-height: 1.4; }
  .hero-body .muted { font-size: 16px; }
  .hero-body .btn { width: auto; padding: 0 28px; min-height: 50px; }
  .subjects { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .ticks.quals { display: block; columns: 2; column-gap: 32px; }
  .ticks.quals li { break-inside: avoid; margin-bottom: 12px; }
  .ticks li { font-size: 16px; }
  .tile { padding: 20px; border-radius: 14px; }
  .tile .ar { font-size: 22px; }

  /* About */
  .about-grid {
    display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px 32px;
    grid-template-areas: "bio side" "actions side"; align-items: start;
  }
  .about-grid .bio { grid-area: bio; flex-direction: column; text-align: center; padding: 32px; border-radius: 20px; }
  .about-grid .bio .photo { width: 160px; height: 160px; }
  .home-bio { gap: 20px; padding: 20px 28px; }
  .home-bio .photo { width: 88px; height: 88px; }
  .home-bio p { font-size: 17px; }
  .bio-title strong { font-size: 20px; }
  .bio-title .ar { font-size: 22px; }
  .bio-name { display: block; font-size: 24px; color: var(--accent); margin-bottom: 8px; }
  .bio p { font-size: 16px; }
  .about-side { grid-area: side; gap: 24px; }
  .about-side .card { padding: 24px 28px; }
  .about-actions { grid-area: actions; }

  /* Book */
  main.wrap.narrow { max-width: 880px; }
  .pay-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 24px; padding: 20px 24px; border-radius: 16px; }
  .pay-small { grid-column: 1 / -1; margin-top: 0; }
  .pay-title { font-size: 18px; }
  .pay-price { text-align: right; flex-shrink: 0; }
  .pay-price .amount { font-size: 22px; }
  .book-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
  .cal-card { border-radius: 20px; padding: 16px; }
}

[hidden] { display: none !important; }
