:root {
  --brand: #6d28d9; --brand-d: #4c1d95; --brand-l: #f1eafe; --teal: #0d9488; --violet: #7c3aed; --coral: #f43f5e;
  --accent: #f59e0b; --ink: #1c2526; --muted: #5f6b6d; --line: #dde4e3;
  --bg: #f5f7fb; --card: #fff; --danger: #b42318; --ok: #157f3b;
  --r: 14px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.06);
  font-family: "Segoe UI", "Noto Sans Hebrew", "Noto Sans Arabic", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 16px; line-height: 1.5; padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 18px; padding-top: max(8px, env(safe-area-inset-top)); background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand .logo { width: 50px; height: 50px; flex: none; filter: drop-shadow(0 3px 8px rgba(76,29,149,.3)); border-radius: 13px; }
.wm { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.wm-line { display: flex; align-items: center; gap: 8px; }
.wm b { font-size: 1.75rem; font-weight: 900; color: #4c1d95; letter-spacing: -.01em; }
.wm em { font-style: normal; font-weight: 800; font-size: .72rem; letter-spacing: .16em; color: #fff;
  background: linear-gradient(90deg, #7c3aed, #db2777); padding: 3px 8px 2px; border-radius: 999px; direction: ltr; }
.wm small { color: #7c3aed; font-size: .95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
#nav { display: flex; align-items: center; gap: 8px; }
.navlinks { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.navlinks a, .navlinks button.link { padding: 8px 13px; border-radius: 999px; text-decoration: none; color: var(--ink);
  font-size: .95rem; background: none; border: 0; cursor: pointer; font: inherit; }
.navlinks a:hover, .navlinks button.link:hover { background: var(--brand-l); }
.navlinks a.cta { background: var(--brand); color: #fff; }
.lang { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: #fff; font: inherit; cursor: pointer; }
.who { font-size: .85rem; color: var(--muted); padding: 0 6px; }
.menu-btn { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.menu-btn span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.topbar.open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topbar.open .menu-btn span:nth-child(2) { opacity: 0; }
.topbar.open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

main { max-width: 1120px; margin: 0 auto; padding: 18px; outline: none; }
.narrow { max-width: 560px; margin: 0 auto; }

/* cards & forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 12px 0 5px; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #c9d3d2; border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
textarea { min-height: 110px; resize: vertical; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-d); }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.secondary:hover { background: var(--brand-l); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.ghost { background: none; border-color: transparent; color: var(--brand); }
.btn.small { padding: 6px 12px; font-size: .88rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.err { color: var(--danger); font-size: .9rem; margin-top: 10px; min-height: 1.2em; }
.okmsg { color: var(--ok); font-weight: 600; }
.banner { background: #fff7e6; border: 1px solid #f5d38a; color: #6b4a00; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-size: .93rem; }
.banner a { font-weight: 700; }

/* search */
.search-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .search-layout { grid-template-columns: 1fr; } .filters.collapsed .fbody { display: none; } }
.filters { position: sticky; top: 74px; }
@media (max-width: 860px) { .filters { position: static; } }
.filters .fhead { display: flex; justify-content: space-between; align-items: center; }
.filters h3 { margin: 0; }
.ftoggle { display: none; }
@media (max-width: 860px) { .ftoggle { display: inline-flex; } }
.hero { background: radial-gradient(circle at 85% 20%, rgba(139,92,246,.55), transparent 55%), linear-gradient(120deg, #151b4d, #3b1477 70%, #5b21b6); color: #fff; border-radius: var(--r); padding: 22px; margin-bottom: 16px; }
.hero h1 { margin: 0 0 2px; }
.hero-brand { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.hero-name { font-size: 2.6rem; font-weight: 900; line-height: 1.05; color: #fff; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-tag { font-size: .95rem; font-weight: 800; letter-spacing: .2em; color: #1e1b4b; background: #fcd34d; padding: 4px 12px 3px; border-radius: 999px; direction: ltr; }
.hero .hero-title { font-size: 1.15rem; font-weight: 600; margin: 4px 0 12px; opacity: .92; }
.hero-logo { width: 104px; height: 104px; flex: none; filter: drop-shadow(0 10px 22px rgba(0,0,0,.4)); border-radius: 26px; }
.hero .slogan { font-size: 1.45rem; font-weight: 800; color: #fcd34d; margin: 6px 0 0; text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.hero .qbar { display: flex; gap: 8px; flex-wrap: wrap; }
.hero .qbar select, .hero .qbar input { flex: 1 1 180px; border: 0; }
.hero .qbar .btn { background: var(--accent); border-color: var(--accent); color: #1c1c1c; }
.resbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.resbar select { width: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.tcard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16,24,40,.1); }
.tcard .top { display: flex; gap: 12px; align-items: center; }
.avatar { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; flex: none; background: var(--brand-l);
  display: grid; place-items: center; color: var(--brand-d); font-weight: 700; font-size: 1.2rem; }
.avatar.lg { width: 112px; height: 112px; font-size: 2.2rem; }
.tcard .name { font-weight: 700; font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--brand-l); color: var(--brand-d); padding: 2px 10px; border-radius: 999px; font-size: .82rem; }
.chip.gray { background: #eef1f1; color: #415052; }
.price { font-weight: 700; }
.score { display: inline-flex; align-items: center; gap: 6px; }
.score .num { background: var(--brand-d); color: #fff; border-radius: 8px 8px 8px 0; padding: 2px 7px; font-weight: 700; font-size: .9rem; }
[dir=rtl] .score .num { border-radius: 8px 8px 0 8px; }
.score .word { font-weight: 600; font-size: .9rem; }
.stars { color: var(--accent); letter-spacing: 1px; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }

/* checkbox chips */
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { position: relative; }
.check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.check span { display: inline-block; padding: 7px 13px; border: 1px solid #c9d3d2; border-radius: 999px; background: #fff; font-size: .92rem; user-select: none; }
.check input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.check input:focus-visible + span { outline: 2px solid var(--accent); }
.region-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.region-group .rg-title { font-weight: 700; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }

/* availability grid */
.avail { width: 100%; border-collapse: separate; border-spacing: 4px; }
.avail th { font-size: .85rem; font-weight: 600; color: var(--muted); }
.avail td { text-align: center; }
.avail .cell { width: 100%; min-width: 38px; height: 36px; border-radius: 8px; border: 1px solid #c9d3d2; background: #fff; cursor: pointer; }
.avail .cell.on { background: var(--brand); border-color: var(--brand); }
.avail .cell.ro { cursor: default; }
.avail .cell:focus-visible { outline: 2px solid var(--accent); }

/* tutor page */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-head h1 { margin: 0; }
.contact { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.two { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; margin-top: 14px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.bigscore { display: flex; gap: 12px; align-items: center; }
.bigscore .num { font-size: 1.6rem; padding: 6px 12px; }
.dist { margin-top: 10px; }
.dist .bar { display: grid; grid-template-columns: 26px 1fr 30px; gap: 8px; align-items: center; font-size: .85rem; }
.dist .track { height: 8px; background: #eef1f1; border-radius: 99px; overflow: hidden; }
.dist .fill { height: 100%; background: var(--accent); }
.review { border-top: 1px solid var(--line); padding: 12px 0; }
.review:first-child { border-top: 0; }
.review .meta { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; color: var(--muted); }
.star-input { display: flex; gap: 4px; flex-direction: row; }
.star-input button { font-size: 2rem; line-height: 1; background: none; border: 0; cursor: pointer; color: #cfd6d5; padding: 0 2px; }
.star-input button.on { color: var(--accent); }
.locked { text-align: center; padding: 26px; }
.locked .lock { font-size: 2rem; }

/* register */
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .role-pick { grid-template-columns: 1fr; } }
.role-pick button { text-align: start; padding: 22px; border: 2px solid var(--line); border-radius: var(--r); background: #fff; cursor: pointer; font: inherit; }
.role-pick button:hover { border-color: var(--brand); background: var(--brand-l); }
.role-pick .ic { font-size: 2rem; }
.role-pick b { display: block; font-size: 1.1rem; margin-top: 6px; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 5px; border-radius: 99px; background: var(--line); }
.steps i.on { background: var(--brand); }
.photo-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.wa { background: #1fae54; border-color: #1fae54; }
.wa:hover { background: #178f44; }
.contact .btn span { display: flex; flex-direction: column; line-height: 1.2; text-align: start; }
.contact .btn small { font-weight: 400; font-size: .75rem; opacity: .9; }
.code-input { font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; direction: ltr; }
.vstate { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #c9d3d2; }
.dot.ok { background: var(--ok); }

/* admin */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a, .tabs button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit;
  color: var(--ink); text-decoration: none; white-space: nowrap; }
.tabs a.on, .tabs button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
table.list { width: 100%; border-collapse: collapse; background: #fff; font-size: .92rem; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
table.list th { background: #f0f4f3; font-weight: 600; }
table.list input[type=text], table.list input[type=number] { padding: 6px 8px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat b { font-size: 1.8rem; display: block; color: var(--brand-d); }
.badge { padding: 2px 9px; border-radius: 999px; font-size: .8rem; background: #eef1f1; }
.badge.active { background: #dcfce7; color: #14532d; }
.badge.pending { background: #fef3c7; color: #78350f; }
.badge.blocked { background: #fee2e2; color: #7f1d1d; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(120px); background: #1c2526; color: #fff;
  padding: 12px 20px; border-radius: 12px; transition: transform .25s, opacity .25s; z-index: 50; max-width: 90vw; opacity: 0; pointer-events: none; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.bad { background: var(--danger); }
.devnote { font-size: .8rem; background: #eef6ff; border: 1px dashed #8ab4f8; padding: 6px 10px; border-radius: 8px; margin-top: 8px; direction: ltr; text-align: left; }
@media (max-width: 520px) {
  .avail { border-spacing: 2px; table-layout: fixed; }
  .avail th { font-size: .72rem; }
  .avail th .muted { display: none; }
  .avail .cell { min-width: 0; height: 32px; }
  .avail thead th:first-child { width: 48px; }
}

/* admin forms */
.userfilter { grid-template-columns: 2fr 1fr 1fr auto; margin-bottom: 10px; }
.addrow { grid-template-columns: 1fr 1fr 90px auto; align-items: end; }
.addrow.reg { grid-template-columns: 1fr 1fr 1fr 90px auto; }

/* ---- admin extras */
.admin-head { display: flex; align-items: center; gap: 10px; }
.admin-head h1 { margin: .2rem 0 .8rem; }
.badge.lvl { background: #ede9fe; color: #5b21b6; font-weight: 700; }
.stat.warn { border-color: #fca5a5; background: #fff5f5; }
.stat.warn b { color: var(--danger); }
td.nowrap, .nowrap { white-space: nowrap; }
td.wrap { min-width: 180px; max-width: 420px; white-space: normal; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar select { width: auto; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
label.inline select { width: auto; }
.int-status { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.istat { padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.istat.ok { border-color: #86efac; background: #f0fdf4; } .istat.ok b { color: var(--ok); }
.istat.off { border-color: #fcd34d; background: #fffbeb; } .istat.off b { color: #92400e; }
.src { font-size: .7rem; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: #eef1f1; color: var(--muted); margin-inline-start: 4px; }
.src-db { background: #e0e7ff; color: #3730a3; } .src-env { background: #fef3c7; color: #78350f; }
.secret-row { display: flex; gap: 6px; }
.testbox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.testbox input { width: auto; flex: 0 1 230px; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 14px 0 8px; margin-top: 4px; z-index: 5; }
.perm-legend { display: grid; gap: 6px; background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: .9rem; }
.report-form { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0 12px; align-items: end; }
.report-form .quick, .report-form .actions { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.rep-title { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.chart-wrap { margin: 10px 0 16px; }
.legend { display: flex; gap: 16px; font-size: .88rem; color: var(--muted); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg.tutors, .cbar.tutors, .ibar.tutors { background: #6d28d9; fill: #6d28d9; }
.lg.students, .cbar.students, .ibar.searches { background: #0d9488; fill: #0d9488; }
.chart-scroll { overflow-x: auto; direction: ltr; }
.chart .grid { stroke: #e5e9f0; stroke-width: 1; }
.chart .axis { fill: #6b7280; font-size: 10px; font-family: inherit; }
.cbar { cursor: pointer; outline: none; }
.cbar:hover, .cbar:focus { opacity: .75; stroke: #111827; stroke-width: 1; }
#ctip { position: fixed; z-index: 60; pointer-events: none; background: #111827; color: #fff; padding: 6px 10px; border-radius: 8px;
  font-size: .85rem; opacity: 0; transition: opacity .1s; white-space: nowrap; }
#ctip.on { opacity: 1; }
#ctip span { opacity: .8; }
.barcell { position: relative; min-width: 120px; }
.ibar { display: block; height: 18px; border-radius: 0 4px 4px 0; min-width: 2px; opacity: .85; }
[dir=rtl] .ibar { border-radius: 4px 0 0 4px; }
.ival { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; font-size: .85rem; color: var(--ink);
  background: rgba(255,255,255,.85); padding: 0 4px; border-radius: 4px; }
small.bad { color: var(--danger); font-size: .8rem; }

/* ===== responsive ===== */
@media (min-width: 1600px) { main { max-width: 1320px; } .grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); } }
@media (max-width: 1024px) { .search-layout { grid-template-columns: 240px 1fr; } .two { grid-template-columns: 1fr 300px; } }
@media (max-width: 860px) {
  .search-layout, .two { grid-template-columns: 1fr; }
  .report-form { grid-template-columns: 1fr 1fr; } .report-form > div:first-child { grid-column: 1 / -1; }
  .userfilter, .addrow, .addrow.reg { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .menu-btn { display: flex; }
  .wm b { font-size: 1.45rem; }
  .wm small { font-size: .8rem; max-width: 52vw; }
  .navlinks { display: none; position: absolute; top: 100%; inset-inline: 0; background: #fff; flex-direction: column; align-items: stretch;
    padding: 8px 12px 14px; border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(16,24,40,.12); gap: 2px; }
  .topbar.open .navlinks { display: flex; }
  .navlinks a, .navlinks button.link { padding: 12px 14px; border-radius: 10px; text-align: start; font-size: 1rem; }
  .navlinks .who { padding: 6px 14px; order: -1; }
  main { padding: 12px; }
  h1 { font-size: 1.35rem; }
  .hero { padding: 16px; }
  .hero-logo { width: 72px; height: 72px; border-radius: 18px; }
  .hero-name { font-size: 2rem; }
  .hero .slogan { font-size: 1.15rem; }
  .hero .hero-title { font-size: 1rem; }
  .hero .qbar > * { flex-basis: 100%; }
  .card { padding: 14px; }
  .profile-head { flex-direction: column; text-align: center; }
  .profile-head .chips, .profile-head .contact { justify-content: center; }
  .contact .btn { flex: 1 1 100%; }
  .contact .btn.call { flex: 1 1 100%; }
  .userfilter, .addrow, .addrow.reg { grid-template-columns: 1fr; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .report-form { grid-template-columns: 1fr; }
  .resbar { font-size: .92rem; }
  .actions .btn { flex: 1 1 auto; }
}
@media (max-width: 400px) {
  .topbar { padding-inline: 10px; gap: 8px; }
  .brand .logo { width: 42px; height: 42px; }
  .wm b { font-size: 1.3rem; }
  .wm em { font-size: .62rem; padding: 2px 6px; }
  .wm small { max-width: 46vw; font-size: .74rem; }
  .lang { padding: 6px 9px; font-size: .85rem; }
  .grid { grid-template-columns: 1fr; }
}
@media (hover: none) { .tcard:hover { transform: none; } }
@media print {
  .topbar, .filters, .contact, #toast, .tabs, .no-print, .admin-head, .actions, #ctip { display: none !important; }
  body { background: #fff; } main { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .tablewrap { overflow: visible; border: 0; }
  table.list { font-size: 10pt; } table.list th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ibar, .cbar, .lg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chart-scroll { overflow: visible; }
}

/* ---- 2FA, contact, footer */
.mfa-ic { font-size: 2.2rem; }
.mfa-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 10px 0; }
.mfa-opt { display: flex; flex-direction: column; gap: 4px; text-align: start; padding: 14px; border: 2px solid var(--line); border-radius: 14px;
  background: #fff; cursor: pointer; font: inherit; }
.mfa-opt:hover { border-color: var(--brand); background: var(--brand-l); }
.mfa-opt .ic { font-size: 1.6rem; } .mfa-opt small { color: var(--muted); }
.mfa-setup { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 12px; }
.steps-list { padding-inline-start: 20px; margin: 0 0 10px; }
.qr-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; line-height: 0; }
.qr svg { width: 168px; height: 168px; }
code.secret { display: block; font-size: 1.05rem; letter-spacing: .08em; background: #f4f2ff; padding: 8px 12px; border-radius: 8px; margin: 6px 0; word-break: break-all; }
.recovery { background: #f0fdf4; border: 1px solid #86efac; border-radius: 14px; padding: 14px; margin-top: 12px; }
.recovery h4 { margin: 0 0 6px; color: var(--ok); }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.codes code { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; text-align: center; font-size: 1rem; }
.switch-row { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; background: #faf8ff; border: 1px solid #e9e3ff;
  border-radius: 12px; padding: 12px; margin: 14px 0 4px; cursor: pointer; }
.switch-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.wa-help { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 10px 12px; margin-top: 12px; line-height: 1.6; }
.inbox .msg .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .92rem; }
.inbox .msg h4 { margin: 8px 0 2px; } .inbox .msg .body { white-space: pre-line; margin-top: 6px; }
.inbox .msg.done { opacity: .7; }
.contact-hero { display: flex; gap: 16px; align-items: center; }
.contact-hero h1 { margin: 0; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 14px 0; }
.ccard { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.ccard:hover { border-color: var(--brand); }
.ccard .ic { font-size: 1.6rem; } .ccard small { display: block; color: var(--muted); } .ccard b { font-size: 1.02rem; }
form input.hp { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; inset-inline-start: 0; }
#footer { margin-top: 30px; background: #151b4d; color: #d9d6ff; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
.foot-in { max-width: 1120px; margin: 0 auto; display: flex; gap: 16px 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.foot-brand { display: flex; gap: 10px; align-items: center; }
.foot-brand img { border-radius: 9px; }
.foot-brand b { color: #fff; display: block; } .foot-brand small { color: #fcd34d; }
.foot-links { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.foot-links a { color: #e9e6ff; text-decoration: none; } .foot-links a:hover { color: #fff; text-decoration: underline; }
.foot-copy { font-size: .8rem; opacity: .7; }
@media (max-width: 760px) { .foot-in { flex-direction: column; align-items: flex-start; } .contact-hero { flex-direction: column; text-align: center; } }
@media print { #footer { display: none; } }

.gender-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 2px; }
.gender-row .glabel { font-weight: 600; font-size: .92rem; }

/* ---- locality picker */
.lp { position: relative; }
.lp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-chips:not(:empty) { margin-bottom: 6px; }
.lp-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand); color: #fff; padding: 4px 6px 4px 10px; font-size: .88rem; }
[dir=rtl] .lp-chip { padding: 4px 10px 4px 6px; }
.lp-chip button { background: rgba(255,255,255,.25); border: 0; color: #fff; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; line-height: 1; font-size: 14px; }
.lp-box { position: relative; }
.lp-list { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 28px rgba(16,24,40,.16); max-height: 320px; overflow-y: auto; }
.lp-list li { display: flex; align-items: baseline; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.lp-list li.on, .lp-list li:hover { background: var(--brand-l); }
.lp-list li b { font-weight: 600; } .lp-list li span { color: var(--muted); font-size: .88rem; }
.lp-list li em { margin-inline-start: auto; font-style: normal; font-size: .75rem; color: var(--muted); background: #f1f0f7; padding: 1px 8px; border-radius: 99px; }
.lp-list li.none { color: var(--muted); cursor: default; }
.hero .qbar .hero-loc { flex: 2 1 240px; }
.hero .hero-loc .lp-input { border: 0; }
.hero .hero-loc .lp-chip { background: #fcd34d; color: #1e1b4b; }
.hero .hero-loc .lp-chip button { background: rgba(30,27,75,.15); color: #1e1b4b; }
.hero-hint { margin: 10px 0 0; font-size: .88rem; opacity: .85; }
.import-box { background: #faf8ff; border: 1px dashed #c4b5fd; border-radius: 12px; padding: 12px; margin-top: 12px; }
.import-box p { margin: 4px 0 0; }

/* ---- logout at the far edge */
.logout-btn { border: 1px solid #fecaca; color: #b42318; background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; cursor: pointer; white-space: nowrap; }
.logout-btn:hover { background: #fef2f2; }
.logout-in-menu { display: none; }
@media (max-width: 760px) {
  .logout-btn { display: none; }
  .logout-in-menu { display: block; color: #b42318 !important; border-top: 1px solid var(--line) !important; margin-top: 4px; }
}
.nbadge { display: inline-block; min-width: 20px; padding: 0 6px; height: 20px; line-height: 20px; border-radius: 99px; background: #db2777; color: #fff;
  font-size: .75rem; font-weight: 700; text-align: center; margin-inline-start: 6px; }
.nbadge[hidden] { display: none; }

/* ---- terms */
.terms-wrap { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.terms-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #f5f3ff; font-size: .95rem; }
.terms-box { max-height: 230px; overflow-y: auto; padding: 4px 16px 12px; font-size: .88rem; line-height: 1.6; background: #fff; border-top: 1px solid var(--line); }
.terms-box h1 { font-size: 1.1rem; } .terms-box h2 { font-size: 1rem; margin: 14px 0 4px; } .terms-box h3 { font-size: .92rem; margin: 10px 0 2px; }
.terms-box ul { padding-inline-start: 20px; margin: 4px 0; }
.terms-accept { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0; font-weight: 600; background: #fffbeb; border-top: 1px solid #fde68a; cursor: pointer; }
.terms-accept input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--brand); }
.terms-page h1 { margin-top: 0; } .terms-page h2 { margin-top: 1.4rem; } .terms-page ul { padding-inline-start: 22px; }
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(15,12,40,.55); display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 18px; padding: 20px; max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal h2 { margin-top: 0; } .modal .terms-box { border: 1px solid var(--line); border-radius: 10px; max-height: 40vh; }

/* ---- messages */
.chat-btn { background: linear-gradient(90deg, #7c3aed, #db2777); border: 0; }
.chat-btn:hover { filter: brightness(1.08); background: linear-gradient(90deg, #7c3aed, #db2777); }
.msgchip { background: #fdf2f8; color: #9d174d; }
.chat-layout { display: grid; grid-template-columns: 330px 1fr; gap: 16px; align-items: start; }
.chat-list { padding: 12px; max-height: calc(100vh - 160px); overflow-y: auto; }
.chat-list h2 { margin: 4px 6px 10px; font-size: 1.1rem; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.chat-item:hover, .chat-item.on { background: var(--brand-l); }
.chat-item .avatar { width: 44px; height: 44px; font-size: 1rem; }
.ci-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ci-main small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: .75rem; color: var(--muted); }
.chat-thread { display: flex; flex-direction: column; min-height: 520px; padding: 0; overflow: hidden; }
.chat-thread > .empty, .chat-thread > .err { margin: auto; }
.th-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.th-head .avatar { width: 42px; height: 42px; font-size: 1rem; }
.th-back { display: none; }
.th-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #faf9ff; max-height: calc(100vh - 330px); min-height: 300px; }
.th-msgs.admin { max-height: 60vh; border-radius: 12px; }
.bubble { max-width: 78%; padding: 8px 12px; border-radius: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.bubble.mine { align-self: flex-end; background: var(--brand); color: #fff; border-end-end-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-end-start-radius: 4px; }
.bubble.removed { opacity: .6; }
.b-body { white-space: pre-wrap; word-break: break-word; }
.b-time { font-size: .72rem; opacity: .75; margin-top: 2px; }
.b-who { font-size: .75rem; font-weight: 700; opacity: .85; }
.th-compose { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.th-compose textarea { min-height: 46px; max-height: 160px; resize: vertical; }
.th-note { margin: 0; padding: 0 14px 10px; }
.admin-chats { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; align-items: start; }
tr.clickable { cursor: pointer; } tr.clickable:hover, tr.clickable.on { background: var(--brand-l); }
.linkbtn { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
@media (max-width: 860px) {
  .chat-layout, .admin-chats { grid-template-columns: 1fr; }
  .chat-layout.has-thread .chat-list { display: none; }
  .chat-layout:not(.has-thread) .chat-thread { display: none; }
  .th-back { display: inline-flex; }
  .th-msgs { max-height: calc(100vh - 300px); }
}
