/* EBERG V296 mobile safety contract.
   One final mobile-only layer for shared containment, readable controls and dashboard state clarity. */
@media (max-width:720px){
  html{max-width:100%;overflow-x:hidden}
  body:is(.eberg-admin,.eberg-public){max-width:100%;overflow-x:hidden}
  body:is(.eberg-admin,.eberg-public) :is(main,section,article,aside,header,footer,nav,form,fieldset,.panel,.card,.wrap,.shell,.container,.content,.grid,.row){min-width:0;max-width:100%;box-sizing:border-box}
  body:is(.eberg-admin,.eberg-public) :is(input,select,textarea,button,.btn,[role="button"]){box-sizing:border-box;max-width:100%}
  body:is(.eberg-admin,.eberg-public) :is(img,svg,canvas,video,iframe){max-width:100%}
  body:is(.eberg-admin,.eberg-public) table{max-width:100%}
  body:is(.eberg-admin,.eberg-public) :is(h1,h2,h3,h4,p,li,dt,dd,label,legend,.hint,.state){overflow-wrap:break-word}

  /* Every control is measured against the inner edge of its own card. */
  body:is(.eberg-admin,.eberg-public) :is(.card,.panel,.admin-section,.admin-upcoming,.recurring-rule,form,fieldset)>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
  body:is(.eberg-admin,.eberg-public) :is(form,.meeting-form,.recurring-grid,.grid,.grid2,.grid3,.grid4){grid-template-columns:minmax(0,1fr)!important;width:100%!important;min-width:0!important;max-width:100%!important}
  body:is(.eberg-admin,.eberg-public) :is(form,.meeting-form,.recurring-grid,.grid,.grid2,.grid3,.grid4)>*{min-width:0!important;max-width:100%!important}
  body.eberg-admin :is(input:not([type="checkbox"]):not([type="radio"]):not([type="time"]),select,textarea),
  body.eberg-public :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;margin-left:0!important;margin-right:0!important;box-sizing:border-box!important}
  body.eberg-admin.page-meetings .meeting-form{display:grid!important;grid-template-columns:minmax(0,1fr)!important}
  body.eberg-admin.page-meetings .meeting-form .btn,
  body.eberg-admin.page-meetings .recurring-grid .btn{grid-column:1/-1!important;width:100%!important}

  /* Upcoming appointments are distinct, fully clickable cards with unclipped controls. */
  body.eberg-admin .admin-upcoming-head{align-items:stretch!important;gap:14px!important}
  body.eberg-admin .admin-upcoming-nav{display:grid!important;grid-template-columns:48px minmax(64px,1fr) 48px!important;align-items:center!important;width:100%!important;gap:12px!important}
  body.eberg-admin .admin-upcoming-nav button{display:grid!important;place-items:center!important;width:48px!important;height:48px!important;min-height:48px!important;padding:0!important;overflow:visible!important;font-size:30px!important;line-height:1!important}
  body.eberg-admin .admin-upcoming-count{min-width:0!important;text-align:center!important}
  body.eberg-admin .admin-upcoming-track{gap:12px!important}
  body.eberg-admin .admin-upcoming-card{box-sizing:border-box!important;border:1px solid var(--app-line,#d8d0c0)!important;border-top:5px solid var(--app-accent,#527866)!important;border-radius:12px!important;overflow:hidden!important}
  body.eberg-admin .admin-record{box-sizing:border-box!important;border:1px solid var(--app-line,#d8d0c0)!important;border-radius:12px!important;margin-top:10px!important;overflow:hidden!important}
  body.eberg-admin .admin-record-actions :is(button,.btn){width:100%!important;max-width:100%!important}

  /* Readable contrast in both colour modes. */
  body.eberg-admin.eberg-night-mode :is(.admin-upcoming-count,.admin-record-label,.admin-upcoming-fact small,.state,.muted){color:#d7e4dc!important}}
/* V297 global mobile component contract. This final layer manifests every repeated rule from the current review. */
@media (max-width:720px){
  :root{--eberg-mobile-edge-start:14px;--eberg-mobile-edge-end:26px;--eberg-mobile-stack-gap:12px;--eberg-mobile-section-gap:28px;--eberg-mobile-control:48px;--eberg-status-new-bg:#dbc8eb;--eberg-status-new-ink:#39264c;--eberg-dark-surface:#1b2822;--eberg-dark-line:#789487;--eberg-dark-ink:#f4f7f4}

  /* Safe edge: visible content ends before the browser scrollbar. */
  html body.eberg-admin.eberg-admin>main,html body.eberg-public.eberg-public>main{width:auto!important;max-width:none!important;margin-left:var(--eberg-mobile-edge-start)!important;margin-right:var(--eberg-mobile-edge-end)!important}
  html body.eberg-public main>.public-back-wrap,html body.eberg-public main>.event-doc-links{max-width:100%!important;box-sizing:border-box!important}

  /* Typography: all mobile actions share one deliberate medium weight. */
  body:is(.eberg-admin,.eberg-public) :is(button,.btn,[role="button"],input[type="button"],input[type="submit"]){font-weight:500!important}

  /* Status chips: semantic new-request colours remain legible in either theme. */
  body.eberg-admin :is(.badge.anfrage,.badge.neueanfrage,[data-status="new"],[data-status="anfrage"]){background:var(--eberg-status-new-bg)!important;color:var(--eberg-status-new-ink)!important;-webkit-text-fill-color:var(--eberg-status-new-ink)!important;border:1px solid #b79acb!important;font-weight:600!important;text-shadow:none!important}
  html[data-theme="dark"] body.eberg-admin :is(.badge.anfrage,.badge.neueanfrage,[data-status="new"],[data-status="anfrage"]),body.eberg-admin.eberg-night-mode :is(.badge.anfrage,.badge.neueanfrage,[data-status="new"],[data-status="anfrage"]){background:#d9c3ea!important;color:#30203f!important;-webkit-text-fill-color:#30203f!important;border-color:#eadff3!important}

  /* Action stacks: reload, admin and data actions never touch. */
  body.eberg-admin :is(.admin-settings-body,.admin-menu-primary,.sync-links,.sync-actions,.admin-data-actions){gap:var(--eberg-mobile-stack-gap)!important}
  body.eberg-admin .admin-settings-body :is(.admin-menu-primary,.sync-links,.sync-actions){display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important}
  body.eberg-admin .admin-settings-body :is(a,button,.btn)+:is(a,button,.btn){margin-top:var(--eberg-mobile-stack-gap)!important}
  body.eberg-admin .admin-settings-body :is(.admin-menu-primary,.sync-links,.sync-actions)+:is(.admin-menu-primary,.sync-links,.sync-actions){margin-top:var(--eberg-mobile-stack-gap)!important}

  /* Select/person controls: one bright, custom chevron. */
  html body:is(.eberg-admin,.eberg-public):is(.eberg-admin,.eberg-public) select{-webkit-appearance:none!important;appearance:none!important;padding-right:48px!important;background-repeat:no-repeat!important;background-position:right 16px center!important;background-size:18px 18px!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23174d3b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E")!important}
  html[data-theme="dark"] body:is(.eberg-admin,.eberg-public):is(.eberg-admin,.eberg-public) select,body:is(.eberg-admin,.eberg-public).eberg-night-mode.eberg-night-mode select{color:var(--eberg-dark-ink)!important;-webkit-text-fill-color:var(--eberg-dark-ink)!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f7f4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E")!important}

  /* Information cards: one surface, transparent rows, separators only. */
  body.eberg-public :is(.side,.good-to-know,.know-card,.public-know){overflow:hidden!important}
  body.eberg-public :is(.side,.good-to-know,.know-card,.public-know) :is(.know,.know-row,.public-know-row){background:transparent!important;box-shadow:none!important;border-radius:0!important}
  html[data-theme="dark"] body.eberg-public :is(.side,.good-to-know,.know-card,.public-know),body.eberg-public.eberg-night-mode :is(.side,.good-to-know,.know-card,.public-know){background:var(--eberg-dark-surface)!important;color:var(--eberg-dark-ink)!important}
  html[data-theme="dark"] body.eberg-public :is(.side,.good-to-know,.know-card,.public-know) :is(.know,.know-row,.public-know-row),body.eberg-public.eberg-night-mode :is(.side,.good-to-know,.know-card,.public-know) :is(.know,.know-row,.public-know-row){background:transparent!important;border-color:var(--eberg-dark-line)!important}

  /* Primary action to information card is a real section break. */
  body.eberg-public :is(.flow>.body,.public-flow .content,.date-layout){row-gap:var(--eberg-mobile-section-gap)!important}
  body.eberg-public :is(.formpart.active,.public-flow .panel.active,.date-main,.wizard-step-main)+:is(.side,.good-to-know,.know-card,.public-know){margin-top:var(--eberg-mobile-section-gap)!important}
  body.eberg-public :is(.actions,.wizard-controls){margin-bottom:0!important}

  /* Calendar navigation: same touch size, icon, weight and contrast everywhere. */
  html body :is(.monthnav,.month-nav,.calendar-monthnav,.monthbar,.year-nav,.seminar-calendar-nav):not(:has(.eberg-calendar-month-row)){grid-template-columns:var(--eberg-mobile-control) minmax(0,1fr) var(--eberg-mobile-control)!important;gap:14px!important;width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important;overflow:visible!important}
  html body :is(.monthnav,.month-nav,.calendar-monthnav,.monthbar,.year-nav,.seminar-calendar-nav):not(:has(.eberg-calendar-month-row))>button,html body :is(.event-calendar-arrow,[data-calendar-prev],[data-calendar-next]){display:grid!important;place-items:center!important;width:var(--eberg-mobile-control)!important;min-width:var(--eberg-mobile-control)!important;height:var(--eberg-mobile-control)!important;min-height:var(--eberg-mobile-control)!important;padding:0!important;border-radius:13px!important;overflow:visible!important;font-size:0!important;line-height:1!important}
  html body :is(.monthnav,.month-nav,.calendar-monthnav,.monthbar,.year-nav,.seminar-calendar-nav):not(:has(.eberg-calendar-month-row))>button :is(svg,.line-icon),html body :is(.event-calendar-arrow,[data-calendar-prev],[data-calendar-next]) :is(svg,.line-icon){display:block!important;width:24px!important;height:24px!important;margin:auto!important;fill:none!important;stroke:currentColor!important;stroke-width:2!important;stroke-linecap:round!important;stroke-linejoin:round!important}
  html[data-theme="dark"] body :is(.monthnav,.month-nav,.calendar-monthnav,.monthbar,.year-nav,.seminar-calendar-nav):not(:has(.eberg-calendar-month-row))>button,body.eberg-night-mode :is(.monthnav,.month-nav,.calendar-monthnav,.monthbar,.year-nav,.seminar-calendar-nav):not(:has(.eberg-calendar-month-row))>button{background:#175b45!important;border:1px solid #91afa0!important;color:#f4f7f4!important;-webkit-text-fill-color:#f4f7f4!important}
}
/* V297 cascade lock: :not(#...) adds one harmless ID specificity so the final contract wins over historic page layers. */
@media (max-width:720px){
  html body:is(.eberg-admin,.eberg-public) :is(button:not(#eberg-contract-never),.btn:not(#eberg-contract-never),[role="button"]:not(#eberg-contract-never)){font-weight:500!important}
  html body:is(.eberg-admin,.eberg-public) select:not(#eberg-contract-never):not(#eberg-contract-never-two){-webkit-appearance:none!important;appearance:none!important;padding-right:48px!important;background-repeat:no-repeat!important;background-position:right 16px center!important;background-size:18px 18px!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23174d3b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E")!important}
  html[data-theme="dark"] body:is(.eberg-admin,.eberg-public) select:not(#eberg-contract-never):not(#eberg-contract-never-two),html body:is(.eberg-admin,.eberg-public).eberg-night-mode select:not(#eberg-contract-never):not(#eberg-contract-never-two){color:#f4f7f4!important;-webkit-text-fill-color:#f4f7f4!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f7f4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E")!important}
  html body :is(.monthnav,.month-nav,.calendar-monthnav,.monthbar,.year-nav,.seminar-calendar-nav):not(:has(.eberg-calendar-month-row))>button:not(#eberg-contract-never),html body :is(.event-calendar-arrow,[data-calendar-prev],[data-calendar-next]):not(#eberg-contract-never){display:grid!important;place-items:center!important;width:48px!important;min-width:48px!important;height:48px!important;min-height:48px!important;padding:0!important;border-radius:13px!important;overflow:visible!important;font-size:0!important;line-height:1!important}
  html body :is(.monthnav,.month-nav,.calendar-monthnav,.monthbar,.year-nav,.seminar-calendar-nav):not(:has(.eberg-calendar-month-row))>button:not(#eberg-contract-never) :is(svg,.line-icon),html body :is(.event-calendar-arrow,[data-calendar-prev],[data-calendar-next]):not(#eberg-contract-never) :is(svg,.line-icon){display:block!important;width:24px!important;height:24px!important;margin:auto!important;fill:none!important;stroke:currentColor!important;stroke-width:2!important;stroke-linecap:round!important;stroke-linejoin:round!important}
}
/* V300 global mobile containment: a direct child of the safe-edged main shell
   must not add horizontal margins on top of its 100% width. Otherwise the
   main shell clips the final pixels of right borders and action controls. */
@media (max-width:720px){
  html body:is(.eberg-admin,.eberg-public)>main>*,
  html body:is(.eberg-admin,.eberg-public)>main>:is(section,article,aside,header,footer,nav,form,div){
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
  }
}
/* V301 mobile request-card and right-hand action contract. */
@media (max-width:720px){
  body.eberg-admin.page-hochzeiten #weddingTable .desktop-inquiry-date{display:none!important}
  body.eberg-admin.page-hochzeiten #weddingTable .mobile-inquiry-date{display:block!important;font-size:10px!important;line-height:1.35!important;color:var(--app-muted,#66736a)!important;font-weight:500!important}
  body.eberg-admin.page-hochzeiten #weddingTable td.wedding-inquiry-date{position:absolute!important;left:20px!important;bottom:82px!important;width:auto!important;padding:0!important;border:0!important;background:transparent!important}
  body.eberg-admin.page-hochzeiten #weddingTable tbody tr{position:relative!important;padding-bottom:112px!important}
  body.eberg-admin.page-hochzeiten #weddingTable .actionbar{position:absolute!important;left:20px!important;right:20px!important;bottom:18px!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important}
  body.eberg-admin.page-hochzeiten #weddingTable .actionbar>[data-action="delete"]{order:1!important}
  body.eberg-admin.page-hochzeiten #weddingTable .actionbar>[data-action="archive"]{order:2!important}
  body.eberg-admin.page-hochzeiten #weddingTable .actionbar>a[href*="hochzeit.html"]{order:3!important}
  body.eberg-admin .admin-request-date{display:block!important;margin-top:5px!important;font-size:10px!important;line-height:1.35!important;color:var(--app-muted,#66736a)!important;font-weight:500!important}
}
/* V302 nested public-flow containment: legacy margins never consume the safe right edge. */
@media (max-width:720px){
  html body.eberg-public main>.public-flow,html body.eberg-public main>.flow,html body.eberg-public main>.public-shell{box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important;margin-right:0!important}
  html body.eberg-public main>.public-flow *,html body.eberg-public main>.flow *,html body.eberg-public main>.public-shell *{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
}
/* V303 natural wedding-card flow and final public edge. */
@media (max-width:720px){
  html body.eberg-public main>:is(.public-back-wrap,.event-doc-links){box-sizing:border-box!important;width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important}
  body.eberg-admin.page-hochzeiten #weddingTable tbody tr{position:relative!important;padding:12px!important}
  body.eberg-admin.page-hochzeiten #weddingTable td.wedding-inquiry-date{display:block!important;position:static!important;grid-column:1/-1!important;grid-row:3!important;width:auto!important;padding:2px 0 0!important;border:0!important;background:transparent!important}
  body.eberg-admin.page-hochzeiten #weddingTable tbody>tr:not(.same-date-notice-row)>td:nth-child(9){position:static!important;grid-column:1/-1!important;grid-row:4!important;padding-top:10px!important;border-top:1px solid var(--app-line,#d8d0c0)!important}
  body.eberg-admin.page-hochzeiten #weddingTable .actionbar{position:static!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important}
}
/* V304 wedding inquiry date must remain visible in the mobile card grid. */
@media (max-width:720px){
  html body.eberg-admin.page-hochzeiten:has(#weddingTable) #weddingTable tbody>tr:not(.same-date-notice-row)>td.wedding-inquiry-date{display:block!important;position:static!important;grid-column:1/-1!important;grid-row:3!important;width:auto!important;padding:2px 0 0!important;border:0!important;background:transparent!important}
  html body.eberg-admin.page-hochzeiten:has(#weddingTable) #weddingTable .mobile-inquiry-date{display:block!important;color:var(--app-muted,#66736a)!important;font-size:10px!important;font-weight:500!important;line-height:1.35!important}
}
/* V305 BergBrunch inventory uses cards instead of a desktop-width table on phones. */
@media (max-width:720px){
  body.eberg-admin.page-brunch .compact-search .tablewrap{width:100%!important;max-width:100%!important;overflow:visible!important}
  body.eberg-admin.page-brunch .compact-search table,body.eberg-admin.page-brunch .compact-search tbody{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important}
  body.eberg-admin.page-brunch .compact-search thead{display:none!important}
  body.eberg-admin.page-brunch .compact-search tbody{display:grid!important;gap:10px!important}
  body.eberg-admin.page-brunch .compact-search tbody tr{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%!important;max-width:100%!important;min-width:0!important;padding:12px!important;border:1px solid var(--app-line,#d8d0c0)!important;border-radius:12px!important;background:var(--app-panel,#fffdf8)!important}
  body.eberg-admin.page-brunch .compact-search tbody td{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;padding:8px 0!important;border:0!important;border-top:1px solid var(--app-line,#d8d0c0)!important;overflow-wrap:anywhere!important}
  body.eberg-admin.page-brunch .compact-search tbody td:first-child{padding-top:0!important;border-top:0!important}
  body.eberg-admin.page-brunch .compact-search tbody td:nth-child(2)::before{content:'Name';display:block;font-size:9px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--app-muted,#68736b)}
  body.eberg-admin.page-brunch .compact-search tbody td:nth-child(3)::before{content:'Gäste';display:block;font-size:9px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--app-muted,#68736b)}
  body.eberg-admin.page-brunch .compact-search tbody td:nth-child(4)::before{content:'Kontakt / Hinweise';display:block;font-size:9px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--app-muted,#68736b)}
  body.eberg-admin.page-brunch .compact-search tbody td:nth-child(5)::before{content:'Status / Quelle';display:block;font-size:9px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--app-muted,#68736b)}
}
/* V306 upcoming-event contract: fine card contours and gallery-style pager arrows. */
@media (max-width:720px){
  html body.eberg-admin{--eberg-upcoming-border:#9db5a5;--eberg-upcoming-card-radius:12px;--eberg-upcoming-nav-hit-area:48px;--eberg-upcoming-nav-color:#174d3b}
  html[data-theme="dark"] body.eberg-admin,html body.eberg-admin.eberg-night-mode{--eberg-upcoming-border:#789487;--eberg-upcoming-nav-color:#eaf3ec}
  html body.eberg-admin :is(.admin-upcoming-track,.admin-upcoming-list,.wmo-list,.eberg-brunch-upcoming-list){gap:12px!important}
  html body.eberg-admin :is(.admin-upcoming-card,.wmo-record,.eberg-brunch-upcoming-card):not(#eberg-contract-never){box-sizing:border-box!important;border:1px solid var(--eberg-upcoming-border)!important;border-radius:var(--eberg-upcoming-card-radius)!important;box-shadow:none!important;overflow:hidden!important}
  html body.eberg-admin :is(.admin-upcoming-nav,.wmo-nav,.eberg-brunch-upcoming-nav) :is(button,.btn):not(#eberg-contract-never){display:grid!important;place-items:center!important;width:var(--eberg-upcoming-nav-hit-area)!important;min-width:var(--eberg-upcoming-nav-hit-area)!important;height:var(--eberg-upcoming-nav-hit-area)!important;min-height:var(--eberg-upcoming-nav-hit-area)!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;color:var(--eberg-upcoming-nav-color)!important;-webkit-text-fill-color:var(--eberg-upcoming-nav-color)!important;font-size:32px!important;font-weight:400!important;line-height:1!important;overflow:visible!important;transform:none!important}
  html body.eberg-admin :is(.admin-upcoming-nav,.wmo-nav,.eberg-brunch-upcoming-nav) :is(button,.btn):not(#eberg-contract-never):is(:hover,:active){background:transparent!important;box-shadow:none!important;transform:none!important}
  html body.eberg-admin :is(.admin-upcoming-nav,.wmo-nav,.eberg-brunch-upcoming-nav) :is(button,.btn):not(#eberg-contract-never):focus-visible{outline:2px solid currentColor!important;outline-offset:2px!important}
  html body.eberg-admin :is(.admin-upcoming-nav,.wmo-nav,.eberg-brunch-upcoming-nav) :is(button,.btn):not(#eberg-contract-never):disabled{opacity:var(--eberg-admin-disabled-opacity,.35)!important}
}
