/* GBS platform foundations – shared by website, Teams, apps and generators.
   Kept separate from lesson/masterplan colours and the PDF print styles. */
:root {
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --ink: #142126;
  --ink-soft: #405157;
  --ink-quiet: #5b686c;
  --water-deep: #142126;
  --brand: #c7d300;
  --brand-soft: #f6f8df;
  --paper: #fff;
  --bg-warm: #f7f8f4;
  --border: #d7dedb;
  --border-soft: #e8ede9;
  --focus-ring: #477437;
}
body { font-family: var(--font-body); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, input, select, textarea { font-family: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button, a, input, select, textarea, [contenteditable] { touch-action: manipulation; }
button:not(:disabled), summary { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
[hidden] { display: none !important; }
body .section-head h1 { font-size: clamp(1.7rem, 2.7vw, 2.5rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.18; }
body .section-head p { max-width: 65ch; line-height: 1.55; }
.btn, .sg-btn-primary, .sg-btn-ghost { font-weight: 700; line-height: 1.35; }
.btn:focus-visible, .sg-btn-primary:focus-visible { outline-color: var(--focus-ring); }
.sidenav a > span { white-space: nowrap; }
.sidenav a svg { flex-shrink: 0; }
.sidenav a.is-active svg, .sidenav a[aria-current="page"] svg { color: #142126 !important; }
.sidebar a:focus-visible { outline-color: var(--brand); }
.bottomnav { padding-bottom: max(7px, env(safe-area-inset-bottom)); }
.bottomnav a { min-height: 52px; min-width: 0; }
.bottomnav a > span { white-space: nowrap; font-weight: 700; }
.editor-gate-card { border: 1px solid var(--border); box-shadow: 0 14px 45px #1421260c; }
.editor-gate-card h1 { letter-spacing: -.035em; }
.editor-gate-merken { line-height: 1.5; }
.editor-gate-merken input { width: 18px; height: 18px; accent-color: var(--ink); }
.editor-gate-error { color: #ad2929; }
.ed-hint, .ed-mini, .info-hinweis { color: var(--ink-quiet); }
.ed-block.has-unsaved, [data-ed-save-section].has-unsaved { border-color: #7c8e3a; }
.ed-block-save { color: #263b18; background: #f2f6d8; }
.editor-hub-tile, .toolbox-tile, .mc-class-card { box-shadow: none; transition: border-color .15s ease, background .15s ease; }
.editor-hub-tile:hover, .toolbox-tile:hover { box-shadow: none; transform: none; }
.editor-hub-tile h2, .editor-hub-tile h3 { letter-spacing: -.025em; }
.gbs-update { position: fixed; z-index: 1300; bottom: calc(82px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 11px 18px; border: 1px solid #687738; border-radius: 30px; background: #142126; color: #fff; font: 700 13px/1.45 var(--font-body); box-shadow: 0 4px 18px #14212620; }

/* Media: quiet desktop mosaic, complete images, a one-finger mobile feed. */
.bdw-approved { border: 1px solid var(--border); border-radius: 12px; box-shadow: none; overflow: hidden; }
.bdw-approved-head { padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.bdw-gallery-feed { padding: 18px; background: #f2f4ef; }
.bdw-gallery { display: block; columns: 3 240px; column-gap: 16px; overflow: visible; padding: 0; }
.bdw-gallery-card { display: inline-block; width: 100%; margin: 0 0 16px; break-inside: avoid; border: 1px solid var(--border); border-radius: 10px; background: #fff; overflow: visible; box-shadow: none; vertical-align: top; }
.bdw-gallery-card:hover { transform: none; box-shadow: none; }
.bdw-media-open { position: relative; display: block; overflow: hidden; border-radius: 9px 9px 0 0; width: 100%; background: #152226; }
body .bdw-gallery-card img, body .bdw-gallery-card video { display: block; width: 100%; height: auto; max-height: 600px; object-fit: contain; background: #152226; }
.bdw-gallery-card video { min-height: 180px; }
.bdw-video-badge { width: 58px; height: 58px; padding: 0 0 0 2px; border: 1px solid #ffffffb3; background: #142126b3; box-shadow: none; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); color: #fff; }
.bdw-media-type { position: absolute; left: 12px; top: 12px; background: #142126c9; color: #fff; border-radius: 5px; padding: 3px 7px; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.bdw-reactions.is-compact { position: relative; align-items: center; padding: 5px 10px; border: 0; border-radius: 0 0 10px 10px; gap: 4px; }
.bdw-reactions .bdw-reaction { flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: 7px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; }
.bdw-reaction:hover { transform: none; background: #f1f4e5; }
.bdw-reaction.is-active { background: #eff3cc; color: #314719; }
.bdw-reaction.is-active svg { fill: currentColor; }
.bdw-reaction span { display: inline-flex; }
.bdw-reaction b:empty { display: none; }
.bdw-reaction-total { margin-left: auto; color: var(--ink-quiet); font-size: 12px; font-variant-numeric: tabular-nums; }
.bdw-more-reactions { position: relative; }
.bdw-more-reactions > summary { list-style: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; font-size: 24px; color: var(--ink-soft); }
.bdw-more-reactions > summary::-webkit-details-marker { display: none; }
.bdw-more-reactions[open] > summary { background: #eff3cc; }
.bdw-more-reactions > div { position: absolute; z-index: 5; bottom: calc(100% + 5px); left: 0; display: flex; padding: 5px; gap: 3px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 5px 18px #14212619; }
.bdw-lightbox { padding: 16px; box-sizing: border-box; overscroll-behavior: contain; }
body .bdw-lightbox-panel { width: min(1180px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); border-radius: 12px; }
.bdw-lightbox-stage { grid-column: 1; grid-row: 1; touch-action: pan-y pinch-zoom; min-height: 220px; }
.bdw-lightbox-stage img, .bdw-lightbox-stage video { max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); }
.bdw-lightbox-info { grid-column: 2; grid-row: 1 / span 2; padding-top: 62px; }
.bdw-lightbox-info p { white-space: pre-wrap; overflow-wrap: anywhere; }
.bdw-lightbox-close { z-index: 4; width: 44px; height: 44px; top: 10px; right: 10px; background: #142126; color: #fff; border: 1px solid #ffffff80; }
.bdw-viewer-nav { grid-column: 1; display: flex; justify-content: center; align-items: center; gap: 24px; color: #fff; background: #142126; padding: 2px 10px; }
.bdw-viewer-nav button { width: 44px; height: 44px; border: 0; background: transparent; color: #fff; font: 32px/1 var(--font-body); }
.bdw-viewer-nav button:disabled { opacity: .35; }
.bdw-viewer-nav span { font-size: 12px; font-variant-numeric: tabular-nums; }
.bdw-playback-error { padding: 12px; border: 1px solid #d9c57e; background: #fff8df; color: #594100; font-size: 14px; }
.bdw-admin-class.is-active { box-shadow: none; border-color: #899939; background: #f7f9e7; }
.bdw-admin-class-label { color: var(--ink-soft); }
.bdw-admin-top p { max-width: 55ch; font-size: 13px; }
#bdw-delete-class { font-size: 12px; color: #943434; border-color: transparent; }
.bdw-admin-actions .btn { min-height: 40px; }

/* Exam generator shares the same frame; print preview keeps print fonts. */
.gbs-generator { background: var(--bg-warm); line-height: 1.55; }
.gbs-generator > div { padding-top: 24px; }
.gbs-generator header { margin-bottom: 24px; }
.gbs-generator header h1 { font-size: clamp(1.5rem, 2.5vw, 2rem); letter-spacing: -.03em; }
.sg-header-actions { min-width: 0; }
.gbs-generator header a { min-height: 40px; display: inline-flex; align-items: center; }
.gbs-generator input:not([type=checkbox]):not([type=radio]), .gbs-generator select { min-height: 40px; }
.gbs-generator .text-xs { font-size: .8rem; }
.gbs-generator [class*="text-[var(--ink-quiet)]"] { color: var(--ink-quiet); }
.info-intro { max-width: 72ch; }
.info-section { border: 1px solid var(--border); background: #fff; border-radius: 9px; margin: 12px 0; overflow: hidden; }
.info-section summary { padding: 16px 18px; font-weight: 800; }
.info-section > div { padding: 0 18px 18px; max-width: 82ch; line-height: 1.7; }
.info-section li + li { margin-top: 10px; }

@media (max-width: 780px) {
  .ed-info-pop { display: none; position: fixed; left: 18px; right: 18px; bottom: 84px; width: auto; transform: none; z-index: 300; }
  .ed-info:hover .ed-info-pop, .ed-info:focus-visible .ed-info-pop { display: block; transform: none; }
  .ed-info-pop::after { display: none; }
  input:not([type=checkbox]):not([type=radio]), select, textarea, .ed-rich-input { font-size: 16px; }
  .btn, .iconbtn { min-height: 44px; }
  .section-head, body .section-head { padding-block: 20px; }
  body .section-head h1 { font-size: 1.7rem; }
  body .bdw-gallery, body.is-appmode.page-bildderwoche .bdw-gallery, body.page-bdw-solo .bdw-gallery { display: block; columns: 1; padding: 0; overflow: visible; scroll-snap-type: none; }
  .bdw-gallery-feed { padding: 10px; overflow: visible; }
  .bdw-gallery-card { display: block; width: 100%; margin-bottom: 14px; scroll-snap-align: none; }
  body .bdw-gallery-card img, body .bdw-gallery-card video, body.is-appmode.page-bildderwoche .bdw-gallery-card img, body.is-appmode.page-bildderwoche .bdw-gallery-card video { height: auto; max-height: 70vh; object-fit: contain; }
  .bdw-approved-head { padding: 12px; }
  .bdw-share-toggle { min-height: 42px; width: auto; padding: 9px 12px; }
  .bdw-lightbox { padding: 8px; }
  body .bdw-lightbox-panel { display: flex; flex-direction: column; width: 100%; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; }
  .bdw-lightbox-stage { min-height: 120px; flex-shrink: 0; }
  .bdw-lightbox-stage img, .bdw-lightbox-stage video { height: auto; max-height: 65vh; max-height: 65dvh; }
  .bdw-lightbox-info { padding: 18px; overflow: visible; }
  .bdw-lightbox-info p { font-size: 15px; line-height: 1.65; }
  .bdw-lightbox-close { position: sticky; top: 8px; right: 8px; align-self: flex-end; margin: 8px 8px -52px 0; flex: 0 0 44px; }
  .bdw-admin-shell { gap: 12px; }
  .bdw-admin-classes { display: block; min-width: 0; }
  .bdw-admin-class-group, .bdw-admin-more-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; flex-wrap: nowrap; }
  .bdw-admin-class-label, .bdw-admin-class-empty { flex: 0 0 auto; align-self: center; }
  .bdw-admin-class-label { display: none; }
  .bdw-admin-class { flex: 0 0 175px; min-height: 66px; }
  .bdw-admin-main { padding: 14px; min-width: 0; }
  .bdw-admin-top-actions { display: flex; gap: 6px; }
  .bdw-admin-top-actions .btn { width: auto; }
  .bdw-admin-top h2 { font-size: 19px; }
  .editor-hub-grid { gap: 12px; }
  .editor-hub-tile { min-height: 140px; padding: 20px 16px; }
  .gbs-generator > div { padding-top: 12px; }
  .gbs-generator header { padding: 16px; margin-bottom: 16px; }
  .gbs-generator header .flex-shrink-0 { flex-shrink: 1; }
  .sg-header-actions { flex-wrap: wrap; gap: 8px; }
  .sg-header-actions a { font-size: 12px; padding: 8px 10px; }
  .gbs-generator .sg-header-actions img { width: 32px; height: 32px; }
  .info-qr-card { display: none; }
}
@media (max-width: 380px) { .bottomnav a > span { font-size: 10px; } .bottomnav a svg { width: 38px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print { .gbs-update { display: none !important; } }
.legal-page { max-width: 1100px; }
.legal-page p, .legal-page li { line-height: 1.7; overflow-wrap: anywhere; }
.legal-contact { border-left: 3px solid var(--brand, #c7d300); padding: 4px 0 4px 20px; margin: 24px 0; }
.legal-contact h2 { margin-top: 0; }
.legal-contact address { font-style: normal; line-height: 1.65; }
.legal-meta { margin: 28px 0 8px; font-size: 14px; }
.bdw-rights { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 8px; font-size: 13px; line-height: 1.6; }
.bdw-rights input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 3px; accent-color: #667000; }
.bdw-rights-link { display: inline-block; margin: 0 0 12px 28px; font-size: 13px; }
.gbs-hub-legal { display: flex; gap: 12px 24px; flex-wrap: wrap; margin-top: 20px; font-size: 14px; }
.gbs-hub-legal a { color: #d3dddd; padding: 10px 0; text-underline-offset: 4px; }
.gbs-hub-legal a:hover { color: #c7d300; }
.class-entry-recovery { max-width: 720px; margin: 32px auto; padding: 24px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--brand, #c7d300); border-radius: 8px; }
.class-entry-recovery > img { border-radius: 12px; }
.class-entry-recovery p { line-height: 1.6; }
.class-entry-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 24px; }
.class-entry-links a { min-height: 48px; justify-content: center; }
