.family-calendar {
  container: familycalendar / inline-size;
  --cal-line: #dedfd4;
  --cal-border: #d5d9ca;
  --cal-muted: #606d60;
  --cal-paper: #fffefa;
  color: var(--ink, #233d33);
}
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 24%); gap: 16px; align-items: start; }
.cal-sheet, .cal-agenda, .cal-issues { border: 1px solid var(--cal-border); background: var(--cal-paper); border-radius: 9px; }
.cal-sheet { overflow: hidden; min-width: 0; }
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 17px 18px 13px; }
.cal-month-heading { min-width: 0; }
.cal-month-title { display: flex; align-items: center; gap: 9px; padding: 0 3px 0 0; border: 0; background: transparent; color: var(--forest); font: 400 clamp(23px, 2.4vw, 31px)/1.15 var(--serif); letter-spacing: -.7px; }
.cal-month-title svg { flex: none; color: #697960; }
.cal-month-title:hover { color: #536e4e; }
.cal-month-heading p { font-size: 13px; line-height: 1.5; margin-top: 3px; color: var(--cal-muted); }
.cal-navigation, .cal-stepper { display: flex; align-items: center; }
.cal-navigation { flex: none; gap: 7px; }
.cal-today-button, .cal-stepper button { background: #fffefa; color: #415840; border: 0; font-weight: 550; }
.cal-today-button { border: 1px solid var(--cal-border); border-radius: 5px; min-height: 35px; padding: 5px 11px; font-size: 14px; }
.cal-stepper { border: 1px solid var(--cal-border); border-radius: 5px; }
.cal-stepper button { min-width: 32px; height: 33px; display: grid; place-content: center; padding: 4px; border-radius: 5px; }
.cal-stepper button:first-child svg { transform: rotate(180deg); }
.cal-stepper button + button { border-left: 1px solid var(--cal-line); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-today-button:hover, .cal-stepper button:hover { background: #f0f2e9; }
.cal-stepper button:disabled { opacity: .4; cursor: default; }
.cal-filters { margin: 0; padding: 0 18px 13px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 19px; row-gap: 6px; border: 0; }
.cal-civilBirthday { --type: #446749; --tint: #e7efe3; }
.cal-hebrewBirthday { --type: #916134; --tint: #f7edda; }
.cal-yahrzeit { --type: #6d5d80; --tint: #eeebf1; }
.cal-filters label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: #455343; font-size: 13px; min-height: 25px; }
.cal-filters input { accent-color: var(--type); width: 14px; height: 14px; cursor: pointer; margin: 0; }
.cal-filters label:has(input:not(:checked)) { color: #73796e; }
.cal-table { border-spacing: 0; border-collapse: separate; table-layout: fixed; width: 100%; }
.cal-table th { padding: 9px 4px; background: #f0f2e9; color: #58694f; border-top: 1px solid var(--cal-line); border-bottom: 1px solid var(--cal-line); font-size: 12px; font-weight: 650; letter-spacing: .65px; text-transform: uppercase; }
.cal-table td { position: relative; min-width: 0; vertical-align: top; height: 83px; padding: 5px 5px 7px; border-bottom: 1px solid var(--cal-line); border-right: 1px solid var(--cal-line); cursor: pointer; }
.cal-table tr:last-child td { border-bottom: 0; }
.cal-table td:last-child { border-right: 0; }
.cal-table td.cal-outside { background: #f7f7f1; }
.cal-table td.cal-outside .cal-date-button { color: #788171; }
.cal-table td.cal-outside .cal-hebrew { color: #727a6e; }
.cal-table td.cal-selected { background: #f0f4ea; box-shadow: inset 0 0 0 1.5px #8c9f80; }
.cal-table td:has(.cal-date-button:focus-visible) { outline: 2px solid #a77042; outline-offset: -3px; z-index: 1; }
.cal-date-button { display: flex; width: 100%; flex-wrap: wrap; align-items: center; gap: 2px 5px; border: 0; background: transparent; color: #364b37; padding: 0; text-align: left; }
.cal-number { flex: none; display: inline-grid; place-items: center; min-width: 25px; height: 26px; font: 500 16px/1 var(--sans); font-variant-numeric: tabular-nums; border-radius: 100px; }
.cal-hebrew { display: flex; justify-content: start; gap: 2px; align-items: baseline; flex-wrap: wrap; color: #64705e; font: 400 12px/1.35 Arial, sans-serif; margin-inline-start: auto; }
.cal-today .cal-number { background: #34533c; color: #fffef7; }
.cal-event { width: 100%; min-width: 0; display: flex; align-items: center; gap: 4px; border: 0; border-radius: 3px; background: var(--tint); margin-top: 3px; padding: 4px; color: var(--type); text-align: left; font-size: 12px; font-weight: 600; line-height: 1.15; }
.cal-event:hover { box-shadow: inset 0 0 0 1px var(--type); }
.cal-event i, .cal-entry i, .cal-marks i { display: block; background: var(--type); border-radius: 50%; }
.cal-event i { flex: none; width: 4px; height: 4px; }
.cal-event bdi { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-event b { margin-left: auto; padding-left: 1px; font-weight: 600; }
.cal-more { background: transparent; border: 0; padding: 3px 1px 0; font-size: 12px; color: #425a43; text-decoration: underline; text-underline-offset: 2px; }
.cal-aside { display: grid; gap: 12px; min-width: 0; }
.cal-agenda { overflow: hidden; }
.cal-aside-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 15px 15px 12px; }
.cal-aside-head h3 { font: 400 22px/1.2 var(--serif); letter-spacing: -.5px; }
.cal-back { padding: 2px 0; border: 0; background: transparent; font-size: 12px; color: #4c674b; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.cal-selection-heb { color: var(--cal-muted); font-size: 13px; padding: 0 15px 10px; margin-top: -6px; }
.cal-agenda-day { border-top: 1px solid #e5e6db; padding: 11px 12px 9px; }
.cal-agenda-day h4 { margin: 0 2px 5px; font-size: 13px; font-weight: 650; color: #51634d; }
.cal-entry, .cal-issue { width: 100%; display: flex; align-items: center; gap: 8px; background: transparent; padding: 7px 3px; border: 0; text-align: left; border-radius: 4px; }
.cal-entry:hover, .cal-issue:hover { background: #f3f5ed; }
.cal-entry i { align-self: start; flex: none; width: 7px; height: 7px; margin-top: 6px; }
.cal-entry > span, .cal-issue > span { flex: 1; min-width: 0; }
.cal-entry strong, .cal-entry small, .cal-issue strong, .cal-issue small { display: block; overflow-wrap: anywhere; }
.cal-entry strong, .cal-issue strong { font-weight: 550; font-size: 14px; line-height: 1.4; }
.cal-entry small, .cal-issue small { margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--cal-muted); }
.cal-entry svg, .cal-issue svg { flex: none; color: #7a8771; }
.cal-entry .cal-certainty { margin-top: 2px; color: #81552d; }
.cal-empty { display: flex; align-items: center; gap: 9px; padding: 15px; border-top: 1px solid #e5e6db; }
.cal-empty svg { flex: none; color: #7b8b6e; }
.cal-empty p { font-size: 14px; line-height: 1.45; color: var(--cal-muted); }
.cal-issues summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 15px; font-size: 14px; font-weight: 600; }
.cal-issues summary::-webkit-details-marker { display: none; }
.cal-issues summary small { display: block; color: var(--cal-muted); font-size: 12px; font-weight: 450; margin-top: 3px; }
.cal-issues[open] summary svg { transform: rotate(180deg); }
.cal-issues summary:focus-visible { outline: 3px solid #b9764b; outline-offset: 2px; border-radius: 6px; }
.cal-issues > div { padding: 0 12px 9px; max-height: 19rem; overflow: auto; }
.cal-issue { border-top: 1px solid var(--cal-line); border-radius: 0; }
.cal-note { padding: 4px 4px 0; }
.cal-note h3 { font-size: 14px; font-weight: 650; margin: 0 0 5px; }
.cal-note p { color: var(--cal-muted); font-size: 13px; line-height: 1.55; margin: 0; }
.cal-adar { display: grid; gap: 5px; margin-top: 12px; color: var(--cal-muted); font-size: 12px; line-height: 1.4; }
.cal-adar select, .cal-jump-fields select, .cal-jump-fields input { width: 100%; min-height: 38px; padding: 6px 10px; border: 1px solid var(--cal-border, #d5d9ca); border-radius: 5px; background-color: #fffefa; color: #354b39; font-size: 14px; }
.cal-adar select, .cal-jump-fields select { appearance: none; padding-right: 27px; background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1.5 5 4.8 5-4.8' fill='none' stroke='%235b6c56' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.cal-narrow-weekday, .cal-marks { display: none; }
.cal-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; margin: -1px; clip: rect(0,0,0,0); white-space: nowrap; }
.cal-dialog { max-width: 390px; }
.cal-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; }
.cal-dialog h2 { font: 400 25px/1.15 var(--serif); letter-spacing: -.65px; }
.cal-jump-fields { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 12px; padding: 0 18px 15px; }
.cal-jump-fields label { display: grid; gap: 5px; font-size: 13px; font-weight: 550; }
.cal-dialog footer { padding: 12px 18px; display: flex; justify-content: flex-end; border-top: 1px solid var(--line); }
@container familycalendar (max-width: 930px) {
  .cal-layout { grid-template-columns: minmax(0,1fr); }
  .cal-aside { grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; }
  .cal-note { grid-column: 1 / -1; max-width: 850px; }
  .cal-adar { max-width: 270px; }
}
@container familycalendar (max-width: 620px) {
  .cal-toolbar { padding: 13px 12px 8px; gap: 7px; }
  .cal-filters { padding: 0 12px 7px; gap: 3px 11px; }
  .cal-navigation { gap: 5px; }
  .cal-month-title { font-size: 23px; gap: 5px; }
  .cal-month-title svg { width: 13px; }
  .cal-month-heading p { font-size: 12px; }
  .cal-date-button { flex-direction: column; align-items: center; gap: 1px; min-height: 51px; justify-content: flex-start; }
  .cal-hebrew { justify-content: center; margin: 0; font-size: 12px; gap: 2px; }
  .cal-table td { padding: 4px 1px; height: 65px; }
  .cal-table th { padding: 7px 0; }
  .cal-event, .cal-more { display: none; }
  .cal-marks { display: flex; align-items: center; justify-content: center; gap: 3px; margin: 2px 0 0; }
  .cal-marks i { width: 5px; height: 5px; }
  .cal-aside { grid-template-columns: 1fr; }
  .cal-note { grid-column: auto; }
}
@container familycalendar (max-width: 390px) {
  .cal-month-title { font-size: 20px; }
  .cal-today-button { padding: 5px 7px; min-height: 33px; }
  .cal-stepper button { min-width: 27px; height: 31px; }
  .cal-filters { column-gap: 7px; }
  .cal-filters label { font-size: 12px; gap: 4px; }
  .cal-hebrew { font-size: 11px; }
  .cal-wide-weekday { display: none; }
  .cal-narrow-weekday { display: inline; }
}
.cal-issue-more { margin: 5px 3px; min-height: 30px; }
.cal-agenda-list { max-height: clamp(260px, 54vh, 640px); overflow-y: auto; }
.cal-agenda-more { min-height: 35px; margin: 0 15px 8px; }
