/* Calendar board - adapted from demo/calendar.html */
body.page-calendar .page.page-cal{
  width:min(1280px,calc(100vw - 48px));
  max-width:1280px;
  margin:18px auto 48px;
  padding:0 16px;
}
body.page-calendar .page.page-cal > .crumbs{max-width:100%}
body.page-calendar .page.page-cal > .section{max-width:900px;margin-left:auto;margin-right:auto}

.jt-cal a.ui-btn{text-decoration:none;color:#32425a}
.jt-cal a.ui-btn:hover{background:#f8fafc;border-color:#c6d2e0}
.jt-cal .city-group{flex-wrap:wrap;justify-content:center}

@media(max-width:790px){
  body.page-calendar .page.page-cal{width:100%;max-width:none;margin:0;padding:0}
}

*{box-sizing:border-box}

:root{
  --blue:#0f68bd;
  --blue-dark:#0b4f93;
  --link:#0a69c7;
  --link-hover:#0758a7;
  --text:#152234;
  --muted:#58677b;
  --line:#c7d2df;
  --line-strong:#b7c5d5;
  --header:#eef7ff;
  --header-sat:#e5f3ff;
  --sat:#eef7ff;
  --sat-soft:#e8f5ff;
  --note:#f4f8ff;
  --note-line:#d8e6f8;
  --shadow:0 10px 30px rgba(24,42,70,.05);
  --top-left:#eef8ff;
  --top-left-border:#d5e8fb;
  --dayview-bg:#fbfcfe;
}



button,select,input,textarea{font:inherit}

.jt-cal{
  width:100% !important;
  max-width:100% !important;
  margin:0 auto 24px;
}

/* top */
.toolbar{
  display:grid;
  grid-template-columns:auto auto auto;
  grid-template-areas:"tools citygroup month";
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
  direction:ltr;
}

.month-nav-wrap{
  grid-area:month;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex:0 0 auto;
  direction:rtl;
}

.city-group{
  grid-area:citygroup;
  display:flex;
  align-items:center;
  gap:10px;
  direction:rtl;
}

.city-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:48px;
  padding:0 18px;
  border:1px solid #bfd7ef;
  border-radius:14px;
  background:#eef7ff;
  box-shadow:0 2px 10px rgba(15,104,189,.05);
  text-align:center;
  color:#163553;
  font-size:16px;
  font-weight:800;
  white-space:nowrap;
  direction:rtl;
}
.city-status svg{
  width:18px;
  height:18px;
  stroke:currentColor;
  flex:0 0 auto;
}

.city-picker{
  direction:rtl;
}

.top-tools{
  grid-area:tools;
  direction:rtl;
}

.month-block{
  min-width:240px;
  text-align:center;
}

.month-block h1,
.month-block .month-title{
  margin:0;
  font-size:31px;
  line-height:1.05;
  font-weight:800;
  letter-spacing:-.8px;
  color:#132238;
}
.month-block .hebrew-month{
  margin-top:5px;
  color:#657386;
  font-size:13px;
  font-weight:700;
}

.top-tools{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  background:var(--top-left);
  border:1px solid var(--top-left-border);
  border-radius:14px;
  padding:8px 10px;
  flex:0 0 auto;
}

.ui-btn{
  min-height:41px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#fff;
  color:#32425a;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 2px 10px rgba(30,50,80,.03);
  transition:.14s ease;
}
.ui-btn:hover{background:#f8fafc;border-color:#c6d2e0}
.ui-btn svg{width:17px;height:17px;stroke:currentColor}
.month-nav{min-width:112px}
.arrow{font-size:22px;line-height:1;margin-top:-2px}

.city-picker{
  display:flex;
  align-items:center;
  gap:8px;
}
.city-picker select{
  height:46px;
  min-width:148px;
  border:1px solid #bfd7ef;
  border-radius:12px;
  background:#fff;
  color:#2c3d53;
  padding:0 12px;
  outline:none;
  cursor:pointer;
  font-weight:800;
  box-shadow:0 2px 10px rgba(15,104,189,.04);
}
.city-picker select:focus{
  border-color:#96c0e7;
  box-shadow:0 0 0 3px rgba(15,104,189,.08);
}

/* calendar */
.calendar-scroll{
  width:100%;
  max-width:100%;
}

.calendar-shell{
  width:100%;
  max-width:100%;
  border:1px solid var(--line-strong);
  border-radius:18px;
  overflow:hidden;
  background:#fff;
  box-shadow:var(--shadow);
}
.weekdays{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  background:var(--header);
  border-bottom:1px solid var(--line-strong);
}
.weekday{
  padding:11px 8px;
  text-align:center;
  color:#111827;
  font-size:13px;
  font-weight:800;
  border-left:1px solid var(--line);
  background:var(--header);
}
.weekday:last-child{border-left:0}
.weekday.sat{background:var(--header-sat)}

.calendar-grid{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
}
.day{
  position:relative;
  min-height:200px;
  padding:11px 11px 38px;
  background:#fff;
  border-left:1px solid var(--line);
  border-bottom:1px solid var(--line);
  cursor:pointer;
  transition:background .14s ease, box-shadow .14s ease;
  overflow:hidden;
}
.day:hover{
  background:#fbfdff;
  box-shadow:inset 0 0 0 1px rgba(15,104,189,.08);
}
.day:nth-child(7n){border-left:0}
.day:nth-last-child(-n+7){border-bottom:0}
.day.friday{background:#fff}
.day.saturday{background:var(--sat)}
.day.saturday:hover{background:var(--sat-soft)}
.day.other-month{background:#fbfcfd}
.day.other-month.saturday{background:#f5fbff}
.day.other-month .greg,
.day.other-month .heb,
.day.other-month .day-footer,
.day.other-month .event,
.day.other-month .parasha,
.day.other-month .note,
.day.other-month .shabbat-pill,
.day.other-month .parasha-pill{opacity:.38}

.day.today{
  z-index:2;
  box-shadow:inset 0 0 0 2px var(--blue);
}
.today-label{
  position:absolute;
  left:9px;
  top:9px;
  padding:3px 7px;
  border-radius:999px;
  background:#162235;
  color:#fff;
  font-size:9.5px;
  font-weight:800;
}

.day-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:7px;
  min-height:43px;
}
.date-wrap{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:3px;
}
.greg{
  color:#0b5da8;
  font-size:31px;
  font-weight:800;
  line-height:1;
  letter-spacing:-1px;
}
.jt-cal .heb,
.heb{
  display:block;
  color:#4d5b6d;
  font-size:12px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
}
.parasha{
  max-width:50%;
  margin-top:1px;
  color:#704d14;
  font-size:11px;
  font-weight:800;
  line-height:1.28;
  text-align:left;
}

.event{
  margin-top:8px;
  color:#4e5d72;
  font-size:12px;
  font-weight:700;
  line-height:1.35;
}
.event .chag-zman{
  display:block;
  margin-top:3px;
  font-size:10.5px;
  font-weight:700;
  color:#3d5a78;
}
.event.green{color:#187348}
.event.centered{
  text-align:center;
  font-size:13.5px;
  font-weight:800;
}

/* shabbat / parasha blocks */
.shabbat-block{
  margin-top:8px;
  text-align:center;
}
.shabbat-pill,
.parasha-pill{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:5px 9px;
  border:1px solid var(--note-line);
  border-radius:8px;
  background:var(--note);
  color:#2d4e6e;
  font-size:10.5px;
  font-weight:700;
  line-height:1.2;
}
.shabbat-pill .time{
  color:var(--link);
  font-weight:800;
  direction:ltr;
}
.parasha-wrap{
  margin-top:5px;
}
.more-places{
  display:inline-flex;
  flex-direction:row-reverse;
  align-items:center;
  justify-content:center;
  gap:4px;
  margin-top:7px;
  padding:0;
  border:0;
  background:transparent;
  color:var(--link);
  font-size:10px;
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
}
.more-places .plus{
  font-size:13px;
  line-height:1;
}
.more-places:hover{
  text-decoration:underline;
  color:var(--link-hover);
}
.more-list{display:none !important}

/* notes preview in cell */
.notes-preview{
  display:flex;
  flex-direction:column;
  gap:5px;
  margin-top:8px;
}
.note{
  width:100%;
  min-height:20px;
  display:flex;
  align-items:center;
  gap:5px;
  padding:4px 6px;
  border:1px solid var(--note-line);
  border-radius:7px;
  background:var(--note);
  color:#35506d;
  font-size:10px;
  line-height:1.2;
  font-weight:700;
  overflow:hidden;
}
.note-time{
  flex:0 0 auto;
  color:var(--link);
  font-weight:800;
  direction:ltr;
}
.note-text{
  min-width:0;
  flex:1;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.more-notes-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:flex-start;
  margin-top:2px;
  padding:3px 8px;
  border:1px solid #d9e6f8;
  border-radius:999px;
  background:#f7fbff;
  color:var(--link);
  font-size:10px;
  font-weight:800;
}
.note-delete{
  flex:0 0 auto;
  width:16px;
  height:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-top:-1px;
  padding:0;
  border:0;
  border-radius:50%;
  background:transparent;
  color:#8795a7;
  font-size:14px;
  line-height:1;
  cursor:pointer;
}
.note-delete:hover{
  background:#e6eef8;
  color:#536273;
}


.item-remove{
  flex:0 0 auto;
  width:17px;
  height:17px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:0;
  border-radius:50%;
  background:transparent;
  color:#8291a5;
  font-size:13px;
  line-height:1;
  cursor:pointer;
}
.item-remove:hover{
  background:#e3edf8;
  color:#43546a;
}
.shabbat-pill,
.parasha-pill{
  position:relative;
}
.shabbat-pill .item-remove,
.parasha-pill .item-remove{
  position:absolute;
  left:6px;
  top:50%;
  transform:translateY(-50%);
}
.dayview-shabbat,
.dayview-parasha{
  position:relative;
}
.dayview-shabbat .item-remove,
.dayview-parasha .item-remove{
  position:absolute;
  left:9px;
  top:50%;
  transform:translateY(-50%);
}
.remove-choice-text{
  color:#566578;
  font-size:13px;
  line-height:1.55;
  margin-bottom:14px;
}
.remove-choice-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.remove-choice-btn{
  width:100%;
  min-height:43px;
  border-radius:11px;
  border:1px solid var(--line);
  background:#fff;
  color:#33445a;
  font-weight:800;
  cursor:pointer;
}
.remove-choice-btn:hover{
  background:#f7faff;
}
.remove-choice-btn.danger{
  border-color:#f0c5c5;
  color:#a33b3b;
  background:#fffafa;
}


.optional-label{
  color:#8a96a6;
  font-size:10px;
  font-weight:500;
}
.field textarea{
  width:100%;
  min-height:82px;
  resize:vertical;
  padding:10px 11px;
  border:1px solid #d5deea;
  border-radius:11px;
  outline:none;
  color:#243147;
  background:#fff;
  line-height:1.45;
}
.field textarea:focus{
  border-color:#98c4e8;
  box-shadow:0 0 0 3px rgba(15,104,189,.08);
}
.time-range-row{
  grid-template-columns:1fr 1fr;
}
.agenda-title,
.hidden-title{
  margin:8px 2px 2px;
  color:#536276;
  font-size:11px;
  font-weight:800;
}
.agenda-list{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:2px 0 6px;
}
.agenda-item{
  position:relative;
  display:grid;
  grid-template-columns:72px minmax(0,1fr);
  gap:9px;
  align-items:stretch;
}
.agenda-time{
  position:relative;
  padding-top:9px;
  color:#607087;
  font-size:11px;
  font-weight:700;
  text-align:left;
  direction:ltr;
  white-space:nowrap;
}
.agenda-time::after{
  content:"";
  position:absolute;
  left:-5px;
  top:0;
  bottom:-9px;
  width:1px;
  background:#dce5ef;
}
.agenda-card{
  position:relative;
  border:1px solid var(--note-line);
  border-radius:12px;
  background:var(--note);
  padding:9px 32px 9px 11px;
  min-height:49px;
}
.agenda-card-title{
  color:#274563;
  font-size:14px;
  font-weight:800;
  line-height:1.25;
}
.agenda-card-desc{
  margin-top:4px;
  color:#65758a;
  font-size:12px;
  line-height:1.35;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.agenda-card .note-delete{
  position:absolute;
  left:8px;
  top:8px;
}
.hidden-items{
  display:flex;
  flex-direction:column;
  gap:7px;
}
.hidden-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px dashed #cdd9e7;
  border-radius:11px;
  background:#fbfdff;
  padding:9px 10px;
}
.hidden-item-text{
  color:#66758a;
  font-size:12px;
  font-weight:700;
}
.restore-btn{
  flex:0 0 auto;
  border:1px solid #bdd7f1;
  border-radius:8px;
  background:#eef7ff;
  color:var(--link);
  padding:5px 9px;
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.restore-btn:hover{
  background:#e3f2ff;
}

/* footer */
.day-footer{
  position:absolute;
  right:9px;
  left:9px;
  bottom:8px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
}
.icon-action{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:3px 5px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:var(--link);
  font-size:9.8px;
  font-weight:800;
  cursor:pointer;
}
.icon-action:hover{
  background:rgba(15,104,189,.06);
  color:var(--link-hover);
  text-decoration:underline;
}
.icon-action.plus-only{
  width:24px;
  height:24px;
  justify-content:center;
  padding:0;
  border-radius:50%;
}
.icon-action.plus-only:hover{text-decoration:none}
.icon-action svg{width:14px;height:14px;stroke:currentColor}

.footer-hint{
  margin-top:11px;
  text-align:center;
  color:#7b8897;
  font-size:11px;
  font-weight:700;
}
.footer-hint p{
  margin:0;
  line-height:1.55;
}
.footer-hint p + p{margin-top:6px}

.cal-page-heading{
  max-width:850px;
  margin:28px auto 0;
  padding:0 15px;
  text-align:center;
}
.cal-page-heading h1{
  margin:0;
  font-size:26px;
  line-height:1.3;
  font-weight:800;
  color:#132238;
}
.cal-page-heading .cal-hebrew-sub{
  margin:8px 0 0;
  font-size:16px;
  font-weight:700;
  color:#4e5d72;
}

/* shared modal */
.modal-backdrop{
  position:fixed;
  inset:0;
  z-index:999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(15,23,42,.42);
  backdrop-filter:blur(2px);
}
.modal-backdrop.open{display:flex}
.modal{
  width:min(470px,100%);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.65);
  border-radius:20px;
  background:#fff;
  box-shadow:0 28px 80px rgba(0,0,0,.2);
}
.modal.settings-modal{
  width:min(520px,100%);
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
}
.modal-head h2{margin:0;font-size:17px;font-weight:800}
.close-btn{
  width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:0;
  border-radius:9px;
  background:#f4f6f9;
  color:#627086;
  font-size:20px;
  cursor:pointer;
}
.modal-body{padding:17px 18px}
.form-row{
  display:grid;
  grid-template-columns:130px 1fr;
  gap:12px;
  margin-bottom:10px;
}
.field label{
  display:block;
  margin-bottom:7px;
  color:#47566b;
  font-size:12px;
  font-weight:800;
}
.field input{
  width:100%;
  height:42px;
  padding:0 11px;
  border:1px solid #d5deea;
  border-radius:11px;
  outline:none;
  color:#243147;
  background:#fff;
}
.field input:focus{
  border-color:#98c4e8;
  box-shadow:0 0 0 3px rgba(15,104,189,.08);
}
.modal-help{color:#7a8797;font-size:11px}
.modal-foot{
  display:flex;
  gap:8px;
  padding:0 18px 18px;
}
.save-btn,
.cancel-btn{
  min-height:39px;
  padding:0 15px;
  border-radius:10px;
  font-weight:800;
  cursor:pointer;
}
.save-btn{
  border:1px solid var(--blue);
  background:var(--blue);
  color:#fff;
}
.cancel-btn{
  border:1px solid var(--line);
  background:#fff;
  color:#536078;
}

/* settings */
.settings-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.setting-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:11px 12px;
  border:1px solid #e5ecf4;
  border-radius:12px;
  background:#fbfdff;
}
.setting-item-title{
  font-size:14px;
  font-weight:700;
  color:#233348;
}
.setting-item-sub{
  margin-top:3px;
  color:#7a8797;
  font-size:11px;
}
.switch{
  position:relative;
  width:52px;
  height:30px;
  flex:0 0 auto;
}
.switch input{
  opacity:0;
  width:0;
  height:0;
}
.slider{
  position:absolute;
  inset:0;
  cursor:pointer;
  background:#d5dde8;
  border-radius:999px;
  transition:.2s ease;
}
.slider:before{
  content:"";
  position:absolute;
  width:22px;
  height:22px;
  right:4px;
  top:4px;
  background:#fff;
  border-radius:50%;
  transition:.2s ease;
  box-shadow:0 1px 3px rgba(0,0,0,.14);
}
.switch input:checked + .slider{
  background:var(--blue);
}
.switch input:checked + .slider:before{
  transform:translateX(-22px);
}

/* day view modal */
.dayview-backdrop{
  position:fixed;
  inset:0;
  z-index:998;
  display:none;
  align-items:center;
  justify-content:center;
  padding:14px;
  background:rgba(15,23,42,.36);
  backdrop-filter:blur(2px);
}
.dayview-backdrop.open{display:flex}
.dayview{
  width:min(420px,calc(100vw - 24px));
  height:min(76vh,650px);
  max-height:calc(100vh - 28px);
  min-height:0;
  overflow:hidden;
  border-radius:24px;
  background:#fff;
  box-shadow:0 28px 80px rgba(0,0,0,.18);
  border:1px solid #edf2f7;
  display:flex;
  flex-direction:column;
}
.dayview-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:18px 18px 14px;
  background:#fbfcfe;
  border-bottom:1px solid #eef2f6;
}
.dayview-title{
  margin:0;
  font-size:18px;
  font-weight:800;
  color:#111827;
}
.dayview-sub{
  margin-top:4px;
  color:#7b8796;
  font-size:12px;
  font-weight:600;
}
.dayview-body{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:16px 14px 12px;
  background:#fff;
}
.dayview-section{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.dayview-card{
  border:1px solid #eaf0f7;
  border-radius:12px;
  background:var(--dayview-bg);
  padding:10px 12px;
}
.dayview-shabbat,
.dayview-parasha,
.dayview-event{
  border:1px solid var(--note-line);
  background:var(--note);
  color:#2d4e6e;
  border-radius:12px;
  padding:12px 14px;
  text-align:center;
  font-size:14px;
  font-weight:700;
}
.dayview-shabbat .time{
  color:var(--link);
  font-weight:800;
  margin-right:6px;
  direction:ltr;
  display:inline-block;
}
.dayview-event{
  color:#7b4f00;
  font-weight:800;
}
.dayview-event.green{
  color:#166534;
}
.dayview-chag-zman{
  margin-top:6px;
  font-size:13px;
  font-weight:700;
  color:#3d5a78;
}
.dayview-chag-zman .time{
  color:var(--link);
  font-weight:800;
  margin-right:4px;
  direction:ltr;
  display:inline-block;
}
.dayview-note{
  display:flex;
  align-items:flex-start;
  gap:8px;
  border:1px solid var(--note-line);
  border-radius:12px;
  background:var(--note);
  padding:10px 12px;
}
.dayview-note-time{
  flex:0 0 auto;
  min-width:44px;
  color:var(--link);
  font-weight:800;
  direction:ltr;
}
.dayview-note-text{
  flex:1;
  font-size:14px;
  color:#274563;
  font-weight:700;
  line-height:1.35;
}
.dayview-empty{
  text-align:center;
  color:#8492a5;
  font-size:13px;
  padding:18px 8px;
}
.dayview-foot{
  padding:12px 16px 18px;
  background:#fff;
  border-top:1px solid #eef2f6;
}
.dayview-add{
  width:100%;
  min-height:52px;
  border:0;
  border-radius:999px;
  background:#f1f3f6;
  color:#6f7d8f;
  display:flex;
  flex-direction:row-reverse;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
}
.dayview-add .plus{
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#fff;
  color:#111827;
  font-size:28px;
  line-height:1;
}
.dayview-close{
  flex:0 0 auto;
  width:34px;
  height:34px;
  border:0;
  border-radius:10px;
  background:#f4f6f9;
  color:#5e6a7e;
  font-size:22px;
  cursor:pointer;
}

/* responsive */
@media(max-width:1050px){
  .jt-cal{width:100%;margin:0}
  .toolbar{padding:12px 14px;margin:0}
  .calendar-shell{
    border-right:0;
    border-left:0;
    border-radius:0;
    box-shadow:none;
  }
  .day{min-height:185px;padding:9px 8px 39px}
  .greg{font-size:28px}
  .heb{font-size:10.5px}
  .parasha{font-size:10px}
  .footer-hint{padding-bottom:18px}
}

@media(max-width:790px){
  .toolbar{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
  }
  .toolbar-right{display:none}
  .month-nav-wrap{order:1;justify-content:center}
  .top-tools{order:2;justify-content:center;flex-wrap:wrap}
  .month-block{min-width:0}
  .month-block h1,
  .month-block .month-title{font-size:22px}
  .month-block .hebrew-month{font-size:11px}
  .month-nav{
    min-width:40px;
    width:40px;
    padding:0;
  }
  .month-nav .nav-text{display:none}
  .city-picker select{
    min-width:112px;
    width:112px;
    padding:0 8px;
    font-size:11px;
  }
  .print-btn .btn-text,
  .settings-btn .btn-text{display:none}
  .print-btn,
  .settings-btn{width:40px;padding:0}
  .calendar-scroll{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
  .calendar-shell{min-width:955px}
  .dayview{
    height:min(78vh,610px);
    max-height:calc(100vh - 14px);
    min-height:0;
  }
  .form-row{grid-template-columns:1fr}
  .time-range-row{grid-template-columns:1fr 1fr}
}


@media(max-width:790px){
  .jt-cal{
    width:100% !important;
    max-width:none !important;
    margin:0;
  }

  .toolbar{
    display:grid;
    grid-template-columns:1fr;
    grid-template-areas:
      "month"
      "citygroup"
      "tools";
    align-items:center;
    gap:7px 6px;
    padding:10px 8px;
    direction:ltr;
  }

  .month-nav-wrap{
    grid-area:month;
    justify-content:space-between;
    width:100%;
    gap:5px;
  }

  .city-group{
    grid-area:citygroup;
    justify-content:center;
    flex-wrap:wrap;
    gap:8px;
  }

  .city-status{
    font-size:11px;
    min-height:38px;
    padding:0 10px;
    white-space:normal;
    text-align:center;
  }

  .city-picker{
    justify-content:flex-end;
  }

  .top-tools{
    grid-area:tools;
    justify-content:center;
    flex-wrap:wrap;
    padding:6px;
    border-radius:10px;
  }

  .month-block{
    min-width:0;
    flex:1 1 auto;
  }

  .month-block h1,
  .month-block .month-title{font-size:21px}
  .month-block .hebrew-month{font-size:10px}

  .month-nav{
    min-width:34px;
    width:34px;
    height:36px;
    min-height:36px;
    padding:0;
    border-radius:9px;
  }

  .month-nav .nav-text{display:none}

  .city-picker select{
    min-width:108px;
    width:108px;
    height:36px;
    padding:0 6px;
    font-size:10.5px;
  }

  .print-btn .btn-text,
  .settings-btn .btn-text{display:none}

  .print-btn,
  .settings-btn{
    width:36px;
    min-height:36px;
    padding:0;
  }

  /* שבעת הימים נשארים על המסך - בלי גלילה אופקית */
  .calendar-scroll{
    width:100%;
    max-width:100%;
    overflow-x:visible;
  }

  .calendar-shell{
    width:100%;
    max-width:100%;
    min-width:0;
    border-radius:0;
    border-right:0;
    border-left:0;
  }

  .weekdays,
  .calendar-grid{
    grid-template-columns:repeat(7,minmax(0,1fr));
    width:100%;
  }

  .weekday{
    min-width:0;
    padding:7px 1px;
    font-size:9px;
    white-space:nowrap;
    overflow:hidden;
  }

  .day{
    min-width:0;
    min-height:245px;
    padding:6px 4px 34px;
    overflow:hidden;
  }

  .day-head{
    min-height:38px;
    gap:2px;
    flex-direction:column;
    align-items:flex-start;
  }

  .date-wrap{
    display:block;
    width:100%;
  }

  .greg{
    font-size:21px;
    line-height:1;
    letter-spacing:-.5px;
  }

  .heb{
    display:block;
    margin-top:3px;
    font-size:8.5px;
    line-height:1.15;
    white-space:normal;
    overflow-wrap:anywhere;
  }

  .parasha{
    max-width:100%;
    width:100%;
    margin-top:3px;
    font-size:8px;
    text-align:center;
    overflow-wrap:anywhere;
  }

  .event{
    margin-top:5px;
    font-size:8.5px;
    line-height:1.2;
  }

  .event.centered{font-size:9.5px}

  .shabbat-block{margin-top:6px}

  .shabbat-pill,
  .parasha-pill{
    min-height:28px;
    padding:4px 16px 4px 4px;
    gap:2px;
    font-size:8px;
    line-height:1.15;
    white-space:normal;
    flex-direction:column;
  }

  .shabbat-pill .item-remove,
  .parasha-pill .item-remove{
    left:2px;
    width:14px;
    height:14px;
    font-size:11px;
  }

  .more-places{
    margin-top:5px;
    font-size:8px;
    gap:2px;
  }

  .more-places .plus{font-size:10px}

  .more-list{
    font-size:7.5px;
    line-height:1.35;
  }

  .notes-preview{
    gap:4px;
    margin-top:6px;
  }

  .note{
    min-height:24px;
    padding:3px 16px 3px 3px;
    font-size:8px;
    line-height:1.15;
    position:relative;
    align-items:flex-start;
    flex-wrap:wrap;
  }

  .note-time{
    width:100%;
    font-size:7.5px;
  }

  .note-text{
    width:100%;
    white-space:normal;
    overflow:hidden;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
  }

  .note .note-delete{
    position:absolute;
    left:1px;
    top:2px;
    width:14px;
    height:14px;
    font-size:11px;
  }

  .more-notes-badge{
    padding:2px 5px;
    font-size:8px;
  }

  .day-footer{
    right:3px;
    left:3px;
    bottom:5px;
    gap:1px;
  }

  .icon-action{
    padding:2px;
    font-size:0;
    gap:0;
  }

  .icon-action svg{
    width:13px;
    height:13px;
  }

  .icon-action.plus-only{
    width:21px;
    height:21px;
  }

  .today-label{
    left:3px;
    top:3px;
    padding:2px 4px;
    font-size:7px;
  }

  .footer-hint{
    padding:0 10px 16px;
  }

  .dayview{
    width:min(390px,calc(100vw - 14px));
    height:min(78vh,610px);
    max-height:calc(100vh - 14px);
    min-height:0;
  }

  .form-row{grid-template-columns:1fr}
  .time-range-row{grid-template-columns:1fr 1fr}
}



@media(max-width:790px){
  .more-places{
    display:inline-flex !important;
    font-size:8px;
    margin-top:5px;
  }
}


@media(max-width:790px){
  .toolbar{
    display:grid !important;
    grid-template-columns:1fr;
    grid-template-areas:
      "month"
      "citygroup"
      "tools";
    align-items:center;
    gap:7px 6px;
    padding:10px 8px;
    direction:ltr;
  }
  .month-nav-wrap{
    grid-area:month;
    width:100%;
    justify-content:space-between;
    direction:rtl;
  }
  .city-group{
    grid-area:citygroup;
    justify-content:center;
    flex-wrap:wrap;
    gap:8px;
    direction:rtl;
  }
  .city-status{
    font-size:11px;
    min-height:38px;
    padding:0 10px;
    white-space:normal;
    text-align:center;
  }
  .city-picker{
    justify-content:flex-end;
    direction:rtl;
  }
  .top-tools{
    grid-area:tools;
    justify-content:center;
    direction:rtl;
  }
}

@media print{
  @page{
    size:A4 landscape;
    margin:8mm;
  }

  

  body{
    margin:0;
  }

  .jt-cal{
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
  }

  .toolbar,
  .calendar-scroll,
  .footer-hint,
  .modal-backdrop,
  .dayview-backdrop{
    display:none !important;
  }

  .print-calendar{
    display:block !important;
    width:100%;
    direction:rtl;
    font-family:"Arimo",Arial,sans-serif;
  }

  .print-title{
    text-align:center;
    margin:0 0 5mm;
  }

  .print-title h1{
    margin:0;
    color:#132238;
    font-size:21px;
    font-weight:800;
  }

  .print-title div{
    margin-top:2px;
    color:#59677b;
    font-size:10px;
    font-weight:600;
  }

  .print-weekdays,
  .print-week{
    width:100%;
    display:grid;
    grid-template-columns:repeat(7,minmax(0,1fr));
  }

  .print-weekdays{
    border-top:1px solid var(--line-strong);
    border-right:1px solid var(--line-strong);
    background:var(--header);
  }

  .print-weekday{
    padding:5px 3px;
    border-left:1px solid var(--line-strong);
    border-bottom:1px solid var(--line-strong);
    text-align:center;
    color:#111827;
    font-size:9.5px;
    font-weight:800;
  }

  .print-week{
    break-inside:avoid;
    page-break-inside:avoid;
    border-right:1px solid var(--line-strong);
  }

  .print-day{
    min-height:31mm;
    padding:5px 5px 6px;
    border-left:1px solid var(--line-strong);
    border-bottom:1px solid var(--line-strong);
    background:#fff;
    break-inside:avoid;
    page-break-inside:avoid;
    overflow:hidden;
  }

  .print-day.saturday{
    background:var(--sat);
  }

  .print-day.other-month{
    background:#fafbfd;
  }

  .print-day.other-month .print-main{
    opacity:.42;
  }

  .print-date{
    display:flex;
    align-items:baseline;
    gap:4px;
    margin-bottom:4px;
  }

  .print-greg{
    color:#0b5da8;
    font-size:18px;
    line-height:1;
    font-weight:800;
  }

  .print-heb{
    color:#4d5b6d;
    font-size:8px;
    font-weight:500;
  }

  .print-event{
    margin:4px 0;
    text-align:center;
    color:#3f4e61;
    font-size:8px;
    font-weight:700;
  }

  .print-event.green{
    color:#187348;
  }

  .print-pill{
    width:100%;
    margin-top:4px;
    padding:4px 5px;
    border:1px solid var(--note-line);
    border-radius:5px;
    background:var(--note);
    color:#2d4e6e;
    font-size:7.5px;
    font-weight:700;
    line-height:1.2;
    text-align:center;
  }

  .print-pill .time{
    color:var(--link);
    font-weight:800;
    direction:rtl;
    unicode-bidi:plaintext;
  }

  .print-notes{
    display:flex;
    flex-direction:column;
    gap:3px;
    margin-top:5px;
  }

  .print-note{
    padding:3px 4px;
    border:1px solid var(--note-line);
    border-radius:5px;
    background:var(--note);
    color:#35506d;
    font-size:7.5px;
    line-height:1.2;
  }

  .print-note-time{
    color:var(--link);
    font-weight:800;
    margin-left:3px;
    direction:rtl;
    unicode-bidi:plaintext;
  }

  /* אם שבוע שלם לא נכנס, הדפדפן מעביר את כל השבוע לעמוד הבא */
  .print-week + .print-week{
    break-before:auto;
  }
}

@media screen{
  .print-calendar{
    display:none;
  }
}
