:root { --calendar-hour-height: 56px; }
.calendar-heading { margin-bottom: 13px; }
.calendar-heading-actions { display: flex; align-items: center; gap: 9px; }
.calendar-mode-nav { display: flex; gap: 22px; align-items: center; border-bottom: 1px solid var(--line); margin: 0 0 14px; }
.calendar-mode-nav a { color: var(--muted); padding: 8px 1px 10px; font-size: 13px; font-weight: 600; }
.calendar-mode-nav a:hover, .calendar-mode-nav a.selected { color: var(--ink); }
.calendar-mode-nav a.selected { box-shadow: inset 0 -2px var(--gold); }
.calendar-toolbar { display: flex; align-items: center; gap: 14px; justify-content: space-between; margin: 0 0 12px; }
.calendar-nav-buttons { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.calendar-filters { display: flex; align-items: center; gap: 7px; }
.calendar-filters input, .calendar-filters select { min-height: 34px; max-width: 180px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink); font-size: 12px; }
.calendar-view-switch { display: flex; align-items: center; gap: 2px; padding: 3px; background: #efefeb; border-radius: 5px; }
.calendar-view-switch a { padding: 5px 9px; font-size: 12px; color: var(--muted); border-radius: 3px; }
.calendar-view-switch a.selected { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(25 27 22 / 10%); }
.time-calendar, .team-calendar-shell, .month-calendar, .agenda-calendar { background: #fff; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.time-grid-head, .time-grid-body { display: grid; }
.time-grid-head.day-count-1, .time-grid-body.day-count-1 { grid-template-columns: 58px minmax(280px, 1fr); }
.time-grid-head.day-count-7, .time-grid-body.day-count-7 { grid-template-columns: 58px repeat(7, minmax(110px, 1fr)); }
.time-grid-head { min-height: 64px; background: #fbfbf9; border-bottom: 1px solid var(--line); }
.time-axis-head { display: flex; align-items: flex-end; justify-content: center; padding: 8px 3px; color: var(--muted); font-size: 10px; border-right: 1px solid var(--line); }
.day-head { min-width: 0; padding: 10px 9px 8px; display: flex; flex-direction: column; gap: 1px; border-right: 1px solid var(--line); }
.day-head strong { font-size: 12px; font-weight: 700; }
.day-head > span { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.day-head small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.3; overflow-wrap: anywhere; }
.time-grid-body { overflow: hidden; }
.time-axis, .calendar-day-column, .team-time-labels, .team-lane { position: relative; height: calc(14 * var(--calendar-hour-height)); min-height: calc(14 * var(--calendar-hour-height)); }
.time-axis { border-right: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.time-axis > span, .team-time-labels > span { position: absolute; right: 7px; transform: translateY(-50%); line-height: 1; }
.time-axis > span:first-child, .team-time-labels > span:first-child { transform: translateY(0); }
.calendar-day-column, .team-lane { min-width: 0; border-right: 1px solid var(--line); background: #fff; }
.hour-lines { position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--calendar-hour-height) - 1px), #e8e9e4 calc(var(--calendar-hour-height) - 1px), #e8e9e4 var(--calendar-hour-height)); pointer-events: none; }
.calendar-day-column::after, .team-lane::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--calendar-hour-height) / 2 - 1px), #f2f2ef calc(var(--calendar-hour-height) / 2 - 1px), #f2f2ef calc(var(--calendar-hour-height) / 2)); pointer-events: none; }
.calendar-event-block { position: absolute; z-index: 2; inset-inline: 4px; overflow: hidden; display: flex; flex-direction: column; gap: 1px; padding: 4px 6px; border-left: 3px solid #9a7b31; border-radius: 3px; background: #f5f0e4; color: #302b20; font-size: 11px; line-height: 1.22; box-shadow: 0 1px 2px rgb(25 27 22 / 5%); }
.calendar-event-block strong { font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.calendar-event-block span, .calendar-event-block small { font-size: 10px; color: #625b4a; }
.calendar-event-block a:hover { text-decoration: underline; text-underline-offset: 2px; }
.event-internal { border-left-color: #607b8e; background: #edf2f5; color: #263843; }
.event-internal span, .event-internal small { color: #516777; }
.event-external { border-left-color: #5f816d; background: #edf3ee; color: #2e4335; }
.event-external span, .event-external small { color: #536d5b; }
.event-private_busy { border-left-color: #777b78; background: #eff0ee; color: #40433f; }
.event-private_busy span, .event-private_busy small { color: #666b66; }
.event-referral_bd { border-left-color: #806992; background: #f2eef5; color: #483854; }
.event-firm_event, .event-general { border-left-color: #a08037; background: #f7f4ec; }
.event-cancelled { opacity: .58; text-decoration: line-through; }
.event-busy-only { border-left-color: #737873; background: #f0f1ef; color: #414540; }
.current-time-line { position: absolute; z-index: 4; left: 0; right: 0; border-top: 2px solid #b84f3c; pointer-events: none; }
.current-time-line::before { content: ""; position: absolute; width: 7px; height: 7px; top: -4px; left: -1px; border-radius: 50%; background: #b84f3c; }
.calendar-privacy-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.month-weekdays, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-weekdays { background: #fbfbf9; border-bottom: 1px solid var(--line); }
.month-weekdays span { padding: 9px 10px; color: var(--muted); font-size: 11px; font-weight: 650; }
.month-cell { min-height: 112px; min-width: 0; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.month-cell.outside-month { background: #fafaf8; color: #898c84; }
.month-cell.current-day { background: #fbfaf5; }
.month-date { display: inline-block; margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.month-event { margin: 3px 0; padding: 3px 5px; overflow: hidden; border-left: 2px solid #9a7b31; background: #f5f0e4; color: #403923; border-radius: 2px; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.month-event.event-internal { border-color: #607b8e; background: #edf2f5; }
.month-event.event-external { border-color: #5f816d; background: #edf3ee; }
.month-event a, .month-event span { display: block; overflow: hidden; text-overflow: ellipsis; }
.month-more { color: var(--gold-dark); font-size: 10px; }
.agenda-calendar { padding: 15px 18px; }
.surface-heading, .selector-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.surface-heading h2, .selector-heading h2 { font-size: 16px; }
.surface-heading span, .selector-heading p { color: var(--muted); font-size: 12px; }
.agenda-event { display: grid; grid-template-columns: 116px 5px minmax(0, 1fr); align-items: center; gap: 13px; padding: 12px 2px; border-bottom: 1px solid #edeee9; }
.agenda-event:last-child { border-bottom: 0; }
.agenda-event time { display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.agenda-event time strong { font-size: 13px; }
.agenda-event time span, .agenda-event > div > span { color: var(--muted); font-size: 12px; }
.agenda-event > div { display: grid; gap: 2px; }
.agenda-event > div strong { font-size: 14px; }
.event-type-mark { align-self: stretch; min-height: 32px; border-radius: 3px; background: #c4ae72; }
.event-type-mark.event-internal { background: #748da0; }
.event-type-mark.event-external { background: #7c9a85; }
.event-type-mark.event-private_busy { background: #858a85; }
.calendar-empty { margin: 0; padding: 25px 10px; color: var(--muted); text-align: center; }
.team-selector { margin-bottom: 12px; padding: 13px 15px; background: #fff; border-block: 1px solid var(--line); }
.selector-heading { padding-bottom: 10px; }
.selector-heading > div:first-child { display: grid; gap: 3px; }
.selector-heading .eyebrow { margin: 0; }
.selector-heading p { margin: 0; }
.team-picker { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding-top: 10px; }
.team-picker fieldset { min-width: 220px; margin: 0; padding: 0; border: 0; }
.team-picker legend { margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.selector-options { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.selector-options label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 12px; }
.selector-options input { accent-color: var(--gold-dark); width: 15px; height: 15px; }
.team-calendar-shell { overflow-x: auto; }
.team-day-heading, .team-time-axis { display: grid; grid-template-columns: 54px repeat(var(--lane-count), minmax(185px, 1fr)); min-width: calc(54px + var(--lane-count) * 185px); }
.team-day-heading { min-height: 62px; background: #fbfbf9; border-bottom: 1px solid var(--line); }
.team-day-heading > span { align-self: end; padding: 8px 4px; color: var(--muted); font-size: 10px; }
.team-day-heading > div { min-width: 0; padding: 9px 10px; border-left: 1px solid var(--line); display: grid; gap: 2px; }
.team-day-heading strong { font-size: 12px; }
.team-day-heading small { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.team-time-labels { position: relative; border-right: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.team-lane { border-right: 1px solid var(--line); }
.common-slots { display: grid; gap: 0; }
.common-slot { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 3px; border-bottom: 1px solid var(--line); }
.common-slot:last-child { border-bottom: 0; }
.common-slot strong { font-size: 13px; }
.common-slot > div { display: grid; gap: 4px; min-width: 0; }
.common-slot small { display: block; line-height: 1.45; }
.consultation-policy-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 22px; margin: 0 0 18px; padding: 13px 16px; border-left: 3px solid var(--gold); background: #f7f7f4; }
.consultation-policy-fact { display: grid; align-content: start; gap: 3px; min-width: 0; }
.consultation-policy-fact strong { color: var(--muted); font-size: 11px; font-weight: 650; }
.consultation-policy-fact span { color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.consultation-policy-band > p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.calendar-participant-row > div { display: grid; gap: 3px; min-width: 0; }
.calendar-participant-row strong { line-height: 1.35; }
.calendar-participant-row small { line-height: 1.4; }
.attendance-card { padding: 12px 0; border-bottom: 1px solid #edeee9; }
.attendance-card:last-child { border-bottom: 0; }
.attendance-person { display: grid; gap: 3px; margin-bottom: 10px; }
.attendance-person strong { line-height: 1.35; }
.attendance-person span { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.calendar-form-surface, .calendar-detail-surface, .availability-surface { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.calendar-form-surface .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 16px; }
.calendar-form-surface .field { min-width: 0; }
.calendar-form-surface .field select[multiple] { min-height: 100px; }
.calendar-form-surface .field-full { grid-column: 1 / -1; }
.calendar-form-surface .form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.calendar-detail-grid { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(270px,.7fr); gap: 24px; }
.calendar-detail-facts { display: grid; gap: 10px; margin: 0; }
.calendar-detail-facts > div { display: grid; grid-template-columns: 125px 1fr; gap: 12px; }
.calendar-detail-facts dt { color: var(--muted); font-size: 12px; }
.calendar-detail-facts dd { margin: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.calendar-participant-row, .calendar-history-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #edeee9; font-size: 13px; }
.calendar-participant-row:last-child, .calendar-history-row:last-child { border-bottom: 0; }
.calendar-participant-row small, .calendar-history-row small { display: block; color: var(--muted); font-size: 11px; }
.calendar-management-tools { display: grid; gap: 12px; margin-top: 18px; }
.calendar-management-tools details { padding-top: 11px; border-top: 1px solid var(--line); }
.calendar-management-tools summary { color: var(--ink-soft); font-size: 13px; font-weight: 650; }
.calendar-management-tools form { display: grid; gap: 10px; margin-top: 10px; }
.calendar-management-tools .field { display: grid; gap: 4px; }
.calendar-management-tools input, .calendar-management-tools textarea, .calendar-management-tools select { width: 100%; }
.availability-columns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.availability-list { margin-top: 18px; }
.availability-list table { min-width: 650px; }
.consultation-badge { color: var(--gold-dark); font-weight: 650; }
@media (max-width: 1120px) {
  .calendar-toolbar { flex-wrap: wrap; }
  .calendar-view-switch { margin-left: auto; }
  .time-grid-head.day-count-7, .time-grid-body.day-count-7 { min-width: 1000px; }
  .time-calendar:has(.day-count-7) { overflow-x: auto; }
}
@media (max-width: 760px) {
  .calendar-heading { align-items: flex-start; flex-direction: column; }
  .calendar-heading-actions { width: 100%; }
  .calendar-heading-actions .button { flex: 1; }
  .calendar-mode-nav { gap: 16px; overflow-x: auto; white-space: nowrap; }
  .calendar-toolbar { align-items: flex-start; }
  .calendar-filters { order: 3; width: 100%; flex-wrap: wrap; }
  .calendar-filters input, .calendar-filters select { flex: 1 1 120px; max-width: none; }
  .calendar-view-switch { margin-left: 0; }
  .day-count-7 { min-width: 1000px; }
  .time-calendar:has(.day-count-7) { overflow-x: auto; }
  .time-grid-head.day-count-1, .time-grid-body.day-count-1 { grid-template-columns: 48px minmax(260px,1fr); }
  .time-axis, .calendar-day-column { height: calc(14 * 48px); min-height: calc(14 * 48px); }
  .team-picker fieldset { width: 100%; }
  .team-day-heading, .team-time-axis { grid-template-columns: 46px repeat(var(--lane-count), minmax(175px,1fr)); min-width: calc(46px + var(--lane-count) * 175px); }
  .month-cell { min-height: 74px; padding: 4px; }
  .month-event { font-size: 9px; }
  .month-event:nth-of-type(n+3) { display: none; }
  .month-weekdays span { padding: 7px 2px; text-align: center; font-size: 10px; }
  .agenda-calendar { padding: 12px; }
  .agenda-event { grid-template-columns: 82px 4px minmax(0,1fr); gap: 8px; padding: 10px 0; }
  .agenda-event > div strong { font-size: 13px; }
  .calendar-form-surface .form-grid, .calendar-detail-grid, .availability-columns { grid-template-columns: minmax(0,1fr); }
  .calendar-form-surface .field-full { grid-column: auto; }
  .calendar-form-surface .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .calendar-form-surface .form-actions .button { width: 100%; }
  .calendar-detail-facts > div { grid-template-columns: 100px 1fr; }
  .consultation-policy-band { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .consultation-policy-band > p { grid-column: auto; }
  .common-slot { align-items: flex-start; flex-direction: column; }
}
