/* נוכחות כולל יום — styles from the approved design canvas. */
:root {
  interpolate-size: allow-keywords;
  --bg: #F4F3EF; --card: #FFFFFF; --ink: #1C1C1A; --muted: #5E5C55; --line: #E2E0D8; --line-soft: #ECEAE3;
  --field: #D6D3C9; --primary: #1F4E8C; --primary-dark: #163A69; --primary-soft: #EEF3FA;
  --ok: #2E7D4F; --ok-soft: #F1F8F3; --print: #1E7A45; --good: #BFE3C9; --danger: #B42318; --danger-soft: #FDECEA;
  --radius: 14px; --font: Assistant, 'Noto Sans Hebrew', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
a { color: var(--primary); } a:hover { color: var(--primary-dark); }
h1 { margin: 2px 0 0; font-size: 36px; font-weight: 800; line-height: 1.1; }
h2 { margin: 0; font-size: 21px; font-weight: 800; }
.wrap { max-width: 1680px; margin: 0 auto; padding: 0 clamp(16px, 2.5vw, 40px); }
main.wrap { padding-top: 28px; padding-bottom: 48px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.muted { color: var(--muted); } .muted-num { font-weight: 600; color: var(--muted); font-size: 0.75em; }
.eyebrow { font-size: 15px; color: var(--muted); font-weight: 600; }
.strong { font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.plain { margin: 0; padding-inline-start: 20px; }

/* buttons and fields */
.btn { height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--field); background: #fff; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-print { background: var(--print); border-color: var(--print); color: #fff; font-weight: 800; font-size: 16px; }
.btn-print:hover { background: #145531; color: #fff; }
.btn-wide { width: 100%; height: 50px; justify-content: center; font-size: 17px; }
.icon-only { width: 44px; padding: 0; justify-content: center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 15px; font-weight: 700; }
.field input[type=text], .field input[type=password], .field input[type=file], input[type=search] {
  height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--field); font: inherit; font-size: 16px; background: #fff; }
.field input[type=file] { padding: 9px 12px; }
.hint { font-size: 14px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; }
.alert { border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #CFE7D7; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #F5C9C4; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .82); backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%); border-bottom: 1px solid rgba(0, 0, 0, .07); }
@media (prefers-reduced-transparency: reduce) { .topbar { background: #fff; backdrop-filter: none; } }
.topbar-row { height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { justify-self: start; }
.mainnav { display: flex; gap: 4px; background: rgba(118, 118, 128, .1); padding: 4px; border-radius: 14px; }
.nav-item { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; color: var(--muted);
  font-weight: 700; font-size: 15px; text-decoration: none; transition: background-color .18s ease, color .18s ease, transform .1s ease; }
.nav-item:hover { color: var(--ink); background: rgba(255, 255, 255, .7); }
.nav-item:active { transform: scale(.96); }
.nav-item { position: relative; isolation: isolate; }
.nav-item.active { color: var(--primary); }
.nav-pill { position: absolute; inset: 0; z-index: -1; border-radius: 10px; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 1px rgba(0, 0, 0, .04); view-transition-name: nav-pill; }
/* moving between screens: the page swaps at once, only the white pill slides to the new place */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(nav-pill) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
.usermenu { justify-self: end; position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 12px; border: 0; border-radius: 22px; background: transparent;
  font: inherit; font-weight: 700; font-size: 15px; color: var(--ink); cursor: pointer; transition: background-color .18s ease; }
.user-btn:hover, .user-btn[aria-expanded=true] { background: rgba(118, 118, 128, .12); }
.user-btn[aria-expanded=true] .chev { transform: rotate(180deg); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(160deg, #3D6DB0, var(--primary)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none; }
.avatar.big { width: 44px; height: 44px; font-size: 19px; }
.user-pop { position: absolute; left: 0; top: calc(100% + 8px); width: 240px; background: #fff; border-radius: 14px; padding: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .16), 0 0 0 1px rgba(0, 0, 0, .05); transform-origin: top left;
  opacity: 0; transform: scale(.96) translateY(-4px); transition: opacity .16s ease, transform .16s cubic-bezier(.2, .8, .2, 1); }
.user-pop.show { opacity: 1; transform: none; }
.user-pop-head { display: flex; gap: 10px; align-items: center; padding: 10px 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.user-pop-head .strong, .user-pop-head .hint { display: block; }
.pop-item { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px; border-radius: 9px; text-decoration: none; color: var(--ink); font-weight: 600; }
.pop-item:hover { background: var(--bg); }
.pop-item.danger { color: var(--danger); }
.pop-item.danger:hover { background: var(--danger-soft); color: var(--danger); }
.flash-wrap { padding-top: 16px; }
@media (max-width: 860px) {
  .brand-text, .user-name, .usermenu .chev { display: none; }
  .nav-item { padding: 0 12px; }
}
@media (max-width: 520px) {
  .nav-label { display: none; }
  .topbar-row { grid-template-columns: auto 1fr auto; }
  .mainnav { justify-self: center; }
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.brand-mark.big { width: 56px; height: 56px; border-radius: 14px; font-size: 26px; }
.brand-name { display: block; font-weight: 800; font-size: 18px; }
.brand-sub { display: block; font-size: 14px; color: var(--muted); }
.past-banner { background: var(--danger); color: #fff; font-weight: 700; padding: 12px 0; }
.past-banner a { color: #fff; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.login-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.login-head h1 { font-size: 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.password-wrap { position: relative; }
.password-wrap input { width: 100%; padding-left: 52px; }
.icon-btn { position: absolute; left: 2px; top: 1px; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.center-link { align-self: center; font-weight: 600; padding: 10px; }

/* month */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.step.active { border: 2px solid var(--primary); padding: 13px 15px; }
.step-mark { width: 32px; height: 32px; flex: none; border-radius: 50%; background: #ECEAE3; color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.step.done .step-mark { background: var(--ok); color: #fff; }
.step.active .step-mark { background: var(--primary); color: #fff; }
.step-label { display: block; font-weight: 700; }
.step-sub { font-size: 14px; color: var(--muted); }
.strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.facts { display: flex; gap: 32px; flex-wrap: wrap; }
.fact-label { font-size: 14px; color: var(--muted); }
.fact-value { font-weight: 800; font-size: 20px; }
.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty p { margin: 0; }
.list { padding: 0; overflow: hidden; }
.list-head { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.list-head input[type=search] { width: 220px; height: 44px; }
.counter { font-size: 15px; font-weight: 700; background: var(--ok-soft); color: var(--ok); padding: 10px 14px; border-radius: 10px; }
.counter.incomplete { background: var(--danger-soft); color: var(--danger); }

.cards-head, .avrech-row { display: grid; grid-template-columns: minmax(240px, 2.4fr) repeat(3, minmax(80px, 1fr)) minmax(150px, 1.1fr) 160px; gap: 16px; align-items: center; }
.cards-head { padding: 10px 20px; background: #F8F7F3; color: var(--muted); font-size: 14px; font-weight: 700; }

.avrech-row { padding: 8px 20px; cursor: pointer; transition: background-color .15s ease; }
.avrech:not(.open) .avrech-row:hover { background: #FAFAF8; }
.avrech { transition: margin .22s cubic-bezier(.2, .8, .2, 1), border-color .22s ease, box-shadow .22s ease, background-color .22s ease, border-radius .22s ease;
  border: 2px solid transparent; border-top: 1px solid var(--line-soft); }
.avrech.open { background: var(--primary-soft); border: 2px solid var(--primary); border-radius: 12px; margin: 10px 12px;
  box-shadow: 0 6px 20px rgba(31, 78, 140, 0.14); }
.avrech.open + .avrech { border-top-color: transparent; }
.avrech.open .avrech-row { padding: 8px; border-bottom: 1px solid #C9D6EA; }
.avrech.open .who-name { color: var(--primary); font-size: 18px; }
.avrech-toggle { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 0; font: inherit; color: inherit; cursor: pointer; text-align: right; min-height: 44px; }
.chev { flex: none; color: var(--muted); transition: transform .2s; }
.avrech.open .chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::details-content { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* quick, light feedback on press */
.btn { transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease, box-shadow .15s ease; }
.btn:active:not(:disabled) { transform: scale(.97); }
.days-input { transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.days-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(31, 78, 140, .15); }
.counter { transition: background-color .3s ease, color .3s ease; }
dialog.modal[open] { animation: modal-in .2s cubic-bezier(.2, .8, .2, 1); }
dialog.modal[open]::backdrop { animation: fade-in .2s ease; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*) { animation: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
.alert { animation: fade-in .25s ease; }
.who-name { display: block; font-weight: 700; }
.who-phone { display: block; font-size: 14px; color: var(--muted); text-align: right; }
.pct, .calc { font-weight: 700; font-size: 16px; border-radius: 8px; padding: 4px 8px; justify-self: start; }
.calc { width: 56px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.pct.good { color: #1E7A45; }
.pct.bad { color: var(--danger); }
.pct-label { display: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.days-input { width: 120px; height: 44px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--field); background: #fff;
  font: inherit; font-size: 18px; font-weight: 700; text-align: center; }
.days-input.done { border-color: var(--ok); background: var(--ok-soft); }
.days-input.saving { border-color: var(--primary); }
.days-input.error { border-color: var(--danger); background: var(--danger-soft); }
.days-input:disabled { background: #F4F3EF; color: var(--muted); }
.input-error { display: block; font-size: 13px; font-weight: 600; color: var(--danger); margin-top: 2px; }
.input-error:empty { display: none; }
.avrech-more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .24s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
.avrech.open .avrech-more { grid-template-rows: 1fr; opacity: 1; }
.avrech-more-inner { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 16px; padding: 0 20px; }
.avrech.open .avrech-more-inner { padding: 16px 8px 14px; }
.avrech[hidden] { display: none; }
.calc.alert { color: var(--danger); background: var(--danger-soft); font-weight: 800; }
.calc.zero { color: var(--ok); background: var(--ok-soft); font-weight: 800; }
.stat-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-group { background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .05); padding: 12px 14px 6px; }
.stat-group h3 { margin: 0 0 4px; font-size: 13px; font-weight: 800; color: var(--muted); }
.stat-group dl { margin: 0; }
.stat-group dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.stat-group dl > div:first-child { border-top: 0; }
.stat-group dt { font-size: 15px; color: var(--ink); }
.stat-group dd { margin: 0; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-group .of { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-group .total dt { font-weight: 700; }
.stat-group .total.alert dd { color: var(--danger); }
@media (max-width: 900px) { .stat-groups { grid-template-columns: 1fr; } }
.table-scroll { overflow-x: auto; }
table.reasons { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 760px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
table.reasons th { text-align: right; font-size: 13px; color: var(--muted); background: #F8F7F3; padding: 8px 10px; }
table.reasons td { padding: 8px 10px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.bottom-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn-danger { color: var(--danger); }

/* dialogs */
dialog.modal { border: 0; padding: 0; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.25); width: min(620px, calc(100vw - 32px)); color: var(--ink); }
dialog.modal::backdrop { background: rgba(28, 28, 26, .45); }
.modal-box { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.modal-box h2 { font-size: 22px; }
.modal-box p { margin: 0; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.two-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field input[type=number], .field input[type=email], .field input[type=time], .field select {
  height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--field); font: inherit; font-size: 16px; background: #fff; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; }
.cal-w { font-size: 13px; font-weight: 700; color: var(--muted); }
.cal-day { height: 44px; border-radius: 10px; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; border: 0; background: var(--primary); color: #fff; }
.cal-day.k-half { background: #6E8FBF; }
.cal-day.k-off, .cal-day:disabled { background: #ECEAE3; color: #9A978D; cursor: default; }
.cal-day[aria-pressed=true] { background: #fff; border: 1px dashed #9A978D; color: var(--muted); text-decoration: line-through; }
.cal-day.out:not(:disabled) { background: #FAFAF8; border: 1px solid #ECEAE3; color: #B5B2A9; text-decoration: none; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sw-study { background: var(--primary); } .sw-half { background: #6E8FBF; } .sw-off { background: #ECEAE3; }
.sw-ex { background: #fff; border: 1px dashed #9A978D; }
.totals { background: var(--primary-soft); border-radius: 12px; padding: 12px 16px; display: flex; gap: 28px; color: var(--primary); }
.totals .fact-label { color: var(--primary); }

/* office grid preview */
.grid-scroll { overflow: auto; max-height: 70vh; }
table.grid { border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { border: 1px solid var(--line); text-align: center; min-width: 26px; height: 24px; padding: 0 2px; }
table.grid thead th { position: sticky; top: 0; background: #F8F7F3; z-index: 1; font-weight: 700; }
table.grid .g-name { text-align: right; padding: 4px 10px; min-width: 190px; white-space: nowrap; position: sticky; right: 0; background: #fff; }
table.grid thead .g-name { z-index: 2; background: #F8F7F3; }
table.grid .g-sum { font-size: 17px; font-weight: 800; min-width: 54px; border-left: 2px solid var(--ink); }
table.grid tr.g-first td { border-top: 2px solid #C9C6BC; }
table.grid td.g-x { background: var(--danger-soft); color: var(--danger); font-weight: 800; }
table.grid td.g-off, table.grid th.g-off { background: #F4F3EF; color: #9A978D; }
table.grid td { color: var(--ok); font-weight: 700; }

/* settings: closed cards */
.settings { max-width: 1200px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.set-group-title { font-size: 14px; font-weight: 700; color: var(--muted); padding: 0 18px; margin-bottom: -12px; }
.set-group { background: var(--card); border-radius: 16px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .04); overflow: hidden; }
.set-row + .set-row > summary::before { content: ""; position: absolute; top: 0; left: 0; right: 64px; border-top: 1px solid var(--line-soft); }
.set-row > summary { position: relative; list-style: none; cursor: pointer; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center;
  gap: 14px; padding: 0 18px; min-height: 60px; transition: background-color .15s ease; -webkit-tap-highlight-color: transparent; }
.set-row > summary::-webkit-details-marker { display: none; }
.set-row > summary:hover { background: #FAFAF8; }
.set-row > summary:active { background: #F0EFEA; }
.set-row > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.set-icon { width: 32px; height: 32px; border-radius: 8px; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.set-title { font-size: 17px; font-weight: 700; }
.set-sum { color: var(--muted); font-size: 15px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.set-chev { color: #C4C4C7; transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.set-row[open] .set-chev { transform: rotate(-90deg); }
.set-row[open] > summary { background: var(--primary-soft); }
.set-row[open] .set-title { color: var(--primary); }
.set-body { padding: 18px 18px 20px 18px; padding-inline-start: 64px; display: flex; flex-direction: column; gap: 18px; border-top: 1px solid var(--line-soft); }
/* smooth open/close where the browser supports it */
.set-row::details-content { block-size: 0; overflow: clip; transition: block-size .24s cubic-bezier(.2, .8, .2, 1), content-visibility .24s allow-discrete; }
.set-row[open]::details-content { block-size: auto; }
.badge-dev { font-size: 12px; font-weight: 700; background: #FFF1DE; color: #8A4B00; padding: 3px 8px; border-radius: 6px; }
.text-danger { color: var(--danger); font-weight: 700; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 16px; }
.fields .field input { width: 100%; }
.field input[type=time] { text-align: right; }
.save-bar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 16px 0 8px; display: flex; justify-content: flex-end; }
.save-bar .btn { height: 50px; padding: 0 28px; font-size: 17px; }
.small-input { width: 130px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--field); font: inherit; }
table.users { min-width: 820px; }
table.users td { vertical-align: middle; }
.add-user { border-top: 1px solid var(--line-soft); padding-top: 16px; gap: 14px; }
.totals.small { padding: 8px 14px; gap: 20px; }
.zmanim { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.zman { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.zman h3 { margin: 0; font-size: 18px; }
.zman fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.zman legend { font-size: 14px; font-weight: 700; padding: 0; margin-bottom: 6px; }
.zdate { display: grid; grid-template-columns: 80px 1fr; gap: 8px; }
.zdate select { height: 44px; border-radius: 10px; border: 1px solid var(--field); font: inherit; font-size: 16px; padding: 0 8px; background: #fff; }
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
[data-year-calendar][aria-busy=true] { opacity: .6; }
.ymonth { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ycal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.yday { height: 38px; border: 0; border-radius: 7px; font: inherit; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1; background: var(--primary); color: #fff; cursor: pointer; }
.yday .yd { font-size: 14px; font-weight: 700; }
.yday .yh { font-size: 10px; opacity: .85; margin-top: 2px; }
.yday.k-half { background: #6E8FBF; }
.yday.k-holiday { background: #F6E3C6; color: #7A4A0B; cursor: default; }
.yday.k-weekend { background: #ECEAE3; color: #9A978D; cursor: default; }
.yday.k-out { background: #FAFAF8; color: #B5B2A9; border: 1px solid #ECEAE3; cursor: default; }
.yday.k-excluded { background: #fff; border: 1px dashed #9A978D; color: var(--muted); }
.yday.k-excluded .yd { text-decoration: line-through; }
.sw-holiday { background: #F6E3C6; } .sw-out { background: #FAFAF8; border: 1px solid #ECEAE3; }
@media (max-width: 640px) {
  .set-sum { display: none; }
  .set-row > summary { grid-template-columns: auto 1fr auto; }
  .set-body { padding-inline-start: 18px; }
}

.import-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

@media (max-width: 820px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-head { display: none; }
  .avrech-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .avrech-toggle { grid-column: 1 / -1; }
  .pct-label { display: block; }
  .calc, .decide { grid-column: span 1; }
  .decide { grid-column: 2 / -1; }
  h1 { font-size: 30px; }
}

/* ---- print (screen-print) ---- */
.screen-print { background: #e9e8e4; }
.print-toolbar { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 24px; display: flex; gap: 12px; align-items: center; z-index: 2; }
.sheet { width: 297mm; min-height: 210mm; margin: 16px auto; background: #fff; padding: 9mm 10mm; color: #111; display: flex; flex-direction: column; gap: 3mm; }
.sheet.flow { min-height: 0; }
.sheet.fixed { height: 210mm; overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.sheet-sub { font-size: 13px; font-weight: 600; color: #444; }
.sheet h1 { font-size: 26px; }
.boxes { display: flex; gap: 10px; }
.box { border: 2px solid #111; padding: 3px 16px; text-align: center; min-width: 120px; font-size: 13px; font-weight: 600; }
.box strong { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; }
table.detail, table.reasons-print { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
table.detail th, table.detail td, table.reasons-print th, table.reasons-print td { border: 1px solid #111; }
table.detail th { height: 46px; font-size: 12px; font-weight: 700; line-height: 1.15; background: #EFEFEF; padding: 2px; }
table.detail td { height: 9.3mm; text-align: center; padding: 0 2px; }
table.detail .right { text-align: right; padding: 0 6px; }
table.detail .who { line-height: 1.1; white-space: nowrap; overflow: hidden; }
table.detail .who .strong { font-size: 13.5px; }
table.detail .phone { font-size: 12.5px; color: #333; text-align: right; }
table.detail .box-col { border: 1.5px solid #111; background: #fff; padding: 2px 4px; }
.pen-box { height: 7.4mm; border: 1px solid #777; display: flex; align-items: center; justify-content: center; }
table.detail td.hl { background: var(--good); font-weight: 700; }
table.detail td.days { font-weight: 800; background: #F4F4F4; }
col.c-box { width: 21mm; } col.c-name { width: 42mm; }
table.reasons-print th { background: #EFEFEF; font-size: 12.5px; text-align: right; padding: 3px 5px; }
table.reasons-print td { padding: 2px 5px; font-size: 13px; line-height: 1.15; vertical-align: top; }
.sheet.fixed { padding: 7mm 9mm 6mm; gap: 2mm; }
table.reasons-print .center { text-align: center; }
table.reasons-print .group { break-inside: avoid; }
table.reasons-print .group-head td { background: #E4E4E4; font-weight: 800; font-size: 13.5px; border-top: 2px solid #111; padding: 2px 5px; }
table.reasons-print .cont-note td { text-align: right; font-weight: 800; font-size: 12.5px; background: #F4F4F4; }
table.reasons-print .count { font-weight: 600; font-size: 13px; color: #333; }
col.c-date { width: 20mm; } col.c-seder { width: 14mm; } col.c-kind { width: 25mm; } col.c-other { width: 36mm; } col.c-time { width: 12mm; }
.sheet-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 12.5px; color: #333; }

@page { size: A4 landscape; margin: 0; }
@media print {
  .no-print { display: none !important; }
  .screen-print { background: #fff; }
  .sheet { margin: 0; width: 297mm; height: 210mm; break-after: page; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .sheet:last-of-type { break-after: auto; }
  table.reasons-print thead { display: table-header-group; }
}
