:root { --demo-toolbar: 70px; }
html { scroll-padding-top: calc(var(--demo-toolbar) + 10px); }
body { padding-top: var(--demo-toolbar); }
.demo-toolbar {
  position: fixed; inset: 0 0 auto; z-index: 1200; min-height: var(--demo-toolbar);
  display: grid; grid-template-columns: minmax(230px, 1fr) auto minmax(160px, 1fr);
  align-items: center; gap: 12px; padding: 8px 18px; background: #eaf8f5; color: #12363c;
  box-shadow: 0 1px 0 #9dcac4;
}
.demo-toolbar > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 10px; }
.demo-toolbar small { flex-basis: 100%; color: #345b62; font-size: 11px; }
.demo-toolbar a { color: #075d54; }
.demo-toolbar nav { display:flex; gap: 4px; }
.demo-toolbar nav a, #resetDemo { padding: 8px 10px; border-radius: 8px; text-decoration: none; font-size: .85rem; }
.demo-toolbar nav a[aria-current="page"] { color: #fff; background: #08685e; font-weight: 750; }
#resetDemo { justify-self: end; color: #104c46; background: #fff; border: 1px solid #82aca7; cursor: pointer; }
.demo-toolbar :is(a,button):focus-visible { outline: 2px solid #075d54; outline-offset: 3px; }

body .sidebar { top: var(--demo-toolbar); }
body .flb7-globalbar { top: var(--demo-toolbar); }
body .flb7-tabsbar { top: calc(var(--demo-toolbar) + 58px); }
body .flb7-search-results { top: calc(var(--demo-toolbar) + 52px); }
#flbBellPanel { margin-top: var(--demo-toolbar); }
.demo-booking { width: min(94vw, 430px); border: 1px solid #91b9b4; border-radius: 14px; padding: 22px; background: #edf9f7; color: #143941; }
.demo-booking::backdrop { background: #062b32ad; }
.demo-booking label { display: grid; gap: 5px; margin: 12px 0; }
.demo-booking input, .demo-booking select { border: 1px solid #7d969c; border-radius: 7px; background: #fff; color: #16343a; padding: 9px; }
.demo-booking-status { color: #92253a; }
.demo-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-example { margin: 10px 0; padding: 14px; }
@media (max-width: 760px) {
  :root { --demo-toolbar: 112px; }
  .demo-toolbar { grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; padding: 7px 10px; }
  .demo-toolbar nav { grid-row: 2; grid-column: 1 / -1; flex-wrap: wrap; }
  .demo-toolbar nav a, #resetDemo { font-size: .77rem; padding: 7px; }
  body[data-auth-role="student"] .sidebar { top: auto; }
}
@media (max-width: 640px) {
  body .flb7-tabsbar { top: calc(var(--demo-toolbar) + 54px); }
}

html[data-flb-plan="standard"] :is([data-adk-only], [data-pro-only], #page-adk, #page-theorie, #trainingPage, #messagesPage, [data-page="training"], [data-page="messages"], [data-open-page="training"], [data-open-page="messages"], #office-billing, #office-payroll, [data-o="billing"], [data-o="payroll"]) {
  display: none !important;
}

body.dark .demo-booking {
  color-scheme: dark;
  background: #102c34;
  color: #e6f4f4;
  border-color: #476d73;
}
body.dark .demo-booking::backdrop { background: #030e14bb; }
body.dark .demo-booking :is(input, select) {
  background: #143841;
  color: #e6f4f4;
  border-color: #527b82;
}
body.dark .demo-booking .secondary-button {
  background: #1b424c !important;
  color: #e6f4f4 !important;
  border: 1px solid #527b82 !important;
}
body.dark .demo-booking button[type="submit"] {
  background: #205951 !important;
  color: #e9fff7 !important;
}
body.dark .demo-booking button:disabled {
  color: #9ab6ba !important;
  background: #19333b !important;
  opacity: 1;
}
body.dark .demo-booking :is(button,input,select):focus-visible {
  outline: 2px solid #8ad9ce;
  outline-offset: 2px;
}
body.dark .demo-booking-status { color: #ffb9c9; }

/* Fixed demo panels start below the demo toolbar and workspace navigation. */
#fullStudentRecordModal :is([data-adk-only], [data-pro-only], #trainingCockpitContent, #trainingCockpitLoading, .training-timeline-card) {
  display:none !important;
}
.record-contact-link { flex-shrink:0; text-decoration:none; }
.record-contact-link[aria-disabled="true"] { opacity:.55; cursor:default; }
.student-instructor-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin-top:8px; }
.student-instructor-actions[hidden] { display:none; }
@media (min-width:1101px) {
  body.flb7-workspace #page-fahrschueler > .flb-student-record-host:not([hidden]) {
    top:calc(var(--demo-toolbar) + 122px) !important;
  }
  body.flb7-workspace :is(#appointmentModal.show,#theoryLiveBackdrop:not([hidden]),#fullStudentRecordModal.show:not(.flb-inline-student-record)) {
    top:calc(var(--demo-toolbar) + 112px) !important;
  }
}
@media (max-width:1100px) {
  #fullStudentRecordModal.show:not(.flb-inline-student-record),
  .student-record-modal.flb-record-standalone {
    top:var(--demo-toolbar) !important;
    max-height:calc(100dvh - var(--demo-toolbar)) !important;
  }
}

/* Demo cockpit cards */
#page-cockpit .right-column :is(.pinboard-panel, .flb7-task-panel) {
  padding: clamp(14px, 2vw, 22px);
}
#page-cockpit .right-column :is(.pinboard-panel, .flb7-task-panel) h3 {
  margin: 4px 0 0;
  color: var(--flb-light-ink, var(--ink));
}
#page-cockpit #pinboardInput::placeholder {
  color: var(--flb-light-muted, var(--muted));
  opacity: 1;
}
#page-cockpit .pinboard-hint {
  margin: 12px 0 0;
  font-size: .75rem;
  line-height: 1.45;
}
#page-cockpit .flb7-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  text-align: left;
  color: var(--flb-light-ink, var(--ink));
  font: inherit;
}
#page-cockpit .flb7-task strong,
#page-cockpit .flb7-task small { display: block; }
#page-cockpit .flb7-task strong {
  color: inherit;
  font-size: .9rem;
  line-height: 1.35;
}
#page-cockpit .flb7-task small {
  margin-top: 3px;
  color: var(--flb-light-muted, var(--muted));
  line-height: 1.4;
}
#page-cockpit .flb7-task:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Only the PrüfPilot module is presented on the demo exam page. */
#page-pruefungen:has(> #flbPruefpilotModule) > :not(#flbPruefpilotModule) {
  display:none !important;
}
#studentModal .invite-form-grid label:has(textarea) { display:block; min-width:0; }
#studentModal .invite-form-grid textarea { display:block; width:100%; min-height:5rem; resize:vertical; }
@media (min-width:1101px) {
  body.flb7-workspace #studentModal.show,
  body.flb7-workspace #oaOfficeFormPanel.show,
  body.flb7-workspace #ppDemoRegistration.show {
    top:calc(var(--demo-toolbar) + 112px) !important;
  }
}
@media (max-width:1100px) {
  #studentModal.show {
    inset:var(--demo-toolbar) 0 0 !important;
    overflow:auto;
  }
  #oaOfficeFormPanel.show,
  #ppDemoRegistration.show {
    top:calc(var(--demo-toolbar) + 8px);
  }
}

#flbPruefpilotModule .pp-row .pp-demo-actions {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
  gap:8px;
  min-width:0;
}
#flbPruefpilotModule .pp-demo-actions :is(.pp-demo-action,.pp-badge) {
  display:inline-flex;
  align-items:center;
  width:auto;
  min-height:32px;
  padding:4px 10px;
  border:1px solid #477481;
  border-radius:8px;
  background:#153842;
  color:#e4f8fa !important;
  font:600 .85rem/1.3 system-ui,sans-serif;
  text-decoration:none;
}
#flbPruefpilotModule .pp-demo-actions .pp-demo-action { cursor:pointer; }
#flbPruefpilotModule .pp-demo-actions .pp-demo-action:hover { text-decoration:underline; }
#flbPruefpilotModule .pp-demo-actions .pp-demo-action:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
html[data-theme="light"] #flbPruefpilotModule .pp-demo-actions :is(.pp-demo-action,.pp-badge) {
  background:#e9f4f4;
  border-color:#71989a;
  color:#12383e !important;
}

#flbPruefpilotModule .pp-list-controls {
  display:flex; flex-wrap:wrap; gap:12px; margin:12px 0;
}
#flbPruefpilotModule .pp-list-controls label {
  display:grid; gap:5px; flex:1 1 190px; min-width:0;
}
#flbPruefpilotModule .pp-list-controls :is(input,select) {
  width:100%; min-width:0; padding:8px 10px;
  border:1px solid var(--flb-light-line,#477481); border-radius:8px;
  background:var(--flb-light-surface,#153842); color:var(--flb-light-ink,#e4f8fa);
  font:inherit;
}
html #flbPruefpilotModule :is(.pp-row,.pp-detail-grid) :is(.pp-status,.pp-demo-actions [data-pp-status]),
html #ppDetail .pp-status {
  background:var(--pp-badge-bg,#36505b) !important;
  color:var(--pp-badge-ink,#fff) !important;
  border-color:transparent;
}
:is(.pp-sent,[data-pp-status="sent"]) { --pp-badge-bg:#12557a; }
:is(.pp-processing,.pp-requested,[data-pp-status="processing"],[data-pp-status="requested"]) { --pp-badge-bg:#784700; }
:is(.pp-question,[data-pp-status="question"]) { --pp-badge-bg:#623889; }
:is(.pp-confirmed,[data-pp-status="confirmed"]) { --pp-badge-bg:#08645d; }
:is(.pp-passed,[data-pp-status="passed"]) { --pp-badge-bg:#2e601e; }
:is(.pp-failed,[data-pp-status="failed"]) { --pp-badge-bg:#932a39; }
:is(.pp-cancelled,[data-pp-status="cancelled"]) { --pp-badge-bg:#4c5564; }

/* Demo controls retain visible boundaries in both color schemes. */
#flbPruefpilotModule .pp-list-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
}
#flbPruefpilotModule #ppRefresh {
  flex:0 0 auto;
  width:auto;
  padding:8px 14px;
  font-size:.875rem;
  color:inherit;
  background:transparent;
  border:1px solid currentColor;
}
#page-einstellungen :is([data-settings-section="planning"],[data-settings-section="notifications"]) .settings-switch-row > i {
  background:#385960;
  border:1px solid #75979c;
}
#page-einstellungen :is([data-settings-section="planning"],[data-settings-section="notifications"]) .settings-switch-row > input:checked + i {
  background:#00766d;
  border-color:#83e5d7;
}
#page-einstellungen .settings-switch-row > input:focus-visible + i {
  outline:2px solid currentColor;
  outline-offset:3px;
}
#page-einstellungen :is([data-settings-section="planning"],[data-settings-section="notifications"]) :is(small,.settings-form-grid label) {
  font-size:.875rem;
  color:inherit;
}
#page-einstellungen .teacher-push-controls {
  display:flex;
  width:auto;
  flex-wrap:wrap;
  gap:8px;
}
#demoSimulatorBooking[hidden], #teacherPushTest[hidden], #teacherPushAction[hidden] {display:none!important}
#demoSimulatorBooking.show {
  background:var(--flb-light-surface,#102e37);
  color:var(--flb-light-text,#e6f4f4);
  border:1px solid var(--flb-light-outline,#385960);
  border-radius:14px;
  overflow:auto;
}
#demoSimulatorBooking form {display:grid;gap:12px;padding:20px;margin:0}
#demoSimulatorBooking label {display:grid;gap:5px}
#demoSimulatorBooking :is(h2,p) {margin:0}
#demoSimulatorBooking .demo-dialog-actions {display:flex;flex-wrap:wrap;gap:8px}
@media (max-width:1100px) {
  #demoSimulatorBooking.show {position:fixed;inset:auto 10px 10px;max-height:85dvh;z-index:2100}
}

.cal-event.demo-cover-event {
  border-inline-start:5px solid #c17a13 !important;
  background:#4d351e !important;
  color:#fff5e3 !important;
}
.cal-event.demo-cover-event :is(b,strong,small) {color:inherit!important}
html[data-theme="light"] .cal-event.demo-cover-event,
body:not(.dark) .cal-event.demo-cover-event {background:#fff0d6!important;color:#482a03!important}
.demo-cover-contact[hidden], .demo-cover-contact [hidden] {display:none!important}
.demo-cover-contact {margin-top:12px}

#studentList .student-row[hidden] {display:none!important}
#flbOfficeAgenda {
  position:relative;
  inset:auto;
  width:100%;
  max-width:none;
  min-height:0;
  margin:0;
  padding:clamp(14px,2vw,24px);
  box-sizing:border-box;
  background:var(--flb-light-surface,var(--panel,#102e37));
  border:1px solid var(--flb-light-outline,var(--line,#385960));
  border-radius:16px;
  color:inherit;
}
#flbOfficeAgenda .oa-head, #flbOfficeAgenda .oa-controls {gap:12px;flex-wrap:wrap}
#flbOfficeAgenda .oa-controls .oa-done-filter {display:flex;align-items:center;gap:8px}
#flbOfficeAgenda #oaDone {appearance:auto;width:18px;height:18px;min-height:0;padding:0;accent-color:#21aeaa}
#flbOfficeAgenda .oa-summary {display:flex;flex-wrap:wrap;gap:8px;background:transparent;padding-inline:0}
#flbOfficeAgenda .oa-summary > * {padding:8px 12px;border:1px solid var(--flb-light-outline,var(--line,#385960));border-radius:8px}
.demo-team-card {padding:16px;display:grid;gap:12px}
.demo-team-card h2,.demo-team-card h3,.demo-team-card p {margin:0}
.demo-team-actions,.demo-branch {display:flex;gap:12px;align-items:end;flex-wrap:wrap}
.demo-branch {padding-block:8px}
.demo-shared-lessons {display:grid;gap:8px}
.demo-team-card img[hidden] {display:none}
.demo-team-card img {max-height:100px;object-fit:contain}

@media(max-width:760px) {
  :root {
    --demo-toolbar:var(--demo-mobile-toolbar, 94px);
    --demo-bottom-space:calc(10px + env(safe-area-inset-bottom, 0px));
  }
  html:has(.flb7-mobile-bottom) {--demo-bottom-space:calc(76px + env(safe-area-inset-bottom, 0px))}
  .demo-keyboard-open {--demo-bottom-space:var(--demo-keyboard-bottom, 0px)!important}
  .demo-toolbar {
    min-height:0;
    grid-template-columns:minmax(0,1fr) auto;
    gap:2px 6px;
    padding:4px 8px;
  }
  .demo-toolbar > div {gap:0 5px;line-height:1.15;font-size:.82rem}
  .demo-toolbar small {color:#31545c;font-size:.64rem;line-height:1.2}
  .demo-toolbar nav {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;width:100%}
  .demo-toolbar nav a {display:grid;place-items:center;min-height:44px;padding:2px;font-size:clamp(.65rem,3vw,.8rem);text-align:center}
  #resetDemo {min-height:44px;padding:4px 6px;font-size:.68rem}
  .demo-keyboard-open .flb7-mobile-bottom {visibility:hidden}
  body .flb7-search-results {max-height:calc(100dvh - var(--demo-toolbar) - 155px);overflow:auto}
  .buddy-mobile-tour:not(.demo-keyboard-open) :is(.main-content,.main) {
    padding-bottom:calc(var(--buddy-reserved, 170px) + 12px)!important;
  }
  .buddy-mobile-tour:not(.demo-keyboard-open) {scroll-padding-bottom:var(--buddy-reserved,170px)}
  #demoSimulatorBooking.show,
  #oaOfficeFormPanel.show,
  #ppDemoRegistration.show,
  #studentModal.show {
    position:fixed!important;
    inset:calc(var(--demo-toolbar) + 6px) 8px calc(var(--demo-bottom-space) + 4px) !important;
    width:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:auto!important;
    overscroll-behavior:contain;
  }
  .buddy-mobile-tour:not(.demo-keyboard-open) :is(#demoSimulatorBooking,#oaOfficeFormPanel,#ppDemoRegistration,#studentModal).show {
    bottom:calc(var(--buddy-reserved, 160px) + 6px)!important;
  }
  #demoSimulatorBooking form {padding:12px;gap:8px}
  #demoSimulatorBooking .demo-dialog-actions > button {width:auto;flex:1 1 100px;min-height:44px}
  #flbPruefpilotModule .pp-list-controls,
  #flbPruefpilotModule .pp-kpis {grid-template-columns:minmax(0,1fr)}
  #flbPruefpilotModule .pp-row {grid-template-columns:minmax(0,1fr);gap:8px}
  #flbPruefpilotModule .pp-demo-action {min-height:44px}
  #flbOfficeAgenda .oa-head {align-items:flex-start}
  #flbOfficeAgenda .oa-head > button {min-height:44px}
  #flbOfficeAgenda .oa-item {display:grid;grid-template-columns:minmax(0,1fr)}
  #flbOfficeAgenda .oa-actions {flex-wrap:wrap}
  #companyProfileForm fieldset {min-inline-size:0}
  .demo-team-card :is(input,select) {max-width:100%;min-width:0}
  .demo-branch > label {width:100%;min-width:0}
  :is(#studentSearch,#ppNameSearch,#demoSimulatorBooking input,#demoSimulatorBooking select,#companyProfileForm input) {font-size:16px}
}
@media(max-width:760px) and (max-height:460px) {
  #buddyTour .buddy-tour-card {max-height:29dvh}
}

@media(max-width:760px) {
  html:has(#appointmentsPage) {--demo-bottom-space:calc(86px + env(safe-area-inset-bottom, 0px))}
  .demo-keyboard-open body:has(#appointmentsPage) .sidebar {visibility:hidden}
  .flb7-mobile-more-sheet {
    max-height:calc(100dvh - var(--demo-toolbar) - var(--demo-bottom-space) - 12px);
    overflow:auto;
    overscroll-behavior:contain;
  }
  .flb7-mobile-more-grid button {min-width:0;min-height:44px;overflow-wrap:anywhere}
  #simulatorCalendarEntries {min-width:0;max-width:100%;overflow-x:auto}
  #page-team-calendar .demo-team-actions > label {min-width:0;max-width:100%;flex:1 1 135px}
  #companyProfileForm .settings-form-grid {grid-template-columns:minmax(0,1fr)}
  #companyProfileForm .settings-wide {grid-column:1}
  #appointmentsPage .appointment-actions > *,
  #b197Page .b197-offer-card > button {min-height:44px}
  #availabilityPage .slot-row > * {min-width:0;max-width:100%}
}

html body :is(#ppList,#ppDemoDetail) span.pp-status,
html body #ppB197List .pp-demo-actions .pp-badge {
  display:inline-flex !important;
  width:fit-content !important;
  padding:4px 10px !important;
  border:1px solid transparent !important;
  border-radius:999px;
  background:var(--pp-badge-bg,#36505b) !important;
  color:#fff !important;
}
@media (min-width:1101px) {
  body.flb7-workspace #ppDemoDetail.show {
    top:calc(var(--demo-toolbar) + 112px) !important;
  }
}
@media (max-width:760px) {
  #ppDemoDetail.show {
    inset:calc(var(--demo-toolbar) + 6px) 8px calc(var(--demo-bottom-space) + 4px) !important;
    overflow:auto;
  }
}
