:root {
  --bg: #0b1116;
  --text: #eaf3fa;
  --muted: #b6c6d5;
  --card: rgba(14, 24, 32, 0.84);
  --line: rgba(168, 208, 235, 0.25);
  --accent: #7cf0da;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  /* Lesson stack (scroll view) — premium glass card */
  --lesson-card-radius: 30px;
  --lesson-media-radius: 16px;
  --lesson-card-pad: 18px;
  --panel-radius: 24px;
}

* { box-sizing: border-box; }

/* Subtle scrollbar – low contrast, dark track */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) rgba(255,255,255,0.04);
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.14);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.24);
  border: 2px solid transparent;
  background-clip: padding-box;
}

#pickerView,
.stackScroller,
.panelBody,
.lessonBodyMain {
  scrollbar-gutter: stable;
}
#pickerView::-webkit-scrollbar,
.stackScroller::-webkit-scrollbar,
.panelBody::-webkit-scrollbar,
.lessonBodyMain::-webkit-scrollbar { width: 6px; }
#pickerView::-webkit-scrollbar-track,
.stackScroller::-webkit-scrollbar-track,
.panelBody::-webkit-scrollbar-track,
.lessonBodyMain::-webkit-scrollbar-track { background: transparent; }
#pickerView::-webkit-scrollbar-thumb,
.stackScroller::-webkit-scrollbar-thumb,
.panelBody::-webkit-scrollbar-thumb,
.lessonBodyMain::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}
#pickerView:hover::-webkit-scrollbar-thumb,
.stackScroller:hover::-webkit-scrollbar-thumb,
.panelBody:hover::-webkit-scrollbar-thumb,
.lessonBodyMain:hover::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.22);
}

html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  overflow: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 8, 12, 0.4), rgba(4, 8, 12, 0.7)),
              url("assets/bakgrund2.webp") center/cover no-repeat;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  height: 100dvh;
  max-width: 1040px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.appHeader {
  flex-shrink: 0;
  padding: 6px 4px 14px;
}
.appHeaderInner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.aboutLink {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.32);
  padding: 4px 8px;
  margin-top: 2px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 160ms ease, border-color 160ms ease;
}
.aboutLink:hover {
  color: rgba(255, 255, 255, 0.58);
  border-color: rgba(255, 255, 255, 0.1);
}
.appFooter {
  margin-top: 48px;
  padding: 24px 4px 20px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}
.appFooter a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 140ms ease;
}
.appFooter a:hover {
  color: rgba(255, 255, 255, 0.75);
}

.appHeader h1 {
  margin: 0;
  font-size: clamp(24px, 3.8vw, 38px);
  line-height: 1.08;
  letter-spacing: 0.01em;
  font-weight: 600;
  font-family: Georgia, "Times New Roman", serif;
}
.appHeader p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.appHeaderTextLink {
  margin-top: 6px !important;
  font-size: 12px !important;
  color: rgba(255, 255, 255, 0.42) !important;
}
.appHeaderTextLink a {
  color: color-mix(in srgb, var(--accent) 70%, white);
  text-decoration: none;
}
.appHeaderTextLink a:hover {
  text-decoration: underline;
}

.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hidden { display: none !important; }

#pickerView {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 2px calc(20px + env(safe-area-inset-bottom)) 0;
}

.pickerGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1050px;
  margin: 0 auto;
}

.pickerCard {
  border: 1px solid color-mix(in srgb, var(--accent, #7cf0da) 40%, transparent);
  background: linear-gradient(180deg, rgba(20, 34, 45, 0.9), rgba(14, 24, 32, 0.9));
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.pickerCard:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent, #7cf0da) 60%, transparent);
  box-shadow: 0 20px 42px rgba(0,0,0,0.36);
}
.pickerCard:active {
  transform: translateY(0);
  box-shadow: 0 14px 32px rgba(0,0,0,0.34);
}
.pickerCard img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.pickerCardBody { padding: 13px 13px 14px; }
.pickerCard p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pickerCard--featured {
  grid-column: span 2;
  border-color: color-mix(in srgb, var(--accent, #7cf0da) 55%, transparent);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
  position: relative;
  cursor: pointer;
}
.pickerCard--featured::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(5, 10, 15, 0.85) 0%,
    rgba(5, 10, 15, 0.4) 50%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 0;
}
.pickerCard--featured img,
.pickerCard--featured .pickerCardBody {
  position: relative;
  z-index: 1;
}
.pickerCard--featured:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}
.pickerCard--featured:active {
  transform: translateY(0);
}
.pickerEyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent, #93d8ca); }
.pickerTitle { margin-top: 7px; font-size: 17px; font-weight: 600; line-height: 1.2; }
.pickerIntro {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: color-mix(in srgb, var(--muted) 80%, var(--bg));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* About modal — same visual system as cards */
.aboutModal {
  position: fixed;
  inset: 0;
  z-index: 25;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  pointer-events: none;
  transition: opacity 200ms ease, visibility 200ms;
}
.aboutModal.hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.aboutModal:not(.hidden) {
  pointer-events: auto;
}
.aboutModalScrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 2, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
.aboutModalCard {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 24px 22px 28px;
  border-radius: var(--lesson-card-radius);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(12, 22, 32, 0.42) 45%,
    rgba(8, 16, 26, 0.52) 100%
  );
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    inset 0 1px 0 rgba(124, 240, 218, 0.07);
  text-align: left;
  pointer-events: auto;
}
.aboutModalEyebrow {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 60%, rgba(255, 255, 255, 0.4));
  margin-bottom: 8px;
}
.aboutModalTitle {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 600;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
}
.aboutModalText {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}
.aboutModalText:last-of-type {
  margin-bottom: 0;
}
.aboutModalClose {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-size: 18px;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms, color 120ms;
}
.aboutModalClose:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
}

.stackTopbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.stackMeta { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; min-width: 160px; }
.stackTitle { color: var(--muted); font-size: 13px; text-align: right; }
.lessonIndicator {
  min-width: 88px;
  text-align: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid color-mix(in srgb, var(--accent, #7cf0da) 46%, transparent);
  color: color-mix(in srgb, var(--accent, #7cf0da) 75%, white 25%);
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%);
}

.uiBtn {
  border: 1px solid var(--line);
  background: rgba(12, 20, 28, 0.86);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  min-height: 40px;
}

.stackScroller {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
}

.lessonPage {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  height: 100dvh;
  height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

/* Outer glass shell: air around inner “screen”, not a full-viewport slab */
.lessonCard {
  width: min(400px, calc(100% - 24px));
  max-width: 100%;
  max-height: min(87dvh, 680px);
  height: auto;
  border-radius: var(--lesson-card-radius);
  border: 1px solid color-mix(in srgb, var(--accent, #7cf0da) 45%, transparent);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(12, 22, 32, 0.42) 45%,
    rgba(8, 16, 26, 0.52) 100%
  );
  backdrop-filter: blur(20px) saturate(130%);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    inset 0 1px 0 rgba(124, 240, 218, 0.07);
  padding: var(--lesson-card-pad);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* Inset framed media — does not touch card edges */
.lessonMedia {
  flex-shrink: 0;
  border-radius: var(--lesson-media-radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.25) inset,
    0 4px 16px rgba(0, 0, 0, 0.2);
}
.lessonImage {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
}

.lessonBody {
  flex: 0 1 auto;
  min-height: 0;
  padding: 0;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.lessonBodyMain {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(32vh, 200px);
  overflow-y: auto;
  padding: 0 4px 6px;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}
.lessonEyebrow {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent, #8fd9cb) 75%, rgba(255, 255, 255, 0.5));
  margin-bottom: 6px;
}
.lessonTitle {
  margin: 0 0 6px;
  font-size: clamp(20px, 5vw, 26px);
  line-height: 1.15;
  font-weight: 600;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
}
.lessonText {
  color: rgba(230, 238, 245, 0.88);
  line-height: 1.45;
  white-space: pre-line;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.lessonHint { margin-top: 6px; color: #bfeee3; font-size: 12px; text-align: center; }
.lessonActions {
  flex-shrink: 0;
  margin-top: 10px;
  padding: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
/* Card buttons: grey = no PANELS content; --available = same accent language as panel .tabBtn.active + pill glow */
.lessonPanelBtn {
  padding: 8px 14px;
  min-height: 36px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.48);
  opacity: 0.78;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}
.lessonPanelBtn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.75);
  opacity: 0.92;
}
.lessonPanelBtn:disabled {
  cursor: not-allowed;
  pointer-events: none;
}
.lessonPanelBtn--available {
  opacity: 1;
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  box-shadow:
    0 0 16px color-mix(in srgb, var(--accent) 20%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.lessonPanelBtn--available:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow:
    0 0 20px color-mix(in srgb, var(--accent) 26%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  isolation: isolate;
  transition: opacity 200ms ease, visibility 200ms;
}
.panel.hidden {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.panelScrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 2, 10, 0.86);
  transition: opacity 200ms ease;
}
.panel.hidden .panelScrim {
  opacity: 0;
}
.panelCard {
  position: absolute;
  z-index: 1;
  right: max(12px, env(safe-area-inset-right));
  left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  top: 18%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 12%),
    linear-gradient(
      180deg,
      rgba(10, 22, 34, 0.55) 0%,
      rgba(6, 14, 24, 0.68) 100%
    );
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(0, 0, 0, 0.25) inset,
    inset 0 1px 0 rgba(124, 240, 218, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-radius: var(--panel-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 200ms ease, transform 200ms ease;
}
.panel.hidden .panelCard {
  opacity: 0;
  transform: translateY(10px);
}
.panelHead {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.panelTitle {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}
.panelCloseBtn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.4);
  font-size: 18px;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms, color 120ms;
}
.panelCloseBtn:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
}
.panelTabs {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px 16px 14px;
}
.tabBtn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.38);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 150ms, color 150ms, background 150ms;
}
.tabBtn:not(.active):hover {
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.05);
}
.tabBtn.active {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}
.panelTabs.accent-orange .tabBtn.active { border-color: #f7a25e; color: #f7a25e; }
.panelTabs.accent-yellow .tabBtn.active { border-color: #f1ce68; color: #f1ce68; }
.panelTabs.accent-green .tabBtn.active { border-color: #72dfc7; color: #72dfc7; }
.panelTabs.accent-blue .tabBtn.active { border-color: #7db9f5; color: #7db9f5; }
.panelTabs.accent-purple .tabBtn.active { border-color: #bf9cfa; color: #bf9cfa; }
.panelBody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px calc(28px + env(safe-area-inset-bottom));
  color: #dce6ef;
  line-height: 1.62;
  font-size: 15px;
  max-width: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, transparent 40%);
}
.panelBody h3 { color: var(--text); margin: 16px 0 8px; font-size: 15px; font-weight: 600; }
.panelBody h3:first-child { margin-top: 0; }
.panelBody p { margin: 0 0 14px; }
.panelBody img { width: 100%; border-radius: 8px; margin-bottom: 14px; }
.panelBody ul { margin: 0 0 14px 20px; padding: 0; }
.panelBody li { margin-bottom: 8px; }

.accent-orange { --accent: #f7a25e; }
.accent-yellow { --accent: #f1ce68; }
.accent-green { --accent: #72dfc7; }
.accent-blue { --accent: #7db9f5; }
.accent-purple { --accent: #bf9cfa; }

/* Mobile: compact top, viewport-aware lesson, CTA priority */
@media (max-width: 600px) {
  .pickerGrid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .pickerCard--featured {
    grid-column: span 1;
  }
  .appHeader {
    padding: 4px 4px 8px;
  }
  .appFooter {
    font-size: 10px;
    margin-top: 36px;
    padding: 20px 4px 16px;
  }
  .aboutLink {
    font-size: 11px;
    padding: 3px 6px;
  }
  .aboutModalCard {
    padding: 20px 18px 24px;
    margin: 0 12px;
  }
  .aboutModalTitle {
    font-size: 18px;
  }
  .aboutModalText {
    font-size: 13px;
  }
  .appHeader h1 {
    font-size: 22px;
  }
  .appHeader p {
    font-size: 12px;
    margin-top: 4px;
  }
  /* Lesson view: hide hero header for max space */
  .lessonView .appHeader {
    padding: 2px 4px 4px;
  }
  .lessonView .appHeader h1 {
    font-size: 16px;
  }
  .lessonView .appHeader p {
    display: none;
  }
  .stackTopbar {
    margin-bottom: 4px;
  }
  .stackTopbar .uiBtn {
    padding: 6px 10px;
    min-height: 36px;
  }
  .lessonIndicator {
    min-width: 72px;
    padding: 4px 8px;
    font-size: 11px;
  }
  .stackTitle {
    font-size: 11px;
  }
  :root {
    --lesson-card-radius: 28px;
    --lesson-media-radius: 14px;
    --lesson-card-pad: 16px;
    --panel-radius: 26px;
  }
  .lessonPage {
    min-height: 100dvh;
    height: 100dvh;
    padding: max(8px, env(safe-area-inset-top)) 12px max(14px, env(safe-area-inset-bottom));
  }
  .lessonCard {
    width: min(380px, calc(100% - 20px));
    max-height: min(88dvh, 660px);
  }
  .lessonBody {
    margin-top: 10px;
  }
  .lessonBodyMain {
    max-height: min(30vh, 180px);
    padding: 0 2px 4px;
  }
  .lessonTitle { font-size: 18px; }
  .lessonText { font-size: 13px; }
  .lessonActions {
    margin-top: 8px;
    gap: 8px;
  }
  .lessonPanelBtn {
    padding: 7px 12px;
    min-height: 34px;
    font-size: 12px;
  }
  .panelHead { padding: 12px 14px 8px; }
  .panelTitle { font-size: 15px; }
  .panelTabs { padding: 8px 14px 12px; gap: 6px; }
  .panelCard .tabBtn { padding: 6px 12px; font-size: 13px; }
  .panelCloseBtn { width: 26px; height: 26px; font-size: 16px; }
  .panelBody { padding: 12px 14px calc(24px + env(safe-area-inset-bottom)); font-size: 14px; }
}

@media (min-width: 900px) {
  .panelCard {
    left: auto;
    width: min(640px, 92vw);
    top: 12%;
  }
}
