@font-face { font-family: "InternD"; src: url(fonts/InternDisplay-SemiBold.ttf); font-weight: 600; font-display: swap; }
@font-face { font-family: "InternD"; src: url(fonts/InternDisplay-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: "Intern"; src: url(fonts/Intern-SemiBold.ttf); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/Inter-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/Inter-Medium.ttf); font-weight: 500; font-display: swap; }

:root {
  --bg: #F2F5F9; --navy: #1D2C57; --blue: #2F6DB5; --sky: #8DB8E4; --ink: #3A4452; --muted: #6B7380;
  --line: #DCE3EC; --white: #FFFFFF; --gold: #D8A45D; --green: #2E8B57; --red: #C2453B;
  --body: "Inter", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --head: "InternD", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --semi: "Intern", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --r: 16px; --shadow: 0 4px 22px rgba(29, 44, 87, .09);
}
html[lang="ar"] { --body: "IBM Plex Sans Arabic", system-ui, sans-serif; --head: "IBM Plex Sans Arabic", system-ui, sans-serif; --semi: "IBM Plex Sans Arabic", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); }
body { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo { height: 38px; display: block; }
.sep { width: 2px; height: 28px; background: var(--line); }
.product { font: 700 24px var(--head); color: var(--navy); white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.tour-btn { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--white); color: var(--navy); border-radius: 999px; padding: 6px 14px 6px 8px; font: 600 14px var(--semi); }
html[dir="rtl"] .tour-btn { padding: 6px 8px 6px 14px; }
.mini-mascot { width: 26px; height: 26px; display: inline-block; }
.lang { position: relative; z-index: 10050; display: flex; background: var(--white); border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.lang button { border: 0; background: transparent; color: var(--navy); border-radius: 999px; padding: 6px 13px; font: 600 14px var(--semi); }
.lang button.on { background: var(--navy); color: var(--white); }
body.touring .lang { box-shadow: 0 0 0 4px rgba(141, 184, 228, .55), var(--shadow); }

/* layout */
.app { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: 18px; padding: 0 24px 12px; min-height: 0; }
.chat { min-width: 0; background: var(--white); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.msgs { flex: 1; overflow-y: auto; padding: 22px 20px 8px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { max-width: 94%; font-size: 15px; line-height: 1.5; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.agent { align-self: flex-start; }
.msg.user { align-self: flex-end; background: var(--navy); color: var(--white); padding: 11px 15px; border-radius: 16px 16px 4px 16px; }
html[dir="rtl"] .msg.user { border-radius: 16px 16px 16px 4px; }
.who { display: flex; align-items: center; gap: 7px; font: 600 13px var(--semi); color: var(--blue); margin-bottom: 4px; }
.who i { width: 18px; height: 18px; border-radius: 50%; background: var(--navy) url(img/sphinx-face-white.png) center/12px no-repeat; display: inline-block; }
.understood { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.understood span { background: var(--bg); border-radius: 8px; padding: 4px 9px; font: 500 13px var(--body); color: var(--navy); }
.q { font: 600 15px var(--semi); color: var(--navy); margin: 8px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--white); color: var(--navy); border-radius: 999px; padding: 8px 14px; font: 500 14px var(--body); text-align: start; }
.chip:hover { border-color: var(--sky); }
.chip.on { background: var(--sky); border-color: var(--sky); }
.chip.example { border-radius: 12px; line-height: 1.4; }
.picks { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pick { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; text-align: start; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--white); }
.pick:hover { border-color: var(--sky); }
.pick.on { border-color: var(--blue); background: #EEF4FA; }
.sw { width: 34px; height: 34px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.pn { font: 600 15px var(--semi); color: var(--navy); }
.ps { font: 400 13px var(--body); color: var(--muted); margin-top: 2px; }
.tag { font: 600 12px var(--semi); color: var(--white); background: var(--blue); padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.tag.alt { background: var(--muted); }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sky); animation: blinkdot 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blinkdot { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.composer { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 400 15px var(--body); color: var(--navy); }
.composer button { width: 48px; border: 0; border-radius: 12px; background: var(--navy); color: var(--white); display: grid; place-items: center; }
html[dir="rtl"] .composer button svg { transform: scaleX(-1); }

/* 3D view */
.view { min-width: 0; position: relative; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); background: #cfe0ee; min-height: 420px; }
.view canvas { display: block; position: absolute; inset: 0; }
.ov-row { position: absolute; left: 16px; right: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; pointer-events: none; }
.ov-top { top: 16px; align-items: flex-start; }
.ov-bottom { bottom: 16px; align-items: flex-end; }
.ov-row > * { pointer-events: auto; }
.panel { background: rgba(255,255,255,.94); border-radius: 14px; box-shadow: 0 4px 18px rgba(0,0,0,.12); }
.glass-card { padding: 12px 16px; flex: 1 1 220px; max-width: 360px; }
.gc-sub { font: 500 13px var(--body); color: var(--muted); }
.gc-name { font: 700 22px var(--head); color: var(--navy); margin-top: 2px; }
.gc-note { font: 400 13px var(--body); color: var(--muted); margin-top: 2px; }
.controls { padding: 12px 14px; flex: 0 1 330px; display: flex; flex-direction: column; gap: 9px; }
.ctl-row { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; }
.ctl-row.time { grid-template-columns: 92px 1fr 64px; }
.ctl-label { font: 500 13px var(--body); color: var(--muted); }
.seg { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; min-width: 0; border: 0; background: transparent; padding: 5px 4px; border-radius: 8px; font: 600 12.5px var(--semi); color: var(--navy); }
.seg button.on { background: var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
input[type=range] { width: 100%; accent-color: var(--blue); }
#timeLabel { font: 600 13px var(--semi); color: var(--navy); text-align: end; }
.sunline { font: 500 13px var(--body); color: var(--navy); display: flex; align-items: center; gap: 8px; }
.sunline i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.meters { padding: 12px 16px; flex: 0 1 340px; }
.m { display: grid; grid-template-columns: 112px 1fr 50px; align-items: center; gap: 10px; margin: 5px 0; font: 500 13px var(--body); color: var(--navy); }
.bar { height: 10px; border-radius: 5px; background: #E5EAF0; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 5px; transition: width .6s ease; }
#bv { background: var(--gold); } #bg { background: var(--red); } #br { background: var(--blue); }
.m b { font: 700 14px var(--head); text-align: end; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-inline-start: auto; }
.btn { border-radius: 999px; padding: 11px 18px; font: 600 14px var(--semi); border: 1.5px solid transparent; }
.btn.solid { background: var(--navy); color: var(--white); }
.btn.ghost { background: var(--white); color: var(--navy); border-color: var(--line); }

.foot { padding: 6px 24px 12px; font: 400 12px var(--body); color: var(--muted); }
.foot a { color: var(--blue); }

/* modals */
.modal { position: fixed; inset: 0; background: rgba(15, 24, 46, .5); display: grid; place-items: center; z-index: 9000; padding: 20px; }
.modal[hidden] { display: none; }
.sheet { background: var(--white); border-radius: 18px; width: min(720px, 100%); max-height: 90vh; overflow: auto; padding: 28px 30px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.sheet h2 { font: 700 26px var(--head); color: var(--navy); margin: 14px 0 4px; }
.sheet .sub { color: var(--muted); font-size: 14px; }
.sheet table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.sheet td, .sheet th { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: start; }
.sheet th { color: var(--muted); font-weight: 500; }
.sheet td.v { text-align: end; font: 700 15px var(--head); color: var(--navy); }
.sheet .note { font-size: 12.5px; color: var(--muted); }
.sheet .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.form-sheet label { display: block; font: 500 13px var(--body); color: var(--muted); margin-top: 12px; }
.form-sheet input { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 400 15px var(--body); margin-top: 4px; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 30px); background: var(--navy); color: var(--white); padding: 12px 18px; border-radius: 12px; font-size: 14px; opacity: 0; transition: .35s; z-index: 9500; max-width: 92vw; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* tour */
.tour { position: fixed; inset: 0; z-index: 10000; pointer-events: none; }
.tour[hidden] { display: none; }
.tour-block { position: fixed; pointer-events: auto; background: transparent; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(9, 18, 40, .62); transition: all .35s ease; pointer-events: none; }
.tour-spot.pulse::after { content: ""; position: absolute; inset: -6px; border-radius: 18px; border: 3px solid var(--sky); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08); } }
.tour-bubble { position: fixed; pointer-events: auto; display: flex; gap: 12px; align-items: flex-end; width: min(430px, calc(100vw - 24px)); transition: top .35s ease, left .35s ease; }
.mascot { width: 92px; height: 92px; flex: none; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.mascot .eyes { animation: blink 4s infinite; transform-origin: 60px 66px; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.mascot .hand { animation: wave 1.6s ease-in-out infinite; transform-origin: 98px 92px; }
@keyframes wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-18deg); } }
.tb-body { flex: 1; background: var(--white); border-radius: 16px; padding: 14px 16px 12px; box-shadow: 0 12px 40px rgba(0,0,0,.28); position: relative; }
.tb-body::before { content: ""; position: absolute; bottom: 18px; inset-inline-start: -8px; width: 16px; height: 16px; background: var(--white); transform: rotate(45deg); }
.tb-name { font: 700 14px var(--head); color: var(--blue); }
.tb-text { font: 400 15px/1.5 var(--body); color: var(--navy); margin-top: 3px; }
.tb-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.tb-skip { border: 0; background: transparent; color: var(--muted); font: 500 13px var(--body); padding: 6px 0; }
.tb-step { margin-inline-start: auto; font: 500 12px var(--body); color: var(--muted); }
.tb-next { border: 0; background: var(--navy); color: var(--white); border-radius: 999px; padding: 8px 16px; font: 600 14px var(--semi); }
.tb-next[hidden] { display: none; }
.tb-wait { font: 600 13px var(--semi); color: var(--blue); }

@media (max-width: 920px) {
  html, body { height: auto; }
  body { display: block; }
  .app { grid-template-columns: minmax(0, 1fr); padding: 0 12px 12px; }
  .top-actions { gap: 6px; } .sep { display: none; }
  .lang button { padding: 5px 9px; }
  .tour-btn { padding: 4px; }
  .ctl-row { grid-template-columns: 74px minmax(0, 1fr); }
  .ctl-row.time { grid-template-columns: 74px minmax(0, 1fr) 58px; }
  .seg button { font-size: 12px; padding: 5px 2px; }
  .glass-card { max-width: none; }
  .view { min-height: 62vh; order: -1; }
  .chat { min-height: 60vh; }
  .ov-row { left: 10px; right: 10px; }
  .controls { flex: 1 1 100%; }
  .meters { display: none; }
  .product { font-size: 16px; } .logo { height: 26px; } .top { padding: 10px 12px; gap: 8px; }
  .tour-btn span:last-child { display: none; }
}
@media print {
  body > *:not(#specModal) { display: none !important; }
  #specModal { position: static; background: none; padding: 0; display: block; }
  .sheet { box-shadow: none; max-height: none; width: 100%; }
  .sheet .row { display: none; }
}
