:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #657080;
  --line: #dfe5ec;
  --paper: #ffffff;
  --soft: #f6f7f8;
  --brand: #00b894;
  --brand-dark: #16806c;
  --danger: #e95155;
  --yellow: #f5c542;
  --radius: 8px;
  --shadow: 0 18px 45px rgba(23, 32, 51, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #eef3f5;
  -webkit-text-size-adjust: 100%;
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  min-width: 0;
}

.shell {
  width: min(1380px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 20px 24px;
  border-radius: 14px;
  color: #fff;
  background: #111;
  border-top: 5px solid var(--brand);
  box-shadow: var(--shadow);
}

.hero-main {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.hero-logo {
  width: min(108px, 22vw);
  height: auto;
  flex-shrink: 0;
  display: block;
}

.hero-copy {
  min-width: 0;
}

.kicker,
.toolbar-label {
  margin: 0 0 6px;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.6rem;
}

h3 {
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.intro {
  max-width: 680px;
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.55;
}

.session-card {
  min-width: 260px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .14);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 8px;
}

.session-card strong {
  display: block;
  margin-bottom: 4px;
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.session-actions .ghost-btn {
  background: #fff;
}

.announcement-banner {
  margin-top: 14px;
  border-radius: var(--radius);
  border: 1px solid #f0d56a;
  background: linear-gradient(180deg, #fff9df 0%, #fff4c4 100%);
  box-shadow: var(--shadow);
}

.announcement-banner-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 18px;
}

.announcement-banner-copy {
  min-width: 0;
}

.announcement-banner-kicker {
  margin: 0 0 4px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8a6d00;
}

.announcement-banner h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  line-height: 1.25;
  color: #172033;
}

.announcement-banner-message,
#announcementBannerMessage {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
  color: #334155;
}

#announcementBannerMessage.is-rich {
  white-space: normal;
}

#announcementBannerMessage.is-rich p {
  margin: 0 0 8px;
}

#announcementBannerMessage.is-rich p:last-child {
  margin-bottom: 0;
}

#announcementBannerMessage.is-rich ul,
#announcementBannerMessage.is-rich ol {
  margin: 6px 0 0;
  padding-left: 1.2rem;
}

.announcement-banner-close {
  width: 36px;
  min-height: 36px;
  border: 1px solid #e6cf66;
  border-radius: 50%;
  background: rgba(255, 255, 255, .75);
  color: #172033;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.auth-panel,
.password-panel,
.app,
.admin-card {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow);
}

.auth-panel {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 410px);
  gap: 26px;
  align-items: center;
}

.reset-form {
  grid-column: 2;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.reset-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 56px);
}

.reset-page {
  width: min(560px, 100%);
  grid-template-columns: 1fr;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}

.auth-copy p,
.hint,
.slot-details,
.toolbar-label {
  color: var(--muted);
}

.login-form,
.admin-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  color: #2f3a4e;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #ccd4e2;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

.check-row input {
  width: auto;
}

.login-remember-row {
  margin: 2px 0 12px;
}

.password-input-wrap {
  position: relative;
  display: grid;
}

.password-input-wrap input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--ink);
  background: #f0f3f8;
}

.password-toggle.is-visible {
  color: var(--brand);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(0, 169, 131, .3);
  outline-offset: 2px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
  min-height: 44px;
  border-radius: var(--radius);
  border: 0;
  padding: 11px 16px;
  font-weight: 800;
}

.primary-btn {
  color: #fff;
  background: var(--brand);
}

.secondary-btn {
  color: #fff;
  background: #172033;
}

.ghost-btn {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.danger-btn {
  color: #b4232a;
  border-color: #f0b7ba;
}

.danger-btn:hover {
  color: #fff;
  background: #b4232a;
}

.icon-btn {
  width: 48px;
  padding: 0;
  color: #fff;
  background: var(--brand-dark);
  font-size: 1.8rem;
  line-height: 1;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.toolbar strong {
  display: block;
  font-size: 1.15rem;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.tab-btn {
  min-width: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-weight: 800;
  background: #fff;
}

.tab-btn.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.planning {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.day-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  min-height: 220px;
  border-radius: var(--radius);
}

.day-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px;
  border-radius: var(--radius);
  background: #172033;
  color: #fff;
  text-align: center;
  font-weight: 900;
}

.slot-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  min-height: 210px;
  padding: 14px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(23, 32, 51, .16);
}

.slot-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.slot-title {
  text-transform: uppercase;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.slot-day {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  font-size: .72rem;
  font-weight: 900;
}

.slot-details {
  min-height: 32px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, .9);
  font-size: .86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.slot-time {
  margin-bottom: 0;
  font-size: 1.02rem;
  font-weight: 900;
}

.slot-count {
  margin-bottom: 0;
  color: #ffe36d;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.slot-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.slot-actions button {
  width: 100%;
  overflow-wrap: anywhere;
}

input[type="color"] {
  min-height: 48px;
  padding: 4px;
  cursor: pointer;
}

.disabled-btn {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  color: #8a91a2;
  background: rgba(255, 255, 255, .86);
  font-weight: 800;
  cursor: not-allowed;
}

.admin {
  margin-top: 28px;
}

.admin-head,
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.admin-nav,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-nav {
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.admin-nav button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  background: transparent;
  font-weight: 900;
}

.admin-nav button.active {
  color: #fff;
  background: var(--brand);
}

.admin-nav button.alert-tab {
  color: #b4232d;
}

.admin-nav button.alert-tab.active {
  color: #fff;
  background: #d92d3a;
}

.alert-kicker {
  color: #b4232d;
}

.announcement-card {
  border-color: rgba(217, 45, 58, 0.25);
}

.wysiwyg {
  display: grid;
  gap: 8px;
}

.wysiwyg-label {
  font-weight: 700;
}

.wysiwyg-toolbar,
.wysiwyg-emoji {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wysiwyg-toolbar button,
.wysiwyg-emoji button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid #d8deea;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  cursor: pointer;
}

.wysiwyg-emoji button {
  font-size: 1.25rem;
}

.wysiwyg-area {
  min-height: 140px;
  padding: 12px;
  border: 1px solid #d8deea;
  border-radius: 12px;
  background: #fff;
  line-height: 1.5;
  white-space: pre-wrap;
}

.wysiwyg-area:focus {
  outline: 2px solid rgba(233, 81, 85, 0.35);
  outline-offset: 1px;
}

.wysiwyg-area.is-empty:before {
  content: attr(data-placeholder);
  color: #94a3b8;
}

.danger-btn {
  background: #d92d3a;
}

.danger-btn:hover,
.danger-btn:focus-visible {
  background: #b4232d;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 16px;
  align-items: start;
}

.admin-grid.schedule-admin-grid {
  grid-template-columns: minmax(260px, 380px) 1fr;
}

.admin-grid-wide {
  grid-column: 1 / -1;
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compact-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
  border-radius: var(--radius);
  background: var(--soft);
  font-size: .88rem;
}

.form-feedback {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: .92rem;
  line-height: 1.45;
}

.form-feedback:empty {
  display: none;
}

.form-feedback.is-info {
  color: #2f3a4e;
  background: #eef3f8;
  border: 1px solid #d8deea;
}

.form-feedback.is-success {
  color: #0f5132;
  background: #e8f7ef;
  border: 1px solid #b7e4c7;
}

.form-feedback.is-warn {
  color: #7a5b00;
  background: #fff8df;
  border: 1px solid #f0df9a;
}

.form-feedback.is-error {
  color: #842029;
  background: #fdecee;
  border: 1px solid #f5c2c7;
}

.status-badge {
  display: inline-block;
  font-size: .88rem;
}

.status-pending {
  color: #657080;
}

.status-sending {
  color: #2563eb;
}

.status-sent {
  color: #b45309;
}

.status-failed {
  color: var(--danger);
}

.status-accepted {
  color: var(--brand-dark);
}

.compact-head {
  margin-bottom: 16px;
}

.compact-head h3 {
  margin-bottom: 0;
}

.admin-cards-mobile {
  display: none;
}

.admin-record-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 32, 51, .06);
}

.admin-record-card-compact {
  gap: 0;
}

.admin-record-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.admin-record-card-head strong {
  display: block;
  font-size: 1rem;
  line-height: 1.3;
}

.admin-record-email,
.admin-record-scope {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.admin-record-pill {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}

.admin-record-pill.is-blocked {
  color: #fff;
  background: #d92d3a;
}

.admin-record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.admin-record-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-record-field-wide {
  grid-column: 1 / -1;
}

.admin-record-field > span:first-child {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-record-field strong {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.admin-record-actions {
  display: grid;
  gap: 8px;
}

.admin-record-actions .ghost-btn,
.admin-record-actions .danger-btn {
  width: 100%;
}

.danger-text {
  color: #c7353a;
}

.security-note p {
  line-height: 1.5;
}

.row-actions {
  display: grid;
  gap: 8px;
}

.wide {
  margin-top: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%) translateY(140%);
  max-width: min(460px, calc(100% - 24px));
  padding: 13px 16px;
  border-radius: var(--radius);
  color: #fff;
  background: #172033;
  box-shadow: var(--shadow);
  transition: transform .22s ease;
  font-size: .95rem;
  line-height: 1.45;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 51, .42);
}

.modal.modal-below-header {
  place-items: start center;
  align-content: start;
  padding-top: calc(var(--shell-header-bottom, 88px) + 12px);
  padding-bottom: 18px;
  overflow-y: auto;
}

.modal.modal-below-header .modal-card {
  max-height: calc(100vh - var(--shell-header-bottom, 88px) - 36px);
  overflow-y: auto;
}

.modal-card {
  position: relative;
  width: min(460px, 100%);
  padding: 22px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-card-wide {
  width: min(560px, 100%);
}

.flat-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.override-mode-fieldset {
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.override-mode-fieldset .check-row + .check-row {
  margin-top: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.slot-card.slot-modified .slot-time {
  text-decoration: underline;
  text-decoration-style: dotted;
}

.slot-card.slot-closed {
  opacity: .72;
}

.announcement-banner.hidden {
  display: none;
}

.data-health-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid #b8e7d8;
  border-radius: var(--radius);
  background: #eefbf6;
  color: #145a45;
  font-size: .92rem;
  font-weight: 700;
}

.data-health-banner.is-empty {
  border-color: #f0d56a;
  background: #fff9df;
  color: #8a6d00;
}

.data-health-banner.hidden {
  display: none;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  font-weight: 900;
}

.modal-color {
  width: 54px;
  height: 8px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--brand);
}

.modal-time {
  font-size: 1.25rem;
  font-weight: 900;
}

.modal-card > .slot-count {
  width: fit-content;
  padding: 8px 10px;
  border-radius: 6px;
  color: #b42318;
  background: #fff0ed;
  font-size: 1.05rem;
}

.modal-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-booking-manager {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.admin-booking-enroll {
  display: grid;
  gap: 8px;
}

.admin-booking-select {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.admin-booking-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.booking-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.booking-member-row span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booking-target-picker {
  margin-bottom: 4px;
}

.booking-target-picker label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: .88rem;
}

.booking-delegate-row {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

#bookingDelegatesList {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.booking-check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.booking-check-row input {
  width: 20px;
  min-height: 20px;
  margin: 0;
}

.booking-check-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

.calendar-embed {
  background: transparent;
}

.full-embed {
  background: #f4f7f8;
}

.full-embed .shell {
  width: min(100% - 20px, 1380px);
  padding-top: 10px;
}

.full-embed .hero {
  margin-top: 0;
}

.full-embed .site-footer {
  display: none;
}

.calendar-embed .shell {
  width: 100%;
  padding: 0;
}

.calendar-embed .hero,
.calendar-embed .auth-panel,
.calendar-embed .password-panel,
.calendar-embed #adminPanel,
.calendar-embed #loginFromPublicBtn,
.calendar-embed .site-footer {
  display: none !important;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  width: min(100% - 32px, 1380px);
  margin: 0 auto;
  padding: 22px 0 28px;
  color: var(--muted);
  font-size: .88rem;
  text-align: center;
}

.site-footer a {
  color: var(--brand-dark);
  font-weight: 900;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
}

.calendar-embed .app {
  display: block !important;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.calendar-embed .toolbar {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.calendar-embed .planning {
  margin-bottom: 0;
}

@media (max-width: 1220px) {
  .planning {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero,
  .auth-panel,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-grid.schedule-admin-grid {
    grid-template-columns: 1fr;
  }

  .reset-form {
    grid-column: auto;
  }

  .session-card {
    min-width: 0;
  }

  .planning {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .planning {
    grid-template-columns: 1fr;
  }

  .day-column {
    display: none;
  }

  .day-column.active {
    display: grid;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding-top: 10px;
  }

  .hero,
  .auth-panel,
  .password-panel,
  .app,
  .admin-card {
    padding: 16px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
  }

  #todayBtn {
    grid-column: 1 / -1;
  }

  .two-cols,
  .admin-head,
  .form-actions,
  .admin-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .slot-card {
    min-height: 0;
  }
}

.view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.view-switch button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
}

.view-switch button.active {
  color: #fff;
  background: var(--brand);
}

.planning {
  display: block;
  min-width: 0;
  margin-bottom: 30px;
}

.agenda-board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.agenda-header,
.agenda-body {
  display: grid;
  grid-template-columns: 70px repeat(var(--agenda-day-count, 6), minmax(160px, 1fr));
}

.agenda-header {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.agenda-corner,
.agenda-day-head {
  min-height: 54px;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: center;
}

.agenda-day-head {
  text-align: center;
}

.agenda-day-head.active-day {
  box-shadow: inset 0 -3px 0 var(--brand);
}

.agenda-lane.active-day {
  background-color: rgba(0, 169, 131, .035);
}

.agenda-day-head strong {
  display: block;
}

.agenda-day-head span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.time-scale {
  position: relative;
  border-right: 1px solid var(--line);
  background: #fbfcff;
}

.time-label {
  position: absolute;
  right: 12px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.agenda-lane {
  position: relative;
  min-width: 0;
  border-right: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, #f0f3f8 0 1px, transparent 1px 76px);
}

.agenda-lane:last-child,
.agenda-day-head:last-child {
  border-right: 0;
}

.agenda-event {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 5px;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(23, 23, 23, .12);
}

.agenda-event .slot-title {
  font-size: .86rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.agenda-event .slot-details {
  min-height: 0;
  font-size: .76rem;
}

.week-agenda .agenda-event .slot-details {
  display: none;
}

.week-agenda .agenda-event {
  align-content: start;
}

.week-agenda .agenda-event .slot-day,
.week-agenda .agenda-event .slot-actions {
  display: none;
}

.week-agenda .agenda-event .slot-count {
  color: rgba(255, 255, 255, .9);
}

.week-agenda .agenda-event .slot-time,
.week-agenda .agenda-event .slot-count {
  font-size: .8rem;
}

.week-agenda .agenda-event .slot-title {
  font-size: .82rem;
}

.agenda-event .slot-time,
.agenda-event .slot-count {
  font-size: .82rem;
}

.agenda-event .slot-actions {
  gap: 5px;
}

.agenda-event .primary-btn,
.agenda-event .secondary-btn,
.agenda-event .ghost-btn,
.agenda-event .disabled-btn {
  min-height: 34px;
  padding: 7px 9px;
  font-size: .8rem;
}

.day-agenda .agenda-header,
.day-agenda .agenda-body {
  grid-template-columns: 64px minmax(0, 1fr);
}

.desktop-day {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.desktop-day-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #111;
  color: #fff;
}

.desktop-day-head h3 {
  margin: 0;
}

.desktop-day-head span {
  color: rgba(255, 255, 255, .78);
  font-weight: 900;
}

.desktop-day-grid {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.desktop-day-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 130px;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--brand);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 7px 18px rgba(23, 23, 23, .06);
}

.desktop-day-time {
  display: grid;
  gap: 2px;
  color: var(--brand-dark);
  font-size: 1.1rem;
  font-weight: 900;
}

.desktop-day-time small {
  color: var(--muted);
  font-size: .88rem;
}

.desktop-day-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.desktop-day-main strong {
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.desktop-day-main em {
  color: var(--muted);
  font-style: normal;
}

.desktop-day-count {
  justify-self: end;
  padding: 8px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.list-agenda {
  display: grid;
  gap: 14px;
}

.list-day {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.list-day.active-day,
.mobile-week-day.active-day,
.mobile-day.active-day,
.desktop-day.active-day {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0, 169, 131, .16);
}

.list-day h3 {
  margin: 0;
  padding: 12px 14px;
  color: #fff;
  background: #172033;
}

.list-day-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 12px;
}

.list-day .slot-card {
  min-height: 0;
}

.mobile-week {
  display: grid;
  gap: 12px;
}

.mobile-week-day,
.mobile-day {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.mobile-week-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  color: #fff;
  background: #172033;
}

.mobile-week-head strong {
  font-size: 1rem;
}

.mobile-week-head span {
  font-size: .84rem;
  font-weight: 800;
  color: rgba(255, 255, 255, .78);
}

.mobile-week-events {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.mobile-week-event {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 3px 10px;
  width: 100%;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 7px solid var(--brand);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 6px 16px rgba(23, 32, 51, .08);
}

.mobile-week-event:disabled {
  opacity: .62;
  cursor: not-allowed;
}

.mobile-week-time {
  grid-row: span 2;
  align-self: center;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
}

.mobile-week-title {
  overflow-wrap: anywhere;
  font-weight: 900;
  text-transform: uppercase;
}

.mobile-week-count {
  color: var(--brand-dark);
  font-size: .84rem;
  font-weight: 900;
}

.tabs.hidden-tabs {
  display: none;
}

@media (max-width: 1080px) {
  .agenda-scroll {
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .agenda-board {
    min-width: 1110px;
  }
}

@media (max-width: 720px) {
  .view-switch {
    width: 100%;
  }

  .view-switch button {
    flex: 1;
  }

  .week-agenda {
    min-width: 820px;
  }

  .day-agenda {
    min-width: 0;
  }

  .agenda-header,
  .agenda-body {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .agenda-corner,
  .agenda-day-head {
    min-height: 48px;
  }

  .time-label {
    right: 5px;
    font-size: .72rem;
  }
}

@media (max-width: 900px) {
  .toolbar {
    position: sticky;
    top: env(safe-area-inset-top, 0);
    z-index: 6;
    margin-bottom: 14px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 24px rgba(23, 32, 51, .08);
  }

  .admin-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .admin-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-nav button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .hint {
    font-size: .92rem;
    line-height: 1.5;
  }

  .agenda-event .primary-btn,
  .agenda-event .secondary-btn,
  .agenda-event .ghost-btn,
  .agenda-event .disabled-btn {
    min-height: 44px;
    font-size: .88rem;
  }

  .modal {
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  }

  .modal-card {
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
    overflow-y: auto;
  }

  .view-switch {
    width: 100%;
  }

  .view-switch button {
    flex: 1;
  }

  .admin-table-desktop {
    display: none;
  }

  .admin-cards-mobile {
    display: grid;
    gap: 12px;
  }

  .compact-list {
    max-height: none;
    overflow: visible;
  }

  .admin-record-card-compact .admin-record-card-head {
    align-items: center;
  }

  .admin-record-card-compact .ghost-btn {
    flex: 0 0 auto;
    min-width: 108px;
  }

  .compact-head {
    display: grid;
    gap: 10px;
  }

  .compact-head .ghost-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
  }
}

@media (max-width: 560px) {
  body {
    background: #eef3f7;
  }

  .shell {
    width: min(100% - 14px, 430px);
  }

  .hero {
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
  }

  .hero-main {
    gap: 12px;
  }

  .hero-logo {
    width: 72px;
  }

  h1 {
    font-size: 2rem;
  }

  .intro {
    font-size: .92rem;
  }

  .session-card {
    display: grid;
    gap: 8px;
    padding: 12px;
  }

  .session-actions,
  .session-actions .ghost-btn {
    width: 100%;
  }

  .app {
    margin-top: 14px;
    padding: 14px;
    border-radius: 8px;
  }

  .planning {
    margin-bottom: 22px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 10px;
    align-items: center;
  }

  .toolbar > div:not(.view-switch) {
    min-width: 0;
    text-align: center;
  }

  .toolbar-label {
    font-size: .68rem;
  }

  .toolbar strong {
    font-size: .98rem;
    line-height: 1.2;
  }

  #todayBtn {
    grid-column: 1 / -1;
  }

  .view-switch {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .view-switch button {
    width: 100%;
    padding: 9px 6px;
    font-size: .92rem;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }

  .tabs.hidden-tabs {
    display: none;
  }

  .tab-btn {
    min-width: 0;
    padding: 10px 6px;
    font-size: .86rem;
  }

  .day-agenda .agenda-header,
  .day-agenda .agenda-body {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .agenda-event {
    padding: 10px;
  }

  .day-agenda .agenda-event .slot-title,
  .list-day .slot-title {
    font-size: .95rem;
  }

  .day-agenda .agenda-event .slot-time,
  .day-agenda .agenda-event .slot-count {
    font-size: .88rem;
  }

  .list-day-body {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .desktop-day-row {
    grid-template-columns: 1fr;
  }

  .desktop-day-count {
    justify-self: start;
  }
}
