/* Shared responsive refinements for the WroSpot public pages and host tools. */
html, body {
  max-width: 100%;
  overflow-x: clip;
}
img, video, iframe {
  max-width: 100%;
}
main, .main, .shell, .content {
  min-width: 0;
}
input, select, textarea, button {
  max-width: 100%;
}
.mobile-select-dates { display:none !important; }
/* Auth scripts toggle header controls with the hidden attribute; keep it effective
   even where page-specific rules assign display:flex to those controls. */
.topbar .top-actions [hidden] { display:none !important; }
.topbar .top-actions > .saved-rooms-link { display:inline-flex; align-items:center; gap:7px; white-space:nowrap; }
.topbar .top-actions > .saved-rooms-link [data-saved-room-count] { display:inline-grid; place-items:center; flex:0 0 auto; min-width:20px; height:20px; padding:0 5px; border-radius:999px; background:var(--mint,#e5f2eb); color:var(--green,#1f6b57); font-size:11px; font-weight:800; line-height:1; }
@media (min-width: 761px) {
  /* Center the logo, Back control, and navigation on the same header axis. */
  .topbar .brand,
  .topbar .back-button,
  .topbar .top-actions { align-self: center; transform: none; }
  /* Guests can sign out from My Account; avoid adding an eighth nav grid cell. */
  .topbar .top-actions > .guest-signout-button { display: none !important; }
}
.topbar-start { display:flex; flex-direction:row-reverse; align-items:center; gap:13px; flex:0 0 auto; }
/* Mobile navigation: keep the header compact and expose links from one menu. */
.mobile-menu-toggle { display:none; }
@media (max-width: 760px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 1200;
    height: 62px !important;
    min-height: 62px;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 7px;
    padding-bottom: 7px;
    overflow: visible;
    background: var(--paper, #f7f6f2);
  }
  .topbar > .topbar-start { flex: 1 1 auto; min-width: 0; max-width: none; }
  .topbar > .top-actions { display:none !important; }

  .topbar > .wrospot-language-picker {
    display:flex;
    flex:0 0 42px;
    width:42px;
    height:42px;
    margin:0;
    z-index:10021;
  }
  .topbar > .wrospot-language-picker > .language {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:42px;
    min-width:42px;
    height:42px;
    min-height:42px;
    padding:0;
    border-radius:50%;
    background:#fff;
    font-size:11px;
    font-weight:750;
  }
  .mobile-select-dates { display:none !important; }
  .topbar.mobile-nav-open > .top-actions > .mobile-select-dates {
    display:flex !important;
    margin-top:5px;
    padding-top:14px !important;
    border-top:1px solid var(--line, #e1e5df);
    color:var(--green, #1f6b57);
    font-weight:750;
  }

  .mobile-menu-toggle {
    display:grid;
    place-content:center;
    gap:5px;
    flex:0 0 42px;
    width:42px;
    height:40px;
    margin-left:auto;
    padding:0;
    border:1px solid var(--line, #e1e5df);
    border-radius:12px;
    background:#fff;
    color:var(--ink, #202b28);
    cursor:pointer;
  }
  .mobile-menu-toggle span { display:block; width:20px; height:2.5px; border-radius:3px; background:currentColor; transition:transform .18s ease, opacity .18s ease; }
  .topbar.mobile-nav-open .mobile-menu-toggle span:first-child { transform:translateY(7.5px) rotate(45deg); }
  .topbar.mobile-nav-open .mobile-menu-toggle span:nth-child(2) { opacity:0; }
  .topbar.mobile-nav-open .mobile-menu-toggle span:last-child { transform:translateY(-7.5px) rotate(-45deg); }
  .topbar.mobile-nav-open > .top-actions {
    display:flex !important;
    position:absolute;
    top:calc(100% + 7px);
    right:0;
    left:auto;
    z-index:1300;
    order:initial;
    flex:initial;
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    gap:5px !important;
    width:min(360px, calc(100vw - 24px)) !important;
    max-width:calc(100vw - 24px);
    max-height:calc(100dvh - 90px);
    overflow-y:auto;
    overscroll-behavior:contain;
    padding:11px;
    border:1px solid var(--line, #e1e5df);
    border-radius:16px;
    background:#fff;
    box-shadow:0 18px 42px #1b302822;
  }
  .topbar.mobile-nav-open > .top-actions > a:not([hidden]),
  .topbar.mobile-nav-open > .top-actions > button:not([hidden]) {
    display:flex !important;
    align-items:center;
    width:100%;
    min-height:43px !important;
    max-width:none;
    padding:10px 12px !important;
    border:0;
    border-radius:10px;
    background:transparent;
    font-size:14px !important;
    white-space:normal;
    text-align:left;
  }
  .topbar.mobile-nav-open > .top-actions > a:hover,
  .topbar.mobile-nav-open > .top-actions > button:hover { background:var(--mint, #e5f2eb); }
  .topbar > .top-actions > [hidden] { display:none !important; }
  .topbar.mobile-nav-open > .top-actions > .host-entry,
  .topbar.mobile-nav-open > .top-actions .wrospot-language-picker { display:flex; width:100%; min-width:0; margin:0; }
  .topbar.mobile-nav-open .host-entry { flex-direction:column; align-items:stretch; }
  .topbar.mobile-nav-open .host-entry .host-signin { width:100%; height:auto; min-height:43px; border:0; border-radius:10px; justify-content:flex-start; padding:10px 12px; }
  .topbar.mobile-nav-open .host-entry .host-signin span { display:inline; }
  .topbar.mobile-nav-open > .top-actions .wrospot-language-picker { position:relative; flex-direction:column; align-items:stretch; }
  .topbar.mobile-nav-open > .top-actions .wrospot-language-picker .language { width:100%; justify-content:flex-start; min-height:43px; padding:10px 12px; border:0; border-radius:10px; text-align:left; }
  .topbar.mobile-nav-open > .top-actions .wrospot-language-menu { position:static !important; top:auto !important; right:auto !important; bottom:auto !important; left:auto !important; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:3px; width:100% !important; max-width:none; max-height:none !important; margin-top:4px; overflow:visible !important; box-shadow:none !important; }
  .topbar.mobile-nav-open > .top-actions .wrospot-language-menu > button { width:100%; min-height:43px; color:var(--ink,#202b28); text-align:left; }
  .topbar.mobile-nav-open .host-menu { position:static; width:100%; margin-top:6px; box-shadow:none; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-menu-toggle span { transition:none; }
}
@media (max-width: 760px) {
  .app {
    display: block !important;
    min-width: 0;
    width: 100%;
  }
  .sidebar {
    position: static !important;
    top: auto !important;
    display: block !important;
    width: 100%;
    height: auto !important;
    min-height: 0;
    padding: 10px 12px !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line, #e1e5df);
    overflow: hidden;
  }
  .sidebar .back-button {
    display: none !important;
  }
  .sidebar .brand {
    display: flex;
    width: max-content;
    max-width: 100%;
    margin: 0 0 8px;
    padding: 0 4px !important;
    font-size: 18px;
  }
  .sidebar .sidebar-nav {
    display: flex !important;
    align-items: center;
    gap: 5px;
    width: 100%;
    margin: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    white-space: nowrap;
  }
  .sidebar .nav-label {
    display: none !important;
  }
  .sidebar .nav-item {
    display: inline-flex !important;
    align-items: center;
    flex: 0 0 auto;
    min-height: 38px;
    margin: 0 !important;
    padding: 8px 10px !important;
    border-radius: 9px;
    font-size: 11px;
  }
  .sidebar .nav-ico {
    width: auto;
    margin-right: 6px;
  }
  .sidebar .side-bottom {
    display: none !important;
  }
  .main {
    width: 100%;
    max-width: none !important;
    min-width: 0;
    margin: 0;
    padding: 17px 12px 32px !important;
  }
  .shell, .article.shell {
    width: min(100% - 24px, 1160px) !important;
  }
  .top, .page-head, .topbar, .title-row, .booking-details-head {
    min-width: 0;
  }
  .top, .page-head, .title-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .host-actions, .head-actions, .guest-search-tools {
    max-width: 100%;
    flex-wrap: wrap;
  }
  .guest-search-tools .guest-search {
    min-width: 0;
    width: 100%;
  }
  .table-wrap, .table-scroll, .calendar-scroll, .calendar-board, .calendar-grid {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .booking-details-dialog {
    width: min(100%, 900px) !important;
    max-height: calc(100dvh - 18px) !important;
    overflow-y: auto;
  }
  .booking-details-sticky {
    position: sticky;
    top: 0;
    z-index: 5;
  }
  .booking-ledger-row {
    grid-template-columns: 20px minmax(0, 1fr) !important;
    align-items: start !important;
  }
  .booking-ledger-override {
    grid-column: 2;
    width: 100%;
  }
  .booking-ledger-amount-field {
    flex: 1 1 110px;
  }
  .booking-ledger-date-field {
    flex: 1 1 132px;
  }
  .booking-ledger-override button {
    min-height: 40px;
  }
  .room-pricing-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
@media (max-width: 480px) {
  .shell, .article.shell {
    width: calc(100% - 20px) !important;
  }
  .main {
    padding-right: 10px !important;
    padding-left: 10px !important;
  }
  .sidebar {
    padding-right: 10px !important;
    padding-left: 10px !important;
  }
  .sidebar .nav-item {
    padding-right: 8px !important;
    padding-left: 8px !important;
  }
  input, select, textarea {
    font-size: 16px !important;
  }
  .room-grid, .stats, .location-grid, .saved-room-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .stay, .booking-summary, .guest-detail-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .request-room-summary {
    flex-direction: column;
    margin-left: 0 !important;
  }
  .request-property-photo {
    width: 100% !important;
    max-width: 320px;
    height: auto !important;
    aspect-ratio: 16 / 10;
  }
}

/* A gentle hover cue for the homepage date fields, only on mouse-like input. */
@media (hover: hover) and (pointer: fine) {
  #searchForm .date-search-field {
    position: relative;
    z-index: 0;
    border-radius: 9px;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
    transform-origin: center;
  }
  #searchForm .date-search-field:hover {
    z-index: 2;
    transform: scale(1.025);
    background: #fff;
    box-shadow: 0 8px 20px #26362b20;
  }
}
@media (prefers-reduced-motion: reduce) {
  #searchForm .date-search-field {
    transition: none;
  }
  #searchForm .date-search-field:hover {
    transform: none;
  }
}

/* The language picker wraps to the left on phones; anchor its menu to the
   button's left edge so the options remain inside the viewport. */
@media (max-width: 760px) {
  .topbar > .top-actions .wrospot-language-menu {
    right: auto !important;
    left: 0 !important;
    min-width: min(160px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
  }
}

@media (max-width: 760px) {
  .topbar .wrospot-language-picker {
    z-index: 10021;
  }
  .topbar .wrospot-language-menu {
    color: #202b28 !important;
    text-align: left !important;
  }
  .topbar .wrospot-language-menu > [role="menuitem"] {
    display: block !important;
    width: 100% !important;
    min-height: 38px !important;
    padding: 8px 11px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #202b28 !important;
    text-align: left !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
  }
  .topbar .wrospot-language-menu > [role="menuitem"]:hover,
  .topbar .wrospot-language-menu > [role="menuitem"]:focus-visible {
    background: #e5f2eb !important;
  }
}


/* Keep the homepage date search in its original place until it reaches
   the lower edge of the phone viewport, then pin it while scrolling past. */
@media (max-width: 760px) {
  #searchForm {
    position:static !important;
    z-index:auto;
    left:auto;
    bottom:auto;
    transform:none;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    align-items:stretch;
    gap:6px;
    width:100%;
    margin:0;
    padding:8px;
    border:1px solid var(--line, #e6e7e1);
    border-radius:16px;
    background:rgba(255,255,255,.97);
    box-shadow:0 8px 24px #26362b18;
    -webkit-backdrop-filter:blur(14px);
    backdrop-filter:blur(14px);
  }
  #searchForm.is-bottom-fixed {
    position:fixed !important;
    z-index:1050;
    left:50%;
    bottom:env(safe-area-inset-bottom, 0px);
    transform:translateX(-50%);
    width:min(560px, calc(100vw - 20px));
    border:2px solid #1f7864;
    background:#fff;
    box-shadow:0 0 0 3px rgba(31,120,100,.16), 0 14px 34px rgba(23,77,64,.28);
  }
  .search-wrap { z-index:1050; margin-bottom:24px; }
  #searchForm .search-field:first-child { display:none !important; }
  #searchForm .search-field:nth-child(2),
  #searchForm .search-field:nth-child(3),
  #searchForm .search-field:nth-child(4) {
    display:block !important;
    min-width:0;
    padding:6px 8px;
    border:1px solid #e1e7e1;
    border-radius:10px;
    background:#f8faf8;
  }
  #searchForm .search-field:nth-child(2) { grid-column:1; grid-row:1; }
  #searchForm .search-field:nth-child(3) { grid-column:2; grid-row:1; }
  #searchForm .search-field:nth-child(4) { grid-column:1; grid-row:2; }
  #searchForm .search-field label { font-size:9px; }
  #searchForm .search-field input,
  #searchForm .search-field select { min-width:0; padding:3px 0 0; font-size:14px !important; }
  #searchForm .search-button { grid-column:2; grid-row:2; min-height:44px; padding:8px 9px; margin:0; border-radius:10px; font-size:14px; }
}
@media (prefers-reduced-motion: reduce) {
  #searchForm .date-search-field { transition:none; }
  #searchForm .date-search-field:hover { transform:none; }
}

/* Keep the guest sign-in page's forms and cards inside a phone viewport. */
@media (max-width: 760px) {
  body.guest-account-page { overflow-x:hidden; }
  body.guest-account-page .shell { width:calc(100% - 24px) !important; max-width:560px; min-width:0; }
  body.guest-account-page .topbar { gap:8px; }
  body.guest-account-page .topbar-start { min-width:0; }
  body.guest-account-page main { padding:22px 0 40px; }
  body.guest-account-page h1 { font-size:clamp(29px,8vw,40px); }
  body.guest-account-page .intro { overflow-wrap:anywhere; }
  body.guest-account-page .panel { width:100%; min-width:0; margin-top:20px; padding:20px 16px; border-radius:17px; }
  body.guest-account-page form { width:100%; max-width:100%; min-width:0; }
  body.guest-account-page form > label,
  body.guest-account-page form input,
  body.guest-account-page form button { min-width:0; max-width:100%; }
  body.guest-account-page .booking { grid-template-columns:minmax(0,1fr); }
}

/* Use Logo #1's circular home-and-study symbol in every shared brand lockup. */
.brand-mark {
  flex: 0 0 auto;
  border-radius: 50% !important;
  background-color: transparent !important;
  background-image: url("images/wrospot-logo-mark.svg") !important;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: transparent !important;
  font-size: 0 !important;
}

/* Keep the back control consistent on subpages; mobile shows the compact arrow only. */
.topbar .back-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  flex:0 0 auto;
  min-height:38px;
  padding:7px 10px;
  border:1px solid var(--line, #e1e5df);
  border-radius:10px;
  background:#fff;
  color:var(--green, #1f6b57);
  font-size:12px;
  font-weight:750;
  white-space:nowrap;
}
.topbar .back-arrow { font-size:19px; line-height:1; }
@media (max-width:760px) {
  .topbar .back-button {
    flex:0 0 42px;
    width:42px;
    height:42px;
    min-height:42px;
    padding:0;
    border-radius:12px;
  }
  .topbar .back-label { display:none; }
}

/* Reserve the same starting area for Back and the logo on every page. */
@media (min-width: 761px) {
  .topbar {
    display: grid;
    align-items: center;
    justify-content: initial;
  }
  .topbar-start {
    display: grid;
    align-items: center;
    box-sizing: border-box;
    flex: none;
  }
  .topbar-start .back-button { flex: none; }
  .topbar-start .brand {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    line-height: 0;
  }
  .topbar-start .brand-logo {
    display: block;
    flex: none;
    height: auto;
    margin: 0;
    object-fit: contain;
    vertical-align: middle;
  }
  .topbar .top-actions {
    display: grid;
    align-items: center;
    justify-content: space-between;
    flex: none;
    width: 100%;
    min-width: 0;
  }
  .topbar .top-actions > a,
  .topbar .top-actions > button,
  .topbar .top-actions > .wrospot-language-picker,
  .topbar .top-actions > .host-entry {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    margin-left: 0;
    padding: 6px 5px;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .top-actions > a,
  .topbar .top-actions > button,
  .topbar .top-actions > .host-entry { font-size: 12px; }
  .topbar .top-actions > .host-entry { display: flex; align-items: center; gap: 4px; padding: 0; overflow: visible; }
  .topbar .top-actions .host-signin { box-sizing: border-box; flex: 1 1 auto; min-width: 0; padding: 6px 5px; white-space: nowrap; }
}

/* Every navigation control keeps its column, even when hidden on a page. */
@media (min-width: 1100px) {
  .topbar { grid-template-columns: 281px minmax(0, 1fr); gap: clamp(7px, .8vw, 12px); }
  .topbar-start { grid-template-columns: 148px 120px; gap: 13px; width: 281px; }
  .topbar-start .brand { grid-column: 1; grid-row: 1; width: 148px !important; max-width: 148px !important; }
  .topbar-start .brand-logo { width: 148px !important; max-width: 148px !important; }
  .topbar-start .back-button { grid-column: 2; grid-row: 1; width: 120px; }
  .topbar:not(:has(.topbar-start)) > .brand { grid-column: 1; justify-self: start; margin-left: 0; width: 148px; }
  .topbar .top-actions { grid-column: 2; grid-template-columns: 60px 120px 98px 160px 125px 64px 180px; gap: 8px; }
  .topbar .top-actions > a[href="home.html"],
  .topbar .top-actions > a[href="/home.html"],
  .topbar .top-actions > a[href="/#home"] { grid-column: 1; }
  .topbar .top-actions > a[href="#rooms"],
  .topbar .top-actions > a[href="home.html#rooms"],
  .topbar .top-actions > a[href="/#rooms"] { grid-column: 2; }
  .topbar .top-actions > .saved-rooms-link { grid-column: 3; }
  .topbar .top-actions > a[href="#contact"],
  .topbar .top-actions > a[href="home.html#contact"],
  .topbar .top-actions > a[href="/#contact"] { grid-column: 4; }
  .topbar .top-actions > .account-link,
  .topbar .top-actions > a[href*="guest-account.html"] { grid-column: 5; }
  .topbar .top-actions > .language,
  .topbar .top-actions > .wrospot-language-picker { grid-column: 6; }
  .topbar .top-actions > .host-entry,
  .topbar .top-actions > a.host-entry { grid-column: 7; }
  .topbar .top-actions > a,
  .topbar .top-actions > button,
  .topbar .top-actions > .wrospot-language-picker,
  .topbar .top-actions > .host-entry { grid-row: 1; }
}

@media (min-width: 1100px) and (max-width: 1349px) {
  .topbar .top-actions { grid-template-columns: 48px 94px 82px 132px 104px 56px 142px; gap: 5px; }
  .topbar .top-actions > a, .topbar .top-actions > button, .topbar .top-actions > .wrospot-language-picker { font-size: 10px; padding-inline: 3px; }
  .topbar .top-actions .host-signin { font-size: 10px; padding-inline: 3px; }
  .topbar .top-actions .host-signin span { display: none; }
  .topbar .top-actions .host-avatar-button { flex: 0 0 36px; width: 36px; min-width: 36px; height: 36px; min-height: 36px; }
}

/* Tablet widths use two stable rows so the desktop controls never collide. */
@media (min-width: 761px) and (max-width: 1099px) {
  .topbar { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-block: 8px; }
  .topbar-start { grid-template-columns: 148px 120px; gap: 13px; width: 281px; }
  .topbar-start .brand { grid-column: 1; grid-row: 1; width: 148px !important; max-width: 148px !important; }
  .topbar-start .brand-logo { width: 148px !important; max-width: 148px !important; }
  .topbar-start .back-button { grid-column: 2; grid-row: 1; width: 120px; }
  .topbar:not(:has(.topbar-start)) > .brand { grid-column: 1; margin-left: 0; width: 148px; }
  .topbar .top-actions { grid-column: 1; grid-template-columns: 44px minmax(80px,1fr) minmax(70px,.9fr) minmax(116px,1.35fr) minmax(96px,1.1fr) 52px minmax(128px,1.4fr); gap: 5px; }
  .topbar .top-actions > a[href="home.html"],
  .topbar .top-actions > a[href="/home.html"] { grid-column: 1; }
  .topbar .top-actions > a[href="#rooms"],
  .topbar .top-actions > a[href="home.html#rooms"],
  .topbar .top-actions > a[href="/#rooms"] { grid-column: 2; }
  .topbar .top-actions > .saved-rooms-link { grid-column: 3; }
  .topbar .top-actions > a[href="#contact"],
  .topbar .top-actions > a[href="home.html#contact"],
  .topbar .top-actions > a[href="/#contact"] { grid-column: 4; }
  .topbar .top-actions > .account-link,
  .topbar .top-actions > a[href*="guest-account.html"] { grid-column: 5; }
  .topbar .top-actions > .language,
  .topbar .top-actions > .wrospot-language-picker { grid-column: 6; }
  .topbar .top-actions > .host-entry,
  .topbar .top-actions > a.host-entry { grid-column: 7; }
  .topbar .top-actions > a,
  .topbar .top-actions > button,
  .topbar .top-actions > .host-entry { font-size: 10px; }
}
