/* Layout-only shell. Legacy calendar time-positioning and editors stay untouched. */
#app.aura-shell {
  display: grid;
  grid-template-columns: var(--aura-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--aura-canvas);
  color: var(--aura-text);
  font-family: var(--aura-font-body);
}
#app.aura-shell.hidden { display: none; }
.aura-sidebar svg, .aura-topbar svg { width: 24px; height: 24px; flex: none; }
.aura-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  box-sizing: border-box;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--aura-space-3);
  padding: var(--aura-space-8) var(--aura-space-4);
  border-right: var(--aura-border-subtle);
  background: var(--aura-card);
}
.aura-sidebar__brand { flex-shrink: 0; display: grid; gap: var(--aura-space-1); padding: 0 var(--aura-space-3) var(--aura-space-6); }
.aura-sidebar__brand .logo { color: var(--aura-text); -webkit-text-fill-color: var(--aura-text); background: none; text-shadow: none; font-family: var(--aura-font-brand); font-size: var(--aura-sidebar-brand-size); line-height: 1.1; letter-spacing: .03em; }
.aura-sidebar__tagline, .aura-nav__english, .aura-sidebar__motto { font-family: var(--aura-font-brand); }
.aura-sidebar__tagline { font-size: var(--aura-text-sm); }
.aura-shell .pillbar.aura-sidebar__nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: var(--aura-space-2); margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.aura-shell .pillbar.aura-sidebar__nav button {
  flex-shrink: 0; display: flex; gap: var(--aura-space-4); align-items: center; text-align: left;
  min-height: var(--aura-nav-height); padding: var(--aura-space-3) var(--aura-space-4);
  border: 1px solid transparent; border-radius: var(--aura-radius-md);
  background: transparent; color: var(--aura-text); font-weight: var(--aura-weight-medium);
}
.aura-shell .pillbar.aura-sidebar__nav button.hidden { display: none; }
.aura-shell .pillbar.aura-sidebar__nav button:hover { background: var(--aura-raised); }
.aura-shell .pillbar.aura-sidebar__nav button.active { background: var(--aura-success-soft); color: var(--aura-success); font-weight: var(--aura-weight-bold); box-shadow: inset 3px 0 0 var(--aura-success); }
.aura-nav__labels { display: grid; gap: var(--aura-space-1); min-width: 0; }
.aura-nav__title { font-size: var(--aura-text-md); white-space: nowrap; }
.aura-nav__english { color: var(--aura-text-secondary); font-size: var(--aura-text-sm); font-weight: var(--aura-weight-regular); }
.aura-shell .aura-sidebar__ai { flex-shrink: 0; justify-content: flex-start; gap: var(--aura-space-4); padding-inline: var(--aura-space-4); text-align: left; min-height: var(--aura-nav-compact-height); }
.aura-sidebar__motto { flex-shrink: 0; white-space: pre-line; line-height: var(--aura-leading-body); color: var(--aura-text-secondary); margin: 0; padding: var(--aura-space-4) var(--aura-space-3); }
.aura-sidebar__account { flex-shrink: 0; display: flex; flex-direction: column; gap: var(--aura-space-2); padding-top: var(--aura-space-4); border-top: var(--aura-border-subtle); }
.aura-sidebar__account-label { color: var(--aura-text-secondary); font-size: var(--aura-text-xs); padding-inline: var(--aura-space-3); }
.aura-shell #logoutBtn { min-height: var(--aura-touch-target); background: var(--aura-card); border: var(--aura-border); color: var(--aura-text-secondary); }
.aura-workspace, .aura-page-content { min-width: 0; }
.aura-shell header.aura-topbar {
  position: relative; top: auto; z-index: auto; display: flex; flex-wrap: wrap;
  justify-content: flex-end; align-items: center; gap: var(--aura-space-4);
  min-height: var(--aura-topbar-height); padding: var(--aura-space-3) var(--aura-space-6);
  background: var(--aura-canvas); border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  max-width: var(--aura-content-max); margin-inline: auto;
}
.aura-profile-chip { display: flex; align-items: center; gap: var(--aura-space-3); min-width: 0; max-width: 100%; color: var(--aura-text); font-size: var(--aura-text-sm); }
.aura-profile-chip > svg { box-sizing: content-box; padding: var(--aura-space-2); border-radius: var(--aura-radius-pill); background: var(--aura-success-soft); color: var(--aura-success); }
.aura-profile-chip__identity { display: grid; min-width: 0; overflow-wrap: anywhere; }
.aura-profile-chip__label, .aura-profile-chip__email { color: var(--aura-text-secondary); font-size: var(--aura-text-xs); }
.aura-profile-chip__name { font-weight: var(--aura-weight-medium); }
.aura-profile-chip__email[hidden], .aura-hero[hidden] { display: none; }
.aura-page-frame { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: var(--aura-space-4); max-width: var(--aura-content-max); margin-inline: auto; padding: 0 var(--aura-space-6) var(--aura-space-8); }
.aura-page-frame:has(> .aura-right-panel:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(var(--aura-right-panel-min), var(--aura-right-panel-width)); }
.aura-right-panel[hidden] { display: none; }
.aura-right-panel { padding: var(--aura-space-4); border: var(--aura-border-subtle); border-radius: var(--aura-radius-lg); background: var(--aura-card); }
.aura-hero { display: grid; isolation: isolate; min-height: var(--aura-hero-height); border-radius: var(--aura-radius-lg); overflow: hidden; border: var(--aura-border-subtle); background: var(--aura-card); margin-bottom: var(--aura-space-6); }
.aura-hero__image, .aura-hero__copy { grid-area: 1 / 1; }
.aura-hero__image { width: 100%; height: var(--aura-hero-height); object-fit: cover; object-position: center; }
.aura-hero__copy { z-index: 1; align-self: center; margin: var(--aura-space-4) 0 var(--aura-space-4) var(--aura-space-8); padding: var(--aura-space-3) var(--aura-space-4); width: fit-content; max-width: var(--aura-hero-copy-max); border-radius: var(--aura-radius-md); background: color-mix(in srgb, var(--aura-card) 88%, transparent); }
.aura-hero__wordmark { display: block; font-family: var(--aura-font-brand); font-size: var(--aura-text-brand); line-height: var(--aura-leading-tight); }
.aura-hero__title { margin: var(--aura-space-2) 0 0; font-size: var(--aura-text-lg); font-weight: var(--aura-weight-medium); line-height: var(--aura-leading-body); }
.aura-hero__subtitle { margin: var(--aura-space-1) 0 0; color: var(--aura-text-secondary); font-family: var(--aura-font-brand); font-size: var(--aura-text-sm); }
.aura-shell main.aura-page-container { width: 100%; max-width: none; margin: 0; padding: 0; min-width: 0; }
/* The sidebar reduces available page width: let the existing agenda heading
   wrap between controls, never inside the selected date. No time-grid changes. */
.aura-shell .schedule-side .sel-head { flex-wrap: wrap; }
.aura-shell .schedule-side .sel-head .d { white-space: nowrap; }
.aura-shell :is(button, a, input, textarea, select):focus-visible { outline: var(--aura-focus-ring); outline-offset: var(--aura-focus-offset); }
.aura-skip-link { position: absolute; top: var(--aura-space-2); left: var(--aura-space-2); transform: translateY(-180%); z-index: var(--aura-z-modal); padding: var(--aura-space-3); background: var(--aura-card); color: var(--aura-primary); border-radius: var(--aura-radius-sm); }
.aura-skip-link:focus { transform: none; }
@media (max-width: 1100px) {
  #app.aura-shell { grid-template-columns: var(--aura-sidebar-compact) minmax(0, 1fr); }
  .aura-sidebar { padding: var(--aura-space-6) var(--aura-space-2); }
  .aura-sidebar__brand { padding: 0 0 var(--aura-space-4); text-align: center; }
  .aura-sidebar__brand .logo { font-size: var(--aura-text-xl); }
  .aura-sidebar__tagline, .aura-nav__english, .aura-sidebar__motto, .aura-sidebar__account-label { display: none; }
  .aura-shell .pillbar.aura-sidebar__nav button { flex-direction: column; justify-content: center; gap: var(--aura-space-1); padding: var(--aura-space-2); }
  .aura-nav__title { font-size: var(--aura-text-xs); }
  .aura-shell .aura-sidebar__ai { justify-content: center; padding-inline: var(--aura-space-2); }
  .aura-sidebar__ai .aura-button__label { display: none; }
  .aura-sidebar__account { margin-top: auto; }
  .aura-shell header.aura-topbar { padding-inline: var(--aura-space-4); }
  .aura-page-frame { padding-inline: var(--aura-space-4); }
  .aura-hero__copy { margin-left: var(--aura-space-4); }
  .aura-page-frame:has(> .aura-right-panel:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
}
/* Short desktop windows retain every route before reserving space for decoration. */
@media (min-width: 761px) and (max-height: 800px) {
  .aura-sidebar { padding-block: var(--aura-space-4); gap: var(--aura-space-2); }
  .aura-sidebar__brand { padding-bottom: var(--aura-space-2); }
  .aura-sidebar__brand .logo { font-size: var(--aura-text-xl); }
  .aura-sidebar__tagline, .aura-sidebar__motto, .aura-sidebar__account-label, .aura-nav__english { display: none; }
  .aura-shell .pillbar.aura-sidebar__nav button { min-height: var(--aura-touch-target); flex-direction: row; gap: var(--aura-space-1); padding-block: var(--aura-space-2); }
  .aura-shell .aura-sidebar__ai { min-height: var(--aura-touch-target); }
  .aura-sidebar__account { padding-top: var(--aura-space-2); }
}
@media (max-width: 760px) {
  /* Keep the natural-height navigation directly above the workspace on short pages. */
  #app.aura-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .aura-sidebar { position: static; height: auto; min-height: 0; overflow: visible; display: flex; flex-flow: row wrap; align-items: center; gap: var(--aura-space-2); padding: var(--aura-space-3); border-right: 0; border-bottom: var(--aura-border-subtle); }
  .aura-sidebar__brand { padding: 0; margin-right: auto; }
  .aura-shell .pillbar.aura-sidebar__nav { flex: 0 0 100%; order: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; overflow: visible; }
  .aura-shell .pillbar.aura-sidebar__nav:has(button[data-tab="admin"]:not(.hidden), button[data-tab="security"]:not(.hidden)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .aura-shell .pillbar.aura-sidebar__nav button { min-width: 0; min-height: var(--aura-nav-compact-height); flex-direction: row; gap: var(--aura-space-1); }
  .aura-shell .pillbar.aura-sidebar__nav button svg { width: 20px; height: 20px; }
  .aura-sidebar__account { margin: 0; padding: 0; border: 0; }
  .aura-shell .aura-sidebar__ai { min-height: var(--aura-touch-target); }
  .aura-shell header.aura-topbar { padding: var(--aura-space-3); }
  .aura-page-frame { padding-inline: var(--aura-space-3); }
  .aura-hero { min-height: var(--aura-hero-height-mobile); margin-bottom: var(--aura-space-4); }
  .aura-hero__image { height: var(--aura-hero-height-mobile); object-position: 64% center; }
  .aura-hero__copy { margin-left: var(--aura-space-2); max-width: 53%; padding: var(--aura-space-2); }
  .aura-hero__wordmark { font-size: var(--aura-text-2xl); }
  .aura-hero__title { font-size: var(--aura-text-sm); }
  .aura-hero__subtitle { display: none; }
}
@media print {
  #app.aura-shell { display: block; }
  .aura-sidebar, .aura-topbar, .aura-hero, .aura-skip-link, .aura-right-panel { display: none !important; }
  .aura-page-frame { display: block; padding: 0; }
}
