/* סטטוס קליק — מערכת עיצוב
   כיוון: מימין לשמאל. משתמשים במאפיינים לוגיים (inline-start/end) כדי שהכיוון יתהפך נכון. */

/* ---------- גופן Rubik (מקומי, בלי שרתים חיצוניים) ---------- */
@font-face { font-family: 'Rubik'; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/rubik-hebrew-400-normal.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Rubik'; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/rubik-hebrew-500-normal.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Rubik'; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/rubik-hebrew-600-normal.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Rubik'; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/rubik-hebrew-700-normal.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Rubik'; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/rubik-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/rubik-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/rubik-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-style: normal; font-display: swap; font-weight: 700; src: url(/fonts/rubik-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- טוקנים ---------- */
:root {
  --c-bg: #FAF8F4;          /* רקע שנהב חם */
  --c-surface: #FFFFFF;     /* משטחי עבודה, טפסים, תצוגה מקדימה */
  --c-brand: #29235C;       /* אינדיגו: לוגו, כותרות, ניווט פעיל, מסגרת פוקוס */
  --c-action: #FF715B;      /* אלמוג: הפעולה הראשית */
  --c-action-hover: #FF5E45;
  --c-action-text: #20202A; /* טקסט כהה על כפתור אלמוג */
  --c-text: #20202A;
  --c-text-2: #625F70;
  --c-border: #E5E1E8;
  --c-success: #18734E;
  --c-error: #A43137;
  --c-success-bg: #E8F3EE;
  --c-error-bg: #F8E9EA;
  --c-info-bg: #EEEDF5;
  --c-warn-bg: #FFF1EC;
  --c-brand-soft: #EEEDF5;

  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-h1: 28px;
  --fs-h2: 20px;
  --fs-h3: 17px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  --shadow-1: 0 1px 2px rgba(41, 35, 92, .06), 0 1px 3px rgba(41, 35, 92, .05);
  --shadow-2: 0 4px 16px rgba(41, 35, 92, .08), 0 1px 3px rgba(41, 35, 92, .06);
  --shadow-3: 0 18px 50px rgba(41, 35, 92, .16);

  --touch: 44px;
  --sidebar-w: 264px;
  --bottomnav-h: 68px;
}

/* ---------- בסיס ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { color: var(--c-brand); line-height: 1.25; margin: 0; }
h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); font-weight: 600; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
p { margin: 0; }
a { color: var(--c-brand); }
:focus-visible { outline: 3px solid var(--c-brand); outline-offset: 2px; border-radius: 6px; }
/* כותרת שמקבלת פוקוס במעבר מסך (בשביל קוראי מסך) — בלי מסגרת */
h1[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--c-text-2); }
.small { font-size: var(--fs-small); }
.noscript { padding: var(--s-6); text-align: center; }
.skip-link { position: absolute; inset-inline-start: var(--s-4); top: -60px; z-index: 100; background: var(--c-brand); color: #fff; padding: var(--s-2) var(--s-4); border-radius: var(--r-sm); text-decoration: none; }
.skip-link:focus { top: var(--s-4); }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { width: 200px; height: auto; opacity: .9; }

/* ---------- מבנה האפליקציה ---------- */
.shell { min-height: 100vh; display: flex; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding: var(--s-4) var(--s-4) calc(var(--bottomnav-h) + var(--s-6)); }
.main-inner { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s-6); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding-block: var(--s-1) var(--s-2); }
.topbar .logo { height: 30px; width: auto; }
.page-head { display: flex; flex-direction: column; gap: var(--s-1); }
.page-head p { color: var(--c-text-2); }

.preview-banner {
  background: var(--c-brand); color: #fff; font-size: var(--fs-small);
  padding: var(--s-2) var(--s-4); text-align: center; line-height: 1.4;
}

/* ניווט תחתון בנייד */
.bottomnav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 20;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--c-surface); border-top: 1px solid var(--c-border);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--touch); text-decoration: none; color: var(--c-text-2); font-size: 12.5px; font-weight: 500;
}
.bottomnav a svg { width: 24px; height: 24px; }
.bottomnav a[aria-current="page"] { color: var(--c-brand); }
.bottomnav a.nav-new .nav-new-dot {
  width: 40px; height: 40px; border-radius: 50%; background: var(--c-action); color: var(--c-action-text);
  display: grid; place-items: center; margin-top: -6px;
}
.bottomnav a.nav-new .nav-new-dot svg { width: 22px; height: 22px; }

@media (min-width: 960px) {
  .sidebar {
    display: flex; flex-direction: column; gap: var(--s-6);
    width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh;
    padding: var(--s-6) var(--s-5); background: var(--c-surface); border-inline-end: 1px solid var(--c-border);
  }
  .sidebar .logo { height: 34px; width: auto; align-self: flex-start; }
  .sidenav { display: flex; flex-direction: column; gap: var(--s-1); }
  .sidenav a {
    display: flex; align-items: center; gap: var(--s-3); min-height: var(--touch);
    padding: var(--s-2) var(--s-3); border-radius: var(--r-md); text-decoration: none;
    color: var(--c-text); font-weight: 500;
  }
  .sidenav a svg { width: 22px; height: 22px; color: var(--c-text-2); }
  .sidenav a:hover { background: var(--c-bg); }
  .sidenav a[aria-current="page"] { background: var(--c-brand-soft); color: var(--c-brand); }
  .sidenav a[aria-current="page"] svg { color: var(--c-brand); }
  .sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--s-3); }
  .main { padding: var(--s-8) var(--s-10) var(--s-10); }
  .bottomnav, .topbar { display: none; }
}

/* ---------- כרטיסים ---------- */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg);
  padding: var(--s-5); box-shadow: var(--shadow-1);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s-2); }
.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.grid-2 { display: grid; gap: var(--s-6); }
@media (min-width: 960px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--touch); padding: 10px var(--s-5); border-radius: var(--r-md);
  border: 1px solid transparent; font-weight: 500; font-size: var(--fs-body); line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.btn-primary { background: var(--c-action); color: var(--c-action-text); box-shadow: 0 1px 0 rgba(32,32,42,.08); }
.btn-primary:hover:not(:disabled) { background: var(--c-action-hover); }
.btn-secondary { background: var(--c-surface); color: var(--c-brand); border-color: var(--c-border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--c-brand); }
.btn-ghost { background: transparent; color: var(--c-brand); }
.btn-ghost:hover:not(:disabled) { background: var(--c-brand-soft); }
.btn-danger { background: var(--c-surface); color: var(--c-error); border-color: #E8C9CB; }
.btn-danger:hover:not(:disabled) { background: var(--c-error-bg); }
.btn-lg { min-height: 56px; font-size: 17px; padding-inline: var(--s-6); border-radius: var(--r-lg); }
.btn-block { width: 100%; }
.btn .spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn .spinner, .progress-bar span { animation: none !important; } }

/* ---------- טפסים ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field label, .field .label { font-weight: 500; }
.field .help { font-size: var(--fs-small); color: var(--c-text-2); }
.field .error { font-size: var(--fs-small); color: var(--c-error); display: flex; gap: var(--s-1); align-items: flex-start; }
.input, .textarea {
  width: 100%; min-height: var(--touch); padding: 10px var(--s-4); background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--r-md); font-size: var(--fs-body); line-height: 1.5;
}
.textarea { min-height: 132px; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(41,35,92,.15); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--c-error); }
.counter { font-size: var(--fs-small); color: var(--c-text-2); text-align: end; }
.counter.over { color: var(--c-error); font-weight: 500; }
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-end: 56px; }
.input-wrap .reveal { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); min-height: 36px; padding: 4px 10px; font-size: var(--fs-small); }

/* בורר סוג תוכן */
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-1); padding: var(--s-1); background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--r-md); }
.segmented button {
  min-height: var(--touch); border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: var(--s-2); font-weight: 500; color: var(--c-text-2);
}
.segmented button svg { width: 20px; height: 20px; }
.segmented button[aria-checked="true"] { background: var(--c-surface); color: var(--c-brand); box-shadow: var(--shadow-1); }

/* צבעי רקע לטקסט */
.swatches { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.swatch {
  width: var(--touch); height: var(--touch); border-radius: 50%; border: 2px solid var(--c-surface);
  box-shadow: 0 0 0 1px var(--c-border); cursor: pointer; position: relative;
}
.swatch[aria-checked="true"] { box-shadow: 0 0 0 3px var(--c-brand); }
.swatch[aria-checked="true"]::after { content: ''; position: absolute; inset: 0; margin: auto; width: 12px; height: 12px; border-radius: 50%; background: #fff; }

/* בחירת קובץ */
.dropzone {
  border: 2px dashed var(--c-border); border-radius: var(--r-lg); background: var(--c-bg);
  padding: var(--s-6) var(--s-4); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--c-brand); background: var(--c-brand-soft); }
.dropzone svg { width: 36px; height: 36px; color: var(--c-brand); }
.dropzone strong { color: var(--c-brand); font-weight: 600; }
.file-info { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); }
.file-info .file-icon { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--c-brand-soft); color: var(--c-brand); display: grid; place-items: center; flex-shrink: 0; }
.file-info .file-icon svg { width: 22px; height: 22px; }
.file-info .meta { flex: 1; min-width: 0; }
.file-info .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; unicode-bidi: plaintext; }

/* ---------- תוויות מצב ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 500; line-height: 1.3; white-space: nowrap; border: 1px solid transparent;
}
.badge svg { width: 15px; height: 15px; flex-shrink: 0; }
.badge-success { background: var(--c-success-bg); color: var(--c-success); }
.badge-error { background: var(--c-error-bg); color: var(--c-error); }
.badge-pending { background: var(--c-warn-bg); color: #8A3A2C; }
.badge-progress { background: var(--c-info-bg); color: var(--c-brand); }
.badge-neutral { background: #F1EFF3; color: var(--c-text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ---------- הודעות מערכת ---------- */
.alert {
  display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); border-radius: var(--r-md);
  border: 1px solid transparent; background: var(--c-info-bg); color: var(--c-text);
}
.alert > .ico > svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; }
.alert .alert-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.alert .alert-title { font-weight: 600; }
.alert .alert-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.alert-info > .ico > svg { color: var(--c-brand); }
.alert-success { background: var(--c-success-bg); border-color: #CDE5DA; }
.alert-success > .ico > svg, .alert-success .alert-title { color: var(--c-success); }
.alert-error { background: var(--c-error-bg); border-color: #EBCDCF; }
.alert-error > .ico > svg, .alert-error .alert-title { color: var(--c-error); }
.alert-warn { background: var(--c-warn-bg); border-color: #FFD9CF; }
.alert-warn > .ico > svg { color: #B4452F; }

/* ---------- התראות קופצות ---------- */
.toasts { position: fixed; z-index: 60; inset-inline: var(--s-4); bottom: calc(var(--bottomnav-h) + var(--s-4)); display: flex; flex-direction: column; gap: var(--s-2); pointer-events: none; align-items: center; }
.toast { pointer-events: auto; background: var(--c-text); color: #fff; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); box-shadow: var(--shadow-3); max-width: 480px; width: 100%; display: flex; gap: var(--s-2); align-items: center; }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }
@media (min-width: 960px) { .toasts { bottom: var(--s-6); inset-inline-start: auto; inset-inline-end: var(--s-6); align-items: flex-end; } }

/* ---------- חלון אישור ---------- */
dialog.confirm { border: 0; padding: 0; border-radius: var(--r-xl); box-shadow: var(--shadow-3); width: min(420px, calc(100vw - 32px)); background: var(--c-surface); color: var(--c-text); }
dialog.confirm::backdrop { background: rgba(32, 32, 42, .45); }
dialog.confirm .dlg { padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-4); }
dialog.confirm .dlg-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
dialog.confirm .dlg-actions .btn { flex: 1; }

/* ---------- מצב ריק ---------- */
.empty { text-align: center; padding: var(--s-10) var(--s-4); display: flex; flex-direction: column; align-items: center; gap: var(--s-3); }
.empty .empty-art { width: 88px; height: 88px; border-radius: 50%; background: var(--c-surface); border: 1px solid var(--c-border); display: grid; place-items: center; margin-bottom: var(--s-2); }
.empty .empty-art img { width: 48px; height: 48px; }

/* ---------- בית ---------- */
.hero { display: flex; flex-direction: column; gap: var(--s-4); }
.conn { display: flex; align-items: center; gap: var(--s-4); }
.conn-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.conn-icon svg { width: 24px; height: 24px; }
.conn-icon.ok { background: var(--c-success-bg); color: var(--c-success); }
.conn-icon.bad { background: var(--c-error-bg); color: var(--c-error); }
.conn-icon.wait { background: var(--c-info-bg); color: var(--c-brand); }
.conn .conn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conn .conn-title { font-weight: 600; color: var(--c-brand); }
.cta-card { display: flex; flex-direction: column; gap: var(--s-4); background: var(--c-brand); color: #fff; border: 0; }
.cta-card h2 { color: #fff; }
.cta-card p { color: #D9D6EA; }
@media (min-width: 640px) { .cta-card { flex-direction: row; align-items: center; justify-content: space-between; } }

/* ---------- רשימת סטטוסים ---------- */
.posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.post { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; border-bottom: 1px solid var(--c-border); }
.post:last-child { border-bottom: 0; }
.thumb {
  width: 56px; height: 72px; border-radius: 10px; flex-shrink: 0; overflow: hidden; background: #17151F;
  display: grid; place-items: center; position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.text { padding: 6px; color: #fff; font-size: 9.5px; line-height: 1.25; text-align: center; overflow: hidden; word-break: break-word; }
.thumb .kind { position: absolute; inset-inline-start: 4px; bottom: 4px; width: 20px; height: 20px; border-radius: 6px; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; }
.thumb .kind svg { width: 13px; height: 13px; }
.post .post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.post .post-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: var(--fs-small); color: var(--c-text-2); }
.post .post-actions { display: flex; gap: var(--s-1); flex-shrink: 0; }
.post a.post-link { text-decoration: none; color: inherit; display: flex; gap: var(--s-3); align-items: center; flex: 1; min-width: 0; min-height: var(--touch); }
.day-head { font-size: var(--fs-small); font-weight: 600; color: var(--c-text-2); padding-top: var(--s-4); }

/* ---------- עורך + תצוגה מקדימה ---------- */
/* נייד: עורך → תצוגה מקדימה → פרסום. מחשב: עורך ופרסום מימין, תצוגה מקדימה משמאל. */
.composer { display: grid; gap: var(--s-6); align-items: start; grid-template-areas: "editor" "preview" "publish"; }
.composer .editor-col { grid-area: editor; min-width: 0; }
.composer .preview-col { grid-area: preview; min-width: 0; }
.composer .publish-bar { grid-area: publish; min-width: 0; }
@media (min-width: 960px) {
  /* בכיוון RTL העמודה הראשונה מוצגת מימין */
  .composer { grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto 1fr; grid-template-areas: "editor preview" "publish preview"; }
  .composer .preview-col { position: sticky; top: var(--s-8); }
}
.publish-bar { display: flex; flex-direction: column; gap: var(--s-3); }
.phone {
  width: 100%; max-width: 250px; margin: 0 auto; aspect-ratio: 9 / 19.5; border-radius: 38px; padding: 10px;
  background: #1B1A22; box-shadow: var(--shadow-3), inset 0 0 0 2px #3A3845;
}
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 30px; overflow: hidden; background: #0E0D12; color: #fff; }
.story-top { position: absolute; z-index: 3; inset-inline: 0; top: 0; padding: 12px 12px 18px; background: linear-gradient(rgba(0,0,0,.45), transparent); }
.story-bars { display: flex; gap: 3px; direction: ltr; }
.story-bars span { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255,255,255,.35); }
.story-bars span.on { background: #fff; }
.story-who { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; }
.story-who .av { width: 30px; height: 30px; border-radius: 50%; background: #FAF8F4; display: grid; place-items: center; }
.story-who .av img { width: 20px; height: 20px; }
.story-who .when { opacity: .75; }
.story-media { position: absolute; inset: 0; display: grid; place-items: center; }
.story-media img, .story-media video { width: 100%; height: 100%; object-fit: contain; }
.story-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 56px 22px; text-align: center; font-size: 22px; font-weight: 500; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }
.story-caption { position: absolute; z-index: 3; inset-inline: 0; bottom: 0; padding: 28px 16px 22px; background: linear-gradient(transparent, rgba(0,0,0,.65)); font-size: 14.5px; line-height: 1.4; text-align: center; white-space: pre-wrap; word-break: break-word; max-height: 45%; overflow: hidden; }
.story-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 32px; color: rgba(255,255,255,.6); font-size: 14px; }
.preview-note { margin-top: var(--s-3); font-size: var(--fs-small); color: var(--c-text-2); text-align: center; }

/* ---------- מעקב פרסום ---------- */
.progress { display: flex; flex-direction: column; gap: var(--s-2); }
.progress-bar { height: 10px; border-radius: var(--r-pill); background: var(--c-brand-soft); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--c-brand); border-radius: inherit; transition: width .4s ease; }
.progress-bar.indeterminate span { width: 35% !important; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(120%); } 100% { transform: translateX(-300%); } }
.result { display: grid; gap: var(--s-6); align-items: start; }
@media (min-width: 960px) { .result { grid-template-columns: minmax(0, 1fr) 280px; } }
.result .thumb-lg { width: 100%; max-width: 240px; aspect-ratio: 9/16; border-radius: var(--r-lg); overflow: hidden; background: #17151F; margin-inline: auto; }
.result .thumb-lg img { width: 100%; height: 100%; object-fit: contain; }
.result .thumb-lg.text { display: grid; place-items: center; padding: 20px; color: #fff; text-align: center; font-size: 17px; white-space: pre-wrap; word-break: break-word; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s-3); }
.stat { background: var(--c-bg); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); }
.stat .v { font-size: 22px; font-weight: 600; color: var(--c-brand); }
.stat .k { font-size: var(--fs-small); color: var(--c-text-2); }

/* ---------- חיבור ---------- */
.qr-wrap { display: grid; gap: var(--s-6); align-items: center; }
@media (min-width: 720px) { .qr-wrap { grid-template-columns: 260px 1fr; } }
.qr { width: 100%; max-width: 260px; aspect-ratio: 1; margin: 0 auto; padding: var(--s-3); background: #fff; border: 1px solid var(--c-border); border-radius: var(--r-lg); display: grid; place-items: center; }
.qr svg { width: 100%; height: 100%; }
.steps { margin: 0; padding-inline-start: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-4); align-items: center; }
.kv dt { color: var(--c-text-2); }
.kv dd { margin: 0; font-weight: 500; }
.numbers { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.numbers li { padding: var(--s-2) var(--s-3); background: var(--c-bg); border-radius: var(--r-sm); display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }

/* ---------- כניסה ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--s-6) var(--s-4); }
.login-card { width: min(420px, 100%); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-xl); box-shadow: var(--shadow-2); padding: var(--s-8) var(--s-6); display: flex; flex-direction: column; gap: var(--s-5); }
.login-card .logo { height: 40px; width: auto; align-self: center; }
.login-card h1 { font-size: 22px; text-align: center; }
.login-card .intro { text-align: center; color: var(--c-text-2); }
code.cmd { direction: ltr; unicode-bidi: isolate; display: inline-block; background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 6px; padding: 1px 6px; font-size: 14px; }

@media (min-width: 960px) { .phone { max-width: 320px; } }

/* ---------- סטטיסטיקה ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.tile { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card .tile { background: var(--c-bg); border-color: transparent; }
.tile-label { font-size: var(--fs-small); color: var(--c-text-2); }
.tile-value { font-size: 24px; font-weight: 600; color: var(--c-brand); line-height: 1.25; overflow-wrap: anywhere; }
.tile-sub { font-size: 13px; color: var(--c-text-2); }
.metric { display: inline-flex; align-items: center; gap: 4px; }
.metric svg { width: 15px; height: 15px; }
.live .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live .dot { animation: none; } }
.loading { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* גרפים */
.chart-fig { margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.chart { position: relative; width: 100%; }
.chart-svg { display: block; overflow: visible; }
.chart-axis { fill: var(--c-text-2); font-size: 11px; font-family: var(--font); }
.chart-label { fill: var(--c-text); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart-hit { cursor: default; outline: none; }
.chart-hit:focus-visible { outline: none; stroke: var(--c-brand); stroke-width: 2; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--c-text); color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; line-height: 1.35; display: flex; flex-direction: column; gap: 1px; white-space: nowrap; box-shadow: var(--shadow-2); direction: rtl; }
.chart-tip strong { font-weight: 600; font-size: 14px; }
.chart-tip span { color: #D4D2DC; }
.chart-table summary { cursor: pointer; color: var(--c-brand); font-size: var(--fs-small); min-height: var(--touch); display: inline-flex; align-items: center; }
.chart-table table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); margin-top: var(--s-2); }
.chart-table th, .chart-table td { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--c-border); }
.chart-table th { color: var(--c-text-2); font-weight: 500; }

/* מסננים */
.filters { display: flex; flex-direction: column; gap: var(--s-3); }
.chips { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; min-height: var(--touch); padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip svg { width: 17px; height: 17px; }
.chip[aria-checked="true"] { background: var(--c-brand); border-color: var(--c-brand); color: #fff; }
.date-range { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); align-items: end; }
.date-range .btn { grid-column: 1 / -1; }
@media (min-width: 720px) { .date-range { grid-template-columns: 200px 200px auto; } .date-range .btn { grid-column: auto; } }
.toolbar { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.toolbar .search { flex: 1 1 220px; position: relative; }
.toolbar .search svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--c-text-2); pointer-events: none; }
.toolbar .search .input { padding-inline-start: 42px; }
.select { width: auto; flex: 0 0 auto; padding-inline-end: 36px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23625F70' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; cursor: pointer; }
.letters { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.letter { flex-shrink: 0; min-width: var(--touch); min-height: var(--touch); padding: 0 10px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--c-brand); font-weight: 600; cursor: pointer; }
.letter:hover { background: var(--c-brand-soft); }
.letter[aria-checked="true"] { background: var(--c-brand); color: #fff; }

/* אנשים */
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.people li { border-bottom: 1px solid var(--c-border); }
.people li:last-child { border-bottom: 0; }
.person { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; min-height: 64px; text-decoration: none; color: inherit; }
.person:hover .person-name { color: var(--c-brand); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--c-brand-soft); color: var(--c-brand); display: grid; place-items: center; font-weight: 600; flex-shrink: 0; }
.avatar svg { width: 20px; height: 20px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.person-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; text-align: end; max-width: 52%; }
.person-side .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.views-count { font-weight: 600; color: var(--c-brand); font-size: 15px; }
.meter { width: 96px; height: 6px; border-radius: var(--r-pill); background: var(--c-brand-soft); overflow: hidden; display: block; }
.meter span { display: block; height: 100%; background: #5B52B6; border-radius: inherit; }
.like { color: var(--c-action); display: inline-flex; }
.like svg { width: 16px; height: 16px; fill: currentColor; }
.load-more { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding-top: var(--s-4); }
.ranked { counter-reset: rank; }
.ranked > li { counter-increment: rank; display: flex; align-items: center; gap: var(--s-3); }
.ranked > li::before { content: counter(rank); width: 22px; flex-shrink: 0; text-align: center; color: var(--c-text-2); font-weight: 600; font-size: var(--fs-small); }
.ranked > li > a { flex: 1; min-width: 0; }
.contact-head .back { display: inline-flex; align-items: center; gap: 4px; min-height: var(--touch); text-decoration: none; font-weight: 500; }
.contact-head .back svg { width: 18px; height: 18px; transform: scaleX(-1); }
.contact-head p { color: var(--c-text-2); }

/* המלצות */
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
@media (min-width: 960px) { .tips { grid-template-columns: repeat(3, 1fr); } }
.tips li { display: flex; gap: var(--s-3); align-items: flex-start; background: var(--c-bg); border-radius: var(--r-md); padding: var(--s-4); }
.tip-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--c-warn-bg); color: #B4452F; display: grid; place-items: center; flex-shrink: 0; }
.tip-ico svg { width: 20px; height: 20px; }

/* ניווט תחתון: חמישה פריטים */
.bottomnav { grid-template-columns: repeat(5, 1fr); }
.bottomnav a { font-size: 12px; }
/* פריטי רשת לא יגדלו מעבר לעמודה בגלל טקסט ארוך */
.grid-2 > * { min-width: 0; }
.filters .chips { flex-wrap: wrap; overflow: visible; }
.views-count { display: inline-flex; align-items: center; gap: 8px; }
.like-count { color: var(--c-text-2); font-weight: 500; font-size: 13px; }
.like-count svg { width: 14px; height: 14px; color: var(--c-action); }
@media (max-width: 479px) { .hide-narrow { display: none !important; } }
.chart-tip[hidden] { display: none; }
@media (min-width: 960px) { .tiles { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); } }
.person-main .ltr { white-space: nowrap; }
.person-side { max-width: 42%; }
