/* Calendar workspace: the date and appointments lead, controls stay secondary. */
.calendar-screen{max-width:1480px}
.calendar-heading{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-bottom:20px}
.calendar-label{font-size:1rem;font-weight:650;margin:3px 0 0}
.calendar-heading .eyebrow{margin:0}
.calendar-timezone{font-size:.88rem;color:var(--muted);margin:0 0 4px;text-align:right}
.calendar-attention{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:center;margin:0 0 14px;padding:10px 13px;border:1px solid #d8aaa4;border-left:4px solid var(--danger);background:#fff8f7;color:var(--ink);font-size:.92rem}
.calendar-attention a{color:var(--danger);font-weight:700}

.calendar-toolbar{
  display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;align-items:center;gap:12px;
  padding:12px 15px;background:var(--surface);border:1px solid var(--border);border-radius:6px 6px 0 0
}
.calendar-period{min-width:0}
.calendar-period h1{font-size:1.55rem;line-height:1.2;font-weight:650;letter-spacing:-.02em;margin:0 0 2px;white-space:normal;overflow-wrap:normal}
.period-short{display:none}
.calendar-period-count{display:block;color:var(--muted);font-size:.83rem;font-weight:600}
.calendar-navigation,.calendar-switch{display:flex;align-items:center;gap:5px}
.calendar-navigation .btn{min-width:39px;min-height:39px;padding:5px 8px}
.calendar-navigation .nav-arrow{font-size:1.45rem;line-height:1;font-weight:400}
.calendar-navigation .today-button{min-width:60px}
.calendar-switch{gap:1px;padding:3px;background:#f2f5ef;border:1px solid var(--border);border-radius:4px}
.calendar-switch a{display:grid;place-items:center;min-height:31px;padding:5px 10px;border-radius:2px;color:var(--text);font-size:.88rem;font-weight:650;text-decoration:none}
.calendar-switch a:hover{background:#e3ece1}
.calendar-switch a.selected{background:var(--accent);color:white}
.calendar-jump{display:flex;gap:4px;margin:0;max-width:190px}
.calendar-jump input{min-width:0;flex:1}
.calendar-jump .btn{min-width:36px;min-height:39px;padding:5px 7px;font-size:.85rem}
.calendar-jump input{width:145px;min-height:39px;padding:6px 8px;font-size:.86rem;border:1px solid var(--border-strong);border-radius:4px;color:var(--ink);background:#fff}
.calendar-jump input:focus{border-color:var(--accent);box-shadow:var(--focus-ring);outline:none}
.calendar-help{margin:10px 1px 0;color:var(--muted);font-size:.85rem;line-height:1.35}

/* The month keeps a fixed rhythm, with a full-day drilldown when crowded. */
.month-calendar{max-width:100%;overflow:hidden;border:1px solid var(--border);border-top:0;border-radius:0 0 6px 6px;background:#fff}
.month-weekdays,.month-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.month-weekdays{background:#f1f5ee;border-bottom:1px solid var(--border)}
.month-weekdays span{padding:8px 5px;text-align:center;color:var(--muted);font-size:.78rem;font-weight:700}
.month-week{border-bottom:1px solid var(--border)}
.month-week:last-child{border-bottom:0}
.month-cell{position:relative;min-width:0;min-height:119px;padding:7px;border-right:1px solid var(--border);background:#fff;cursor:pointer}
.month-cell:last-child{border-right:0}
.month-cell:hover{background:#f5faf3}
.month-cell.outside-month{background:#f8f9f6}
.month-cell.outside-month .month-date{color:#768078}
.month-cell.is-today{background:#f1f7ef}
.month-cell.is-selected:not(.is-today){box-shadow:inset 0 0 0 2px #9ab9a1}
.month-cell-top{display:flex;align-items:center;justify-content:space-between;min-height:29px;margin-bottom:5px}
.month-date{display:grid;place-items:center;min-width:28px;height:28px;padding:0 4px;border-radius:3px;color:var(--ink);font-size:.85rem;font-weight:700;text-decoration:none}
.month-date:hover{background:#dbe9d9;text-decoration:none}
.month-cell.is-today .month-date{background:var(--accent);color:#fff}
.month-add{display:grid;place-items:center;width:26px;height:26px;border-radius:3px;color:var(--accent);font-size:1.18rem;font-weight:700;text-decoration:none;line-height:1}
.month-add:hover{background:#dcebdc;text-decoration:none}
.month-events{display:grid;gap:3px}
.month-event{display:flex;align-items:baseline;gap:5px;min-width:0;padding:3px 5px;border-left:2px solid #6b9c79;background:#eaf2e9;border-radius:2px;color:var(--ink);font-size:.79rem;line-height:1.2;text-decoration:none;white-space:nowrap;overflow:hidden}
.month-event:hover,.month-event:focus-visible{background:#d8e9d9;text-decoration:none}
.month-event time{flex:none;font-size:.77rem;font-weight:700}
.month-event span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.month-more{display:inline-block;margin-top:2px;padding:2px 4px;color:var(--accent);font-size:.81rem;font-weight:750;text-decoration:underline;text-decoration-color:#9ebaa3}
.month-mobile-count{display:none}
.month-help{display:none}

/* The 15-minute grid stays available for all 24 hours. */
.calendar-time-tools{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 14px;min-height:45px;padding:6px 13px;background:#f8faf6;border:1px solid var(--border);border-top:0}
.calendar-time-tools p{margin:0;color:var(--muted);font-size:.84rem}
.calendar-time-jumps{display:flex;align-items:center;gap:4px}
.calendar-time-jumps>span{margin-right:4px;color:var(--muted);font-size:.78rem;font-weight:650}
.calendar-time-jumps button{min-height:28px;padding:2px 6px;border:1px solid transparent;border-radius:3px;background:transparent;color:var(--accent);font-size:.81rem;font-weight:700;cursor:pointer}
.calendar-time-jumps button:hover,.calendar-time-jumps button:focus-visible{background:#e2eee2;border-color:#afc8b2}
.calendar-scroll{max-height:min(72dvh,800px);overflow:auto;scrollbar-gutter:stable;max-width:100%;border:1px solid var(--border);border-top:0;border-radius:0 0 6px 6px;background:#fff}
.time-calendar{display:grid;grid-template-columns:58px repeat(var(--calendar-days),minmax(150px,1fr));min-width:1120px}
.time-calendar.one-day{grid-template-columns:58px minmax(0,1fr);min-width:0}
.time-rail{position:sticky;left:0;z-index:6;background:#fff}
.time-rail-head,.calendar-day-head{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:center;height:68px;border-bottom:1px solid var(--border);background:#f6f9f4}
.time-rail-head{font-size:.73rem;font-weight:700;letter-spacing:.04em;color:var(--muted);text-transform:uppercase}
.time-rail-slot{position:relative;height:28px}
.time-rail-slot span{position:absolute;top:2px;right:6px;padding:0 2px;background:#fff;color:var(--muted);font-size:.74rem;font-variant-numeric:tabular-nums}
.calendar-day-column{min-width:0;border-left:1px solid var(--border)}
.calendar-day-column.is-today .calendar-day-slots{background:#fbfdf9}
.calendar-day-head{flex-direction:column;gap:0;text-decoration:none;color:var(--muted);font-size:.76rem;font-weight:700;text-transform:none}
.calendar-day-head:hover{background:#e7f0e5;text-decoration:none}
.calendar-day-head strong{display:grid;place-items:center;min-width:25px;height:25px;color:var(--ink);font-size:1.32rem;font-weight:700;line-height:1}
.calendar-day-head small{font-size:.75rem;font-weight:600;color:var(--muted)}
.calendar-day-column.is-today .calendar-day-head strong{background:var(--accent);color:#fff;border-radius:3px}
.calendar-day-column.is-selected:not(.is-today) .calendar-day-head{box-shadow:inset 0 -2px 0 #8fb49a}
.calendar-day-slots{position:relative}
.calendar-slot{display:block;position:relative;height:28px;border-top:1px solid #eef1eb;text-decoration:none}
.calendar-slot.hour-start{border-top-color:#ccd9cd}
.calendar-slot:hover,.calendar-slot:focus-visible{background:#e8f2e8;text-decoration:none}
.calendar-slot span{display:none;position:absolute;top:0;right:10px;color:var(--accent);font-size:1.13rem;font-weight:800;line-height:1.1}
.calendar-slot:hover span,.calendar-slot:focus-visible span{display:block}
.calendar-slot.unavailable{background:#f6f7f4;cursor:default}
.calendar-event{position:absolute;z-index:2;display:block;min-width:0;overflow:hidden;padding:5px 7px;border-left:3px solid #548866;border-radius:2px;background:#deebdf;color:var(--ink);text-decoration:none;font-size:.83rem;line-height:1.17}
.calendar-event:hover,.calendar-event:focus-visible{z-index:4;background:#c9e1cd;text-decoration:none;min-height:30px;height:auto!important;overflow:visible;box-shadow:0 3px 10px #263d2e30}
.calendar-event strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:750}
.calendar-event .event-time{display:block;margin-top:3px;font-size:.76rem;font-variant-numeric:tabular-nums;white-space:nowrap}
.calendar-event.is-short{display:flex;align-items:center;gap:4px;padding:2px 4px;white-space:nowrap}
.calendar-event.is-short .event-time{order:0;flex:none;margin:0;font-size:.73rem;font-weight:700}
.calendar-event.is-short .event-end{display:none}
.calendar-event.is-short strong{order:1;min-width:0;font-size:.78rem}
.calendar-now-line{position:absolute;left:0;right:0;z-index:3;height:2px;background:#b34f3d;pointer-events:none}
.calendar-now-line::before{content:"";position:absolute;left:-4px;top:-4px;width:9px;height:9px;border-radius:50%;background:#b34f3d}
.calendar-now-line span{position:absolute;right:3px;top:-11px;padding:1px 4px;border-radius:2px;background:#b34f3d;color:#fff;font-size:.66rem;font-weight:750;line-height:1.2}
.calendar-now-line[hidden]{display:none}

/* On small screens a week becomes a chronological agenda. The day retains its grid. */
.week-mobile-agenda{display:none}
.calendar-slot.is-closed,.calendar-slot.unavailable.is-closed{background:#e8e9e6;border-top-color:#daddd7}
.calendar-slot.is-closed:hover,.calendar-slot.is-closed:focus-visible{background:#d9e2d8}
.calendar-closed-range{position:absolute;left:0;right:0;pointer-events:none;overflow:clip;color:#59615b;z-index:1}
.calendar-closed-range span{display:block;position:sticky;top:70px;margin:3px 7px;font-size:.78rem;line-height:1.25}
.agenda-closed-times{padding:10px 0;color:var(--muted);font-size:.85rem}.agenda-closed-times span{display:block;margin-top:4px}
.month-more{min-height:24px}.month-event{min-height:24px}
@media(max-width:1100px){
  .calendar-toolbar{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'period jump' 'navigation switch';row-gap:11px}
  .calendar-period{grid-area:period}.calendar-navigation{grid-area:navigation}.calendar-switch{grid-area:switch;justify-self:end}.calendar-jump{grid-area:jump;justify-self:end}
  .period-full{display:none}.period-short{display:inline}
}
@media(max-width:1180px){
  .month-cell{min-height:68px;padding:4px}
  .month-events{display:none}
  .month-add{display:none}
  .month-mobile-count{display:grid;place-items:center;min-width:26px;width:max-content;min-height:21px;margin:4px 0 0;padding:1px 5px;border-radius:2px;background:#dfece0;color:var(--accent);font-size:.79rem;font-weight:750;text-decoration:none}
  .month-mobile-count:hover{background:#cfe3d1;text-decoration:none}
  .month-count-label{display:none}
  .month-help{display:block;margin:0;padding:8px 12px;border:1px solid var(--border);border-top:0;background:#f8faf6}
}
@media(min-width:761px) and (max-width:1180px){
  .month-mobile-count{display:inline-block}
  .month-count-label{display:inline}
}
@media(max-width:760px){
  .calendar-heading{margin-bottom:16px}
  .calendar-label{font-size:1rem}
  .calendar-timezone{font-size:.78rem;max-width:125px;line-height:1.3}
  .calendar-toolbar{padding:11px;border-radius:5px 5px 0 0;gap:10px}
  .calendar-toolbar{grid-template-areas:'period period' 'navigation switch' 'jump jump'}
  .calendar-jump{justify-self:start;max-width:210px}
  .calendar-period h1{font-size:1.33rem}
  .calendar-period-count{font-size:.77rem}
  .calendar-navigation{gap:4px}
  .calendar-navigation .btn{min-width:36px;min-height:36px;padding:4px 6px}
  .calendar-navigation .today-button{min-width:56px;font-size:.87rem}
  .calendar-switch a{min-height:28px;padding:4px 8px;font-size:.84rem}
  .calendar-jump input{width:130px;min-height:37px;font-size:.79rem}
  .month-weekdays span{padding:8px 1px;font-size:.72rem}
  .month-cell{min-height:82px;padding:3px}
  .month-cell-top{margin:0}
  .month-date{min-width:27px;height:29px;font-size:.78rem}
  .month-mobile-count{min-width:24px;min-height:21px;margin-top:4px;font-size:.75rem}
  .calendar-scroll{max-height:min(64dvh,650px)}
  .time-calendar.one-day{min-width:0}
  .calendar-scroll:has(.time-calendar:not(.one-day)){display:none}
  .week-time-tools{display:none}
  .week-mobile-agenda{display:block;border:1px solid var(--border);border-top:0;border-radius:0 0 6px 6px;background:#fff}
  .week-day{padding:15px 16px 10px;border-bottom:1px solid var(--border)}
  .week-day:last-child{border-bottom:0}
  .week-day.is-today{background:#f6faf4}
  .week-day-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
  .week-day-head>div{min-width:0}
  .week-day-head a:first-child{display:block;color:var(--ink);font-size:1.04rem;font-weight:750;text-decoration:none}
  .week-day-head a:first-child:hover{text-decoration:underline}
  .week-day-head span{display:block;color:var(--muted);font-size:.78rem}
  .week-day-head .btn{flex:none;min-height:33px;padding:5px 8px;font-size:.78rem}
  .week-event{display:grid;grid-template-columns:78px minmax(0,1fr) 12px;align-items:center;gap:8px;min-height:43px;padding:6px 3px;border-top:1px solid #e6ece3;color:var(--ink);text-decoration:none}
  .week-event:hover,.week-event:focus-visible{background:#edf5eb;text-decoration:none}
  .week-event time{font-size:.85rem;font-weight:750;line-height:1.05}
  .week-event time small{display:block;margin-top:2px;color:var(--muted);font-size:.72rem;font-weight:500}
  .week-event strong{min-width:0;overflow-wrap:anywhere;font-size:.94rem;font-weight:650}
  .week-event>span{color:var(--muted);font-size:1.2rem}
  .week-empty{display:block;padding:5px 0 11px;color:var(--muted);font-size:.85rem}
  .calendar-time-tools{align-items:flex-start;gap:5px;padding:8px 10px}
  .calendar-time-tools p{font-size:.79rem}
  .calendar-time-jumps{width:100%;justify-content:space-between}
  .calendar-time-jumps button{font-size:.78rem}
}
@media(max-width:350px){
  .calendar-toolbar{gap:7px;padding:9px}
  .calendar-period h1{font-size:1.19rem}
  .calendar-period-count{font-size:.78rem}
  .calendar-jump input{width:119px;padding:5px;font-size:.78rem}
  .calendar-navigation .btn{min-width:32px;padding:3px 4px}
  .calendar-navigation .today-button{min-width:50px;font-size:.8rem}
  .calendar-switch a{padding:4px 6px;font-size:.8rem}
  .month-weekdays span{font-size:.67rem}
  .month-cell{min-height:76px;padding:2px}
  .month-date{min-width:24px;height:26px;font-size:.8rem}
  .month-mobile-count{min-width:24px;min-height:24px;font-size:.85rem}
}
