/* ============================================================
   sigma3 · הקהילה של שוברות משוואות
   Mobile first. Everything self-hosted — no external fonts or CDNs,
   which is both a design choice and what keeps content filters calm.
   ============================================================ */

@font-face {
  font-family: 'Discordia';
  src: url('/fonts/Discordia-Regular.woff2') format('woff2'),
       url('/fonts/Discordia-Regular.woff') format('woff');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Discordia';
  src: url('/fonts/Discordia-Bold.woff2') format('woff2'),
       url('/fonts/Discordia-Bold.woff') format('woff');
  font-weight: 700; font-display: swap;
}

:root {
  --bg:        #0d0d0d;
  --surface:   #161616;
  --surface-2: #1e1e1e;
  --line:      #2a2a2a;
  --line-soft: #212121;

  --text:      #f2f2f2;
  --muted:     #9a9a9a;
  --faint:     #6b6b6b;

  --c1: #ff7e5f;
  --c2: #d76db4;
  --c3: #7c5cff;
  --grad: linear-gradient(95deg, #ff7e5f 0%, #d76db4 50%, #7c5cff 100%);
  --grad-soft: linear-gradient(95deg, rgba(255,126,95,.16), rgba(215,109,180,.16), rgba(124,92,255,.16));

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 30px;

  --sans: 'Segoe UI', 'Assistant', 'Rubik', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --display: 'Discordia', var(--sans);

  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* translucent bars — they need their own values so the light theme can
     lighten them without every rule having to know which theme is on */
  --chrome-bg: rgba(13,13,13,.85);
  --nav-bg:    rgba(18,18,18,.94);
  --accent-text: #e9c7de;
  --danger-bg: #3a1717;
  --danger-line: #6d2626;
  --danger-text: #ff9b9b;
  --orb-opacity: .5;
  --shadow: rgba(0,0,0,.6);
}

/* ------------------------------------------------------------ light mode */

:root[data-theme="light"] {
  --bg:        #ffffff;
  --surface:   #f5f3f2;
  --surface-2: #ebe8e7;
  --line:      #dedad8;
  --line-soft: #eceae9;

  --text:      #15141a;
  --muted:     #58555c;
  --faint:     #8b878d;

  --grad-soft: linear-gradient(95deg, rgba(255,126,95,.15), rgba(215,109,180,.15), rgba(124,92,255,.15));

  --chrome-bg: rgba(255,255,255,.88);
  --nav-bg:    rgba(250,249,249,.96);
  --accent-text: #93356f;
  --danger-bg: #fdecec;
  --danger-line: #f0bcbc;
  --danger-text: #b02a2a;
  --orb-opacity: .30;
  --shadow: rgba(20,18,25,.16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100%;
  overscroll-behavior-y: none;
}

body { overflow-x: hidden; }

a { color: var(--c2); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 16px; }

::selection { background: rgba(215,109,180,.35); }

/* --------------------------------------------------------- ambience */

.orb {
  position: fixed; border-radius: 50%; filter: blur(90px);
  pointer-events: none; z-index: 0; opacity: var(--orb-opacity);
}
.orb-a { width: 340px; height: 340px; background: rgba(215,109,180,.30); top: -120px; inset-inline-start: -110px; }
.orb-b { width: 300px; height: 300px; background: rgba(124,92,255,.24); bottom: -110px; inset-inline-end: -100px; }

@media (prefers-reduced-motion: no-preference) {
  .orb-a { animation: drift 22s ease-in-out infinite alternate; }
  .orb-b { animation: drift 27s ease-in-out infinite alternate-reverse; }
}
@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to   { transform: translate3d(30px, 40px, 0) scale(1.14); }
}

/* --------------------------------------------------------- layout */

.app {
  position: relative; z-index: 1;
  max-width: 720px; margin: 0 auto;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}

.screen { flex: 1; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 14px); }
.screen.no-nav { padding-bottom: calc(var(--safe-b) + 20px); }
.pad { padding: 0 16px; }

.boot { flex: 1; display: grid; place-content: center; gap: 22px; justify-items: center; min-height: 100dvh; }
.boot-logo { font-family: var(--display); font-size: 40px; letter-spacing: 1px; }

.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--c2);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------- brand bits */

.g {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.plus {
  position: absolute; color: var(--c2); opacity: .35;
  font-weight: 700; pointer-events: none; user-select: none;
}

/* --------------------------------------------------------- header */

.head {
  position: sticky; top: 0; z-index: 40;
  padding: calc(var(--safe-t) + 14px) 16px 12px;
  background: var(--chrome-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px;
}
.head h1 {
  font-family: var(--display); font-size: 26px; font-weight: 700;
  margin: 0; letter-spacing: .5px; line-height: 1;
}
.head .sub { font-size: 12px; color: var(--faint); margin-top: 3px; }
.head .grow { flex: 1; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); display: grid; place-content: center;
  font-size: 18px; flex: none; transition: .15s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn.has-dot { position: relative; }
.icon-btn.has-dot::after {
  content: ''; position: absolute; top: 7px; inset-inline-end: 8px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--c1);
  box-shadow: 0 0 0 2px var(--bg);
}

.back-btn { font-size: 22px; }

/* the theme switch for screens that have no header of their own */
.theme-fab {
  position: fixed; z-index: 60;
  top: calc(var(--safe-t) + 14px); inset-inline-start: 16px;
}

/* --------------------------------------------------------- tabs */

.tabs {
  display: flex; gap: 6px; padding: 12px 16px 6px;
  position: sticky; top: 0; z-index: 30;
}
.tab {
  flex: 1; padding: 11px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 14.5px; font-weight: 600;
  transition: .18s;
}
.tab.on { background: var(--grad); border-color: transparent; color: #fff; }

/* --------------------------------------------------------- thread list */

.list { padding: 8px 16px 0; display: flex; flex-direction: column; gap: 10px; }

.thread {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-soft);
  transition: .15s; position: relative; overflow: hidden;
  text-align: start; width: 100%; color: inherit;
}
.thread:active { transform: scale(.985); background: var(--surface-2); }
.thread.unread { border-color: rgba(215,109,180,.4); }
.thread.unread::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0;
  width: 3px; background: var(--grad);
}
.thread.pinned { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 1px solid transparent; }

.thread-main { flex: 1; min-width: 0; }
.thread-title {
  font-weight: 700; font-size: 16px; margin: 0 0 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-snippet {
  color: var(--muted); font-size: 13.5px; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.5;
}
.thread-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 7px; font-size: 12px; color: var(--faint);
}

.chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.chip.grad { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; }
.chip.soft { background: var(--grad-soft); border-color: rgba(215,109,180,.35); color: var(--accent-text); }

/* --------------------------------------------------------- avatars */

.av {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-content: center; overflow: hidden;
  background: var(--grad); color: #fff;
  font-weight: 700; font-size: 15px; letter-spacing: .5px;
}
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.sm { width: 34px; height: 34px; font-size: 12px; }
.av.lg { width: 84px; height: 84px; font-size: 28px; }
.av.admin { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c1); }

/* --------------------------------------------------------- thread view */

.msgs { padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 14px; }

.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.msg-name { font-weight: 700; font-size: 14.5px; }
.msg-biz { font-size: 12px; color: var(--faint); }
.msg-time { font-size: 11.5px; color: var(--faint); margin-inline-start: auto; }

.bubble {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: 4px var(--r) var(--r) var(--r);
  padding: 11px 14px; white-space: pre-wrap; word-break: break-word;
  font-size: 15.5px; line-height: 1.65;
}
.msg.mine .bubble { background: var(--grad-soft); border-color: rgba(215,109,180,.28); }
.bubble.deleted { color: var(--faint); font-style: italic; background: transparent; border-style: dashed; }

.mention { color: var(--c2); font-weight: 700; }

.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att-img {
  width: 163px; height: 163px; border-radius: var(--r-sm);
  object-fit: cover; border: 1px solid var(--line); display: block;
}
.att-img.pending { filter: blur(14px); }
.att-file {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; color: var(--text); max-width: 100%;
}
.att-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the chat stream sits above a composer that sits above the nav — the tail of
   the stream has to clear both, or the newest message hides behind the box */
.chat-screen { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 92px); }

.day-sep {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 2px 4px; color: var(--faint); font-size: 12px;
}
.day-sep::before, .day-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--line-soft);
}

.thread-root {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 12px 6px; margin-bottom: 4px;
}
.thread-root .bubble { background: transparent; border: none; padding: 0; }

/* the reply affordance: quiet when unused, alive the moment it has content */
.msg-foot { display: flex; align-items: center; gap: 12px; margin-top: 7px; }

.reply-chip {
  background: none; border: 1px solid var(--line);
  color: var(--faint); font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px;
  margin-inline-start: auto;              /* sits on the far side, as asked */
  transition: .15s; white-space: nowrap;
}
.reply-chip.has {
  border-color: rgba(215,109,180,.45); color: var(--accent-text); background: var(--grad-soft);
}
.reply-chip:active { transform: scale(.94); }

.msg-tools { display: flex; gap: 10px; margin-top: 6px; }
.tiny-btn {
  background: none; border: none; color: var(--faint);
  font-size: 12px; padding: 0; text-decoration: underline;
}
.tiny-btn:active { color: var(--c1); }

/* --------------------------------------------------------- composer */

.composer {
  position: sticky; bottom: 0; z-index: 35;
  padding: 10px 12px calc(10px + var(--safe-b));
  background: var(--chrome-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-soft);
}
/* On the main chat the bottom nav is also on screen, so the box rides above it.
   Fixed rather than sticky — a sticky box lifted above the nav still reserves
   its space at the end of the document and ends up covering the last message. */
.composer.above-nav {
  position: fixed;
  inset-inline: 0;
  bottom: calc(var(--nav-h) + var(--safe-b));
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 10px;
}
.composer-row { display: flex; gap: 7px; align-items: flex-end; }

/* the WhatsApp shape: a rounded pill with the emoji key living inside it */
.input-pill {
  flex: 1; min-width: 0;
  display: flex; align-items: flex-end; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; padding: 3px 4px 3px 14px;
  transition: border-color .15s;
}
.input-pill:focus-within { border-color: rgba(215,109,180,.55); }

.composer textarea {
  flex: 1; min-width: 0; resize: none; max-height: 130px;
  background: none; border: none; outline: none;
  color: var(--text); padding: 10px 0; line-height: 1.5;
}
.composer textarea::placeholder { color: var(--faint); }

.emoji-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  border: none; background: none; font-size: 21px;
  display: grid; place-content: center; opacity: .8;
}
.emoji-btn:active { transform: scale(.88); }

.round-btn {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 22px; line-height: 1;
  display: grid; place-content: center; transition: .15s;
}
.round-btn.grad {
  background: var(--grad); border-color: transparent; color: #fff; font-size: 19px;
}
.round-btn:active { transform: scale(.9); }
.round-btn:disabled { opacity: .45; }

/* the announcement switch — only rendered for admins, and loud when armed */
.broadcast-btn { font-size: 19px; }
.broadcast-btn.on {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 4px 16px rgba(215,109,180,.45);
}

.broadcast-note {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 9px; padding: 10px 14px; border-radius: var(--r);
  background: var(--grad-soft); border: 1px solid rgba(215,109,180,.45);
  font-size: 13.5px; line-height: 1.5;
}
.broadcast-note b { font-weight: 700; }
.broadcast-note button {
  margin-inline-start: auto; flex: none;
  background: none; border: none; color: var(--muted);
  font-size: 12.5px; text-decoration: underline; padding: 0 2px;
}

.emoji-panel {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  max-height: 208px; overflow-y: auto; margin-bottom: 9px; padding: 8px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  -webkit-overflow-scrolling: touch;
}
.emoji-panel button {
  background: none; border: none; font-size: 23px;
  padding: 7px 0; border-radius: 9px; line-height: 1;
}
.emoji-panel button:active { background: var(--surface); }
@media (min-width: 480px) { .emoji-panel { grid-template-columns: repeat(11, 1fr); } }

.rec-bar { display: flex; align-items: center; gap: 11px; padding: 4px 2px; }
.rec-dot {
  width: 11px; height: 11px; border-radius: 50%; background: #ff4d4d; flex: none;
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; transform: scale(.8); } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; direction: ltr; }
.rec-label { color: var(--muted); font-size: 14px; flex: 1; }
.rec-cancel {
  background: none; border: none; color: var(--faint);
  font-size: 14px; text-decoration: underline; padding: 0 4px;
}

.att-audio {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px 7px 8px; max-width: 100%;
}
.att-audio .mic { font-size: 17px; flex: none; }
.att-audio audio { height: 34px; max-width: 210px; }

.pending-files { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.pending-file {
  display: flex; align-items: center; gap: 7px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 8px 5px 12px; color: var(--muted);
}
.pending-file button { background: none; border: none; color: var(--c1); font-size: 15px; padding: 0 2px; }

/* the @ picker */
.mention-pop {
  position: absolute; bottom: 100%; inset-inline-start: 12px; inset-inline-end: 12px;
  margin-bottom: 8px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r);
  max-height: 230px; overflow-y: auto; z-index: 50;
  box-shadow: 0 -12px 34px var(--shadow);
}
.mention-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 13px; background: none; border: none;
  border-bottom: 1px solid var(--line-soft); color: var(--text);
  text-align: start; font-size: 14px;
}
.mention-item:last-child { border-bottom: none; }
.mention-item:active { background: var(--surface); }
.mention-item small { color: var(--faint); font-size: 11.5px; display: block; }

/* --------------------------------------------------------- bottom nav */

.nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 45;
  max-width: 720px; margin: 0 auto;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex; align-items: stretch;
  background: var(--nav-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}
.nav button {
  flex: 1; background: none; border: none; color: var(--faint);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 10.5px; font-weight: 600; padding: 0;
  position: relative; transition: color .15s;
}
.nav button .ic { font-size: 20px; line-height: 1; }
/* six tabs have to fit a 360px phone without wrapping */
.nav.tight button { font-size: 9.5px; gap: 2px; }
.nav.tight button .ic { font-size: 18px; }
.nav button.on { color: var(--text); }
.nav button.on .ic {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav button .badge {
  position: absolute; top: 8px; inset-inline-end: 50%; transform: translateX(50%) translateX(15px);
  min-width: 17px; height: 17px; border-radius: 999px;
  background: var(--c1); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-content: center; padding: 0 4px;
}

/* --------------------------------------------------------- fab */

.fab {
  position: fixed; z-index: 44;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  inset-inline-start: 18px;
  width: 56px; height: 56px; border-radius: 50%;
  border: none; background: var(--grad); color: #fff;
  font-size: 26px; line-height: 1;
  box-shadow: 0 10px 28px rgba(215,109,180,.42);
  display: grid; place-content: center; transition: .15s;
}
.fab:active { transform: scale(.9); }
@media (min-width: 760px) { .fab { inset-inline-start: calc(50% - 360px + 18px); } }

/* --------------------------------------------------------- forms */

.form { display: flex; flex-direction: column; gap: 15px; padding: 18px 16px; }

.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--muted); margin-bottom: 6px;
}
.field label .req { color: var(--c1); }
.field input, .field textarea, .field select {
  width: 100%; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px 15px; outline: none; transition: .15s;
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: rgba(215,109,180,.6);
  box-shadow: 0 0 0 3px rgba(215,109,180,.12);
}
.field .hint { font-size: 12px; color: var(--faint); margin-top: 5px; line-height: 1.5; }
.field.bad input, .field.bad textarea { border-color: var(--danger-line); }

.btn {
  width: 100%; padding: 15px; border-radius: 999px; border: none;
  background: var(--grad); color: #fff; font-size: 16px; font-weight: 700;
  transition: .15s; box-shadow: 0 8px 22px rgba(215,109,180,.3);
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; box-shadow: none; }
.btn.ghost {
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); box-shadow: none; font-weight: 600;
}
.btn.danger { background: var(--danger-bg); border: 1px solid var(--danger-line); color: var(--danger-text); box-shadow: none; }
.btn.sm { padding: 10px 18px; font-size: 14px; width: auto; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* --------------------------------------------------------- code input */

.code-boxes { display: flex; gap: 9px; direction: ltr; justify-content: center; margin: 6px 0 4px; }
.code-boxes input {
  width: 48px; height: 60px; text-align: center;
  font-size: 26px; font-weight: 700; color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); outline: none;
}
.code-boxes input:focus { border-color: var(--c2); box-shadow: 0 0 0 3px rgba(215,109,180,.15); }

/* --------------------------------------------------------- welcome / states */

.hero { padding: 40px 20px 22px; text-align: center; }
.hero .logo {
  font-family: var(--display); font-size: 52px; font-weight: 700;
  letter-spacing: 1px; line-height: 1; margin-bottom: 10px;
}
.hero .tag { color: var(--muted); font-size: 15px; }
.hero .rule { width: 54px; height: 3px; border-radius: 3px; background: var(--grad); margin: 20px auto 0; }

.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: 18px; margin: 0 16px 14px;
}
.card h3 { margin: 0 0 8px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

.empty { text-align: center; padding: 54px 26px; color: var(--faint); }
.empty .big { font-size: 42px; margin-bottom: 12px; opacity: .55; }
.empty p { margin: 0 0 6px; }

.waiting-ring {
  width: 130px; height: 130px; border-radius: 50%; margin: 0 auto 22px;
  display: grid; place-content: center; text-align: center;
  background: conic-gradient(from 180deg, var(--c1), var(--c2), var(--c3), var(--c1));
  position: relative;
}
.waiting-ring::after {
  content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--bg);
}
.waiting-ring > * { position: relative; z-index: 1; }
.signature {
  font-family: var(--display); font-size: 21px; font-weight: 700;
  margin: 22px 0 0; letter-spacing: .5px;
}

.waiting-ring .n { font-size: 34px; font-weight: 700; line-height: 1; }
.waiting-ring .u { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* --------------------------------------------------------- דרושות */

.job {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 15px;
}
.job.closed { opacity: .62; }
.job.closed .job-title { text-decoration: line-through; }

.job-head { display: flex; align-items: flex-start; gap: 9px; flex-wrap: wrap; }
.job-title { font-weight: 700; font-size: 16.5px; margin: 0; flex: 1; min-width: 0; line-height: 1.4; }
.job-body { color: var(--muted); font-size: 14.5px; margin: 8px 0 0; white-space: pre-wrap; line-height: 1.6; }
.job-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }

.job-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.job-who b { display: block; font-size: 14px; }
.job-who small { display: block; color: var(--faint); font-size: 12px; }

.job-contact {
  margin-top: 10px; padding: 9px 13px; border-radius: var(--r-sm);
  background: var(--grad-soft); border: 1px solid rgba(215,109,180,.28);
  font-size: 13.5px;
}

/* the @כולן row, so nobody broadcasts to 500 women by accident */
.mention-item.all {
  background: var(--grad-soft);
  border-bottom-color: rgba(215,109,180,.35);
}
.mention-item.all span { font-weight: 700; }

/* --------------------------------------------------------- directory */

.search-bar { padding: 12px 16px 4px; }
.search-bar input {
  width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 13px 18px; color: var(--text); outline: none;
}
.search-bar input:focus { border-color: rgba(215,109,180,.55); }

.dir-card {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: start;
  padding: 14px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line-soft); color: inherit;
}
.dir-card:active { background: var(--surface-2); }
.dir-name { font-weight: 700; font-size: 15.5px; margin: 0; }
.dir-biz { color: var(--c2); font-size: 13.5px; margin: 2px 0 0; font-weight: 600; }
.dir-more { color: var(--muted); font-size: 13px; margin: 5px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* --------------------------------------------------------- profile */

.profile-top { text-align: center; padding: 26px 20px 14px; }
.profile-top h2 { margin: 12px 0 2px; font-size: 22px; }
.profile-top .biz { color: var(--c2); font-weight: 600; font-size: 15px; }
.profile-top .meta { color: var(--faint); font-size: 13px; margin-top: 5px; }

.kv { display: flex; flex-direction: column; gap: 14px; }
.kv .k { font-size: 12px; color: var(--faint); font-weight: 600; margin-bottom: 3px; }
.kv .v { font-size: 15px; color: var(--text); white-space: pre-wrap; }

/* --------------------------------------------------------- admin */

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 14px 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 14px;
}
.stat .n { font-size: 26px; font-weight: 700; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .l { font-size: 12px; color: var(--faint); margin-top: 5px; }

.admin-row {
  display: flex; gap: 11px; align-items: flex-start; padding: 13px 14px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.admin-row .who { flex: 1; min-width: 0; }
.admin-row .who b { display: block; font-size: 15px; }
.admin-row .who small { display: block; color: var(--faint); font-size: 12px; line-height: 1.6; }
.admin-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.admin-actions button {
  font-size: 12px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
}
.admin-actions button.ok { border-color: rgba(215,109,180,.45); color: var(--accent-text); }
.admin-actions button.no { border-color: var(--danger-line); color: var(--danger-text); }

.toggle-row {
  display: flex; align-items: center; gap: 12px; padding: 15px 16px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); margin-bottom: 10px;
}
.toggle-row .t { flex: 1; }
.toggle-row .t b { display: block; font-size: 15px; }
.toggle-row .t small { color: var(--faint); font-size: 12.5px; line-height: 1.5; }

.switch { width: 50px; height: 29px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); position: relative; flex: none; transition: .2s; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-end: 3px;
  width: 21px; height: 21px; border-radius: 50%; background: var(--faint); transition: .2s; }
.switch.on { background: var(--grad); border-color: transparent; }
.switch.on::after { inset-inline-end: calc(100% - 24px); background: #fff; }

.code-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: var(--r); margin-bottom: 8px;
}
.code-row .em { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.code-row .cd { font-size: 22px; font-weight: 700; letter-spacing: 3px; direction: ltr; }

.log-line {
  display: flex; gap: 9px; align-items: baseline; padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft); font-size: 12.5px;
}
.log-line .st { flex: none; font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.log-line .st.good { color: #9be6a8; border-color: #2c4a32; }
.log-line .st.bad  { color: var(--danger-text); border-color: var(--danger-line); }
.log-line .em { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-line .tm { color: var(--faint); font-size: 11px; flex: none; }

/* --------------------------------------------------------- section titles */

.section-title {
  font-size: 12.5px; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 20px 16px 9px;
}

/* --------------------------------------------------------- toast + modal */

.toast {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-b) + 22px);
  inset-inline: 20px; z-index: 90; margin: 0 auto; max-width: 420px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 17px; font-size: 14px;
  box-shadow: 0 14px 38px var(--shadow);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { border-color: #6d2626; color: #ffbcbc; }
.toast.ok { border-color: rgba(215,109,180,.5); }

.modal {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(0,0,0,.82); backdrop-filter: blur(6px);
  display: grid; place-content: center; padding: 20px;
}
/* An author `display` beats the UA rule for [hidden], so say it explicitly —
   otherwise the overlay sits over the whole app and swallows every tap. */
.modal[hidden], [hidden] { display: none !important; }
.modal img { max-width: 92vw; max-height: 84vh; border-radius: var(--r); display: block; }
.modal .close {
  position: absolute; top: calc(var(--safe-t) + 14px); inset-inline-end: 16px;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 20px;
}

/* --------------------------------------------------------- misc */

.divider { height: 1px; background: var(--line-soft); margin: 18px 16px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.fs13 { font-size: 13px; }
.mt { margin-top: 14px; }
.hidden { display: none !important; }

@media (min-width: 760px) {
  .nav { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .app { box-shadow: 0 0 90px var(--shadow); }
}
