/* =========================================================
   לוח התוכן — עיצוב
   בסיס בהיר: שמנת ופחם חם, צבע מבטא חימר מהמותג של הילה.
   ========================================================= */

:root {
  --bg:        #FBF9F6;
  --bg-2:      #F3EEE7;
  --surface:   #FFFFFF;
  --surface-2: #F5F1EA;
  --line:      rgba(42, 39, 35, .10);
  --line-2:    rgba(42, 39, 35, .18);
  --ink:       #2A2723;
  --ink-2:     rgba(42, 39, 35, .64);
  --ink-3:     rgba(42, 39, 35, .40);
  --clay:      #B5654A;
  --clay-soft: rgba(181, 101, 74, .12);
  --clay-line: rgba(181, 101, 74, .34);
  --sand:      #C9A87C;
  --good:      #4E7C5A;
  --warn:      #B5654A;
  --glass:     rgba(251, 249, 246, .72);
  --shadow-1:  0 1px 2px rgba(42,39,35,.05), 0 2px 8px rgba(42,39,35,.05);
  --shadow-2:  0 2px 6px rgba(42,39,35,.07), 0 12px 32px rgba(42,39,35,.12);
  --shadow-3:  0 -2px 10px rgba(42,39,35,.06), 0 -18px 60px rgba(42,39,35,.18);
  --r-s: 10px; --r-m: 14px; --r-l: 20px; --r-xl: 26px;
  --tap: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --t-reel: #B5654A;      --t-reel-soft: rgba(181,101,74,.13);    --t-reel-ink: #A0553C;
  --t-post: #1BAF7A;      --t-post-soft: rgba(27,175,122,.13);    --t-post-ink: #147F58;
  --t-carousel: #4A3AA7;  --t-carousel-soft: rgba(74,58,167,.12); --t-carousel-ink: #4A3AA7;
  --t-story: #EDA100;     --t-story-soft: rgba(237,161,0,.15);    --t-story-ink: #8F6100;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #1B1917;
    --bg-2:      #221F1C;
    --surface:   #26231F;
    --surface-2: #2E2A25;
    --line:      rgba(240, 235, 228, .10);
    --line-2:    rgba(240, 235, 228, .18);
    --ink:       #F0EBE4;
    --ink-2:     rgba(240, 235, 228, .66);
    --ink-3:     rgba(240, 235, 228, .40);
    --clay:      #D08161;
    --clay-soft: rgba(208, 129, 97, .16);
    --clay-line: rgba(208, 129, 97, .40);
    --sand:      #D5B88F;
    --good:      #7FB08C;
    --glass:     rgba(27, 25, 23, .74);
    --shadow-1:  0 1px 2px rgba(0,0,0,.30), 0 2px 8px rgba(0,0,0,.24);
    --shadow-2:  0 2px 6px rgba(0,0,0,.34), 0 12px 32px rgba(0,0,0,.44);
    --shadow-3:  0 -2px 10px rgba(0,0,0,.30), 0 -18px 60px rgba(0,0,0,.52);
    --t-reel: #D95926;      --t-reel-soft: rgba(217,89,38,.18);       --t-reel-ink: #F0855A;
    --t-post: #199E70;      --t-post-soft: rgba(25,158,112,.18);      --t-post-ink: #4FC59A;
    --t-carousel: #9085E9;  --t-carousel-soft: rgba(144,133,233,.18); --t-carousel-ink: #B1A8F2;
    --t-story: #C98500;     --t-story-soft: rgba(201,133,0,.18);      --t-story-ink: #E8B04A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:        #1B1917;
  --bg-2:      #221F1C;
  --surface:   #26231F;
  --surface-2: #2E2A25;
  --line:      rgba(240, 235, 228, .10);
  --line-2:    rgba(240, 235, 228, .18);
  --ink:       #F0EBE4;
  --ink-2:     rgba(240, 235, 228, .66);
  --ink-3:     rgba(240, 235, 228, .40);
  --clay:      #D08161;
  --clay-soft: rgba(208, 129, 97, .16);
  --clay-line: rgba(208, 129, 97, .40);
  --sand:      #D5B88F;
  --good:      #7FB08C;
  --glass:     rgba(27, 25, 23, .74);
  --shadow-1:  0 1px 2px rgba(0,0,0,.30), 0 2px 8px rgba(0,0,0,.24);
  --shadow-2:  0 2px 6px rgba(0,0,0,.34), 0 12px 32px rgba(0,0,0,.44);
  --shadow-3:  0 -2px 10px rgba(0,0,0,.30), 0 -18px 60px rgba(0,0,0,.52);
  --t-reel: #D95926;    --t-reel-soft: rgba(217,89,38,.18);     --t-reel-ink: #F0855A;
  --t-post: #199E70;    --t-post-soft: rgba(25,158,112,.18);    --t-post-ink: #4FC59A;
  --t-carousel: #9085E9;  --t-carousel-soft: rgba(144,133,233,.18); --t-carousel-ink: #B1A8F2;
  --t-story: #C98500;   --t-story-soft: rgba(201,133,0,.18);    --t-story-ink: #E8B04A;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* חייב לגבור על כללי display של המחלקות, אחרת אלמנט מוסתר ממשיך לחסום לחיצות */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 100%;
  line-height: 1.55;
  font-weight: 400;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100svh; }

h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.15; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; letter-spacing: -.022em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; letter-spacing: -.008em; }
p  { margin: 0; }
small, .small { font-size: .8125rem; letter-spacing: .005em; }

button, input, textarea, select {
  font: inherit; color: inherit;
  font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
button { cursor: pointer; border: 0; background: none; }
a { color: var(--clay); }

:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------ מסך כניסה ------------------------------ */
.gate {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 24px;
  background: var(--bg);
}
.gate-card { width: 100%; max-width: 340px; text-align: center; }
.gate-mark {
  width: 62px; height: 62px; margin: 0 auto 20px;
  border-radius: 18px; background: var(--clay);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
  padding: 13px; box-shadow: var(--shadow-2);
}
.gate-mark span { border-radius: 50%; background: rgba(255,255,255,.9); }
.gate-mark span:nth-child(5) { background: var(--sand); }
.gate-sub { color: var(--ink-2); margin: 6px 0 26px; font-weight: 300; }
#gateCode {
  width: 100%; height: 52px; text-align: center; letter-spacing: .3em;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-m); margin-bottom: 12px; padding: 0 12px;
}
#gateCode::placeholder { letter-spacing: 0; color: var(--ink-3); }
.gate-err { color: var(--warn); margin-top: 14px; font-size: .875rem; }

/* -------------------------------- כפתורים -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--tap); padding: 0 18px;
  border-radius: var(--r-m); font-weight: 500;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2);
  transition: transform 110ms cubic-bezier(.2,.7,.3,1), background-color 140ms ease, border-color 140ms ease;
}
.btn:active { transform: scale(.968); }
.btn-primary { background: var(--clay); color: #fff; border-color: transparent; font-weight: 700; }
.btn-quiet   { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-soft    { background: var(--clay-soft); border-color: transparent; color: var(--clay); font-weight: 500; }
.btn-danger  { color: var(--warn); border-color: var(--clay-line); background: transparent; }
.btn-block   { width: 100%; }
.btn-sm      { min-height: 36px; padding: 0 12px; font-size: .875rem; border-radius: var(--r-s); }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%;
  display: grid; place-items: center; color: var(--ink);
  transition: transform 110ms cubic-bezier(.2,.7,.3,1), background-color 140ms ease;
}
.icon-btn:active { transform: scale(.9); background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; }

/* -------------------------------- מבנה -------------------------------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: var(--safe-t);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}
.topbar-in {
  max-width: 760px; margin: 0 auto; padding: 6px 8px;
  display: flex; align-items: center; gap: 4px; min-height: 54px;
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .small { color: var(--ink-2); }
/* קצה רך במקום קו מפריד, כדי שהתוכן ייעלם מתחת לסרגל ולא ייחתך */
.topbar::after {
  content: ''; position: absolute; inset-inline: 0; bottom: -14px; height: 14px;
  background: linear-gradient(to bottom, var(--glass), transparent);
  pointer-events: none;
}

.screen { padding-bottom: calc(96px + var(--safe-b)); }

/* -------------------------- בורר תצוגה (מקטעים) -------------------------- */
.seg {
  display: flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border-radius: 12px;
  position: relative;
}
.seg button {
  flex: 1; min-height: 34px; padding: 0 12px; border-radius: 9px;
  font-size: .875rem; font-weight: 500; color: var(--ink-2);
  transition: color 140ms ease;
  position: relative; z-index: 1; white-space: nowrap;
}
.seg button[aria-selected="true"] { color: var(--ink); font-weight: 700; }
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; border-radius: 9px;
  background: var(--surface); box-shadow: var(--shadow-1); z-index: 0;
}

/* --------------------------------- צ'יפים --------------------------------- */
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 34px; padding: 0 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: .8125rem; font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform 110ms cubic-bezier(.2,.7,.3,1), background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: transparent; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }

/* ------------------------------ תיקיות לקוחות ------------------------------ */
.client-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow-1);
  transition: transform 130ms cubic-bezier(.2,.7,.3,1);
}
.client-card:active { transform: scale(.985); }
.client-avatar {
  width: 46px; height: 46px; border-radius: 15px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.05rem;
}
.client-meta { flex: 1; min-width: 0; }
.client-meta .name { font-weight: 700; letter-spacing: -.01em; }
.client-meta .sub { color: var(--ink-2); font-size: .8125rem; }
.badge {
  flex: 0 0 auto; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px;
  display: grid; place-items: center; font-size: .75rem; font-weight: 700;
  background: var(--clay-soft); color: var(--clay);
}
.badge.late { background: var(--warn); color: #fff; }

/* -------------------------------- פס ימים -------------------------------- */
.daystrip { display: flex; gap: 6px; padding: 2px 0 12px; }
.daystrip button {
  flex: 1; padding: 8px 2px 9px; border-radius: var(--r-m);
  display: grid; gap: 1px; justify-items: center;
  background: transparent; border: 1px solid transparent;
  transition: background-color 150ms ease, border-color 150ms ease, transform 110ms cubic-bezier(.2,.7,.3,1);
}
.daystrip button:active { transform: scale(.94); }
.daystrip .dw { font-size: .6875rem; color: var(--ink-3); letter-spacing: .02em; }
.daystrip .dn { font-size: 1.0625rem; font-weight: 500; letter-spacing: -.01em; }
.daystrip .dd { height: 5px; display: flex; gap: 3px; margin-top: 2px; }
.daystrip .dd i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.daystrip button[aria-selected="true"] { background: var(--ink); border-color: transparent; }
.daystrip button[aria-selected="true"] .dw { color: rgba(255,255,255,.6); }
.daystrip button[aria-selected="true"] .dn { color: var(--bg); font-weight: 700; }
.daystrip button.is-today .dn { color: var(--clay); font-weight: 700; }
.daystrip button.is-today[aria-selected="true"] .dn { color: var(--bg); }

.dayhead { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 14px; }
.dayhead h1 { font-size: 1.45rem; }
.dayhead .sub { color: var(--ink-2); font-size: .875rem; font-weight: 300; }

/* -------------------------------- כרטיס פריט -------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); margin-bottom: 12px; overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: opacity 220ms ease, filter 220ms ease, transform 130ms cubic-bezier(.2,.7,.3,1);
  position: relative;
}
.card::before {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px;
  background: var(--type-color, var(--sand));
  transition: opacity 220ms ease;
}
.card.published { opacity: .58; filter: saturate(.12); }
.card.published .card-thumb img { filter: grayscale(1); }
.card.published::before { opacity: .3; }

.card-top { display: flex; align-items: center; gap: 9px; padding: 12px 14px 0 10px; }
.type-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .01em;
  background: var(--type-soft); color: var(--type-ink, var(--type-color));
}
.card-time { font-size: .8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.card-top .spacer { flex: 1; }
.status-tag { font-size: .75rem; font-weight: 500; color: var(--ink-3); }
.status-tag.ready { color: var(--good); }

.card-body { padding: 8px 14px 12px; cursor: pointer; }
.card-title { font-weight: 700; letter-spacing: -.01em; margin-bottom: 3px; }
.card-cap {
  color: var(--ink-2); font-size: .875rem; font-weight: 300;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext;
}
.card-thumb { display: grid; grid-auto-flow: column; gap: 2px; background: var(--surface-2); }
.card-thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--surface-2); }
.card-thumb.one img { aspect-ratio: 3/2; }
.card-link {
  display: flex; align-items: center; gap: 7px; margin: 0 14px 12px;
  padding: 9px 11px; border-radius: var(--r-s);
  background: var(--surface-2); color: var(--ink-2);
  font-size: .8125rem; text-decoration: none;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.card-link svg { flex: 0 0 auto; width: 15px; height: 15px; }

.card-actions { display: flex; gap: 8px; padding: 0 12px 12px; }
.card-actions .btn { flex: 1; }

/* --------------------------------- לוח חודש --------------------------------- */
.monthbar { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.monthbar h2 { flex: 1; text-align: center; letter-spacing: -.018em; }
.weekhead {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px;
  font-size: .6875rem; color: var(--ink-3); text-align: center; margin-bottom: 6px;
}
.monthgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.mcell {
  aspect-ratio: .82; border-radius: var(--r-s); padding: 4px 4px 3px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px; overflow: hidden;
  transition: transform 110ms cubic-bezier(.2,.7,.3,1), border-color 150ms ease;
  text-align: start;
}
.mcell:active { transform: scale(.94); }
.mcell.out { background: transparent; border-color: transparent; opacity: .35; }
.mcell.today { border-color: var(--clay); }
.mcell.alldone { background: var(--bg-2); }
.mcell .n { font-size: .75rem; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; line-height: 1.1; }
.mcell.today .n { color: var(--clay); font-weight: 700; }
.mcell.alldone .n { color: var(--ink-3); }
.mcell .mth { flex: 1; border-radius: 5px; overflow: hidden; background: var(--surface-2); min-height: 0; }
.mcell .mth img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcell.alldone .mth img { filter: grayscale(1); opacity: .5; }
.mcell .mdots { display: flex; flex-wrap: wrap; gap: 2px; }
.mcell .mdots i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.mcell.alldone .mdots i { opacity: .35; }
.mcell .more { font-size: .625rem; color: var(--ink-3); }

/* ---------------------------------- רשימה ---------------------------------- */
.list-day { margin: 22px 0 8px; display: flex; align-items: baseline; gap: 8px; }
.list-day h3 { letter-spacing: -.01em; }
.list-day .sub { color: var(--ink-3); font-size: .8125rem; }
.list-day.is-today h3 { color: var(--clay); }

/* ---------------------------------- ריק ---------------------------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty .ico { font-size: 34px; margin-bottom: 10px; opacity: .5; }
.empty h3 { margin-bottom: 6px; }
.empty p { font-weight: 300; font-size: .9375rem; margin-bottom: 18px; }

/* ------------------------------- כפתור צף ------------------------------- */
.fab {
  position: fixed; inset-inline-start: 18px; bottom: calc(18px + var(--safe-b)); z-index: 30;
  height: 52px; padding: 0 20px; border-radius: 999px;
  background: var(--clay); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 20px rgba(181,101,74,.36);
  transition: transform 130ms cubic-bezier(.2,.7,.3,1);
}
.fab:active { transform: scale(.94); }
.fab svg { width: 19px; height: 19px; }

/* --------------------------------- גיליון --------------------------------- */
.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(20, 18, 16, .42);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 41;
  max-width: 760px; margin: 0 auto;
  max-height: 92svh; display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-3);
  will-change: transform;
  touch-action: none;
}
.sheet-grab { padding: 9px 0 3px; display: grid; place-items: center; flex: 0 0 auto; cursor: grab; }
.sheet-grab i { width: 38px; height: 4px; border-radius: 999px; background: var(--line-2); display: block; }
.sheet-head {
  display: flex; align-items: center; gap: 6px; padding: 2px 8px 8px; flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { flex: 1; padding-inline-start: 8px; font-size: 1.05rem; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px calc(20px + var(--safe-b)); touch-action: pan-y; }
.sheet-foot {
  flex: 0 0 auto; padding: 10px 16px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line); background: var(--surface);
  display: flex; gap: 10px;
}

/* --------------------------------- שדות --------------------------------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: .8125rem; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .005em; }
.field .hint { font-size: .75rem; color: var(--ink-3); margin-top: 5px; font-weight: 300; }
.input, .textarea, select.input {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-m);
  padding: 11px 13px; min-height: var(--tap);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-soft); }
.textarea { min-height: 132px; resize: vertical; line-height: 1.6; white-space: pre-wrap; unicode-bidi: plaintext; }
.textarea.short { min-height: 76px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.label-row label { font-size: .8125rem; font-weight: 500; color: var(--ink-2); }

.typegrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.typegrid button {
  padding: 10px 4px 9px; border-radius: var(--r-m); border: 1px solid var(--line);
  background: var(--surface); display: grid; gap: 3px; justify-items: center;
  font-size: .8125rem; font-weight: 500; color: var(--ink-2);
  transition: transform 110ms cubic-bezier(.2,.7,.3,1), border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
.typegrid button:active { transform: scale(.94); }
.typegrid button svg { width: 20px; height: 20px; }
.typegrid button[aria-pressed="true"] { background: var(--tc-soft); border-color: var(--tc); color: var(--tc); font-weight: 700; }

.statusrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.statusrow button {
  min-height: 44px; border-radius: var(--r-m); border: 1px solid var(--line);
  background: var(--surface); font-size: .875rem; font-weight: 500; color: var(--ink-2);
  transition: transform 110ms cubic-bezier(.2,.7,.3,1), background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.statusrow button:active { transform: scale(.95); }
.statusrow button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: transparent; font-weight: 700; }
.statusrow button[data-s="published"][aria-pressed="true"] { background: var(--good); }
.statusrow button[data-s="ready"][aria-pressed="true"] { background: var(--clay); }

/* --------------------------------- מדיה --------------------------------- */
.mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.mediagrid .m {
  position: relative; aspect-ratio: 1; border-radius: var(--r-m); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
}
.mediagrid .m img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mediagrid .m .x {
  position: absolute; top: 4px; inset-inline-end: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(20,18,16,.62); color: #fff; display: grid; place-items: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.mediagrid .add {
  aspect-ratio: 1; border-radius: var(--r-m);
  border: 1.5px dashed var(--line-2); background: transparent;
  display: grid; place-items: center; gap: 2px; color: var(--ink-3); font-size: .75rem;
  transition: transform 110ms cubic-bezier(.2,.7,.3,1), border-color 150ms ease, color 150ms ease;
}
.mediagrid .add:active { transform: scale(.94); }
.mediagrid .add svg { width: 22px; height: 22px; }
.m.uploading { display: grid; place-items: center; }
.m .bar { position: absolute; inset-inline: 6px; bottom: 6px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.4); overflow: hidden; }
.m .bar i { display: block; height: 100%; background: var(--clay); width: 40%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { margin-inline-start: -40%; } 100% { margin-inline-start: 100%; } }

/* -------------------------------- lightbox -------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 70; background: rgba(14,12,11,.95);
  display: grid; place-items: center; padding: 16px;
}
.lightbox img { max-width: 100%; max-height: 84svh; object-fit: contain; border-radius: 6px; }
.lightbox .lb-bar {
  position: absolute; top: calc(10px + var(--safe-t)); inset-inline: 10px;
  display: flex; gap: 8px; justify-content: space-between;
}
.lightbox .lb-bar .btn, .lightbox .icon-btn { color: #fff; background: rgba(255,255,255,.14); border-color: transparent; }

/* --------------------------------- הודעה --------------------------------- */
.toast {
  position: fixed; z-index: 80; inset-inline: 0; bottom: calc(20px + var(--safe-b));
  margin: 0 auto; width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--bg);
  padding: 11px 16px; border-radius: 999px;
  box-shadow: var(--shadow-2); font-size: .875rem; font-weight: 500;
}
.toast button { color: var(--sand); font-weight: 700; font-size: .875rem; }

/* --------------------------------- שונות --------------------------------- */
.sect-title { font-size: .8125rem; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; margin: 24px 0 10px; }
.rowlink {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start;
  min-height: 52px; padding: 8px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-m); margin-bottom: 8px;
}
.rowlink .g { flex: 1; min-width: 0; }
.rowlink .g .t { font-weight: 500; }
.rowlink .g .s { font-size: .75rem; color: var(--ink-3); }
.offline-bar {
  position: fixed; top: var(--safe-t); inset-inline: 0; z-index: 50;
  background: var(--ink); color: var(--bg); text-align: center;
  font-size: .75rem; padding: 5px; font-weight: 500;
}

/* ------------------------ נגישות: תנועה ושקיפות ------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .btn, .chip, .icon-btn, .mcell, .card, .fab, .typegrid button, .statusrow button, .daystrip button { transition: opacity 160ms ease !important; }
  .btn:active, .chip:active, .icon-btn:active, .mcell:active, .fab:active { transform: none; opacity: .7; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .topbar::after { display: none; }
  .scrim { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(20,18,16,.55); }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(42,39,35,.28); --line-2: rgba(42,39,35,.5); --ink-2: rgba(42,39,35,.8); --ink-3: rgba(42,39,35,.62); }
  .topbar { background: var(--bg); backdrop-filter: none; }
}

/* ------------------------- גודל אחיד לאייקונים ------------------------- */
svg { flex: 0 0 auto; }
.btn svg        { width: 17px; height: 17px; }
.btn-sm svg     { width: 15px; height: 15px; }
.type-pill svg  { width: 13px; height: 13px; }
.rowlink > svg  { width: 18px; height: 18px; opacity: .45; }
.empty .ico svg { width: 34px; height: 34px; }
.mediagrid .m .x svg { width: 14px; height: 14px; }
.toast svg      { width: 15px; height: 15px; }

/* טקסט שהמשתמשת מקלידה שומר על הכיוון הטבעי שלו */
.card-link { unicode-bidi: plaintext; }
.topbar-title .small, .client-meta .sub, .rowlink .s { unicode-bidi: isolate; }

/* כרטיס לקוחה: השם והשורה שמתחתיו הם שתי שורות נפרדות */
.client-meta .name, .client-meta .sub { display: block; }
.client-meta .late-note { color: var(--warn); font-weight: 700; }
.rowlink .t, .rowlink .s { display: block; }
.seg-static button[aria-selected="true"] { background: var(--surface); box-shadow: var(--shadow-1); }

/* --------------------------- סינון: מונים והודעה --------------------------- */
.chip-n { font-size: .6875rem; font-weight: 700; opacity: .55; margin-inline-start: 2px; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .chip-n { opacity: .8; }
.filter-note {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 12px; padding: 8px 12px; border-radius: var(--r-s);
  background: var(--clay-soft); color: var(--clay); font-size: .8125rem; font-weight: 500;
}
.filter-note button { color: var(--clay); font-weight: 700; font-size: .8125rem; text-decoration: underline; text-underline-offset: 3px; }
/* הצ'יפים נשברים לשורה שנייה במקום להיחתך בקצה המסך */
.chips { flex-wrap: wrap; overflow-x: visible; row-gap: 7px; }
