#lexa-luach{ color:#0f172a; direction:rtl; text-align:right; -webkit-text-size-adjust:100%; }
#lexa-luach *{ box-sizing:border-box; }
#lexa-luach button{ font:inherit; }
#lexa-luach .lx-ic{ width:1.05em; height:1.05em; vertical-align:-0.16em; flex:none; }

/* ---- Toolbar ---- */
#lexa-luach .lx-toolbar{ background:#fff; border:1px solid #cbd5e1; border-radius:14px; padding:14px 16px; margin-bottom:14px; }
#lexa-luach .lx-navrow{ display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; }
#lexa-luach .lx-title{ text-align:center; min-width:250px; padding:0 6px; }
#lexa-luach .lx-title .g{ font-size:1.6rem; font-weight:800; color:#0f172a; line-height:1.2; }
#lexa-luach .lx-title .h{ font-size:1.1rem; font-weight:800; color:#0f766e; }

#lexa-luach .lx-btn{ display:inline-flex; align-items:center; gap:7px; border:1px solid #94a3b8; background:#fff; color:#0f172a;
    border-radius:10px; padding:10px 15px; font-size:.95rem; font-weight:700; cursor:pointer; line-height:1; transition:.12s; }
#lexa-luach .lx-btn:hover{ border-color:#0d9488; color:#0f766e; background:#f0fdfa; }
#lexa-luach .lx-btn.primary{ background:#0d9488; border-color:#0d9488; color:#fff; }
#lexa-luach .lx-btn.primary:hover{ background:#0f766e; border-color:#0f766e; color:#fff; }
#lexa-luach .lx-btn.sm{ padding:8px 13px; font-size:.9rem; }

#lexa-luach select, #lexa-luach input[type=date], #lexa-luach input[type=time], #lexa-luach input[type=text]{
    border:1px solid #94a3b8; border-radius:10px; padding:9px 11px; font-size:.95rem; color:#0f172a; background:#fff; max-width:100%; }
#lexa-luach select:focus, #lexa-luach input:focus{ outline:none; border-color:#0d9488; box-shadow:0 0 0 3px rgba(13,148,136,.2); }

#lexa-luach .lx-subrow{ display:flex; align-items:center; justify-content:center; gap:12px 20px; flex-wrap:wrap;
    margin-top:14px; padding-top:14px; border-top:1px solid #e2e8f0; }
#lexa-luach .lx-group{ display:flex; align-items:center; gap:6px; }
#lexa-luach .lx-group .lbl{ font-size:.9rem; color:#1e293b; font-weight:700; }
#lexa-luach .lx-actions{ display:flex; gap:8px; flex-wrap:wrap; justify-content:center; margin-top:14px; padding-top:14px; border-top:1px solid #e2e8f0; }

/* clear "add events" call-to-action */
#lexa-luach .lx-hint{ display:flex; align-items:center; justify-content:center; gap:8px; text-align:center;
    background:#ecfdf7; border:1px solid #5eead4; color:#115e59; font-weight:700; font-size:.95rem; border-radius:10px; padding:10px 14px; margin:0 0 16px; }
#lexa-luach .lx-hint .lx-ic{ color:#0d9488; width:1.15em; height:1.15em; }

/* ---- Countdown strip ---- */
#lexa-luach .lx-cd{ background:#fff; border:1px solid #cbd5e1; border-radius:14px; padding:14px 16px; margin-bottom:14px; }
#lexa-luach .lx-cd-title{ display:flex; align-items:center; gap:7px; font-weight:800; color:#0f172a; font-size:1.05rem; margin-bottom:12px; }
#lexa-luach .lx-cd-title .lx-ic{ color:#0d9488; width:1.1em; height:1.1em; }
#lexa-luach .lx-cd-row{ display:flex; gap:10px; overflow-x:auto; padding-bottom:4px; scrollbar-width:thin; -webkit-overflow-scrolling:touch; }
#lexa-luach .lx-cd-card{ flex:0 0 auto; min-width:126px; text-align:center; border:1px solid #cbd5e1; border-radius:12px;
    padding:12px 14px; background:#fff; cursor:pointer; transition:.12s; }
#lexa-luach .lx-cd-card:hover{ border-color:#0d9488; background:#f4fbfa; }
#lexa-luach .lx-cd-card.lead{ border-color:#0d9488; background:#ecfdf7; }
#lexa-luach .lx-cd-card .cd-num{ display:flex; flex-direction:column; align-items:center; line-height:1.05; }
#lexa-luach .lx-cd-card .cd-pre{ font-size:.72rem; color:#475569; font-weight:800; }
#lexa-luach .lx-cd-card .cd-big{ font-size:1.75rem; color:#0f766e; font-weight:800; }
#lexa-luach .lx-cd-card.custom{ border-color:#c7d2fe; }
#lexa-luach .lx-cd-card.custom .cd-big{ color:#1e3a8a; }
#lexa-luach .lx-cd-card.custom.lead{ background:#eef2ff; border-color:#1e3a8a; }
#lexa-luach .lx-cd-card .cd-unit{ font-size:.72rem; color:#475569; font-weight:800; }
#lexa-luach .lx-cd-card .cd-name{ font-weight:800; color:#0f172a; margin-top:7px; font-size:.95rem; }
#lexa-luach .lx-cd-card .cd-date{ font-size:.78rem; color:#475569; margin-top:2px; }

/* ---- Calendar grid ---- */
/* minmax(0,1fr) lets the 7 columns shrink below their content width so the grid
   never forces horizontal overflow on narrow screens (nowrap badges truncate instead). */
#lexa-luach .lx-cal{ border:1px solid #cbd5e1; border-radius:14px; overflow:hidden; background:#fff; box-shadow:0 1px 3px rgba(15,23,42,.08); }
#lexa-luach .lx-week{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); background:#0f766e; }
#lexa-luach .lx-week > div{ text-align:center; padding:11px 4px; color:#fff; font-weight:800; font-size:1rem; letter-spacing:.2px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#lexa-luach .lx-week > div.sat{ background:#115e59; }
#lexa-luach .lx-grid{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }

#lexa-luach .lx-cell{ min-height:132px; min-width:0; overflow:hidden; border-inline-start:1px solid #dbe2ea; border-bottom:1px solid #dbe2ea;
    padding:8px 9px 30px; position:relative; cursor:pointer; background:#fff; transition:background .1s; }
#lexa-luach .lx-cell:nth-child(7n){ border-inline-start:0; }
#lexa-luach .lx-cell:hover{ background:#f4fbfa; }
#lexa-luach .lx-cell.other{ background:#f8fafc; }
#lexa-luach .lx-cell.other .g-num{ color:#64748b; }
#lexa-luach .lx-cell.other .h-num,#lexa-luach .lx-cell.other .h-month{ color:#5b8f88; }
#lexa-luach .lx-cell.sat{ background:#eefdfb; }
#lexa-luach .lx-cell.chag{ background:#fff8ec; }
#lexa-luach .lx-cell.today{ box-shadow:inset 0 0 0 3px #0d9488; }

#lexa-luach .lx-cell .top{ display:flex; align-items:flex-start; justify-content:space-between; gap:6px; }
#lexa-luach .lx-cell .g-num{ font-size:1.5rem; font-weight:800; color:#0f172a; line-height:1; }
#lexa-luach .lx-cell.today .g-num{ color:#0f766e; }
#lexa-luach .lx-cell .h-num{ text-align:end; font-size:1rem; font-weight:800; color:#0f766e; line-height:1.15; }
#lexa-luach .lx-cell .h-month{ display:block; font-size:.72rem; color:#0f766e; font-weight:700; margin-top:1px; }

#lexa-luach .lx-cell .cell-add{ position:absolute; inset-block-end:6px; inset-inline-start:7px; width:22px; height:22px; border-radius:7px;
    border:1px solid #94a3b8; background:#fff; color:#64748b; display:inline-flex; align-items:center; justify-content:center; padding:0; cursor:pointer; transition:.12s; }
#lexa-luach .lx-cell:hover .cell-add{ border-color:#0d9488; color:#0d9488; background:#f0fdfa; }
#lexa-luach .lx-cell .cell-add .lx-ic{ width:14px; height:14px; }

#lexa-luach .badges{ margin-top:7px; display:flex; flex-direction:column; gap:3px; }
#lexa-luach .bdg{ font-size:.79rem; font-weight:800; border-radius:6px; padding:2px 7px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#lexa-luach .bdg.major{ background:#b45309; color:#fff; }
#lexa-luach .bdg.minor{ background:#fff; color:#b45309; border:1px solid #fdba74; }
#lexa-luach .bdg.parsha{ background:#0f766e; color:#fff; }
#lexa-luach .zman{ display:flex; align-items:center; gap:4px; font-size:.78rem; color:#334155; font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#lexa-luach .zman .lx-ic{ width:13px; height:13px; color:#475569; }
#lexa-luach .zman.fast{ color:#7c2d12; }
#lexa-luach .zman.fast .lx-ic{ color:#9a3412; }
#lexa-luach .evt{ font-size:.79rem; font-weight:800; border-radius:6px; padding:2px 7px; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#lexa-luach .more{ font-size:.74rem; color:#475569; font-weight:800; }

/* ---- Legend ---- */
#lexa-luach .lx-legend{ display:flex; flex-wrap:wrap; gap:8px 18px; align-items:center; font-size:.92rem; color:#1e293b; font-weight:700; margin:14px 2px 26px; }
#lexa-luach .lx-legend span.item{ display:inline-flex; align-items:center; gap:6px; }
#lexa-luach .lx-legend .dot{ width:14px; height:14px; border-radius:4px; display:inline-block; }
#lexa-luach .lx-legend .lx-ic{ color:#475569; }

/* ---- Cards / content ---- */
#lexa-luach .lx-card{ background:#fff; border:1px solid #e2e8f0; border-radius:14px; padding:20px 22px; margin-bottom:26px; }
#lexa-luach h2.lx-h{ font-size:1.35rem; font-weight:800; color:#0f766e; margin:0 0 14px; }
#lexa-luach h3.lx-sub{ font-size:1rem; font-weight:700; color:#1e293b; margin:0 0 8px; }
#lexa-luach .lx-conv-grid{ display:grid; grid-template-columns:1fr 1fr; gap:22px; }
#lexa-luach .lx-conv-out{ background:#ecfdf7; border:1px solid #5eead4; border-radius:12px; color:#115e59; font-weight:800; font-size:1.05rem; padding:14px; text-align:center; margin-top:8px; }
#lexa-luach .lx-conv-3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
#lexa-luach .lx-prose{ color:#334155; line-height:1.9; }
#lexa-luach .lx-prose p{ margin:0 0 12px; }
#lexa-luach .lx-prose strong{ color:#0f172a; }
#lexa-luach .lx-secttl{ font-size:1.35rem; font-weight:800; color:#0f172a; border-inline-start:5px solid #0d9488; padding-inline-start:12px; margin:0 0 14px; }
#lexa-luach .lx-faq{ margin-bottom:16px; }
#lexa-luach .lx-faq .q{ font-weight:800; color:#0f766e; margin-bottom:4px; }
#lexa-luach .lx-attr{ text-align:center; color:#64748b; font-size:.85rem; margin:6px 0 4px; }
#lexa-luach .lx-attr a{ color:#0f766e; font-weight:700; }

/* ---- Modal ---- */
#lexa-luach .lx-modal{ position:fixed; inset:0; z-index:99999; display:none; }
#lexa-luach .lx-modal.open{ display:block; }
#lexa-luach .lx-backdrop{ position:absolute; inset:0; background:rgba(15,23,42,.55); }
#lexa-luach .lx-dialog{ position:relative; width:calc(100% - 28px); max-width:470px; margin:6vh auto; background:#fff;
    border-radius:16px; box-shadow:0 24px 60px rgba(0,0,0,.32); overflow:hidden; max-height:86vh; display:flex; flex-direction:column; }
#lexa-luach .lx-mhead{ background:#0f766e; color:#fff; padding:16px 18px; display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
#lexa-luach .lx-mhead .g{ font-size:1.15rem; font-weight:800; }
#lexa-luach .lx-mhead .h{ font-size:.92rem; color:#e0fbf4; margin-top:2px; font-weight:600; }
#lexa-luach .lx-close{ background:transparent; border:0; color:#fff; font-size:1.6rem; cursor:pointer; line-height:1; padding:0 2px; }
#lexa-luach .lx-mbody{ padding:16px 18px; overflow:auto; }
#lexa-luach .lx-mnote{ background:#fff7ed; border:1px solid #fdba74; border-radius:10px; padding:9px 12px; font-size:.92rem; color:#7c2d12; font-weight:700; margin-bottom:14px; }
#lexa-luach .lx-mlabel{ font-weight:800; color:#334155; font-size:.85rem; margin:0 0 8px; }
#lexa-luach .evt-row{ border:1px solid #e2e8f0; border-radius:10px; padding:9px 11px; margin-bottom:8px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
#lexa-luach .evt-row .del{ background:transparent; border:0; color:#be123c; font-weight:800; cursor:pointer; font-size:.9rem; }
#lexa-luach .lx-field{ width:100%; margin-bottom:9px; }
#lexa-luach .lx-2col{ display:grid; grid-template-columns:1fr 1.4fr; gap:9px; margin-bottom:9px; }
#lexa-luach .lx-colors{ display:flex; align-items:center; gap:8px; margin-bottom:14px; }
#lexa-luach .lx-colors .swatch{ width:30px; height:30px; border-radius:8px; border:2px solid transparent; cursor:pointer; }
#lexa-luach .lx-colors .swatch.active{ border-color:#0f172a; }

/* ---- Toast ---- */
#lexa-luach .lx-toast{ position:fixed; inset-block-end:22px; inset-inline:0; margin:auto; width:max-content; max-width:90%;
    background:#0f172a; color:#fff; padding:11px 18px; border-radius:10px; font-weight:700; z-index:100000; box-shadow:0 8px 24px rgba(0,0,0,.25); }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

/* Tablets and large phones */
@media (max-width:760px){
    #lexa-luach .lx-conv-grid{ grid-template-columns:1fr; }

    /* toolbar: month title on its own row, the nav buttons share the row below it */
    #lexa-luach .lx-navrow{ gap:8px; }
    #lexa-luach .lx-title{ order:-1; flex-basis:100%; min-width:0; margin-bottom:2px; }
    #lexa-luach .lx-navrow > .lx-btn{ flex:1 1 auto; justify-content:center; }

    /* each nav group on its own full-width row, selects grow to fill */
    #lexa-luach .lx-subrow{ gap:10px; }
    #lexa-luach .lx-group{ flex-basis:100%; flex-wrap:wrap; justify-content:center; }
    #lexa-luach .lx-group select{ flex:1 1 auto; min-width:0; }

    /* action buttons two per row */
    #lexa-luach .lx-actions .lx-btn{ flex:1 1 calc(50% - 4px); justify-content:center; }

    /* calendar cells */
    #lexa-luach .lx-cell{ min-height:96px; padding:6px 6px; }
    #lexa-luach .lx-cell .cell-add{ display:none; }        /* tap the day instead */
    #lexa-luach .lx-cell .g-num{ font-size:1.15rem; }
    #lexa-luach .lx-cell .h-num{ font-size:.82rem; }
    #lexa-luach .lx-week > div{ font-size:.8rem; padding:9px 2px; }
    #lexa-luach .bdg,#lexa-luach .evt,#lexa-luach .zman{ font-size:.66rem; padding:1px 5px; }
    #lexa-luach .zman .lx-ic{ width:11px; height:11px; }
}

/* Phones */
@media (max-width:480px){
    /* 16px on form fields prevents iOS from auto-zooming when they get focus */
    #lexa-luach select, #lexa-luach input[type=date], #lexa-luach input[type=time], #lexa-luach input[type=text]{ font-size:16px; }

    #lexa-luach .lx-toolbar{ padding:12px 12px; }
    #lexa-luach .lx-title .g{ font-size:1.35rem; }
    #lexa-luach .lx-title .h{ font-size:1rem; }
    #lexa-luach .lx-btn{ padding:9px 10px; font-size:.9rem; }
    #lexa-luach .lx-btn.sm{ padding:9px 10px; font-size:.85rem; }

    /* compact month grid */
    #lexa-luach .lx-cal{ border-radius:10px; }
    #lexa-luach .lx-cell{ min-height:78px; padding:4px 4px; }
    #lexa-luach .lx-cell .top{ gap:3px; }
    #lexa-luach .lx-cell .g-num{ font-size:.98rem; }
    #lexa-luach .lx-cell .h-num{ font-size:.68rem; font-weight:700; }
    #lexa-luach .lx-cell .h-month{ display:none; }         /* month name is already in the title */
    #lexa-luach .lx-week > div{ font-size:.68rem; padding:8px 1px; letter-spacing:0; }
    #lexa-luach .badges{ margin-top:4px; gap:2px; }
    #lexa-luach .bdg,#lexa-luach .evt,#lexa-luach .zman{ font-size:.6rem; padding:1px 4px; border-radius:4px; }
    #lexa-luach .zman .lx-ic{ width:10px; height:10px; }
    #lexa-luach .more{ font-size:.58rem; }

    /* content + modal spacing */
    #lexa-luach .lx-card{ padding:16px 14px; }
    #lexa-luach .lx-conv-3{ gap:6px; }
    #lexa-luach .lx-2col{ grid-template-columns:1fr; }     /* stack time + note */
    #lexa-luach .lx-cd-card{ min-width:114px; padding:10px 12px; }
    #lexa-luach .lx-cd-card .cd-big{ font-size:1.55rem; }
    #lexa-luach .lx-legend{ gap:6px 14px; font-size:.86rem; }
}

/* Very small phones */
@media (max-width:360px){
    #lexa-luach .lx-cell{ min-height:66px; }
    #lexa-luach .lx-cell .g-num{ font-size:.9rem; }
    #lexa-luach .lx-cell .h-num{ font-size:.62rem; }
    #lexa-luach .bdg,#lexa-luach .evt,#lexa-luach .zman{ font-size:.56rem; }
    #lexa-luach .lx-week > div{ font-size:.62rem; }
}