[hidden] { display: none !important; }
:root {
  --teal: #00746B; --teal-2: #02A393; --teal-l: #E3F1EF; --ink: #10302C; --muted: #5C716E; --line: #D6E4E1;
  --bg: #F6FAF9; --card: #fff; --bad: #C0392B; --warn: #E08A1E; --ok: #2E9E5B;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); letter-spacing: 0 !important; -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; border: 0; }
.en { font-size: .78em; color: var(--muted); font-weight: 400; direction: ltr; unicode-bidi: isolate; }
a { color: var(--teal); }

/* ---------- phone shell: everything fits one screen ---------- */
.app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; max-width: 560px; margin: 0 auto; background: #000; }
.top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--teal); color: #fff; flex: none; }
.top img { height: 30px; }
.top b { font-size: 16px; line-height: 1.1; }
.top .en { color: #CFE9E5; display: block; text-align: right; }
.top nav { margin-inline-start: auto; display: flex; gap: 6px; }
.top nav a { color: #fff; text-decoration: none; font-size: 12px; padding: 5px 9px; border: 1px solid #ffffff66; border-radius: 99px; white-space: nowrap; }
.top nav a.on { background: #fff; color: var(--teal); }

.cam { position: relative; flex: 1 1 auto; min-height: 0; transition: flex-basis .3s; overflow: hidden; }
.cam video, .cam canvas.ov { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam canvas.ov { pointer-events: none; }
.frame { position: absolute; inset: 14% 16%; border-radius: 22px; box-shadow: 0 0 0 999px #00000055; pointer-events: none; }
.frame::before, .frame::after { content: ""; position: absolute; inset: 0; border: 4px solid var(--teal-2); border-radius: 22px;
  clip-path: polygon(0 0, 28% 0, 28% 4%, 4% 4%, 4% 28%, 0 28%, 0 72%, 4% 72%, 4% 96%, 28% 96%, 28% 100%, 72% 100%, 72% 96%, 96% 96%, 96% 72%, 100% 72%, 100% 28%, 96% 28%, 96% 4%, 72% 4%, 72% 0, 100% 0, 100% 100%, 0 100%); }
.hint { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; color: #fff; font-size: 15px; text-shadow: 0 1px 4px #000; padding: 0 12px; }
.hint .en { color: #E8F4F2; }
.camerr { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #fff; padding: 24px; gap: 10px; background: #0F2E2B; }
.camerr button { background: var(--teal-2); color: #fff; padding: 10px 18px; border-radius: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; color: #fff; font-size: 13px; font-weight: 600; }
.toast { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: #000c; color: #fff; padding: 8px 14px; border-radius: 12px; font-size: 14px; white-space: nowrap; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }

/* rating sheet */
.sheet { flex: none; background: var(--card); border-radius: 22px 22px 0 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); display: none; flex-direction: column; gap: 10px; }
.app.rating .sheet { display: flex; }
.app.rating .cam { flex: 1 1 auto; min-height: 22dvh; }
.app.rating .hint, .app.rating .frame { display: none; }
.sheet h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet .q { font-size: 15px; font-weight: 600; }
.rates { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; direction: ltr; }
.rates button { background: var(--teal-l); border-radius: 14px; padding: 8px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid transparent; color: var(--ink); }
.rates button span:first-child { font-size: 26px; line-height: 1; }
.rates button b { font-size: 16px; }
.rates button small { font-size: 10px; line-height: 1.15; color: var(--muted); text-align: center; }
.rates button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 16%, #fff); }
.scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); direction: ltr; margin-top: -4px; }
.sheet textarea { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font: inherit; font-size: 15px; height: 58px; }
.row { display: flex; gap: 8px; align-items: center; }
.mic { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--teal-l); color: var(--teal); border-radius: 14px; padding: 12px 8px; font-weight: 600; font-size: 14px; }
.mic.rec { background: var(--bad); color: #fff; animation: pulse 1s infinite; }
.mic.has { background: #E8F5EC; color: var(--ok); }
@keyframes pulse { 50% { opacity: .75; } }
.send { flex: 1.2; background: var(--teal); color: #fff; border-radius: 14px; padding: 12px 8px; font-weight: 700; font-size: 15px; }
.send:disabled { opacity: .45; }
.ghost { background: none; color: var(--muted); font-size: 13px; padding: 4px; }
.done { text-align: center; padding: 18px 8px; display: grid; gap: 8px; }
.done .big { font-size: 44px; }

/* ---------- dashboard ---------- */
.dash { max-width: 1400px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
.dash header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dash header img { height: 52px; }
.dash header h1 { font-size: 22px; line-height: 1.25; }
.live { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.live i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 #2E9E5B88; animation: ping 1.6s infinite; }
.live.off i { background: var(--bad); animation: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px #2E9E5B00; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.kpi .v { font-size: 34px; font-weight: 700; color: var(--teal); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 16px; color: var(--muted); font-weight: 500; }
.kpi .l { font-size: 14px; }
.grid3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .grid3 { grid-template-columns: 1fr; } }
.panel h3 { font-size: 15px; margin-bottom: 10px; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.bar .t { height: 14px; background: var(--teal-l); border-radius: 7px; overflow: hidden; }
.bar .t i { display: block; height: 100%; border-radius: 7px; transition: width .5s; }
.bar .n { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 64px; text-align: end; }
.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 6px; font-size: 14px; }
.card.new { animation: flash 2.4s; }
@keyframes flash { 0% { background: #FFF6D6; border-color: var(--warn); } 100% { background: var(--card); } }
.card .h { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card .s { font-size: 18px; margin-inline-start: auto; direction: ltr; }
.card .m { font-size: 11px; color: var(--muted); }
.card .tr { color: var(--muted); font-size: 13px; border-inline-start: 3px solid var(--teal-l); padding-inline-start: 8px; }
.card audio { width: 100%; height: 34px; }
.empty { color: var(--muted); font-size: 14px; padding: 18px; text-align: center; }
.geo { position: absolute; inset: 0; overflow: auto; background: var(--bg); color: var(--ink); padding: 14px; display: grid; align-content: start; gap: 10px; }
.geo .st { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 14px; }
.geo .st.in { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-l); }
.geo .st button { grid-column: 1 / -1; background: var(--teal-l); color: var(--teal); border-radius: 10px; padding: 6px; font-size: 12px; }
.tabs { display: flex; gap: 6px; padding: 8px 14px; background: #0F2E2B; flex: none; }
.tabs button { flex: 1; background: #ffffff1a; color: #fff; border-radius: 10px; padding: 7px; font-size: 13px; }
.tabs button.on { background: #fff; color: var(--teal); font-weight: 700; }
