body:has(.rq-page) .desktop-sidebar { width: 184px; }
body:has(.rq-page) .main-content { margin-left: 184px; padding: 24px; }

.rq-page {
  --rq-text: #263b56;
  --rq-muted: #536a85;
  --rq-soft: #f5f8fc;
  --rq-accent: #eaf2ff;
  --rq-accent-border: #8bb0ec;
  --rq-blue: #2458ac;
  --rq-green: #23634b;
  --rq-green-bg: #e9f5ee;
  --rq-amber: #755512;
  --rq-amber-bg: #fff3d5;
  --rq-purple: #59408e;
  --rq-purple-bg: #f0ebfa;
  max-width: 1320px;
  margin: 0 auto;
  color: var(--rq-text);
}
.rq-page [hidden] { display: none !important; }
.rq-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.rq-header h1 { font-size: clamp(23px, 2.4vw, 30px); letter-spacing: -.025em; line-height: 1.15; }
.rq-surgeon-picker {
  min-width: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
}
.rq-surgeon-picker[open] { grid-column: 1 / -1; }
.rq-surgeon-picker:not([open]) { max-width: 360px; }
.rq-surgeon-picker summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  padding: 8px 12px;
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.rq-surgeon-picker summary::-webkit-details-marker { display: none; }
.rq-surgeon-picker summary::after {
  content: '';
  flex: 0 0 7px;
  height: 7px;
  margin: 0 2px 4px auto;
  border: solid var(--rq-muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.rq-surgeon-picker[open] summary::after { transform: translateY(4px) rotate(225deg); }
.rq-surgeon-label, .rq-cohort > span { font-size: 12px; font-weight: 650; color: var(--rq-muted); }
.rq-surgeon-form { padding: 10px; border-top: 1px solid var(--color-border); }
.rq-surgeon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr));
  gap: 8px;
}
.rq-team { min-width: 0; border: 1px solid var(--color-border); border-radius: 6px; overflow: hidden; }
.rq-team h2 { padding: 8px 10px; background: var(--rq-soft); font-size: 13px; overflow-wrap: anywhere; }
.rq-team ul { list-style: none; }
.rq-team li { border-top: 1px solid var(--color-border); }
.rq-team button {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 0;
  background: var(--color-surface);
  color: var(--rq-text);
  font: 13px/1.4 var(--font-sans);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.rq-team button:hover { background: var(--rq-soft); }
.rq-team button:focus-visible { outline-offset: -2px; }
.rq-team button[aria-current=true] { background: var(--rq-accent); color: var(--rq-blue); font-weight: 650; }
.rq-availability-only { margin-top: 6px; }
.rq-page .form-control { min-width: 0; font-size: 13px; border-color: var(--color-border-strong); background: #fff; }
.rq-note { font-size: 12px; color: var(--rq-muted); line-height: 1.5; }
.rq-deadline {
  border: 1px solid #c9ddf7;
  border-radius: var(--radius);
  padding: 11px 13px;
  margin-bottom: 14px;
  background: var(--rq-accent);
  color: var(--rq-blue);
  font-size: 13px;
}
.rq-deadline.is-closed { border-color: #eed8a9; background: var(--rq-amber-bg); color: var(--rq-amber); }
.rq-mobile-switch { display: none; }
.rq-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(268px, 310px);
  grid-template-areas: 'calendar fields' 'calendar review' 'calendar saved' 'calendar .';
  grid-template-rows: auto auto auto 1fr;
  align-items: start;
  column-gap: 15px;
}
.rq-panel {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
}
.rq-panel h2 { font-size: 16px; line-height: 1.3; }
.rq-fields { grid-area: fields; padding: 15px 15px 12px; border-bottom: 0; border-radius: 10px 10px 0 0; }
.rq-fields h2 { margin-bottom: 12px; }
.rq-type-field { min-width: 0; border: 0; margin: 0 0 12px; padding: 0; }
.rq-type-field legend, .rq-date-fields label { color: var(--rq-text); font-size: 12px; font-weight: 650; }
.rq-types { display: grid; grid-template-columns: 1fr .8fr 1fr; gap: 4px; margin-top: 6px; }
.rq-types label { position: relative; min-width: 0; }
.rq-types input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rq-types span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 37px;
  padding: 4px 1px;
  border: 1px solid var(--color-border-strong);
  border-radius: 6px;
  color: var(--rq-text);
  font-size: 11px;
  text-align: center;
}
.rq-types input:checked + span { background: var(--rq-accent); border-color: var(--rq-accent-border); color: var(--rq-blue); font-weight: 650; }
.rq-types input:focus-visible + span { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.rq-types input:disabled + span { opacity: .55; }
.rq-date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rq-date-fields label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rq-date-fields .form-control { width: 100%; padding-inline: 6px; color: var(--rq-text); }

.rq-calendar { grid-area: calendar; overflow: hidden; }
.rq-calendar-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
}
.rq-month-navigation { display: flex; align-items: center; min-width: 0; gap: 6px; }
.rq-month-navigation input { width: 178px; font-weight: 650; }
.rq-month-navigation .btn { font-size: 22px; min-width: 35px; min-height: 37px; padding: 0 7px; line-height: 1; }
.rq-cohort { display: grid; gap: 4px; min-width: 0; }
.rq-cohort select { width: 100%; max-width: 220px; }
.rq-calendar-hint { font-size: 12px; line-height: 1.5; color: var(--rq-muted); padding: 0 14px 12px; }
.rq-weekdays, .rq-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.rq-weekdays {
  background: var(--rq-soft);
  border-block: 1px solid var(--color-border);
  color: var(--rq-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.rq-weekdays span { padding: 8px 0; }
.rq-month-grid { gap: 1px; background: var(--color-border); }
.rq-day { position: relative; min-height: 77px; background: #fff; min-width: 0; }
.rq-day.is-weekend, .rq-day.is-other-month { background: var(--rq-soft); }
.rq-day.is-other-month { padding: 8px 6px; font-size: 12px; color: var(--rq-muted); }
.rq-day.is-holiday { background: var(--color-holiday); }
.rq-day.is-today time { color: var(--rq-blue); text-decoration: underline; text-underline-offset: 3px; }
.rq-day.is-selected { background: var(--rq-accent); box-shadow: inset 0 0 0 2px var(--rq-accent-border); }
.rq-day.is-auto-draft:not(.is-selected) { box-shadow: inset 0 0 0 1px #d3a44c; }
.rq-select-day {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 7px 5px;
  font: inherit;
  text-align: left;
  display: flex;
  align-items: flex-start;
  color: var(--rq-text);
}
.rq-select-day:disabled { cursor: default; }
.rq-select-day time { font-weight: 700; font-size: 12px; }
.rq-select-day:focus-visible { outline-offset: -2px; z-index: 1; }
.rq-select-day:not(:disabled):hover { background: #2563eb0b; }
.rq-ph { color: var(--rq-amber); font-size: 9px; font-weight: 650; margin-left: 3px; }
.rq-day-count {
  position: absolute;
  top: 5px;
  right: 4px;
  z-index: 2;
  min-width: 30px;
  min-height: 23px;
  border: 0;
  border-radius: 5px;
  padding: 2px 4px;
  color: var(--rq-green);
  background: var(--rq-green-bg);
  font: 650 11px/1.2 var(--font-sans);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.rq-day-count.is-low { color: var(--rq-amber); background: var(--rq-amber-bg); }
.rq-day-count:disabled { color: var(--rq-muted); background: transparent; cursor: default; }
.rq-day-count:not(:disabled):hover { text-decoration: underline; }
.rq-day-mark, .rq-saved-kind {
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
}
.rq-day-mark { position: absolute; top: 33px; inset-inline: 4px; width: fit-content; max-width: calc(100% - 8px); overflow-wrap: anywhere; }
.rq-mark-short { display: none; }
.rq-unavailable { background: #edf0f5; color: #4b5b72; }
.rq-no_call { background: var(--rq-amber-bg); color: var(--rq-amber); }
.rq-study_leave { background: var(--rq-purple-bg); color: var(--rq-purple); }
.rq-automatic, .rq-auto-key { outline: 1px dashed #a27929; outline-offset: -1px; }
.rq-calendar-footer { display: grid; gap: 5px; padding: 10px 14px; border-top: 1px solid var(--color-border); }
.rq-legend { display: flex; flex-wrap: wrap; gap: 6px 13px; font-size: 11px; color: var(--rq-muted); }
.rq-legend span { display: flex; align-items: center; gap: 5px; }
.rq-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
.rq-selected-key { background: var(--rq-accent); border: 1px solid var(--rq-accent-border); }
.rq-load-state { display: flex; align-items: center; gap: 8px; }
.rq-load-state:has(p:empty) { display: none; }
.rq-noscript { padding: 12px 14px; }

.rq-review {
  grid-area: review;
  display: grid;
  gap: 10px;
  padding: 4px 15px 15px;
  border-top: 0;
  border-radius: 0 0 10px 10px;
}
.rq-review-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 25px; font-size: 13px; }
.rq-link { border: 0; padding: 5px 2px; background: transparent; font: 650 12px var(--font-sans); color: var(--rq-blue); cursor: pointer; }
.rq-link:hover { text-decoration: underline; }
.rq-error { color: #9c2727; font-size: 12px; line-height: 1.4; }
.rq-impact { padding: 9px 10px; background: var(--rq-soft); border-radius: 6px; }
.rq-impact h3 { font-size: 12px; margin-bottom: 4px; }
.rq-impact ul, .rq-saved-list { list-style: none; }
.rq-impact li { display: flex; justify-content: space-between; gap: 6px; padding: 3px 0; font-size: 12px; }
.rq-auto-preview { padding: 9px 10px; background: var(--rq-amber-bg); color: var(--rq-amber); border-radius: 6px; font-size: 12px; line-height: 1.4; }
.rq-auto-preview p { margin-top: 3px; }
.rq-submit { width: 100%; justify-content: center; min-height: 40px; }
.rq-page button:disabled:not(.rq-select-day):not(.rq-day-count) { opacity: .55; cursor: default; }
.rq-saved { grid-area: saved; padding: 14px 15px; margin-top: 12px; }
.rq-saved header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.rq-saved-list { display: grid; gap: 4px; margin-bottom: 10px; }
.rq-saved-list label { display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 7px; min-height: 32px; padding: 4px 0; border-bottom: 1px solid var(--color-border); font-size: 12px; cursor: pointer; }
.rq-saved-list input { accent-color: var(--color-primary); }
.rq-saved-kind { white-space: nowrap; }
.rq-availability-dialog {
  margin: auto;
  width: min(490px, calc(100vw - 24px));
  max-height: calc(100dvh - 28px);
  padding: 17px;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  color: var(--rq-text);
}
.rq-availability-dialog::backdrop { background: #12243d66; }
.rq-availability-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.rq-availability-dialog header h2 { font-size: 18px; }
.rq-detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 0; }
.rq-detail-columns section { background: var(--rq-soft); border-radius: 7px; padding: 10px; min-width: 0; }
.rq-detail-columns h3 { margin-bottom: 5px; font-size: 13px; }
.rq-detail-columns ul { list-style: none; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.rq-detail-columns li + li { margin-top: 4px; }
.rq-day-requests { padding-top: 9px; }

@media (max-width: 1150px) {
  body:has(.rq-page) .main-content { padding: 18px 14px; }
  .rq-layout { grid-template-columns: minmax(0, 1fr) 270px; column-gap: 12px; }
  .rq-mark-full { display: none; }
  .rq-mark-short { display: inline; }
}
@media (max-width: 900px) {
  body:has(.rq-page) .desktop-sidebar { display: none; }
  body:has(.rq-page) .mobile-nav { display: flex; position: static; padding: 10px 12px 0; margin-bottom: 0; }
  body:has(.rq-page) .main-content { margin-left: 0; padding: 12px; }
  .rq-page { max-width: 640px; }
  .rq-header { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
  .rq-surgeon-picker:not([open]) { max-width: none; }
  .rq-surgeon-picker summary, .rq-team button, .rq-availability-only { min-height: 44px; }
  .rq-mobile-switch { display: flex; align-items: stretch; gap: 20px; margin-bottom: 11px; border-bottom: 1px solid var(--color-border-strong); }
  .rq-mobile-switch button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 2px; font: 650 14px var(--font-sans); color: var(--rq-muted); cursor: pointer; min-height: 42px; }
  .rq-mobile-switch button[aria-pressed=true] { border-color: var(--rq-blue); color: var(--rq-blue); }
  .rq-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'fields' 'calendar' 'review' 'saved'; grid-template-rows: auto; row-gap: 11px; }
  .rq-fields, .rq-review { border: 1px solid var(--color-border); border-radius: 9px; padding: 12px; }
  .rq-fields h2 { display: none; }
  .rq-fields > .rq-note { margin-bottom: 8px; }
  .rq-types span { min-height: 44px; font-size: 12px; }
  .rq-page .form-control { min-height: 39px; font-size: 16px; }
  .rq-page:not([data-panel=saved]) .rq-saved,
  .rq-page[data-panel=saved] .rq-fields,
  .rq-page[data-panel=saved] .rq-review { display: none; }
  .rq-saved { margin-top: 0; }
  .rq-saved-list label { min-height: 43px; }
  .rq-submit { min-height: 44px; }
}
@media (max-width: 480px) {
  .rq-calendar-toolbar { align-items: stretch; flex-direction: column; gap: 9px; padding: 10px; }
  .rq-month-navigation { justify-content: space-between; gap: 6px; }
  .rq-month-navigation .btn { min-width: 42px; min-height: 42px; }
  .rq-month-navigation input { flex: 1; width: 0; text-align: center; }
  .rq-cohort { grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 7px; }
  .rq-cohort select { max-width: none; }
  .rq-calendar-hint, .rq-calendar-footer { padding-inline: 10px; }
  .rq-day { min-height: 64px; }
  .rq-select-day { padding: 5px 3px; }
  .rq-day-mark { top: 20px; padding: 2px 3px; font-size: 9px; left: 3px; right: 3px; max-width: calc(100% - 6px); }
  .rq-day-count { top: auto; bottom: 3px; left: 3px; right: 3px; min-width: 0; min-height: 23px; padding-inline: 2px; font-size: 11px; }
  .rq-day.is-other-month { padding: 5px 3px; }
}
