/* Editorial Campus: warm paper, ink, terracotta. Semantic status colours remain distinct. */
:root {
  color-scheme: light;
  --bg: #f7f3ec; --panel: #fffcf7; --text: #292721; --muted: #665f55; --line: #ddd3c5;
  --primary: #a64419; --primary-weak: #f9e8d9; --mine: #28604d; --mine-weak: #e8f1e8;
  --danger: #a52e32; --danger-weak: #fbe9e6; --warn: #80520b; --closed: #eee9e1;
  --available: #6b503b; --available-bg: #fff5e7; --available-line: #b89a7e;
  --control-line: #9c8f7e; --reserved-line: #8aa991; --reserved-bg: #e5f1e7;
  --reserved-text: #315b42; --reserved-hover: #d7e8da; --available-hover: #f7e7d1;
  --booking-mine: #8d3a1c; --booking-mine-hover: #713019;
  --lecture-bg: #e9e1d8; --lecture-text: #594737; --lecture-line: #8b7057; --lecture-hover: #ded2c5;
  --radius: 6px; --shadow: none;
  --editorial: Georgia, "Noto Serif KR", "Nanum Myeongjo", "Batang", "AppleMyungjo", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--primary); }
h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; text-decoration: none; color: var(--text); font-size: 1.1rem; }
.nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.nav a { padding: .4rem .7rem; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; }
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--primary-weak); color: var(--primary); }
.userbox { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; }

.view { max-width: 1200px; margin: 0 auto; padding: 1.25rem; outline: none; }
.calendar-status-legend { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 .75rem; }
.calendar-status-legend span { padding: .25rem .65rem; border-radius: 6px; font-size: .85rem; font-weight: 600; }
.calendar-status-legend .available { background: var(--available-bg); color: var(--available); border: 1px solid var(--available-line); }
.calendar-status-legend .reserved { background: var(--reserved-bg); color: var(--reserved-text); border: 1px solid var(--reserved-line); }
.reserved-day-count { display: block; color: var(--primary); font-size: .8rem; }
.daily-title:focus { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 3px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head p { flex-basis: 100%; margin: .25rem 0 0; }
.muted { color: var(--muted); }
.warn { color: var(--warn); font-weight: 600; }
.pre { white-space: pre-wrap; word-break: break-word; }
.empty, .loading { color: var(--muted); padding: 2rem; text-align: center; }
.error-box { background: var(--danger-weak); color: var(--danger); padding: 1rem; border-radius: var(--radius); }
.notice { background: var(--primary-weak); padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.notice.success { background: var(--mine-weak); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem;
  box-shadow: var(--shadow); margin-bottom: 1rem; }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 38px;
  padding: .45rem .9rem; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--control-line); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.small { min-height: 32px; padding: .25rem .6rem; font-size: .85rem; }
.btn.big { min-height: 48px; font-size: 1rem; width: 100%; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: .2rem .3rem; }
.link.danger { color: var(--danger); }

input, select, textarea { font: inherit; color: inherit; padding: .5rem .6rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); width: 100%; min-height: 38px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .6rem; }
.field .label { font-weight: 600; font-size: .9rem; }
.hint { color: var(--muted); font-size: .8rem; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 .75rem; }
.grid-form .wide { grid-column: 1 / -1; }
.inline-form { display: flex; gap: .5rem; margin-bottom: .75rem; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem; }
.check { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.filters, .toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 160px; }
.filters > select { width: auto; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: .3rem 0; border-bottom: 1px dashed var(--line); }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap;
  background: var(--closed); color: var(--muted); }
.badge.booked, .badge.published { background: var(--primary-weak); color: var(--primary); }
.badge.completed, .badge.reviewed { background: var(--mine-weak); color: var(--mine); }
.badge.cancelled, .badge.no_show, .badge.closed { background: var(--danger-weak); color: var(--danger); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
.card { display: flex; flex-direction: column; gap: .35rem; text-align: left; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); font: inherit; }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card .actions, td.actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.card p { margin: 0; }

/* 주간 시간표 */
.week-nav { display: flex; justify-content: space-between; align-items: center; margin: .5rem 0; gap: .5rem; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .85rem; color: var(--text); margin-bottom: .5rem; }
.lg::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.lg.open::before { background: var(--available-bg); border: 2px solid var(--available-line); }
.lg.reserved::before { background: var(--reserved-bg); border: 2px solid var(--reserved-line); }
.lg.lecture::before { background: var(--lecture-bg); border: 1px solid var(--lecture-line); border-left: 4px solid var(--lecture-line); }
.lg.mine::before { background: var(--booking-mine); }
.lg.closed::before { background: var(--closed); border: 1px dashed var(--muted); }
.week-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.week-grid { display: grid; grid-template-columns: 56px repeat(5, minmax(110px, 1fr)); min-width: 606px; position: relative; align-items: stretch; }
.day-head { grid-row: 1; padding: .5rem; text-align: center; border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; font-size: .9rem; }
.corner { grid-row: 1; grid-column: 1; border-bottom: 1px solid var(--line); background: var(--bg); }
.hour { grid-column: 1; font-size: .75rem; color: var(--muted); padding: 0 .3rem; border-top: 1px solid var(--line); }
.cell { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.slot { margin: 1px 3px; border-radius: 6px; border: 0; padding: .2rem .4rem; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; overflow: hidden; font: inherit; font-size: .78rem; z-index: 1; line-height: 1.25; }
.slot.open { background: var(--available-bg); color: var(--available); border: 1px solid var(--available-line); }
.slot.open:hover, .slot.open:focus-visible { background: var(--available-hover); }
.slot.reserved { background: var(--reserved-bg); color: var(--reserved-text); border: 1px solid var(--reserved-line); }
.slot.reserved:hover, .slot.reserved:focus-visible { background: var(--reserved-hover); }
.daily .card.slot.reserved { background: var(--reserved-bg); color: var(--reserved-text); border: 2px solid var(--reserved-line); }
.slot.mine { background: var(--booking-mine); color: #fff; }
.slot.mine:hover, .slot.mine:focus-visible { background: var(--booking-mine-hover); }
.slot.closed { background: var(--closed); color: var(--muted); border: 1px dashed var(--muted); }
.slot.cancelled { background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 6px, var(--closed) 6px, var(--closed) 12px); color: var(--muted); text-decoration: line-through; }
.slot-time { font-weight: 700; }
.slot-meta, .slot-count, .slot-loc { opacity: 1; }
.slot:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }

/* 모바일 일별 */
.day-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; margin-bottom: .75rem; }
.chip { display: flex; flex-direction: column; align-items: center; padding: .4rem 0; border: 1px solid var(--line);
  background: var(--panel); border-radius: 10px; font: inherit; cursor: pointer; position: relative; min-height: 52px; }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip em { position: absolute; top: -4px; right: -2px; font-style: normal; font-size: .7rem; background: var(--mine);
  color: #fff; border-radius: 999px; padding: 0 .35rem; }
.daily-title { margin: .25rem 0 .5rem; }
.daily .card.slot { margin: 0; font-size: .95rem; padding: 1rem; min-height: 72px; gap: .4rem; }
.daily .card.slot.open { border: 2px solid var(--available-line); background: var(--available-bg); }
.daily .card.slot.mine { border: 2px solid var(--booking-mine); }
.daily .card.slot.closed { border: 1px dashed var(--muted); }
.chip em { top: -6px; min-width: 18px; text-align: center; }
.slot-time { font-variant-numeric: tabular-nums; }
.week-wrap { scrollbar-gutter: stable; }

/* 모바일 일간 시간표: 목록형 카드와 같은 데이터/클릭 동작 공유 */
.mobile-view-toggle { display: flex; gap: .5rem; margin: .6rem 0 .85rem; }
.mobile-view-toggle .btn { flex: 1; min-height: 44px; }
.day-timeline { position: relative; margin: .5rem 0 1rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.day-timeline-hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line);
  height: 1px; pointer-events: none; }
.day-timeline-hour span { display: inline-block; position: absolute; top: -10px; left: 6px;
  font-size: .73rem; color: var(--muted); font-variant-numeric: tabular-nums;
  background: var(--panel); padding-right: 4px; }
.day-timeline-slot { position: absolute; left: 62px; right: 8px; width: calc(100% - 70px);
  margin: 0; min-height: 44px; overflow: hidden; border-radius: 8px; padding: .3rem .55rem;
  text-align: left; font: inherit; font-size: .82rem; line-height: 1.2; cursor: pointer;
  display: flex; flex-direction: column; gap: .1rem; z-index: 1; }
.day-timeline-slot:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.day-timeline-slot.slot.open { border: 2px solid var(--available-line); }
.day-timeline-slot.slot.reserved { border: 2px solid var(--reserved-line); }
.day-timeline-slot.slot.mine { border: 2px solid var(--booking-mine); }
.day-timeline-slot .slot-meta { font-size: .73rem; white-space: nowrap;
  text-overflow: ellipsis; overflow: hidden; }

/* 테이블 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); }
.table th, .table td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .9rem; }
.table th { background: var(--bg); font-weight: 700; }
.table select { min-width: 110px; }
.action-more summary { list-style: none; cursor: pointer; }
.action-more summary::-webkit-details-marker { display: none; }
.action-more-panel { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.action-more-panel .btn { white-space: nowrap; }
code { font-size: .78rem; word-break: break-all; }

/* 교수자·관리자 상담 통합 정보 페이지 */
.insight-section { margin-bottom: 1.6rem; }
.insight-section-head { display: flex; justify-content: space-between; align-items: center;
  gap: .8rem; flex-wrap: wrap; margin: 0 0 .8rem; }
.insight-section-head h2 { margin: 0; }
.insight-period { display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .87rem; }
.insight-period select { width: auto; min-width: 128px; }
.insight-overview > .muted { font-size: .85rem; margin: .25rem 0 .8rem; }
.insight-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem; margin-bottom: 1rem; }
.insight-metric { display: flex; flex-direction: column; gap: .3rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem; min-height: 108px; box-shadow: var(--shadow); }
.insight-metric .insight-number { font-size: 1.7rem; font-weight: 800;
  line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.insight-breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; }
.insight-breakdowns .panel { margin: 0; }
.insight-breakdown-item { display: flex; justify-content: space-between; gap: .6rem; }
.insight-search { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 1rem; }
.insight-search input { flex: 1; min-width: min(220px, 100%); }
.insight-search button { min-height: 44px; }
.consult-note-list { display: grid; gap: .8rem; }
.consult-note-card { margin: 0; min-width: 0; }
.consult-note-card .muted { font-size: .86rem; margin: .35rem 0; }
.consult-note-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.consult-note-text { line-height: 1.65; word-break: break-word; white-space: pre-wrap;
  padding: .75rem; margin: .65rem 0; background: var(--bg); border-radius: 8px;
  border: 1px solid var(--line); max-height: 280px; overflow: auto; }
.insight-pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin: 1rem 0; }
@media (max-width: 720px) {
  .insight-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .insight-metric { padding: .8rem; min-height: 96px; }
  .insight-metric .insight-number { font-size: 1.45rem; }
  .insight-search { gap: .4rem; }
  .insight-search input { flex-basis: 100%; }
}

/* 설문 */
.title-input { font-size: 1.3rem; font-weight: 700; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; margin-bottom: .5rem; }
.questions { display: flex; flex-direction: column; gap: .75rem; }
.q-card { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--primary);
  border-radius: var(--radius); padding: 1rem; margin: 0 0 .75rem; }
.q-card legend { font-weight: 700; padding: 0 .25rem; }
.q-row { display: grid; grid-template-columns: 1fr 160px; gap: .5rem; }
.q-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.options { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.opt { display: flex; align-items: center; gap: .4rem; }
.dot { color: var(--muted); }
.add-q { align-self: flex-start; }
.choices { display: flex; flex-direction: column; gap: .4rem; }
.scale { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.scale-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.req { color: var(--danger); }
.preview-banner { background: #fff6e0; color: var(--warn); padding: .5rem 1rem; border-radius: var(--radius); margin-bottom: .75rem; font-weight: 600; }
.bars { display: flex; flex-direction: column; gap: .35rem; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 160px) 1fr 40px; gap: .5rem; align-items: center; }
.bar { background: var(--closed); height: 14px; border-radius: 7px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--primary); border-radius: 7px; }
.bar-n { text-align: right; font-weight: 700; }
.texts { padding-left: 1.2rem; margin: 0; }
.texts li { padding: .2rem 0; }
.themes .quote { color: var(--muted); }
.stats { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .3rem .7rem; display: flex; gap: .4rem; }

/* 모달·토스트 */
.backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem; }
.modal { background: var(--panel); border-radius: 14px; padding: 1.25rem; width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.modal-actions .btn:disabled { opacity: .5; cursor: progress; }
.mobile-tabs { display: none; }
.calendar-toggle { display: flex; gap: .45rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.calendar-toggle .btn[aria-pressed="true"] { background: var(--primary-weak); border-color: var(--primary); color: var(--primary); }
.booking-detail { display: grid; gap: .65rem; }
.toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 60; }
.toast { background: var(--text); color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; }
.toast-success { background: var(--mine); }
.toast-error { background: var(--danger); }

.login-box { max-width: 420px; margin: 4rem auto; text-align: center; display: flex; flex-direction: column; gap: .75rem; }
.dev-login { text-align: left; border-top: 1px dashed var(--line); padding-top: .75rem; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .topbar { flex-wrap: wrap; padding: .5rem .9rem; }
  .nav { display: none; order: 3; flex-basis: 100%; flex-direction: column; }
  .topbar:has(.nav.open) { max-height: calc(100dvh - 76px); overflow-y: auto; }
  .nav.open { display: flex; }
  .nav a { padding: .7rem; }
  .userbox { display: none; }
  .nav.open ~ .userbox { display: flex; order: 4; flex-basis: 100%; justify-content: space-between; }
  .topbar { min-height: 52px; }
  .view { padding-bottom: 88px; }
  .mobile-tabs { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    min-height: 66px; background: var(--panel); border-top: 1px solid var(--line); padding: .25rem .4rem max(.25rem, env(safe-area-inset-bottom)); }
  .mobile-tabs a, .mobile-tabs button { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center;
    align-items: center; gap: .1rem; min-height: 46px; border: 0; border-radius: 8px; background: transparent;
    font: inherit; color: var(--muted); text-decoration: none; font-size: .78rem; cursor: pointer; }
  .mobile-tabs a.active { color: var(--primary); background: var(--primary-weak); font-weight: 700; }
  .mobile-tabs a:focus-visible, .mobile-tabs button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
  .inline-form input[type="date"] { flex: 0 0 auto; }
  .page-head { gap: .35rem; }
  .mobile-tab-icon { font-size: 1.25rem; line-height: 1.15; }
  .inline-form input[type="date"] { flex: 0 0 auto !important; min-height: 42px; height: auto; }
  .view { padding: .9rem .9rem 88px; }
  .split { grid-template-columns: 1fr; }
  .q-row { grid-template-columns: 1fr; }
  .inline-form { flex-direction: column; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 2px solid var(--line); padding: .4rem 0; }
  .table td { border: 0; padding: .3rem .7rem; }
  .table td::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); font-weight: 700; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; }
  .toasts { left: 1rem; right: 1rem; }
  .week-nav strong { font-size: .9rem; text-align: center; }
  .week-nav .btn { white-space: nowrap; padding: .4rem .6rem; }
  .grid-form { grid-template-columns: 1fr 1fr; }
}
.inline-form input[type="date"] { flex: 0 0 170px; }
.inline-form button { white-space: nowrap; flex: 0 0 auto; }

/* Help stays out of the primary navigation on desktop. */
.nav .mobile-help-link { display: none; }
.desktop-help-link, .brand { white-space: nowrap; }
.support-guide, .support-list { margin-top: 1rem; }
.support-list { margin-bottom: 1rem; }
.support-title { overflow-wrap: anywhere; }
.support-thread { max-width: 900px; }
@media (min-width: 721px) and (max-width: 1200px) { .userbox .who { display: none; } }
@media (max-width: 720px) {
  .nav .mobile-help-link { display: block; }
  .userbox .desktop-help-link { display: none; }
}
.support-count[hidden] { display: none; }
/* Representative booking notice: plain text, readable on narrow screens. */
.announcement-panel { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.announcement-head { display: flex; flex-wrap: wrap; gap: 6px; font-size: .875rem; align-items: center; }
.announcement-head .btn { margin-left: auto; }
.announcement-panel h2 { font: inherit; font-weight: 600; margin: 4px 0; }
.announcement-body { white-space: pre-wrap; line-height: 1.5; font-size: .875rem; margin: 4px 0 0; }
.announcement-body.is-collapsed { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.announcement-panel > p.muted { font-size: .875rem; margin: 4px 0; }
.announcement-toggle { min-height: 44px; margin-top: 2px; padding: 4px 0; font-size: .875rem; text-decoration: underline; text-underline-offset: .2em; }
.booking-guide { margin: 0 0 16px; color: var(--muted); }
.booking-guide summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.booking-guide p { line-height: 1.6; }
.survey-qr { text-align: center; }
.survey-qr img { display: block; width: min(100%, 280px); height: auto; margin: 12px auto; background: white; }
.survey-share-url { display: block; overflow-wrap: anywhere; margin-top: 12px; }
.scale-choices label { min-height: 44px; }
.questions .add-q { scroll-margin-bottom: 100px; }
#mobile-tabs[hidden] { display: none; }
.survey-settings .field { min-width: 0; }
.survey-settings input, .survey-settings select { min-width: 0; max-width: 100%; }
@media (max-width: 720px) { .survey-settings .grid-form { grid-template-columns: minmax(0, 1fr); } }

/* Distinct navigation shapes and an availability summary above the notice. */
#nav > a:not(.mobile-help-link) { display: inline-flex; align-items: center; gap: 6px; }
.nav-icon { flex: 0 0 auto; vertical-align: middle; }
.available-days { padding: 10px 12px; margin: 8px 0; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); }
.available-days h2 { font: inherit; font-size: .875rem; font-weight: 600; margin: 0 0 6px; }
.available-days > p { font-size: .875rem; margin: 4px 0; }
.available-day-buttons { display: flex; flex-wrap: nowrap; gap: 6px; margin-bottom: 0; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.available-day-buttons .btn { flex: 0 0 auto; white-space: nowrap; text-align: left; font-size: .8125rem; padding: 4px 8px; min-height: 44px; background: var(--bg); }
.available-days > .btn { margin-top: 6px; min-height: 44px; }
#slot-create-panel .notice { margin: 10px 0 0; overflow-wrap: anywhere; }
#slot-create-panel [hidden] { display: none !important; }

.schedule-preview{width:100%;min-width:0}
.preview-month{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;text-align:center;margin:12px 0}
.preview-month button{min-width:0;min-height:48px;padding:4px 0;border:1px solid var(--control-line);border-radius:8px;background:#fff;color:var(--text)}
.preview-month button strong,.preview-month button small{display:block}
.preview-month button[aria-pressed="true"]{background:var(--primary-weak);border:2px solid var(--primary);color:var(--primary)}
.preview-month button:disabled{color:var(--muted);background:var(--closed);border-color:transparent}
.preview-times{max-height:220px;overflow:auto;border-top:1px solid var(--line);padding-top:8px}
.notification-summary{font-size:.9rem}.notification-summary>div{margin:8px 0}.notification-summary small{display:block}
.week-grid{scroll-margin-top:80px}

.schedule-preview-body>p{margin:6px 0}.schedule-preview-body .row{justify-content:space-between}.schedule-preview-body h3{margin:6px 0}
.staff-today .actions { display: flex; flex-wrap: wrap; gap: 8px; }

.mobile-bookings > details > summary { cursor: pointer; padding: .4rem 0; overflow-wrap: anywhere; }
.mobile-bookings > details > summary > span { display: block; margin-top: .25rem; }

/* Shared desktop/mobile inbox entry. More stays in the mobile bottom navigation. */
.inbox-header { position: relative; flex-shrink: 0; }
.inbox-bell { position: relative; min-height: 44px; white-space: nowrap; }
.inbox-badge { background: var(--danger); color: white; border-radius: 1rem; padding: .1rem .4rem; font-size: .75rem; }
.inbox-popover { position: absolute; right: 0; top: calc(100% + .5rem); width: min(390px, calc(100vw - 24px));
  max-height: calc(100dvh - 160px); overflow-y: auto; padding: 1rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 25px #0002; color: var(--text); }
.inbox-popover[hidden], .inbox-badge[hidden] { display: none; }
.inbox-popover-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.inbox-popover-head h2 { margin: 0; }
.inbox-preview { border-top: 1px solid var(--line); padding: .8rem 0; overflow-wrap: anywhere; }
.inbox-preview p { margin: .35rem 0; }
.inbox-preview .actions { margin-top: .5rem; }
@media (max-width: 720px) {
  .inbox-header { margin-left: auto; order: 1; }
  .inbox-popover { position: fixed; right: 12px; top: 62px; }
}

.inbox-more[hidden] { display: none; }

/* Readability polish: retain existing brand and semantic status colours. */
.login-box { gap: 16px; }
.login-box > p { margin: 0; }
.login-box > .actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.suggestion-writer { max-width: 740px; margin: 0 auto; }
.privacy-summary { font-size: .95rem; line-height: 1.65; margin: 0 0 12px; }
.help-details { margin: 0 0 16px; color: var(--muted); font-size: .9rem; }
.help-details > summary { cursor: pointer; padding: 8px 0; color: var(--text); }
.help-details > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.help-details p { margin: 8px 0; line-height: 1.65; }
.writer-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.inbox-intro { margin: 8px 0 12px; color: var(--muted); }
.inbox-item-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.inbox-item-heading h2, .inbox-item-heading h3 { margin: 0; overflow-wrap: anywhere; }
.inbox-read-state { flex-shrink: 0; color: var(--muted); font-size: .8rem; }
.is-unread .inbox-read-state { color: var(--primary); font-weight: 600; }
.is-unread .inbox-read-state::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.is-read .inbox-item-heading h2, .is-read .inbox-item-heading h3 { font-weight: 400; }
.suggestion-meta { color: var(--muted); font-size: .85rem; }
.inbox-item > .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.inbox-item small, .inbox-preview small { font-variant-numeric: tabular-nums; }

.trash-selection { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.trash-selection-label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.trash-selection-label input { width: 18px; height: 18px; flex-shrink: 0; }

/* Layout and typography are shared by every role and public entry point. */
body { line-height: 1.65; font-size: 16px; }
h1, h2, h3, .brand, .week-nav strong { font-family: var(--editorial); }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.65rem); line-height: 1.25; letter-spacing: -.035em; margin: 0 0 .6rem; text-wrap: balance; }
h2 { font-size: 1.3rem; line-height: 1.4; }
h3 { font-size: 1.1rem; }
a { text-underline-offset: .2em; }
.topbar { padding: 1rem max(1.25rem, calc((100vw - 1360px) / 2)); gap: 1.3rem; background: var(--bg); border-bottom-color: #9c8f7e; flex-wrap: wrap; }
.brand { font-size: 1.85rem; letter-spacing: -.055em; line-height: 1.2; }
.nav { gap: .2rem; align-items: center; }
.nav a { border-radius: 0; padding: .65rem .55rem; border-bottom: 2px solid transparent; font-size: .95rem; color: var(--text); }
.nav a.active { color: var(--primary); background: transparent; border-bottom-color: var(--primary); }
.nav a:hover { color: var(--primary); background: var(--primary-weak); }
.userbox { gap: .7rem; }
.userbox .btn { background: transparent; }
.view { max-width: 1320px; padding: 2.4rem 1.5rem 4rem; }
.page-head { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1.3rem; gap: .7rem 1.5rem; }
.page-head h1 { margin: 0; }
.page-head + .muted { margin-top: -.45rem; margin-bottom: 1.7rem; }
.panel { padding: 1.5rem; border-radius: 5px; margin-bottom: 1.3rem; }
.panel > h2 { padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.card { padding: 1.15rem; gap: .55rem; min-width: 0; }
.cards { gap: 1rem; }
.btn { border-radius: 5px; min-height: 44px; border-color: #9c8f7e; padding: .5rem 1rem; }
.btn:hover { border-color: var(--primary); background: var(--primary-weak); }
.btn.primary:hover { background: #873615; color: #fff; }
.btn.danger { border-color: #b15d59; }
.btn.danger:hover { background: var(--danger-weak); }
.btn.small { min-height: 38px; }
input, select, textarea { min-height: 44px; background: var(--panel); border-color: #9c8f7e; border-radius: 5px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
textarea { line-height: 1.75; }
.field { gap: .35rem; margin-bottom: .85rem; min-width: 0; }
.field .label { font-size: .95rem; }
.hint { font-size: .85rem; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.notice { border-left: 3px solid var(--primary); border-radius: 3px; }
.notice.success { border-left-color: var(--mine); }
.week-nav { margin: 1.5rem 0 1rem; }
.week-nav strong { font-size: clamp(1rem, 2vw, 1.6rem); }
.week-wrap { border-radius: 0; background: var(--panel); }
.day-head { padding: .7rem .35rem; font-weight: 600; }
.hour { font-size: .8rem; }
.slot { border-radius: 4px; }
.slot.reserved, .daily .card.slot.reserved { background: var(--reserved-bg); color: var(--reserved-text); border-color: var(--reserved-line); }
.slot.reserved:hover, .slot.reserved:focus-visible { background: var(--reserved-hover); }
.slot.open { color: var(--available); }
.daily .card.slot { border-width: 1px; border-left-width: 4px; }
.chip { border-radius: 5px; min-height: 62px; background: var(--panel); }
.chip strong { font-family: var(--editorial); font-size: 1.2rem; }
.daily-title { border-left: 3px solid var(--primary); padding-left: .65rem; margin: 1rem 0; }
.table { border-radius: 4px; }
.table th { background: var(--closed); color: var(--text); padding: .8rem; }
.table td { padding: .9rem .8rem; line-height: 1.6; }
.insight-metric { border-radius: 5px; border-top: 3px solid var(--primary); }
.insight-number { font-family: var(--editorial); }
.inbox-item.is-unread { border-left: 3px solid var(--primary); }
.inbox-item.is-read { background: var(--bg); }
.inbox-popover { border-radius: 6px; box-shadow: 0 8px 24px #30251a18; }
.modal { border-radius: 8px; padding: 1.6rem; border: 1px solid var(--line); }
.backdrop { background: #27231e80; }
.login-box { margin: 5rem auto; max-width: 460px; border-top: 3px solid var(--primary); padding-top: 2rem; }
.login-box h1 { font-size: 2.4rem; }
.title-input { background: transparent; }
.q-card { border-radius: 5px; }
.booking-guide { color: var(--muted); }
.announcement-panel, .available-days { border-radius: 5px; }
.preview-month button { background: var(--panel); color: var(--text); border-color: #9c8f7e; }
.preview-month button[aria-pressed="true"] { background: var(--primary-weak); color: var(--primary); border-color: var(--primary); }
.day-timeline, .day-timeline-hour span { background: var(--panel); }
.day-timeline-hour { border-color: var(--line); }
.skip-link { position: fixed; left: 1rem; top: -80px; z-index: 100; padding: .6rem 1rem; background: var(--panel); color: var(--primary); }
.skip-link:focus { top: .5rem; }
@media (max-width: 1100px) and (min-width: 721px) {
  .nav { order: 4; flex-basis: 100%; }
  .userbox { margin-left: auto; }
}
@media (max-width: 720px) {
  .topbar { padding: .85rem 1rem; gap: .5rem; }
  .brand { font-size: 1.65rem; }
  .view { padding: 1.5rem 1rem 100px; }
  .page-head { padding-bottom: .85rem; }
  h1 { font-size: 1.9rem; }
  .page-head > .btn.primary { width: 100%; margin-top: .6rem; }
  .panel { padding: 1rem; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .filters .field { min-width: 0; flex: 1 1 140px; }
  .week-nav { margin-top: 1.25rem; }
  .week-nav strong { font-size: 1rem; }
  .mobile-tabs { background: var(--panel); border-top-color: #9c8f7e; }
  .mobile-tabs a, .mobile-tabs button { color: var(--muted); border-radius: 4px; }
  .mobile-tabs a.active { color: var(--primary); background: var(--primary-weak); }
  .btn.small { min-height: 44px; }
  .toasts { bottom: 88px; }
  .modal { padding: 1.2rem; }
  .login-box { margin: 2rem auto; }
  .nav a { padding: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Lectures are staff calendar events, not bookable slots. */
.slot.lecture { background: var(--lecture-bg); color: var(--lecture-text); border: 1px solid var(--lecture-line); border-inline-start: 4px solid var(--lecture-line); }

/* Mobile timetable: editorial week overview and readable daily lists, shared details. */
@media (max-width: 720px) {
  .mobile-calendar { min-width: 0; max-width: 100%; }
  .calendar-view-switch { gap: .3rem; padding: .25rem; background: var(--closed); border-radius: 7px; }
  .calendar-view-switch .btn { min-width: 0; min-height: 44px; padding: .5rem; }
  .calendar-help { margin: .5rem 0; line-height: 1.6; }
  .mobile-grid-wrap { max-width: 100%; max-height: 64vh; max-height: 64dvh; overflow: auto;
    border-radius: 6px; scrollbar-gutter: auto; overscroll-behavior-x: contain; overscroll-behavior-y: auto; }
  .mobile-grid-wrap .week-grid { min-width: 0; width: 100%; }
  .mobile-grid-wrap .day-head { top: 0; z-index: 4; padding: .55rem .1rem; font-size: .65rem;
    overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: .2rem; }
  .mobile-grid-wrap .day-head strong { font-size: .8rem; }
  .mobile-grid-wrap .day-head.is-today { color: var(--primary); box-shadow: inset 0 -3px var(--primary); }
  .mobile-grid-wrap .corner { position: sticky; top: 0; left: 0; z-index: 5; }
  .mobile-grid-wrap .hour { position: sticky; left: 0; z-index: 3; background: var(--panel); font-size: .6rem; padding: .2rem .1rem; }
  .mobile-grid-wrap .slot { min-width: 0; min-height: 0; margin-left: 1px; margin-right: 1px; padding: .15rem .1rem; font-size: .6rem; border-radius: 3px; }
  .mobile-grid-wrap .slot-time { font-size: .55rem; overflow-wrap: anywhere; }
  .mobile-grid-wrap .slot-meta { overflow-wrap: anywhere; }
  .mobile-grid-wrap .slot:focus-visible { z-index: 6; }
  .mobile-grid-wrap .reserved-day-count { font-size: .55rem; }
}

@media (max-width: 720px) {
  .calendar-grid-title { font-size: .9rem; margin: .65rem 0; }
  .calendar-support { margin: .6rem 0; border-bottom: 1px solid var(--line); }
  .calendar-support > summary { cursor: pointer; min-height: 44px; padding: .6rem .2rem; color: var(--muted); }
  .calendar-support[open] > summary { color: var(--primary); }
  .view { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    padding-left: max(1rem, env(safe-area-inset-left, 0px)); padding-right: max(1rem, env(safe-area-inset-right, 0px)); }
  .topbar { padding-top: calc(.85rem + env(safe-area-inset-top, 0px));
    padding-left: max(1rem, env(safe-area-inset-left, 0px)); padding-right: max(1rem, env(safe-area-inset-right, 0px)); }
  .mobile-tabs { padding-left: max(.4rem, env(safe-area-inset-left, 0px));
    padding-right: max(.4rem, env(safe-area-inset-right, 0px)); }
}

@media (max-width: 720px) {
  .mobile-grid-wrap .slot.open { background: var(--available-bg); color: var(--available); border: 1px solid var(--available-line); }
  .mobile-grid-wrap .slot.open:hover, .mobile-grid-wrap .slot.open:focus-visible { background: var(--available-hover); }
  .mobile-grid-wrap .slot.lecture { background: var(--lecture-bg); color: var(--lecture-text); border-color: var(--lecture-line); }
}

/* Horizontal week gestures do not consume vertical scroll or pinch zoom. */
.week-swipe { position: relative; touch-action: pan-y pinch-zoom; }
.week-swipe > .week-grid { z-index: 1; background: var(--panel); }
.week-swipe-hint { position: absolute; z-index: 0; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 0;
  box-sizing: border-box; overflow: hidden; color: var(--muted); background: var(--bg);
  pointer-events: none; user-select: none; text-align: center; }
.week-swipe-hint[hidden] { display: none; }
.week-swipe-hint[data-direction="previous"] { left: 0; }
.week-swipe-hint[data-direction="next"] { right: 0; }
.week-swipe-arrow { font-size: 24px; line-height: 1; }
.week-swipe-label { font-size: 11px; white-space: nowrap; }
.week-swipe-hint.is-narrow .week-swipe-label { display: none; }
.week-swipe-hint[data-ready="true"] { color: var(--primary); background: var(--primary-weak); font-weight: 700; }
.week-swipe-hint.is-reduced { z-index: 7; border: 1px solid var(--line); border-radius: 5px; }
.week-swipe > .week-grid { will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  .week-swipe > .week-grid { transition: none !important; transform: none !important; will-change: auto; }
}

/* Empty timetable hit areas retain grid sizing; event cards paint above them. */
.week-grid button.calendar-time-cell { padding: 0; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; background: transparent; min-width: 0; cursor: pointer; }
.week-grid button.calendar-time-cell:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }

/* Compact staff navigation: every existing destination remains available. */
.nav { flex-wrap: nowrap; }
.nav-group { position: relative; }
.nav-group summary { cursor: pointer; white-space: nowrap; padding: .65rem .55rem; border-bottom: 2px solid transparent; font-weight: 600; }
.nav-group summary.active { color: var(--primary); border-bottom-color: var(--primary); }
.nav-group summary:hover { background: var(--primary-weak); }
.nav-group-links { position: absolute; top: 100%; left: 0; min-width: 180px; padding: .4rem; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 8px 18px #29272118; }
.nav-group-links a { display: flex; gap: .5rem; align-items: center; white-space: nowrap; }
.nav > a { white-space: nowrap; }
.activity-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.activity-table th, .activity-table td { text-align: left; padding: .8rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.activity-table th { color: var(--muted); font-size: .85rem; }
.activity-table th:nth-child(1) { width: 19%; }
.activity-table th:nth-child(2) { width: 14%; }
.activity-table th:nth-child(3) { width: 23%; }
.activity-table th:nth-child(4) { width: 25%; }
.activity-table th:nth-child(5) { width: 19%; }
.activity-details summary { cursor: pointer; color: var(--primary); }
.activity-details p { margin: .4rem 0; }
@media (max-width: 720px) {
  .nav { align-items: stretch; }
  .nav-group-links { position: static; box-shadow: none; margin: 0 .5rem .5rem; }
  .activity-table, .activity-table tbody, .activity-table tr, .activity-table td { display: block; width: 100%; }
  .activity-table thead { display: none; }
  .activity-table tr { border: 1px solid var(--line); margin-bottom: .8rem; padding: .5rem; border-radius: 6px; }
  .activity-table td { border: 0; padding: .25rem; }
  .activity-table td::before { content: attr(data-label) " · "; color: var(--muted); font-size: .85rem; }
  .activity-table td:last-child::before { content: none; }
}

.mobile-menu-account { display: none; }
/* Compact controls retain full names for assistive technology. */
.available-day-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
.available-day-buttons .btn { min-width: 0; white-space: normal; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.available-day-buttons .btn small { color: var(--muted); }
.week-nav strong { text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .week-nav { gap: 6px; margin: 8px 0; }
  .week-nav .btn { min-height: 44px; padding: 6px 10px; }
  .week-nav strong { font-size: 1rem; }
  .topbar:has(.nav.open) { max-height: none; overflow: visible; }
  .nav.open { position: fixed; top: auto; bottom: calc(var(--mobile-tabs-height, 76px) + 8px); left: 12px; right: 12px; max-height: 60dvh; overflow-y: auto; overscroll-behavior: contain; z-index: 45; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; box-shadow: 0 -8px 24px #29272120; }
  .nav.open ~ .userbox { display: none; }
  .mobile-menu-account { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; border-top: 1px solid var(--line); }
  .available-day-buttons .btn { font-size: .75rem; padding: 6px; }
}
@media (max-width: 350px) { .available-day-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Notification rows are single keyboard-accessible links, never nested controls. */
.inbox-row-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
.inbox-row-link:hover, .inbox-row-link:focus-visible { outline: 2px solid var(--accent, #a85f45); outline-offset: 2px; }
.notification-target { outline: 2px solid #a85f45; outline-offset: 3px; background: #fbf2e9; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { .notification-target { animation: none !important; transition: none !important; } }

@media (max-width: 720px) {
  .week-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 4px; }
  .week-nav .btn { padding: 6px; font-size: .8125rem; }
  .week-nav strong { min-width: 0; overflow-wrap: anywhere; font-size: .875rem; }
}

.available-day-buttons .btn { line-height: 1.3; }
.available-day-buttons .btn > span { white-space: nowrap; }

/* Clip translated week layers, preserving native vertical scrolling. */
.week-swipe { overflow-x: clip; }
.week-slide-outgoing { user-select: none; }
@media (prefers-reduced-motion: reduce) { .week-slide-outgoing { display: none; } }

/* Legacy weekend records remain reachable without reintroducing weekend columns. */
.legacy-weekend-events { margin-top: 1rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; }
.legacy-weekend-event { display: block; width: 100%; text-align: left; margin-top: .5rem; white-space: normal; }

/* Screen-reader text must never spill into the visible notification summary. */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important;
  white-space: nowrap !important; border: 0 !important; }
.inbox-row-link .inbox-item-heading { align-items: baseline; gap: .65rem; }
.inbox-row-link .inbox-item-heading h3 { font-family: inherit; font-size: 1rem; line-height: 1.5;
  margin: 0; min-width: 0; overflow-wrap: anywhere; }
.inbox-row-link.is-read h3 { font-weight: 500; }
.inbox-arrival { flex-shrink: 0; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.inbox-summary { margin: .35rem 0 0; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.inbox-unread-dot { display: inline-block; width: .45rem; height: .45rem; border-radius: 50%;
  background: var(--primary); margin-right: .45rem; vertical-align: middle; }
.inbox-row-link { min-height: 44px; }
.notification-booking-summary p { margin: .75rem 0; }
.booking-summary-person { font-size: 1.05rem; }
@media(max-width: 480px) {
  .inbox-row-link .inbox-item-heading { flex-wrap: wrap; gap: .2rem .65rem; }
  .inbox-arrival { margin-left: auto; }
  .inbox-popover .inbox-preview { padding-block: .8rem; }
}

/* Keep compact event text readable without changing the time-axis geometry. */
.slot.lecture:hover, .slot.lecture:focus-visible { background: var(--lecture-hover); }
@media (max-width: 720px) {
  .mobile-grid-wrap .slot-meta { font-size: .6875rem; line-height: 1.25; flex-shrink: 0;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .mobile-grid-wrap .slot-time { font-size: .625rem; line-height: 1.2; flex-shrink: 0; }
  .mobile-grid-wrap .slot.lecture:hover, .mobile-grid-wrap .slot.lecture:focus-visible { background: var(--lecture-hover); }
}

/* Short mobile consultations reserve a full line for the attendee name. */
@media (max-width: 720px) {
  .mobile-grid-wrap .slot.compact-short { padding-block: 0; }
  .mobile-grid-wrap .compact-short .slot-time { white-space: nowrap; }
  .mobile-grid-wrap .compact-short .slot-time-end { display: none; }
  .mobile-grid-wrap .compact-short .slot-meta { display: block; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 720px) {
  .mobile-grid-wrap .compact-tiny .slot-time { display: none; }
  .mobile-grid-wrap .slot.compact-tiny { justify-content: center; }
}

/* Keep reservation actions reachable while the detail body scrolls on phones. */
.modal:has(.booking-detail) { display: flex; flex-direction: column; overflow: hidden; }
.modal:has(.booking-detail) > h2,
.modal:has(.booking-detail) > .modal-actions { flex-shrink: 0; }
.modal:has(.booking-detail) > .modal-body { min-height: 0; overflow-y: auto; }
.booking-detail p { margin: .35rem 0; }

/* 2026-11-23 UX priority pass: calendar first, readable slots, one registration path. */
.slot-meta { word-break: keep-all; overflow-wrap: anywhere; }
@media (min-width: 721px) {
  /* 30-minute cards are 34px tall on PC: keep time and label on one line when they fit. */
  .week-grid .slot.compact-short { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: .35rem;
    padding-block: .1rem; line-height: 1.15; }
  .available-day-buttons { grid-template-columns: repeat(auto-fill, minmax(120px, 168px)); }
}
.calendar-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; margin: .5rem 0; }
.calendar-tools .legend { margin-bottom: 0; }
.slots-head .head-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.notice.booking-active { padding: .55rem .85rem; line-height: 1.5; }
.notice.booking-active a { white-space: nowrap; font-weight: 600; }
.refresh-status[hidden] { display: none; }
@media (max-width: 720px) {
  .slots-head { margin-bottom: .5rem; }
  .slots-head .head-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .slots-head .head-actions .btn { min-height: 44px; justify-content: center; text-align: center; }
  .notice.booking-active { margin-bottom: .6rem; font-size: .9rem; }
  .calendar-help { margin: .35rem 0; font-size: .8rem; line-height: 1.45; }
}
/* Staff menu groups are dropdowns, not collapsible sections: chevron after the label. */
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: "▾"; display: inline-block; margin-left: .3rem; font-size: .8em; color: var(--muted); transition: transform .15s; }
.nav-group[open] > summary::after { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .nav-group > summary::after { transition: none; } }
/* Admin: readable audit rows and account search. */
.audit-table .audit-actor { white-space: nowrap; min-width: 6.5rem; }
.audit-table .audit-code { display: block; font-size: .72rem; }
.user-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.user-filters input[type="search"] { flex: 1 1 240px; max-width: 360px; }
tr[hidden] { display: none; }
.support-operator { margin-top: 1.5rem; border-style: dashed; }
.survey-summary { color: var(--text); font-size: .9rem; }
.suggestion-counts { font-size: .85rem; margin: .25rem 0 .75rem; }
.personal-alert-form { display: grid; gap: .75rem; max-width: 560px; }
.personal-alert-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem .4rem; margin: 0; display: grid; gap: .45rem; }
.personal-alert-form legend { font-weight: 700; padding: 0 .3rem; }
.personal-alert-form label { display: flex; gap: .4rem; align-items: center; min-height: 32px; }
.personal-alert-form .field { margin: 0; max-width: 220px; }
.personal-alert-form .hint { margin: 0; }

/* Keep frequent staff navigation compact and destructive account actions apart. */
.staff-today .page-head { margin-bottom: .5rem; gap: .5rem; }
.staff-today .page-head h2 { margin: 0; }
.staff-today .hint { margin: .35rem 0 .5rem; }
.user-state-actions .btn + .btn { margin-left: .5rem; }
.day-count-hint { margin: 0 0 .35rem; }
@media (max-width: 720px) {
  .staff-today { padding: .75rem; }
  .staff-today .page-head { flex-wrap: nowrap; }
  .staff-today .page-head h2 { font-size: 1rem; border: 0; padding: 0; }
  .staff-today .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
  .staff-today .actions .btn { min-height: 44px; padding: .4rem .2rem; font-size: .8rem; }
}

@media (max-width: 720px) {
  .user-table td { padding: .4rem .7rem; }
  .user-table td:nth-child(2) { overflow-wrap: anywhere; }
  .user-table .btn { min-height: 44px; }
}

/* Mobile content-first layout: preserve touch targets, reduce surrounding chrome. */
.staff-today-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.staff-today-summary > button { margin-left: auto; }
.inbox-read-all { margin-left: auto; }
.personal-alert-form .field { align-items: stretch; text-align: left; }
.slot-select { color: var(--primary); }
.survey-history > summary, .other-events > summary { cursor: pointer; padding: 12px 0; }
.announcement-panel > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.announcement-panel > summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .topbar { min-height: 52px; padding: calc(4px + env(safe-area-inset-top, 0px)) 12px 4px; }
  .brand { font-size: 1.35rem; }
  .view { padding: 12px 12px calc(var(--mobile-tabs-height, 76px) + 20px); }
  .view h1 { font-size: 1.4rem; margin: 0 0 8px; }
  .page-head { padding-bottom: 4px; margin-bottom: 8px; border-bottom: 0; }
  .page-head h1 { margin: 0; }
  .desktop-timetable-link { display: none; }
  #nav a.bottom-tab-duplicate { display: none; }
  #nav .nav-group:has(.nav-group-links > .bottom-tab-duplicate):not(:has(.nav-group-links > a:not(.bottom-tab-duplicate))) { display: none; }
  #nav .nav-group > summary { pointer-events: none; padding: 8px 12px 0; font-size: .75rem; color: var(--muted); }
  #nav .nav-group > summary::after { content: none; }
  #nav .nav-group-links { border: 0; padding: 0; margin: 0; }
  #nav a:not(.bottom-tab-duplicate), #nav .mobile-help-link { display: flex; justify-content: flex-start; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; margin: 0; border: 0; width: 100%; background: transparent; font-size: .95rem; }
  .staff-today { padding: 8px; margin-bottom: 8px; }
  .staff-today-summary { font-size: .85rem; }
  .calendar-toggle { margin: 8px 0; gap: 6px; }
  .calendar-toggle .btn { font-size: .85rem; padding: 6px 10px; }
  .filters { gap: 8px; margin: 8px 0; }
  .filters .field { margin: 0; }
  .mobile-bookings .card { padding: 10px; }
  .inbox-controls { gap: 6px; margin: 8px 0; }
  .inbox-controls .btn { padding: 6px 8px; font-size: .8rem; }
  .inbox-controls .inbox-read-all { margin-left: auto; }
  .inbox-item { padding: 12px; margin-bottom: 10px; }
  .announcement-panel { padding: 0 8px; margin: 4px 0; }
  .available-days { padding: 4px 0; margin: 4px 0; border: 0; background: transparent; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .available-days h2 { margin: 0; font-size: .75rem; }
  .available-day-buttons { display: flex; flex-wrap: nowrap; gap: 4px; max-width: 100%; overflow-x: auto; }
  .available-day-buttons .btn { flex-direction: row; align-items: center; gap: 4px; padding: 4px 8px; }
  .calendar-view-switch { margin: 4px 0; }
  .calendar-view-switch .btn { min-height: 44px; padding: 4px 8px; font-size: .85rem; }
  .calendar-help { font-size: .75rem; margin: 0 0 4px; }
  .day-chips .chip { min-height: 60px; padding: 4px; }
  .day-chips .chip strong { font-size: 1.1rem; }
  .day-count-hint { margin: 4px 0; font-size: .75rem; }
  .daily-title { font-size: 1rem; margin: 8px 0; }
  .daily .card.slot { padding: 10px; gap: 2px; }
  .legend { font-size: .75rem; margin: 4px 0; }
}

.announcement-panel .badge[hidden], .inbox-retry[hidden] { display: none; }

.personal-alert-form .check { word-break: keep-all; }

/* Approved minimal staff timetable. Support components are temporarily hidden, not deleted. */
.minimal-timetable .slots-head { margin: 0; padding: 0; border: 0; }
.minimal-timetable .slots-head h1,
.minimal-timetable .calendar-support,
.minimal-timetable .calendar-tools,
.minimal-timetable .reserved-day-count { display: none; }
.schedule-fab { position: fixed; right: 20px; bottom: 24px; z-index: 20;
  min-height: 52px; padding: 12px 20px; border-radius: 999px; box-shadow: 0 4px 12px #59331730; }
.minimal-timetable .week-wrap { padding-bottom: 76px; }
.registration-backdrop { position: fixed; inset: 0; z-index: 40; background: #29272170;
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.registration-sheet { width: min(680px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto;
  overscroll-behavior: contain; padding: 20px; background: var(--panel); border-radius: 18px; }
.registration-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.registration-heading h1 { margin: 0; font-size: 1.4rem; }
.registration-close { border: 0; background: transparent; font-size: 1.6rem; min-width: 44px; min-height: 44px; }
.registration-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.registration-tabs .btn { min-width: 0; padding: 8px 4px; }
.staff-booking-form { display: grid; gap: 8px; }
.staff-booking-form .field { margin: 0; }
.booking-time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.staff-booking-form > .btn { width: 100%; min-height: 48px; margin-top: 8px; }
body:has(.registration-sheet) { overflow: hidden; }
@media (max-width: 720px) {
  .minimal-timetable .week-nav { margin-top: 0; }
  .minimal-timetable .mobile-grid-wrap { max-height: calc(100dvh - 172px - var(--mobile-tabs-height, 76px)); }
  .schedule-fab { right: 16px; bottom: calc(var(--mobile-tabs-height, 76px) + 14px); }
  .registration-backdrop { padding: 0; align-items: flex-end; }
  .registration-sheet { width: 100%; max-height: calc(100dvh - 60px); border-radius: 20px 20px 0 0;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .registration-sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px;
    background: var(--line); margin: 0 auto 10px; }
}
