/* Shared primitives and compatibility aliases for existing renderers.
   Layout, visibility and permissions remain with their existing owners. */
html { scroll-padding-block:80px 100px; }
body { margin:0; background:var(--gwh-bg); color:var(--gwh-text); font-family:var(--gwh-font); font-size:var(--gwh-type-body); line-height:var(--gwh-leading); -webkit-text-size-adjust:100%; text-size-adjust:100%; }
*,*::before,*::after { box-sizing:border-box; }
:where(main,section,article,form,fieldset,details,.field,.row,.stack,.grid) { min-inline-size:0; }
:where(p,label,legend,h1,h2,h3,.meta,.muted) { overflow-wrap:anywhere; }
:where(img,video,canvas) { max-inline-size:100%; }
:where(h1,h2,h3) { line-height:1.15; text-wrap:balance; }
:where(button,input,select,textarea) { font-family:inherit; }
:where(main,section,article,form,.row,.grid,.stack)>* { min-inline-size:0; }
[hidden] { display:none!important; }
:where(button,a.btn,input,textarea,select,summary) { touch-action:manipulation; }
:where(button,a.btn,summary) { -webkit-tap-highlight-color:transparent; }

/* Accent / neutral / quiet; danger and VIP keep their own color pairs. */
body :is(button,a.btn,.gwh-button):not(.leaflet-control-zoom-in,.leaflet-control-zoom-out) {
  border-width:var(--gwh-line); word-break:normal; overflow-wrap:anywhere; white-space:normal;
  transition:background-color var(--gwh-motion-fast) var(--gwh-ease),
    box-shadow var(--gwh-motion-fast) var(--gwh-ease),transform var(--gwh-motion-fast) var(--gwh-ease);
}
body :is(.primary,.gwh-utility-primary,.gwh-button--primary):not(.danger,.danger-solid,.sos):not(:disabled) {
  background:var(--gwh-text); color:var(--gwh-surface-warm);
  border-color:var(--gwh-border); border-radius:var(--gwh-radius-sm); box-shadow:var(--gwh-shadow-sm);
}
.gwh-button { display:inline-flex; align-items:center; justify-content:center; gap:var(--gwh-space-8);
  min-height:var(--gwh-control); padding:var(--gwh-space-12) var(--gwh-space-16);
  border:var(--gwh-line) solid var(--gwh-border); border-radius:var(--gwh-radius-sm);
  background:var(--gwh-surface-warm); color:var(--gwh-text);
  font-size:var(--gwh-type-body); font-weight:800; text-decoration:none; cursor:pointer; }
.gwh-button--quiet { background:transparent; color:inherit; border-color:transparent; box-shadow:none; }
body :is(button,a.btn):disabled,body [aria-disabled=true] { cursor:not-allowed; box-shadow:none; }
body button:disabled { opacity:.65; }
body button[aria-busy=true] { cursor:progress; }
body :is(button,a.btn):active:not(:disabled) { transform:translateY(1px); box-shadow:none; }
@media(hover:hover) { body :is(button,a.btn):hover:not(:disabled) { filter:brightness(.97); } }
body :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible:not([tabindex="-1"]) {
  outline:var(--gwh-line-strong) solid var(--gwh-text)!important; outline-offset:3px!important;
  box-shadow:none;
}
/* Headings receive focus only as accessible modal entry points. Keep the ring
   on actionable keyboard controls, not around a programmatically focused title. */
body dialog [data-gwh-initial-focus][tabindex="-1"]:focus{outline:none!important;box-shadow:none!important}
body .carousel-btn:active:not(:disabled) { transform:translateY(-50%); }

/* Readable controls on iOS, without disabling user zoom. */
body :is(input,select,textarea):not([type=checkbox],[type=radio],[type=range],[type=color],[type=hidden]) {
  min-width:0; max-width:100%; min-height:var(--gwh-control);
  font-size:var(--gwh-type-body); line-height:1.4;
  border:var(--gwh-line) solid var(--gwh-border); border-radius:var(--gwh-radius-sm);
  background:var(--gwh-surface); color:var(--gwh-text); padding:10px 12px;
}
body input:is([type=date],[type=time],[type=datetime-local]) { appearance:none; -webkit-appearance:none; inline-size:100%; min-inline-size:0; }
body input::-webkit-date-and-time-value { min-width:0; text-align:left; }
body textarea { resize:vertical; }
body input::placeholder,body textarea::placeholder { color:var(--gwh-muted); opacity:1; }
body input[type=file] { width:100%; overflow:hidden; }
body input[type=file]::file-selector-button { max-width:100%; padding:8px 12px; border:0; border-radius:8px;
  background:var(--gwh-selection); color:var(--gwh-text); font:inherit; margin-right:8px; }
body :is(input,textarea,select)[aria-invalid=true] { border-color:var(--gwh-danger-ink);
  outline:2px dashed var(--gwh-danger-ink); outline-offset:2px; }
body :is(.field>label,.field>small) { text-transform:none; letter-spacing:0; line-height:1.4; }
body :is(.field>label,legend) { font-weight:700; }
.gwh-field-error { display:block; margin-top:8px; font-size:14px; font-weight:700; }
:where(form) { accent-color:var(--gwh-text); }
:where(form) :where(fieldset) { margin-inline:0; }

/* Quiet secondary surfaces; selected/primary cards gain depth. */
body :is(.card,.booking-card,.review-card,.table-card,.gwh-card) {
  border-width:var(--gwh-line); border-radius:var(--gwh-radius-lg); box-shadow:var(--gwh-shadow-sm);
}
.gwh-card { padding:var(--gwh-space-16); border:var(--gwh-line) solid var(--gwh-border);
  background:var(--gwh-surface); color:var(--gwh-text); }
body :is(.card,.booking-card,.review-card) :is(.card,.table-card,.payment-destination,.meeting-plan-grid>div) { box-shadow:none; }
.gwh-card--quiet { box-shadow:none!important; }
.gwh-card--selected { box-shadow:var(--gwh-shadow-md)!important; border-width:var(--gwh-line-strong)!important; }
body :is(.badge,.chip,.sticker,.member-item-tag,.profile-item-tag) { border-width:var(--gwh-line); }
body :is(.meta,.muted,small) { line-height:1.45; }

/* Native dialogs stay above map controls and navigation. */
body dialog {
  max-inline-size:calc(100% - 24px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px));
  max-block-size:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
  background:var(--gwh-surface-warm); color:var(--gwh-text);
  border:var(--gwh-line) solid var(--gwh-border); border-radius:var(--gwh-radius-xl);
  box-shadow:var(--gwh-shadow-md); overscroll-behavior:contain;
}
body dialog::backdrop { background:rgba(23,23,25,.55); }
body dialog :is(form,.field,.row,.stack,.grid,.actions) { min-width:0; max-width:100%; }
body dialog .dialog-inner { overflow-wrap:anywhere; }
body dialog :is(h1,h2) { line-height:1.15; }
body dialog :is(button,a.btn) { min-height:var(--gwh-touch); }
body dialog :is(input,textarea,select) { font-size:var(--gwh-type-body)!important; }
body .gwh-utility-head { border-bottom-width:var(--gwh-line); }
body .gwh-utility-foot { border-top-width:var(--gwh-line); }

/* Content first: touch targets without a heavy box around every action. */
body.member-mobile .app-shell :is(.card,.booking-card,.review-card) { border-width:var(--gwh-line); box-shadow:var(--gwh-shadow-sm); }
body.member-mobile .app-shell>.top :is(.notif-bell,.member-settings-trigger) {
  width:44px!important; height:44px!important; min-width:44px!important; flex-basis:44px!important; box-shadow:none!important;
}
body.member-mobile .app-shell :is(.people-switch button,.vibe-filter-strip button) { min-height:44px; }
body.member-mobile :is(.global-feed-actions,.global-reply-tools) button { box-shadow:none!important; }
body.member-mobile :is(.global-feed-card,.global-reply) :is(.meta,small) { font-size:var(--gwh-type-caption); }
body.member-mobile .member-help-button { width:44px;min-width:44px;height:44px;padding:12px;box-shadow:none!important;background:transparent!important;border:0!important;color:var(--gwh-text); }
body.member-mobile .member-help-button>span{display:none}
body.member-mobile .member-help-button .gwh-icon{width:18px;height:18px;flex-basis:18px}
body.member-mobile .booking-state-line { border-width:0; border-radius:var(--gwh-radius-sm); }
body.member-mobile .booking-compact :is(.presence-box,.mutual-cancel-box,.contact-box) { box-shadow:none; }

/* Admin shares the same density, fields and actions. */
body .admin-layout :is(.card,.table-card,.admin-nav-group) { border-width:var(--gwh-line); box-shadow:var(--gwh-shadow-sm); }
body .admin-layout :is(input,select,textarea) { font-size:16px; }
body .admin-layout .actions { flex-wrap:wrap; gap:8px; }
body .admin-layout .actions>button { min-height:44px; white-space:normal; word-break:normal; overflow-wrap:normal; }
body .admin-layout :is(h1,h2,h3,p,.meta,.muted) { overflow-wrap:anywhere; }
body .admin-layout .stats-grid { gap:12px; }
body .qa-admin-notice { padding:12px; border:var(--gwh-line) dashed var(--gwh-border);
  border-radius:var(--gwh-radius-sm); background:var(--gwh-surface-warm); font-size:12px; font-weight:800; }
body .admin-member-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
body .admin-member-heading>b { font-size:20px; overflow-wrap:anywhere; min-width:0; }
body .admin-member-heading .badge { flex:none; }
body .admin-member-card>.meta { margin:8px 0; font-size:14px; }
body .admin-member-card :is(.admin-member-readiness,.admin-member-options) {
  border:0; border-top:1px solid color-mix(in srgb,var(--gwh-border) 25%,transparent);
  border-radius:0; background:transparent; box-shadow:none; padding:0; margin:12px 0 0;
}
body .admin-member-card summary { min-height:44px; padding:12px 0; font-size:14px; cursor:pointer; }
body .admin-member-card .admin-member-readiness { color:var(--gwh-text); }
body .admin-member-ready { margin:12px 0; font-size:14px; }
body .admin-member-card .admin-member-primary { display:flex; flex-wrap:wrap; margin-top:12px; }
body .admin-member-card .admin-member-primary button { flex:1 1 150px; }
body .admin-member-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr)); gap:8px; padding-bottom:8px; }
body .admin-member-actions button { min-height:44px; padding:10px; font-size:14px; white-space:normal; }
body .admin-layout :is(table,.table-wrap) { max-width:100%; }

@media(max-width:480px) {
  body .admin-layout .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body :is(.auth-wrap,.share-shell) { padding-inline:16px; }
  body .share-actions .btn { min-width:min(180px,100%); }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important;
    animation-iteration-count:1!important; transition-duration:.01ms!important; }
}
@media(forced-colors:active) {
  body :is(button,a.btn,input,select,textarea,.card,dialog) { border-color:CanvasText; }
  body :is(button,a.btn):focus-visible { outline-color:Highlight; }
}
/* Shared account and booking section hierarchy. */
body.member-mobile :is(#clientView,#companionView)>.account-panel-header,
body.member-mobile .mi-cuenta-title,
body.member-mobile .booking-group-head,
body.member-mobile .items-head{background:var(--gwh-surface-warm);color:var(--gwh-text);border-radius:var(--gwh-radius-md);padding:12px 16px}
body.member-mobile .booking-workflow{background:var(--gwh-surface-warm);color:var(--gwh-text);border-radius:var(--gwh-radius-md);padding:8px 12px;margin:8px 0}
body.member-mobile .booking-group-head :is(h2,.eyebrow),body.member-mobile .mi-cuenta-title h2{color:var(--gwh-text)!important}
body.member-mobile .section-head button{color:var(--gwh-text);background:var(--gwh-surface-warm)}

.gwh-skip-link{position:fixed;top:12px;left:12px;z-index:10000;transform:translateY(-200%);padding:12px 16px;border:2px solid var(--gwh-border);border-radius:12px;background:var(--gwh-surface);color:var(--gwh-text);font-weight:800}
.gwh-skip-link:focus{transform:none}
.login-help{text-align:right;font-size:14px}.login-help a{display:inline-flex;align-items:center;min-height:44px}
.remember-session{align-items:flex-start!important}.remember-session-copy{display:grid;gap:4px;min-width:0}.remember-session-copy small{font-size:12px;color:var(--gwh-muted);font-weight:400}
.recover-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:20px}.recover-grid h2{margin:8px 0 0}.recover-note{margin-top:16px}.recover-code{font-size:14px;line-height:1.5;color:var(--gwh-muted)}
#gwhUpdateNotice{position:fixed;z-index:200;left:12px;right:12px;bottom:calc(100px + env(safe-area-inset-bottom,0px));max-width:520px;margin:auto;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:14px;border:2px solid var(--gwh-border);border-radius:16px;background:var(--gwh-surface-warm);color:var(--gwh-text);font-size:14px;box-shadow:var(--gwh-shadow-sm)}
#gwhUpdateNotice button,.pwa-install-btn{min-height:44px;padding:10px 14px;border:2px solid var(--gwh-border);border-radius:12px;background:var(--gwh-selection);color:var(--gwh-text);font:inherit;font-weight:800;cursor:pointer;box-shadow:var(--gwh-shadow-sm)}
.top-inner>.pwa-install-btn{margin-left:auto}
body.gwh-dialog-open #gwhUpdateNotice,.gwh-keyboard-open #gwhUpdateNotice{display:none}
@media(max-width:700px){.pwa-install-btn{font-size:12px;padding:8px 10px;max-width:100%}}
/* These components own geometry across member, public and administrator shells. */
body :is(.gwh-empty,.empty){padding:24px 16px;text-align:center;overflow-wrap:anywhere;color:var(--gwh-muted)}
body :is(.safe,.alert,.danger,.gwh-state){border:var(--gwh-line) solid var(--gwh-border);border-radius:var(--gwh-radius-md);padding:12px 14px;line-height:1.5}
body :is(.safe,.gwh-state--success){background:var(--gwh-success);color:var(--gwh-text)}
body :is(.alert,.gwh-state--pending){background:var(--gwh-warning);color:var(--gwh-text)}
body :is(.danger,.gwh-state--error){background:var(--gwh-danger);color:var(--gwh-danger-ink)}
body :is(.badge.ok,.reservation-state.ok){background:var(--gwh-success)}
body :is(.badge.warn,.reservation-state.warn){background:var(--gwh-warning)}
body :is(.badge.bad,.reservation-state.bad){background:var(--gwh-danger)}
body :is(.badge.info,.reservation-state.info){background:var(--gwh-selection)}
body :is(.actions,.form-actions){gap:var(--gwh-space-8);flex-wrap:wrap}
body :is(.actions,.form-actions)>:is(button,.btn){min-width:0;max-width:100%}
body :is(.gwh-utility-head,.invitation-heading,.admin-detail-heading){min-width:0;overflow-wrap:anywhere}
body :is(.gwh-utility-close,.reading-panel-close){flex:none;min-width:44px;min-height:44px}
body .gwh-button--danger{background:var(--gwh-danger);color:var(--gwh-danger-ink)}
body .gwh-button--secondary{background:var(--gwh-surface-warm);color:var(--gwh-text);box-shadow:none}
/* Native confirmation keeps the same keyboard/scroll behavior as other dialogs. */
.gw-admin-confirm{width:min(420px,calc(100% - 24px));padding:24px;background:var(--gwh-surface-warm);color:var(--gwh-text)}
.gw-admin-confirm h2{margin:0 0 12px;font-size:24px}
.gw-admin-confirm p{margin:0 0 20px;white-space:pre-wrap;overflow-wrap:anywhere}
.gw-admin-confirm-icon{display:grid;place-items:center;width:48px;height:48px;margin-bottom:16px;border:2px solid var(--gwh-border);border-radius:12px;background:var(--gwh-warning);font-size:24px;font-weight:900}
.gw-admin-confirm-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.gw-admin-confirm-actions button{flex:1;min-width:100px}
.gw-admin-toast{position:fixed;z-index:10000;inset:16px 12px auto;max-width:520px;margin:auto;padding:14px 18px;border:2px solid var(--gwh-border);border-radius:16px;background:var(--gwh-success);color:var(--gwh-text);box-shadow:var(--gwh-shadow-sm);overflow-wrap:anywhere}
.gw-admin-toast.bad{background:var(--gwh-danger)}
.member-confirm-dialog{--gwh-dialog-width:480px}
.gw-confirm{display:grid;gap:16px;min-width:0;max-width:100%}
.gw-confirm h2{margin:0;font-size:clamp(24px,5vw,30px);line-height:1.1}
.gw-confirm p{margin:0;line-height:1.5;font-size:16px;overflow-wrap:anywhere}
.gw-confirm-icon{width:52px;height:52px;display:grid;place-items:center;border:2px solid var(--gwh-border);border-radius:16px;background:var(--gwh-selection);box-shadow:var(--gwh-shadow-sm);font-size:24px;font-weight:900}
.gw-confirm.dangerous .gw-confirm-icon{background:var(--gwh-danger)}
.gw-confirm-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:4px}
.gw-confirm-actions button{min-height:48px}
.gw-toast{position:fixed;left:50%;bottom:calc(100px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:99999;max-width:min(520px,90vw);padding:12px 16px;border:2px solid var(--gwh-border);border-radius:12px;background:var(--gwh-success);color:var(--gwh-text);font-weight:800;box-shadow:var(--gwh-shadow-sm);overflow-wrap:anywhere;animation:gwToastIn .18s ease-out}
.gw-toast.bad{background:var(--gwh-danger)}
@keyframes gwToastIn{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}
@media(max-width:360px){.gw-confirm-actions{grid-template-columns:minmax(0,1fr)}}
body.public-mobile:not(.gwh-landing) :is(.legal-shell,.auth-wrap){max-width:760px;margin-inline:auto}
body.public-mobile .legal-section{background:var(--gwh-surface);box-shadow:var(--gwh-shadow-sm);padding:clamp(16px,4vw,24px)}
body.public-mobile .legal-nav a{min-height:44px;display:inline-flex;align-items:center}
body.public-mobile .legal-nav a.active{background:var(--gwh-selection)}
body.public-mobile .legal-hero h1{font-size:clamp(32px,8vw,60px);line-height:1.06;letter-spacing:-1.5px}
body.public-mobile .legal-section h2{font-size:clamp(21px,5vw,28px)}
@media(max-width:480px){
 body :is(.section-head,.contact-box,.payout-strip){flex-wrap:wrap}
 body :is(.contact-box,.payout-strip)>*{min-width:0;max-width:100%;overflow-wrap:anywhere}
 body .price-panel{gap:10px}
 body .price-panel>div{min-width:0}
 body .price-panel strong{font-size:24px;overflow-wrap:anywhere}
 body .price-panel>.primary{max-width:100%}
 body .gwh-utility-head h2{font-size:22px}
}
/* One navigation geometry in every section; the iPhone safe area stays outside. */
body.rabbit-hole.member-mobile .app-shell .bottom-nav{position:fixed;z-index:35;left:calc(50% + (var(--gwh-safe-left) - var(--gwh-safe-right))/2);bottom:calc(12px + var(--gwh-safe-bottom));transform:translateX(-50%);width:min(548px,calc(100% - 24px - var(--gwh-safe-left) - var(--gwh-safe-right)));height:74px;box-sizing:border-box;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;gap:4px;padding:8px;border:2px solid var(--rh-ink);border-radius:24px;background:var(--rh-ink);background-clip:border-box;box-shadow:none!important;overflow:visible;mask:none;-webkit-mask:none}
body.rabbit-hole.member-mobile .app-shell .bottom-nav:not(.hidden){display:grid}
body.rabbit-hole.member-mobile .app-shell .bottom-nav::before,body.rabbit-hole.member-mobile .app-shell .bottom-nav::after{content:none!important;display:none!important}
body.rabbit-hole.member-mobile .app-shell .bottom-nav button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;min-width:0;height:54px;min-height:54px;margin:0;padding:4px 0;box-sizing:border-box;background:transparent;color:var(--rh-cream);border:0;border-radius:16px;box-shadow:none!important;font-size:11px;line-height:14px;overflow:visible;transform:none!important}
body.rabbit-hole.member-mobile .app-shell .bottom-nav button.active{background:var(--rh-cream);color:var(--rh-ink)}
body.rabbit-hole.member-mobile .app-shell .bottom-nav button:focus-visible{outline:2px solid var(--rh-lilac);outline-offset:2px}
body.rabbit-hole.member-mobile .app-shell .bottom-nav .nav-icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 24px;margin:0;line-height:1}
body.rabbit-hole.member-mobile .app-shell .bottom-nav .nav-icon .gwh-icon{width:24px;height:24px;flex-basis:24px}
body.rabbit-hole.member-mobile .app-shell .bottom-nav .nav-label{display:block;width:100%;min-width:0;margin:0;font-size:clamp(10px,2.7vw,11px);font-weight:800;line-height:14px;white-space:nowrap;letter-spacing:-.2px;text-align:center;overflow:visible}
body.rabbit-hole.member-mobile .app-shell .page{padding-bottom:calc(110px + var(--gwh-safe-bottom))!important}


body .inbox-row.inbox-official{background:#e9ddfa;border:2px solid #111;border-radius:20px;margin:10px 0;padding:16px 12px}body .inbox-official-label{display:block;font-size:10px;font-weight:900;letter-spacing:.08em;margin-bottom:8px;color:#483262}body .inbox-official .inbox-icon{background:#c4a7ed}body .inbox-official .inbox-body{display:block;-webkit-line-clamp:unset;overflow:visible;white-space:normal}
.official-member-notices{margin:16px auto;max-width:900px;padding:0 16px}.official-member-notices article{background:#e9ddfa;border:2px solid #111;border-radius:20px;padding:16px;margin:8px 0}.official-member-notices small{font-weight:900;letter-spacing:.08em}.official-member-notices p{white-space:pre-wrap;overflow-wrap:anywhere}.official-member-notices button{min-height:44px}
