/* ============================================================
   דיירים · سُكّان — מערכת עיצוב
   בהיר, חמים ומרווח · RTL · מצב יום ולילה
   ============================================================ */

:root{
  /* משטחים */
  --bg:        #F6F2EA;
  --bg-tint:   #EFE8DC;
  --surface:   #FFFFFF;
  --surface-2: #FBF8F2;
  --line:      #E7DFD3;
  --line-soft: #F0EAE0;

  /* טקסט */
  --text:      #2A2620;
  --text-soft: #6F675C;
  --text-mute: #756A5C;  /* עודכן לעמידה ביחס ניגודיות 4.5:1 (WCAG 2.1 AA / ת"י 5568) */

  /* מותג — נדגם ישירות מקובץ הלוגו (assets/logo.png): נייבי + זהב */
  --navy:        #0B2342;
  --gold:        #D69426;
  --gold-hover:  #B37A1D;
  --on-gold:     #14213D;
  --accent:      #0B2342;
  --accent-hi:   #2E5490;
  --accent-hover:#071730;
  --accent-soft: #E7EBF3;
  --accent-ring: rgba(11,35,66,.16);
  --on-accent:   #FFFFFF;

  /* סטטוס — הגוונים עודכנו כדי לעמוד ביחס ניגודיות 4.5:1 גם על משטח לבן וגם על הרקע הרך שלהם */
  --ok:        #0A7452;
  --ok-soft:   #E4F6EF;
  --debt:      #A34C2C;
  --debt-soft: #FAEBE4;
  --amber:     #83591A;
  --amber-soft:#F9F0DE;

  /* שירותים */
  --elec:      #83591A;  --elec-soft: #F9F0DE;
  --water:     #356B8C;  --water-soft:#E6F0F6;
  --gas:       #8A5731;  --gas-soft:  #F6ECE3;

  /* כרום */
  --topbar:    rgba(246,242,234,.82);
  --paper:     #FFFDF8;

  /* פינות */
  --r-xs: 9px;  --r-sm: 13px;  --r-md: 17px;  --r-lg: 22px;  --r-pill: 999px;

  /* צללים */
  --sh-sm: 0 1px 2px rgba(42,38,32,.05);
  --sh:    0 1px 2px rgba(42,38,32,.04), 0 6px 20px rgba(42,38,32,.06);
  --sh-md: 0 2px 6px rgba(42,38,32,.05), 0 14px 32px rgba(42,38,32,.10);
  --sh-lg: 0 4px 10px rgba(42,38,32,.06), 0 24px 52px rgba(42,38,32,.14);

  /* טיפוגרפיה */
  --font: 'Rubik','Heebo','Segoe UI',system-ui,sans-serif;
  --fs-xs: .775rem; --fs-sm: .86rem; --fs-md: .95rem;
  --fs-lg: 1.06rem; --fs-xl: 1.35rem; --fs-2xl: 1.8rem;

  --ease: cubic-bezier(.4,.14,.3,1);
}

html[lang="ar"]{ --font: 'Cairo','Tajawal','Segoe UI',system-ui,sans-serif; }

/* ---------- מצב לילה ---------- */
html[data-theme="dark"]{
  --bg:        #161513;
  --bg-tint:   #1E1C19;
  --surface:   #201E1B;
  --surface-2: #272420;
  --line:      #37332D;
  --line-soft: #2D2A25;

  --text:      #F0EBE2;
  --text-soft: #ADA598;
  --text-mute: #7E766A;

  --navy:        #8FAEE8;
  --gold:        #E3B354;
  --gold-hover:  #EFC978;
  --accent:      #5E82CC;
  --accent-hi:   #8FAEE8;
  --accent-hover:#7194D8;
  --accent-soft: #202B44;
  --accent-ring: rgba(94,130,204,.26);
  --on-accent:   #0C1526;

  --ok:        #35C295;  --ok-soft:   #17332A;
  --debt:      #DD8A69;  --debt-soft: #3A281F;
  --amber:     #D9AB57;  --amber-soft:#352C1B;

  --elec:      #D9AB57;  --elec-soft: #352C1B;
  --water:     #78AECE;  --water-soft:#1E2E38;
  --gas:       #C68B60;  --gas-soft:  #33261D;

  --topbar:    rgba(22,21,19,.82);

  --sh-sm: 0 1px 2px rgba(0,0,0,.3);
  --sh:    0 1px 2px rgba(0,0,0,.28), 0 6px 20px rgba(0,0,0,.32);
  --sh-md: 0 2px 6px rgba(0,0,0,.3), 0 14px 32px rgba(0,0,0,.4);
  --sh-lg: 0 4px 10px rgba(0,0,0,.34), 0 24px 52px rgba(0,0,0,.5);

  color-scheme: dark;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  background:var(--bg);
  background-image:
    radial-gradient(1100px 520px at 100% -8%, var(--bg-tint) 0%, transparent 62%),
    radial-gradient(760px 420px at -10% 0%, var(--accent-soft) 0%, transparent 55%);
  background-attachment:fixed;
  color:var(--text);
  font-family:var(--font);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

button,input,textarea,select{ font-family:inherit; font-size:inherit; color:inherit; }
h1,h2,h3,h4{ margin:0; font-weight:600; line-height:1.25; letter-spacing:-.015em; }
table{ border-collapse:collapse; width:100%; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

.skip-link{
  position:absolute; top:-100px; inset-inline-end:12px; z-index:500;
  background:var(--accent); color:var(--on-accent);
  padding:12px 20px; border-radius:var(--r-sm);
  font-weight:600; font-size:var(--fs-sm); text-decoration:none;
  transition:top .16s var(--ease);
}
.skip-link:focus{ top:12px; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* ============================================================
   סרגל עליון
   ============================================================ */
.topbar{
  position:sticky; top:0; z-index:60;
  background:var(--topbar);
  backdrop-filter:blur(14px) saturate(1.4);
  border-bottom:2px solid var(--gold);
}
.topbar-inner{
  max-width:1180px; margin:0 auto; padding:11px 22px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}

.brand{
  display:flex; align-items:center; gap:12px;
  background:none; border:0; padding:4px 6px 4px 4px; cursor:pointer;
  border-radius:var(--r-sm); color:var(--text);
  transition:background .16s var(--ease);
}
.brand:hover{ background:var(--surface-2); }
.brand-mark{
  width:42px; height:42px; flex:none; display:block;
  border-radius:13px; box-shadow:0 4px 14px rgba(11,35,66,.28);
}
.brand-text{ display:flex; flex-direction:column; align-items:flex-start; line-height:1.12; }
.brand-text strong{ font-size:1.22rem; font-weight:700; letter-spacing:-.025em; }
.brand-text small{
  font-size:.72rem; color:var(--text-soft);
  letter-spacing:.06em; font-weight:500;
}

.topbar-actions{ display:flex; align-items:center; gap:9px; }

.btn-ghost{
  display:inline-flex; align-items:center; gap:7px;
  background:var(--surface); border:1px solid var(--line);
  padding:8px 15px; border-radius:var(--r-pill); cursor:pointer;
  font-size:var(--fs-sm); color:var(--text-soft); font-weight:500;
  box-shadow:var(--sh-sm);
  transition:color .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease);
}
.btn-ghost:hover{ color:var(--text); border-color:var(--text-mute); transform:translateY(-1px); }
.btn-ghost.icon-only{ padding:9px 11px; line-height:0; }
.btn-ghost.icon-only svg{ display:block; }

.lang-switch{
  display:flex; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-pill); padding:3px; gap:2px; box-shadow:var(--sh-sm);
}
.lang-switch button{
  border:0; background:none; cursor:pointer;
  padding:6px 14px; border-radius:var(--r-pill);
  font-size:var(--fs-sm); font-weight:500; color:var(--text-soft);
  transition:background .18s var(--ease), color .18s var(--ease);
}
.lang-switch button:hover{ color:var(--text); }
.lang-switch button.active{
  background:var(--accent); color:var(--on-accent);
  box-shadow:0 2px 8px var(--accent-ring), 0 0 0 1.5px var(--gold);
}

/* ============================================================
   פריסה
   ============================================================ */
.view{ max-width:1180px; margin:0 auto; padding:30px 22px 90px; }

.page-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:18px; flex-wrap:wrap; margin-bottom:24px;
}
.page-head h1{ font-size:var(--fs-2xl); }
.page-head p{ margin:5px 0 0; color:var(--text-soft); font-size:var(--fs-md); }

.back-link{
  display:inline-flex; align-items:center; gap:6px;
  background:none; border:0; cursor:pointer; padding:4px 0 12px;
  color:var(--accent); font-weight:500; font-size:var(--fs-sm);
  transition:gap .16s var(--ease);
}
html[dir="rtl"] .back-link svg{ transform:scaleX(-1); }
.back-link:hover{ color:var(--accent-hover); gap:10px; }

.card{
  background:var(--surface);
  border:1px solid var(--line-soft);
  border-radius:var(--r-lg);
  box-shadow:var(--sh);
  padding:24px;
}
.card + .card{ margin-top:18px; }
.card-title{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  font-size:var(--fs-lg); font-weight:600; letter-spacing:-.015em;
  margin-bottom:18px;
}
.card-title .hint{
  font-weight:400; font-size:var(--fs-xs); color:var(--text-mute);
  margin-inline-start:auto;
}

/* ============================================================
   לוח בקרה
   ============================================================ */
.summary{
  display:grid; grid-template-columns:repeat(4,1fr);
  gap:14px; margin-bottom:22px;
}
@media (max-width:1020px){ .summary{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .summary{ grid-template-columns:1fr; } }
.stat{
  position:relative; overflow:hidden;
  background:var(--surface); border:1px solid var(--line-soft);
  border-radius:var(--r-md); padding:17px 19px; box-shadow:var(--sh);
  display:flex; align-items:center; gap:14px;
}
.stat-ic{
  width:42px; height:42px; border-radius:12px; flex:none;
  display:grid; place-items:center;
  background:var(--accent-soft); color:var(--accent);
}
.stat.is-debt .stat-ic{ background:var(--debt-soft); color:var(--debt); }
.stat.is-ok   .stat-ic{ background:var(--ok-soft);   color:var(--ok); }
.stat .label{ font-size:var(--fs-xs); color:var(--text-soft); letter-spacing:.01em; }
.stat .value{
  font-size:1.5rem; font-weight:700; margin-top:1px;
  letter-spacing:-.03em; font-variant-numeric:tabular-nums;
}
.stat .value small{ font-size:.78rem; font-weight:400; color:var(--text-mute); letter-spacing:0; }
.stat.is-debt .value{ color:var(--debt); }
.stat.is-ok   .value{ color:var(--ok); }

/* סרגל סינון */
.toolbar{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  margin-bottom:18px;
}
.search{
  position:relative; flex:1 1 240px; min-width:200px; max-width:380px;
}
.search svg{
  position:absolute; inset-inline-start:14px; top:50%; transform:translateY(-50%);
  color:var(--text-mute); pointer-events:none;
}
.search input{
  width:100%; padding:11px 42px 11px 16px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-pill); box-shadow:var(--sh-sm);
  transition:border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.search input:focus{
  outline:0; border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-ring);
}
.chips{ display:flex; gap:7px; flex-wrap:wrap; }
.chip{
  display:inline-flex; align-items:center; gap:7px;
  background:var(--surface); border:1px solid var(--line);
  padding:9px 15px; border-radius:var(--r-pill); cursor:pointer;
  font-size:var(--fs-sm); font-weight:500; color:var(--text-soft);
  box-shadow:var(--sh-sm);
  transition:all .16s var(--ease);
}
.chip:hover{ color:var(--text); border-color:var(--text-mute); }
.chip.active{
  background:var(--accent); border-color:var(--accent);
  color:var(--on-accent); box-shadow:0 3px 10px var(--accent-ring), 0 0 0 1.5px var(--gold);
}
.chip .count{
  font-size:var(--fs-xs); font-variant-numeric:tabular-nums;
  background:var(--bg-tint); color:var(--text-soft);
  padding:1px 7px; border-radius:var(--r-pill);
}
.chip.active .count{ background:rgba(255,255,255,.22); color:inherit; }

/* כרטיסי דירות */
.apt-grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(252px,1fr)); gap:16px;
}
.apt-card{
  position:relative; overflow:hidden; text-align:start;
  background:var(--surface); border:1px solid var(--line-soft);
  border-radius:var(--r-lg); box-shadow:var(--sh);
  padding:18px 18px 16px; cursor:pointer;
  transition:transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.apt-card::before{
  content:''; position:absolute; inset-block:0; inset-inline-start:0; width:4px;
  background:var(--ok); opacity:.85;
}
.apt-card.debt::before{ background:var(--debt); }
.apt-card.vacant::before{ background:var(--line); }
.apt-card:hover{
  transform:translateY(-3px); box-shadow:var(--sh-md); border-color:var(--line);
}
.apt-card .head{ display:flex; align-items:center; gap:12px; }
.apt-card .num{
  width:44px; height:44px; border-radius:14px; flex:none;
  background:var(--accent-soft); color:var(--accent);
  display:grid; place-items:center; font-weight:700; font-size:1.1rem;
  font-variant-numeric:tabular-nums;
}
.apt-card.vacant .num{ background:var(--bg-tint); color:var(--text-mute); }
.apt-card .unit-name{
  font-weight:600; font-size:var(--fs-xs); color:var(--accent);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.apt-card .tenant{
  font-weight:600; font-size:var(--fs-md);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.apt-card .tenant.empty{ color:var(--text-mute); font-weight:400; font-style:italic; }
.apt-card .meta{ font-size:var(--fs-xs); color:var(--text-soft); margin-top:1px; }
.apt-card .foot{
  margin-top:16px; padding-top:13px; border-top:1px solid var(--line-soft);
  display:flex; align-items:center; justify-content:space-between; gap:8px;
}
.apt-card .balance{
  font-weight:700; font-size:var(--fs-lg);
  font-variant-numeric:tabular-nums; letter-spacing:-.02em;
}
.apt-card.debt .balance{ color:var(--debt); }
.apt-card.ok .balance{ color:var(--ok); }

.pill{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 11px; border-radius:var(--r-pill);
  font-size:var(--fs-xs); font-weight:600; white-space:nowrap;
}
.pill.ok{ background:var(--ok-soft); color:var(--ok); }
.pill.debt{ background:var(--debt-soft); color:var(--debt); }
.pill.neutral{ background:var(--bg-tint); color:var(--text-soft); }
.pill .dot{ width:6px; height:6px; border-radius:50%; background:currentColor; }
/* ============================================================
   חלון אישור מודאלי (במקום confirm()/alert() של הדפדפן)
   ============================================================ */
.modal-overlay{
  position:fixed; inset:0; z-index:200;
  background:rgba(20,20,25,.5);
  display:flex; align-items:center; justify-content:center;
  padding:20px; animation:overlayIn .14s var(--ease);
}
.modal-overlay[hidden]{ display:none; }
@keyframes overlayIn{ from{ opacity:0; } to{ opacity:1; } }
.modal-box{
  width:100%; max-width:400px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); box-shadow:var(--sh-lg);
  padding:22px; animation:modalIn .16s var(--ease);
}
@keyframes modalIn{ from{ opacity:0; transform:translateY(8px) scale(.98); } to{ opacity:1; transform:none; } }
.modal-msg{ font-size:var(--fs-md); color:var(--text); line-height:1.5; margin:0 0 20px; white-space:pre-line; }
.modal-actions{ display:flex; gap:10px; justify-content:flex-end; }
.modal-actions .btn{ min-width:96px; }

/* ============================================================
   מסך פתיחה (splash) — לאחר כניסה לחשבון
   ============================================================ */
.splash{
  position:fixed; inset:0; z-index:300; overflow:hidden;
  background:#FFFFFF;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  opacity:1; transform:translateY(0);
  transition:opacity .5s var(--ease), transform .5s var(--ease);
}
.splash.hide{ opacity:0; transform:translateY(-46px); pointer-events:none; }

.splash-glow{
  position:absolute; left:50%; top:50%; width:520px; height:520px; border-radius:50%;
  background:radial-gradient(circle, rgba(214,148,38,.16), rgba(214,148,38,0) 70%);
  opacity:0; transform:translate(-50%,-50%) scale(.5);
  animation:splashGlow 1.2s var(--ease) forwards;
}
@keyframes splashGlow{ to{ opacity:1; transform:translate(-50%,-50%) scale(1); } }

.splash-logo{
  position:relative; width:min(70vw, 320px); height:auto;
  opacity:0; transform:translateY(54px) scale(.6);
  animation:splashPop .85s cubic-bezier(.3,1.6,.4,1) forwards;
}
@keyframes splashPop{ to{ opacity:1; transform:translateY(0) scale(1); } }

.pill.toggle{
  border:0; font:inherit; cursor:pointer;
  transition:filter .14s var(--ease);
}
.pill.toggle:hover{ filter:brightness(0.95); }
html[data-theme="dark"] .pill.toggle:hover{ filter:brightness(1.15); }

/* ============================================================
   מסך דירה
   ============================================================ */
.apt-hero{
  display:flex; align-items:center; gap:16px; flex-wrap:wrap;
  margin-bottom:22px;
}
.apt-hero .avatar{
  width:58px; height:58px; border-radius:18px; flex:none;
  background:var(--accent); color:var(--on-accent);
  display:grid; place-items:center;
  font-size:1.35rem; font-weight:700; font-variant-numeric:tabular-nums;
  box-shadow:0 6px 18px var(--accent-ring);
}
.apt-hero .who{ min-width:0; }
.apt-hero h1{ font-size:var(--fs-2xl); }
.apt-hero .sub{ color:var(--text-soft); font-size:var(--fs-sm); margin-top:2px; }
.apt-hero .money{ margin-inline-start:auto; text-align:end; }
.apt-hero .money .amt{
  font-size:1.6rem; font-weight:700; letter-spacing:-.03em;
  font-variant-numeric:tabular-nums; line-height:1.2;
}

.tabs{
  position:sticky; top:66px; z-index:40;
  display:flex; gap:5px; flex-wrap:nowrap; overflow-x:auto;
  background:var(--surface); border:1px solid var(--line-soft);
  border-radius:var(--r-pill); padding:5px; box-shadow:var(--sh);
  margin-bottom:20px; scrollbar-width:none;
}
.tabs::-webkit-scrollbar{ display:none; }
.tabs button{
  display:inline-flex; align-items:center; gap:7px; white-space:nowrap;
  border:0; background:none; cursor:pointer;
  padding:10px 17px; border-radius:var(--r-pill);
  font-size:var(--fs-md); font-weight:500; color:var(--text-soft);
  transition:background .18s var(--ease), color .18s var(--ease);
}
.tabs button:hover{ background:var(--surface-2); color:var(--text); }
.tabs button.active{
  background:var(--accent); color:var(--on-accent);
  box-shadow:0 3px 10px var(--accent-ring), 0 0 0 1.5px var(--gold);
}

/* ============================================================
   טפסים
   ============================================================ */
.form-grid{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(228px,1fr)); gap:17px;
}
.field{ display:flex; flex-direction:column; gap:7px; min-width:0; }
.field label{
  font-size:var(--fs-sm); color:var(--text-soft); font-weight:500;
}
.field input, .field textarea, .field select{
  background:var(--surface-2); border:1px solid var(--line);
  border-radius:var(--r-sm); padding:12px 14px; width:100%;
  transition:border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
.field input:hover:not(:disabled), .field select:hover:not(:disabled){ border-color:var(--text-mute); }
.checkline{
  display:flex; align-items:center; gap:9px; cursor:pointer;
  font-size:var(--fs-sm); color:var(--text-soft); font-weight:500;
  margin-top:auto; margin-bottom:auto; padding:12px 0;
}
.checkline input[type="checkbox"]{ width:18px; height:18px; flex:none; accent-color:var(--accent); cursor:pointer; }
.field input:focus, .field textarea:focus, .field select:focus{
  outline:0; border-color:var(--accent);
  box-shadow:0 0 0 4px var(--accent-ring); background:var(--surface);
}
.field input:disabled, .field select:disabled, .field textarea:disabled{
  opacity:.62; cursor:not-allowed; background:var(--bg-tint);
}
.field textarea{ resize:vertical; min-height:118px; line-height:1.7; }
.field .sub{ font-size:var(--fs-xs); color:var(--text-mute); line-height:1.5; }
.field.wide{ grid-column:1/-1; }
/* קופסת טקסט טכני (JSON וכד') — מונוספייס, תמיד LTR ללא תלות בכיוון הדף */
.json-box{
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  direction:ltr; text-align:left;
  min-height:220px; resize:vertical; white-space:pre;
}
.field input[type="number"]{ font-variant-numeric:tabular-nums; }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background:var(--accent); color:var(--on-accent); border:0; cursor:pointer;
  padding:12px 24px; border-radius:var(--r-pill);
  font-weight:600; font-size:var(--fs-md);
  box-shadow:0 3px 12px var(--accent-ring);
  transition:background .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}
.btn:hover{ background:var(--accent-hover); transform:translateY(-1px); box-shadow:0 6px 18px var(--accent-ring); }
.btn:active{ transform:translateY(0); }
.btn.secondary{
  background:var(--surface); color:var(--text-soft);
  border:1px solid var(--line); box-shadow:var(--sh-sm);
}
.btn.secondary:hover{ color:var(--text); border-color:var(--text-mute); background:var(--surface); }
.btn.danger{ background:var(--debt); box-shadow:none; }
.btn:disabled{ opacity:.45; cursor:not-allowed; transform:none; }

.actions{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:20px; }

/* ============================================================
   טבלאות
   ============================================================ */
.table-wrap{
  overflow-x:auto; border:1px solid var(--line-soft);
  border-radius:var(--r-md); background:var(--surface);
}
table th, table td{
  padding:12px 15px; text-align:start; font-size:var(--fs-sm);
  border-bottom:1px solid var(--line-soft); white-space:nowrap;
}
table th{
  background:var(--surface-2); color:var(--text-soft);
  font-weight:600; font-size:var(--fs-xs); letter-spacing:.02em;
  position:sticky; top:0;
}
table tbody tr:last-child td{ border-bottom:0; }
table tbody tr{ transition:background .14s var(--ease); }
table tbody tr:hover{ background:var(--surface-2); }
table tfoot th{ background:var(--bg-tint); position:static; font-size:var(--fs-sm); }
td.num, th.num{ font-variant-numeric:tabular-nums; }
.row-del{
  background:none; border:0; cursor:pointer; color:var(--text-mute);
  padding:5px 7px; border-radius:var(--r-xs); line-height:0;
  transition:color .14s var(--ease), background .14s var(--ease);
}
.row-del:hover{ color:var(--debt); background:var(--debt-soft); }

.empty-state{
  display:flex; flex-direction:column; align-items:center; gap:10px;
  padding:44px 20px; text-align:center; color:var(--text-mute); font-size:var(--fs-md);
}
.empty-state svg{ opacity:.5; }

/* סינון תאריכים */
.filter-bar{
  display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap;
  padding:15px 17px; background:var(--surface-2);
  border:1px solid var(--line-soft); border-radius:var(--r-md); margin-bottom:15px;
}
.filter-bar .field{ min-width:152px; }
.filter-bar .field input{ background:var(--surface); }

/* ============================================================
   מונים
   ============================================================ */
.meter-head{
  display:flex; align-items:center; gap:15px; flex-wrap:wrap;
  padding:19px 22px; border-radius:var(--r-lg); margin-bottom:18px;
  border:1px solid transparent;
}
.meter-head .ic{
  width:48px; height:48px; border-radius:15px; flex:none;
  display:grid; place-items:center; background:var(--surface);
  box-shadow:var(--sh-sm);
}
.meter-head .txt strong{
  display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  font-size:var(--fs-lg); color:var(--text);
}
.meter-head .txt span{ font-size:var(--fs-sm); color:var(--text-soft); }
.meter-head .last{ margin-inline-start:auto; text-align:end; color:var(--text); }
.meter-head .last b{ font-size:1.35rem; font-variant-numeric:tabular-nums; letter-spacing:-.02em; }
.meter-head .last span{ display:block; font-size:var(--fs-xs); color:var(--text-soft); }
.m-electricity{ background:var(--elec-soft);  color:var(--elec);  border-color:var(--elec-soft); }
.m-water{      background:var(--water-soft); color:var(--water); border-color:var(--water-soft); }
.m-gas{        background:var(--gas-soft);   color:var(--gas);   border-color:var(--gas-soft); }

.sub-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:18px; }
.sub-tabs button{
  display:inline-flex; align-items:center; gap:8px;
  background:var(--surface); border:1px solid var(--line-soft);
  padding:10px 17px; border-radius:var(--r-pill); cursor:pointer;
  font-size:var(--fs-md); font-weight:500; color:var(--text-soft);
  box-shadow:var(--sh-sm);
  transition:all .16s var(--ease);
}
.sub-tabs button:hover{ transform:translateY(-1px); color:var(--text); }
.sub-tabs button.active{ border-color:currentColor; box-shadow:var(--sh); }
.sub-tabs button.active.m-electricity{ color:var(--elec); }
.sub-tabs button.active.m-water{ color:var(--water); }
.sub-tabs button.active.m-gas{ color:var(--gas); }

/* ============================================================
   חשבון ותשלומים
   ============================================================ */
.ledger{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(174px,1fr));
  gap:13px; margin-bottom:20px;
}
.ledger .box{
  background:var(--surface-2); border:1px solid var(--line-soft);
  border-radius:var(--r-md); padding:16px 18px;
}
.ledger .box .label{ font-size:var(--fs-xs); color:var(--text-soft); }
.ledger .box .value{
  font-size:1.4rem; font-weight:700; margin-top:2px;
  font-variant-numeric:tabular-nums; letter-spacing:-.03em;
}
.ledger .box.balance-debt{ background:var(--debt-soft); border-color:transparent; }
.ledger .box.balance-debt .value{ color:var(--debt); }
.ledger .box.balance-ok{ background:var(--ok-soft); border-color:transparent; }
.ledger .box.balance-ok .value{ color:var(--ok); }

/* ============================================================
   חתימה
   ============================================================ */
.sign-pad{
  position:relative; background:var(--paper);
  border:2px dashed var(--line); border-radius:var(--r-md);
  overflow:hidden; touch-action:none;
  transition:border-color .16s var(--ease);
}
.sign-pad:hover{ border-color:var(--accent); }
.sign-pad canvas{ display:block; width:100%; height:210px; cursor:crosshair; }
.sign-pad .ph{
  position:absolute; inset:0; display:grid; place-items:center;
  color:#A79C8D; font-size:var(--fs-sm); pointer-events:none;
}
.sign-saved{
  background:var(--paper); border:1px solid var(--line);
  border-radius:var(--r-md); padding:14px; text-align:center;
}
.sign-saved img{ max-width:100%; height:165px; object-fit:contain; }
.signed-meta{
  display:inline-flex; align-items:center; gap:7px; margin-top:12px;
  background:var(--ok-soft); color:var(--ok);
  padding:7px 14px; border-radius:var(--r-pill);
  font-size:var(--fs-sm); font-weight:600;
}

/* ============================================================
   קבצים
   ============================================================ */
.upload-zone{
  border:2px dashed var(--line); border-radius:var(--r-md);
  background:var(--surface-2); padding:30px 20px; text-align:center;
  transition:border-color .16s var(--ease), background .16s var(--ease);
}
.upload-zone.drag{ border-color:var(--accent); background:var(--accent-soft); }
.upload-zone p{ margin:11px 0 0; color:var(--text-mute); font-size:var(--fs-sm); }

.file-list{ display:flex; flex-direction:column; gap:10px; margin-top:16px; }
.file-item{
  display:flex; align-items:center; gap:14px;
  background:var(--surface-2); border:1px solid var(--line-soft);
  border-radius:var(--r-md); padding:12px 15px;
  transition:border-color .16s var(--ease), transform .16s var(--ease);
}
.file-item:hover{ border-color:var(--line); }
html[dir="rtl"] .file-item:hover{ transform:translateX(-2px); }
html[dir="ltr"] .file-item:hover{ transform:translateX(2px); }
.file-thumb{
  width:54px; height:54px; border-radius:12px; flex:none;
  background:var(--bg-tint); display:grid; place-items:center; overflow:hidden;
  color:var(--text-soft);
}
.file-thumb img{ width:100%; height:100%; object-fit:cover; }
.file-thumb.pdf{ background:var(--debt-soft); color:var(--debt); }
.file-info{ min-width:0; flex:1; }
.file-info .name{
  font-weight:600; font-size:var(--fs-md);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.file-info .meta{ font-size:var(--fs-xs); color:var(--text-mute); }
.file-acts{ display:flex; gap:6px; flex:none; }
.file-acts .btn{ padding:8px 15px; font-size:var(--fs-sm); box-shadow:none; }

/* ============================================================
   שונות
   ============================================================ */
.note{
  background:var(--accent-soft); color:var(--accent);
  border-radius:var(--r-md); padding:13px 16px;
  font-size:var(--fs-sm); line-height:1.65;
}
html[data-theme="dark"] .note{ color:var(--accent-hi); }

.storage-warn{
  background:var(--debt-soft); color:var(--debt);
  border-bottom:1px solid var(--line); text-align:center;
  padding:10px 20px; font-size:var(--fs-sm); font-weight:500;
}

.app-footer{
  display:flex; align-items:center; justify-content:center; gap:10px;
  padding:22px 20px 30px; font-size:var(--fs-xs); color:var(--text-mute);
}
.app-footer .text-link{ color:var(--text-soft); font-weight:500; }
.app-footer .text-link:hover{ color:var(--accent); }
.app-footer-sep{ color:var(--text-mute); }

/* ============================================================
   מסמכים משפטיים (תנאי שימוש / מדיניות פרטיות)
   ============================================================ */
.legal-doc h2{
  font-size:var(--fs-lg); font-weight:700; color:var(--navy);
  margin:26px 0 10px;
}
.legal-doc h2:first-child{ margin-top:0; }
.legal-doc h3{
  font-size:var(--fs-md); font-weight:600; margin:16px 0 6px;
}
.legal-doc p{
  font-size:var(--fs-sm); color:var(--text-soft); line-height:1.75;
  margin:0 0 10px; white-space:pre-line;
}
.legal-doc .legal-meta{
  color:var(--text-mute); font-size:var(--fs-xs); margin:-4px 0 20px;
}

.toast{
  position:fixed; left:50%; transform:translateX(-50%);
  bottom:30px; z-index:99;
  background:var(--text); color:var(--bg);
  padding:12px 24px; border-radius:var(--r-pill);
  font-size:var(--fs-md); font-weight:500; box-shadow:var(--sh-lg);
  animation:toastIn .24s var(--ease);
}
@keyframes toastIn{
  from{ opacity:0; transform:translateX(-50%) translateY(10px) scale(.96); }
}

.view > *{ animation:fadeUp .26s var(--ease) both; }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(6px); } }

/* ============================================================
   מותג, תפריטים וחשבון
   ============================================================ */
.brand-text strong, .wordmark{ color:var(--navy); }
html[data-theme="dark"] .brand-text strong,
html[data-theme="dark"] .wordmark{ color:#C7D7F5; }

.prop-switch{
  display:inline-flex; align-items:center; gap:8px; max-width:230px;
  background:var(--surface); border:1px solid var(--line);
  padding:8px 14px; border-radius:var(--r-pill); cursor:pointer;
  font-size:var(--fs-sm); font-weight:600; color:var(--text);
  box-shadow:var(--sh-sm);
  transition:border-color .16s var(--ease), transform .16s var(--ease);
}
.prop-switch:hover{ border-color:var(--text-mute); transform:translateY(-1px); }
.prop-switch span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.prop-switch .chev{ flex:none; color:var(--text-mute); }

.menu-wrap{ position:relative; }
.menu{
  position:absolute; top:calc(100% + 9px); inset-inline-end:0; z-index:80;
  min-width:262px; padding:7px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); box-shadow:var(--sh-lg);
  animation:menuIn .16s var(--ease);
  /* גם במסך נמוך במצב לרוחב התפריט נשאר בתוך המסך */
  max-height:calc(100vh - 88px); overflow-y:auto;
}
@keyframes menuIn{ from{ opacity:0; transform:translateY(-6px); } }
.menu-head{
  padding:8px 12px 6px; font-size:var(--fs-xs); font-weight:600;
  color:var(--text-mute); letter-spacing:.03em;
}
.menu-sep{ height:1px; background:var(--line-soft); margin:6px 4px; }
.menu-item{
  display:flex; align-items:center; gap:11px; width:100%;
  background:none; border:0; cursor:pointer; text-align:start;
  padding:10px 12px; border-radius:var(--r-sm);
  font-size:var(--fs-md); color:var(--text);
  transition:background .14s var(--ease);
}
.menu-item:hover{ background:var(--surface-2); }
.menu-item.active{ background:var(--accent-soft); }
.menu-item.danger{ color:var(--debt); }
.menu-item svg{ flex:none; color:var(--text-soft); }
.menu-item.danger svg{ color:var(--debt); }
.mi-text{ display:flex; flex-direction:column; min-width:0; flex:1; line-height:1.3; }
.mi-text b{ font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mi-text small{ font-size:var(--fs-xs); color:var(--text-mute); }

.menu-user{ display:flex; align-items:center; gap:12px; padding:12px; }
.menu-av, .avatar-btn{
  display:grid; place-items:center; overflow:hidden; flex:none;
  background:var(--accent); color:var(--on-accent);
  font-weight:700; font-size:var(--fs-sm);
}
.menu-av{ width:44px; height:44px; border-radius:14px; }
.avatar-btn{
  width:40px; height:40px; border-radius:50%; border:0; cursor:pointer; padding:0;
  box-shadow:0 3px 10px var(--accent-ring);
  transition:transform .16s var(--ease);
}
.avatar-btn:hover{ transform:translateY(-1px); }
.avatar-btn img, .menu-av img{ width:100%; height:100%; object-fit:cover; }

/* ---------- מסך כניסה ---------- */
.auth{ display:grid; place-items:center; min-height:calc(100vh - 220px); padding:20px 0; }
.auth-card{
  width:100%; max-width:430px; text-align:center;
  background:var(--surface); border:1px solid var(--line-soft);
  border-radius:var(--r-lg); box-shadow:var(--sh-md); padding:38px 32px;
  border-top:3px solid var(--gold);
}
.auth-logo{ border-radius:22px; box-shadow:0 10px 28px var(--accent-ring); }
.wordmark{
  font-size:2.1rem; font-weight:700; letter-spacing:-.03em; margin:16px 0 6px;
}
.auth-tag{ color:var(--text-soft); font-size:var(--fs-md); margin:0 0 26px; }
.auth-card .btn{ width:100%; }
.google-btn{
  background:var(--surface); color:var(--text);
  border:1px solid var(--line); box-shadow:var(--sh-sm);
}
.google-btn:disabled{ opacity:.72; }
.auth-note{ margin:14px 0 20px; text-align:start; }

.text-link{
  background:none; border:0; padding:0; cursor:pointer;
  color:var(--accent); font:inherit; font-weight:600;
  text-decoration:underline; text-underline-offset:2px;
}
.text-link:hover{ color:var(--accent-hover); }

.consent-row{
  display:flex; align-items:flex-start; gap:10px; text-align:start;
  margin:6px 0 18px; cursor:pointer;
}
.consent-row input[type="checkbox"]{
  width:18px; height:18px; flex:none; margin-top:2px;
  accent-color:var(--accent); cursor:pointer;
}
.consent-row span{ font-size:var(--fs-sm); color:var(--text-soft); line-height:1.5; }

/* ---------- תמונת פרופיל ---------- */
.photo-row{ display:flex; align-items:center; gap:20px; flex-wrap:wrap; }
.photo-preview{
  width:96px; height:96px; border-radius:28px; flex:none; overflow:hidden;
  background:var(--accent); color:var(--on-accent);
  display:grid; place-items:center; font-size:1.9rem; font-weight:700;
  box-shadow:0 6px 18px var(--accent-ring);
}
.photo-preview img{ width:100%; height:100%; object-fit:cover; }

/* ---------- כרטיס נכס ---------- */
.prop-card{ padding:16px 18px; }
.prop-card.active{ border-color:var(--accent); }
.prop-card .card-title{ font-size:var(--fs-md); margin-bottom:8px; }
.prop-card .card-title svg{ width:16px; height:16px; }
.prop-card .muted{ margin-bottom:10px; font-size:var(--fs-xs); }
.prop-card .ledger{ gap:8px; margin-bottom:12px; }
.prop-card .ledger .box{ padding:9px 11px; }
.prop-card .ledger .box .label{ font-size:.68rem; }
.prop-card .ledger .box .value{ font-size:1.05rem; }
.prop-card .actions{ margin-top:0; }
.prop-card .actions .btn{ padding:9px 16px; font-size:var(--fs-sm); }
.muted{ color:var(--text-soft); font-size:var(--fs-sm); margin:0 0 16px; }
.err{ color:var(--debt); font-size:var(--fs-sm); }

/* ---------- בורר אמצעי תשלום ---------- */
.seg{
  display:inline-flex; gap:4px; padding:4px;
  background:var(--surface-2); border:1px solid var(--line);
  border-radius:var(--r-pill); flex-wrap:wrap;
}
.seg button{
  border:0; background:none; cursor:pointer;
  padding:9px 20px; border-radius:var(--r-pill);
  font-size:var(--fs-sm); font-weight:500; color:var(--text-soft);
  transition:background .16s var(--ease), color .16s var(--ease);
}
.seg button:hover{ color:var(--text); }
.seg button.active{
  background:var(--accent); color:var(--on-accent);
  box-shadow:0 2px 8px var(--accent-ring), 0 0 0 1.5px var(--gold);
}

.pill.info{ background:var(--accent-soft); color:var(--accent-hi); }
.pill.warn{ background:var(--amber-soft); color:var(--amber); }
html[data-theme="dark"] .pill.info{ color:var(--accent-hi); }

.btn.wa{ color:#128C7E; border-color:#128C7E33; }
.btn.wa svg{ color:#25D366; }
html[data-theme="dark"] .btn.wa{ color:#4FD98A; }

/* ============================================================
   חשבונות חיוב ביחידה
   ============================================================ */
.accounts{ display:flex; flex-direction:column; gap:12px; }
.account{
  border:1px solid var(--line); border-radius:var(--r-md);
  background:var(--surface-2); overflow:hidden;
  transition:opacity .16s var(--ease);
}
.account.off{ opacity:.72; }
.account-head{
  display:flex; align-items:center; gap:11px; flex-wrap:wrap;
  padding:13px 16px; border-bottom:1px solid var(--line-soft);
}
.account-head b{ font-size:var(--fs-md); }
.account-head .switch{ margin-inline-start:auto; }
.account-ic{
  width:34px; height:34px; border-radius:10px; flex:none;
  display:grid; place-items:center;
}
.account-ic svg{ width:18px; height:18px; }
.m-neutral{ background:var(--accent-soft); color:var(--accent); }

/* ============================================================
   קטעי תעריפים (חשמל / גז / מים / ארנונה / חניה) — מסגרת אחידה
   ============================================================ */
.rate-section{ padding-top:22px; border-top:1px solid var(--line-soft); margin-top:22px; }
.rate-section:first-of-type{ padding-top:0; border-top:0; margin-top:18px; }
.rate-section-title{ display:flex; align-items:center; gap:10px; }
.rs-ic{
  width:32px; height:32px; border-radius:10px; flex:none;
  display:grid; place-items:center;
}
.rs-ic svg{ width:17px; height:17px; }

/* ============================================================
   ניהול יחידות בנכס (הוספה / מחיקה / שינוי שם)
   ============================================================ */
.units-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.unit-row{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:10px 12px; border:1px solid var(--line-soft); border-radius:var(--r-md);
  background:var(--surface-2);
}
.unit-row .unit-num{
  width:30px; height:30px; border-radius:9px; flex:none;
  background:var(--accent-soft); color:var(--accent);
  display:grid; place-items:center; font-weight:700; font-size:.8rem;
  font-variant-numeric:tabular-nums;
}
.unit-row input[type="text"]{ flex:1; min-width:130px; }
.unit-row.unit-add{ background:transparent; border-style:dashed; }
.unit-row.unit-add .unit-num{ background:var(--bg-tint); color:var(--text-mute); }
.unit-row.unit-add .unit-num svg{ width:15px; height:15px; }
.account-body{ padding:14px 16px; display:flex; flex-direction:column; gap:13px; }
.account-vals{ display:flex; gap:22px; flex-wrap:wrap; }
.av{ display:flex; flex-direction:column; gap:2px; }
.av .k{ font-size:var(--fs-xs); color:var(--text-mute); }
.av .v{ font-size:var(--fs-md); font-variant-numeric:tabular-nums; }
.av .v.readonly{ color:var(--text-soft); }
.av .v.strong{ font-weight:700; }
.inherit-note{ color:var(--text-mute); font-size:var(--fs-xs); }
.override{ padding-top:4px; }
.off-note{ background:var(--debt-soft); color:var(--debt); }

.seg.small button{ padding:7px 14px; font-size:var(--fs-xs); }

/* מתג הפעלה/כיבוי */
.switch{ display:inline-flex; align-items:center; cursor:pointer; }
.switch input{ position:absolute; opacity:0; width:0; height:0; }
.switch .track{
  width:46px; height:26px; border-radius:var(--r-pill);
  background:var(--line); display:block; position:relative;
  transition:background .18s var(--ease);
}
.switch .knob{
  position:absolute; top:3px; inset-inline-start:3px;
  width:20px; height:20px; border-radius:50%;
  background:#fff; box-shadow:var(--sh-sm);
  transition:transform .18s var(--ease);
}
.switch input:checked + .track{ background:var(--ok); }
html[dir="rtl"] .switch input:checked + .track .knob{ transform:translateX(-20px); }
html[dir="ltr"] .switch input:checked + .track .knob{ transform:translateX(20px); }
.switch input:focus-visible + .track{ box-shadow:0 0 0 3px var(--accent-ring); }

/* ============================================================
   עריכת קריאות מונה
   ============================================================ */
.row-acts{ display:flex; gap:4px; }
.row-edit{
  background:none; border:0; cursor:pointer; color:var(--text-mute);
  padding:5px 7px; border-radius:var(--r-xs); line-height:0;
  transition:color .14s var(--ease), background .14s var(--ease);
}
.row-edit:hover{ color:var(--accent); background:var(--accent-soft); }
.row-edit.editing{ color:var(--accent); background:var(--accent-soft); }
.edit-row td{ background:var(--surface-2); white-space:normal; }
.edit-box{ display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.edit-box .field{ min-width:150px; }
.edited{
  font-size:var(--fs-xs); font-weight:600; color:var(--amber);
  background:var(--amber-soft); border-radius:var(--r-pill);
  padding:1px 8px; display:inline-block; margin-top:3px;
}
.sub-tabs button.off{ opacity:.55; }
.meter-head.off{ filter:grayscale(.55); }

/* ============================================================
   ולידציה
   ============================================================ */
.field-err{ font-size:var(--fs-xs); color:var(--debt); min-height:1em; }
input.invalid, select.invalid{
  border-color:var(--debt) !important;
  box-shadow:0 0 0 3px var(--debt-soft) !important;
}

/* ============================================================
   חבילות מנוי
   ============================================================ */
.plans{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(232px,1fr)); gap:16px;
}
.plan-card{ position:relative; display:flex; flex-direction:column; }
.plan-card.active{ border-color:var(--accent); box-shadow:var(--sh-md); }
.plan-badge{
  position:absolute; top:14px; inset-inline-end:14px;
  background:var(--gold); color:var(--on-gold);
  font-size:var(--fs-xs); font-weight:600;
  padding:3px 11px; border-radius:var(--r-pill);
}
.plan-card h3{ font-size:var(--fs-xl); }
.plan-price{
  font-size:1.9rem; font-weight:700; letter-spacing:-.03em;
  margin:8px 0 14px; font-variant-numeric:tabular-nums;
}
.plan-price span{
  display:block; font-size:var(--fs-xs); font-weight:400;
  color:var(--text-mute); letter-spacing:0;
}
.plan-list{ list-style:none; padding:0; margin:0 0 18px; flex:1; }
.plan-list li{
  display:flex; align-items:center; gap:8px;
  font-size:var(--fs-sm); padding:6px 0; color:var(--text-soft);
}
.plan-list svg{ color:var(--ok); flex:none; }
.plan-list b{ color:var(--text); }

/* ============================================================
   אזורי מגע — גודל מזערי 44×44px בכל רוחב מסך (WCAG 2.5.5,
   חשוב במיוחד לשימוש מהסמארטפון) ולא רק מתחת לפריצת נקודה מסוימת
   ============================================================ */
.btn-ghost.icon-only{
  min-width:44px; min-height:44px;
  display:inline-flex; align-items:center; justify-content:center;
}
.avatar-btn{ min-width:44px; min-height:44px; }
.btn, .chip, .seg button, .tabs button, .sub-tabs button, .lang-switch button{ min-height:44px; }
.unit-row input[type="text"]{ min-height:44px; }
.row-del, .row-edit{
  min-width:44px; min-height:44px;
  display:inline-flex; align-items:center; justify-content:center;
}
.switch .track{ width:52px; height:30px; }
.switch .knob{ width:24px; height:24px; }
html[dir="rtl"] .switch input:checked + .track .knob{ transform:translateX(-22px); }
html[dir="ltr"] .switch input:checked + .track .knob{ transform:translateX(22px); }

/* ============================================================
   רספונסיביות
   ============================================================ */
@media (max-width:760px){
  .apt-hero .money{ margin-inline-start:0; text-align:start; width:100%; }
  .tabs{ top:60px; }
}
@media (max-width:640px){
  body{ font-size:15px; }
  .topbar-inner{ padding:10px 14px; gap:8px; }
  .brand-text{ display:none; }
  .prop-switch{ max-width:150px; padding:8px 11px; }
  .photo-row{ gap:14px; }
  #themeBtn{ display:none; }

  /* תפריטים נצמדים לרוחב המסך כדי שלא ייחתכו */
  .menu{
    position:fixed; inset-inline:12px; top:62px;
    min-width:0; width:auto; max-height:calc(100vh - 80px); overflow-y:auto;
  }

  /* המקלדת לא תסתיר את כפתור השמירה */
  .actions{ padding-bottom:4px; }
  .edit-box{ gap:10px; }
  .edit-box .field{ min-width:120px; flex:1; }
  .view{ padding:22px 14px 70px; }
  .card{ padding:18px; border-radius:var(--r-md); }
  .btn-ghost span{ display:none; }
  .apt-grid{ grid-template-columns:1fr; }
  .search{ max-width:none; }
  .file-acts .btn{ padding:8px 12px; }
}

/* ============================================================
   כלי נגישות למשתמש
   ============================================================ */
.a11y-toggle{
  position:fixed; inset-inline-start:20px; bottom:20px; z-index:250;
  width:52px; height:52px; border-radius:50%; border:0; cursor:pointer;
  background:var(--accent-hi); color:var(--on-accent);
  display:grid; place-items:center;
  box-shadow:0 6px 18px rgba(0,0,0,.22);
  transition:transform .16s var(--ease), background .16s var(--ease);
}
.a11y-toggle:hover{ transform:translateY(-2px); background:var(--accent); }

.a11y-panel{
  position:fixed; inset-inline-start:20px; bottom:80px; z-index:250;
  width:280px; max-width:calc(100vw - 40px); max-height:calc(100vh - 110px); overflow-y:auto;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:var(--sh-lg); padding:8px;
  animation:menuIn .16s var(--ease);
}
.a11y-panel-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 10px 10px; font-size:var(--fs-md);
}
.a11y-close{
  background:none; border:0; cursor:pointer; color:var(--text-mute);
  padding:6px; border-radius:var(--r-xs); display:grid; place-items:center;
  min-width:32px; min-height:32px;
}
.a11y-close:hover{ color:var(--text); background:var(--surface-2); }

.a11y-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px; border-radius:var(--r-sm); gap:10px;
  font-size:var(--fs-sm); color:var(--text);
}
.a11y-stepper{ display:flex; gap:6px; }
.a11y-stepper button{
  min-width:38px; min-height:38px; border-radius:var(--r-sm);
  border:1px solid var(--line); background:var(--surface-2); cursor:pointer;
  font-weight:700; font-size:var(--fs-sm); color:var(--text);
}
.a11y-stepper button:hover{ border-color:var(--text-mute); }

.a11y-item{
  display:block; width:100%; text-align:start;
  background:none; border:0; cursor:pointer;
  padding:10px; border-radius:var(--r-sm);
  font-size:var(--fs-sm); color:var(--text);
  min-height:44px;
}
.a11y-item:hover{ background:var(--surface-2); }
.a11y-item[aria-pressed="true"]{ background:var(--accent-soft); color:var(--accent); font-weight:600; }

.a11y-panel-foot{
  display:flex; flex-direction:column; align-items:stretch; gap:8px;
  padding:12px 10px 6px; border-top:1px solid var(--line-soft); margin-top:6px;
}
.a11y-panel-foot .text-link{ text-align:center; font-size:var(--fs-xs); }

@media (max-width:640px){
  .a11y-toggle{ inset-inline-start:14px; bottom:14px; width:48px; height:48px; }
  .a11y-panel{ inset-inline-start:14px; bottom:70px; }
}

/* --- אפקטים מוחלים --- */
html[data-a11y-fontstep="1"]{ font-size:112.5%; }
html[data-a11y-fontstep="2"]{ font-size:125%; }
html[data-a11y-fontstep="3"]{ font-size:137.5%; }

html.a11y-grayscale{ filter:grayscale(1); }

html.a11y-contrast{
  --bg:#FFFFFF; --bg-tint:#FFFFFF; --surface:#FFFFFF; --surface-2:#F2F2F2;
  --line:#000000; --line-soft:#333333;
  --text:#000000; --text-soft:#000000; --text-mute:#1A1A1A;
  --navy:#00136B; --accent:#00136B; --accent-hi:#00136B; --accent-hover:#000A40;
  --accent-soft:#DCE4FF; --on-accent:#FFFFFF;
  --ok:#005C2E; --ok-soft:#D9F2E3; --debt:#8A1300; --debt-soft:#FBDCD4;
  --amber:#5C3D00; --amber-soft:#F5E6C8;
}
html[data-theme="dark"].a11y-contrast{
  --bg:#000000; --bg-tint:#000000; --surface:#0A0A0A; --surface-2:#161616;
  --line:#FFFFFF; --line-soft:#666666;
  --text:#FFFFFF; --text-soft:#FFFFFF; --text-mute:#EDEDED;
  --navy:#9FC2FF; --accent:#9FC2FF; --accent-hi:#C7DBFF; --accent-hover:#C7DBFF;
  --accent-soft:#0F2A54; --on-accent:#000000;
  --ok:#7CFFB8; --ok-soft:#0B3A22; --debt:#FF9E86; --debt-soft:#4A1409;
  --amber:#FFD873; --amber-soft:#3D2E00;
}

html.a11y-underline-links a,
html.a11y-underline-links .text-link{ text-decoration:underline !important; text-underline-offset:2px; }

html.a11y-stop-anim *,
html.a11y-stop-anim *::before,
html.a11y-stop-anim *::after{
  animation-duration:.001ms !important; animation-iteration-count:1 !important;
  transition-duration:.001ms !important;
}

html.a11y-readable-font body{
  font-family:Arial, Helvetica, sans-serif !important;
  letter-spacing:.01em; line-height:1.8;
}
