/* Lerni — shell layout (extracted from Lerni.html prototype) */

.deploy-environment-banner {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  z-index: 500;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--tint-orange) 65%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tint-orange) 88%, var(--bg-elevated));
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
}

.shell { display: flex; min-height: 100vh; }

/* Skip link: hidden until focused, then pinned top-left over everything. */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 400;
  transform: translateY(-150%);
  padding: 8px 14px; border-radius: var(--radius-sm);
  background: var(--tint-blue); color: var(--on-accent);
  font-size: 14px; font-weight: 600;
  transition: transform var(--dur-fast) var(--ease-default);
}
.skip-link:focus { transform: translateY(0); outline: none; }

/* ---- Sidebar ---- */
.sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 0.5px solid var(--separator);
  display: flex; flex-direction: column;
  padding: 12px;
  gap: 4px;
  overflow-y: auto;
  transition: transform var(--dur-base);
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed; inset: 0; z-index: 100;
    width: 280px;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
}

/* Drawer backdrop. Always mounted so it can fade in/out with the sidebar
   slide; invisible and non-interactive until .open. */
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 99;
  background: var(--scrim);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-default);
}
.sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

.brand { display: flex; align-items: center; gap: 0; padding: 8px; margin-bottom: 4px; }
.brand-word {
  font: 700 22px/1 var(--font-sans);
  letter-spacing: -0.03em;
  color: var(--label-primary);
}
.brand-mark {
  height: 24px;
  width: auto;
  background: transparent;
  display: block;
  margin: 0 4px 0 10px;
}

.nav-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--label-secondary); cursor: pointer; text-align: left;
  transition: background var(--dur-fast);
}
.nav-item:hover { background: var(--sidebar-active); }
.nav-item.active { background: var(--sidebar-active); color: var(--label-primary); font-weight: 600; }
.nav-item .badge-ct {
  margin-left: auto; font-size: 11px; padding: 1px 7px;
  border-radius: 999px; background: var(--fill-quaternary);
  color: var(--label-tertiary);
}

.nav-label {
  padding: 16px 10px 4px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--label-tertiary);
}
.subj-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; align-self: flex-start; margin-top: 5px; }

.sidebar-footer {
  margin-top: auto; padding: 8px;
  border-top: 0.5px solid var(--separator);
}

/* ---- Main ---- */
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 50px; flex-shrink: 0;
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  border-bottom: 0.5px solid var(--separator);
  background: var(--material-regular);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky; top: 0; z-index: 10;
}
.topbar-crumbs {
  font-size: 14px; color: var(--label-tertiary);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-crumbs strong { color: var(--label-primary); font-weight: 600; }
.ic-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px; color: var(--label-secondary);
  transition: background var(--dur-fast);
}
.ic-btn:hover { background: var(--fill-quaternary); }
.mobile-menu { display: none; }
@media (max-width: 768px) {
  .mobile-menu { display: grid; }
  /* Keep the top bar within the viewport on phones so fixed-position modals
     stay centred: drop the desktop spacer and the Strg-K hint, let search shrink. */
  .topbar-spacer { display: none; }
  .search-hint { display: none; }
}

/* Horizontal padding scales with viewport so wide screens get real breathing
   room instead of content sprawling edge-to-edge. */
.content { flex: 1; padding: 24px clamp(24px, 3.5vw, 56px) 64px; overflow-y: auto; }
@media (max-width: 768px) { .content { padding: 16px 16px 48px; } }

/* Native <select> dropdown options — ensure popup follows the active theme.
   Some browsers ignore color-scheme for the option list, so set explicit colors. */
select option {
  background-color: var(--bg-elevated);
  color: var(--label-primary);
}

/* Custom date picker — subtle entry animation for the popover. */
@keyframes pickerPopIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.picker-pop {
  animation: pickerPopIn var(--dur-fast) var(--ease-default);
  transform-origin: top left;
}

/* ===== WocheScreen edit-mode hover + drag preview ===== */

.woche-cell {
  transition: background var(--dur-fast) var(--ease-default);
}
.woche-grid--edit .woche-cell:hover {
  background: var(--bg-hover);
}

/* Drag-select cell tints — drawn per cell within the drag range so the user
   sees each selected hour, like a spreadsheet selection. Placed AFTER the
   :hover rule so source-order resolves the (0,3,0) tie in their favor. */
.woche-grid--edit .woche-cell.woche-cell--drag-termin {
  background: color-mix(in srgb, var(--tint-blue) 22%, transparent);
}
.woche-grid--edit .woche-cell.woche-cell--drag-blocker {
  background: var(--fill-primary);
}

@keyframes selectPreviewIn {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}
.select-preview {
  animation: selectPreviewIn var(--dur-fast) var(--ease-default);
}

/* Interactive EventChip (chips with onClick) */
.event-chip {
  transition: background var(--dur-fast) var(--ease-default),
              box-shadow var(--dur-fast) var(--ease-default),
              transform var(--dur-fast) var(--ease-default);
}
.event-chip--interactive:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* Date picker day cells */
.day-cell:hover:not(.is-active) {
  background: var(--bg-hover);
}

/* ===== Button interaction states =====
   AppleBtn keeps its per-variant background inline; these add the missing
   hover/press feedback (the inline opacity/filter/transform transition makes
   them animate). Suppressed while disabled. */
.apple-btn { -webkit-tap-highlight-color: transparent; }
.apple-btn:not(:disabled):hover { filter: brightness(1.06); }
.apple-btn:not(:disabled):active { transform: scale(0.97); }
.apple-btn:disabled { cursor: not-allowed; }

/* Clickable list rows / cards get a hover wash so the tap target is
   discoverable (mirrors .nav-item / .day-cell). Applied only when interactive. */
.row--clickable { transition: background var(--dur-fast) var(--ease-default); }
.row--clickable:hover { background: var(--bg-hover); }
.row--clickable:active { background: var(--bg-active); }

/* Sidebar nav focus ring sits inside the scrollable rail; keep it crisp. */
.nav-item:focus-visible { outline-offset: -2px; }

/* Search/catalog pills carry the focus ring for their inner (outline:none)
   input via :focus-within, so the ring frames the whole field. */
.field-pill:focus-within {
  outline: 2px solid var(--tint-blue);
  outline-offset: 1px;
}

/* Modal entrance: backdrop fades, panel rises — mirrors .picker-pop. */
@keyframes modalBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPanelIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.modal-backdrop { animation: modalBackdropIn var(--dur-base) var(--ease-default); }
.modal-panel { animation: modalPanelIn var(--dur-base) var(--ease-default); }

/* Skeleton loader pulse (Skeleton/CardSkeleton/ListRowSkeleton). Neutralized
   globally under prefers-reduced-motion by the rule in plani-tokens.css. */
@keyframes skeletonPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 0.8; } }
.skeleton-pulse { animation: skeletonPulse 1.2s ease-in-out infinite; }
