/* Phone and app-mode layout for every signed-in page (loaded on every page by the Worker, after the page's own styles). */
.vt-burger { display:none; }

/* Installed app: keep the header clear of the notch / status bar, and the bottom clear of the home bar. */
@media (display-mode: standalone) {
  header { padding-top:calc(14px + env(safe-area-inset-top)) !important; }
  body { padding-bottom:env(safe-area-inset-bottom); }
}

@media (max-width:700px) {
  html, body { overflow-x:hidden; }
  body { -webkit-text-size-adjust:100%; }
  /* Header: logo, account photo and a menu button; the menu drops down as a list. */
  header { flex-wrap:nowrap !important; padding-left:max(16px, env(safe-area-inset-left)) !important; padding-right:max(16px, env(safe-area-inset-right)) !important; gap:10px !important; }
  header img { height:30px !important; }
  header .user { margin-left:auto; gap:8px !important; }
  .vt-burger { display:inline-grid; place-items:center; width:42px; height:42px; flex:none; border-radius:10px; cursor:pointer;
    color:var(--c-ffffff,#ffffff); background:rgba(var(--ink-rgb,255,255,255),.05); border:1px solid rgba(183,137,71,.45); padding:0; }
  .vt-burger svg { width:22px; height:22px; }
  header.vt-open .vt-burger { background:rgba(183,137,71,.18); border-color:#b78947; }
  header nav { display:none !important; }
  header.vt-open nav { display:flex !important; flex-direction:column; position:absolute; left:0; right:0; top:100%; margin:0 !important;
    width:auto !important; gap:0 !important; padding:8px 12px 14px; background:var(--b-0f2a45,#0f2a45); border-bottom:1px solid rgba(183,137,71,.45);
    box-shadow:0 18px 40px rgba(0,0,0,.45); max-height:calc(100vh - 80px); overflow-y:auto; z-index:60; font-size:16px !important; }
  header.vt-open nav a { padding:12px 10px; border-radius:8px; border-bottom:0 !important; color:var(--c-e6edf5,#e6edf5); }
  header.vt-open nav a.on { background:rgba(183,137,71,.15); color:var(--c-ffffff,#ffffff); box-shadow:inset 3px 0 0 #b78947; }

  main { padding-left:max(14px, env(safe-area-inset-left)) !important; padding-right:max(14px, env(safe-area-inset-right)) !important; padding-top:22px !important; }
  h1 { font-size:23px; }
  /* 16px text in form fields stops iPhones zooming in when you tap one. */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size:16px !important; max-width:100%; }
  img, video, canvas, iframe { max-width:100%; }
  /* Wide tables scroll sideways inside their own box instead of stretching the page. */
  .vt-scroll { max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  /* Pop-up windows fit the screen. */
  dialog { max-width:calc(100vw - 20px) !important; max-height:calc(100dvh - 20px); }
  .btn, button { min-height:38px; }
  /* Tab rows that don't fit (e.g. Lettings & Management, Reviews) slide sideways instead of being cut off. */
  /* Every kind of tab / stage / view-switch row: one line that slides sideways, each label in full (no squashed
     labels running into the next tab). nav.js fades the edge when there are more tabs off-screen. */
  main :is(.tabs, .dtabs, .ptabs, .steps, .subtabs, [role=tablist]), main .seg:not(.f .seg) {
    flex-wrap:nowrap !important; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; -webkit-overflow-scrolling:touch; max-width:100%; }
  main :is(.tabs, .dtabs, .ptabs, .steps, .subtabs, [role=tablist])::-webkit-scrollbar, main .seg::-webkit-scrollbar { display:none; }
  main :is(.tabs, .dtabs, .ptabs, .steps, .subtabs, [role=tablist]) > *, main .seg:not(.f .seg) > * {
    flex:none !important; min-width:max-content !important; white-space:nowrap; }
  main .steps button { padding-left:12px !important; padding-right:12px !important; }
  main .vt-more { -webkit-mask-image:linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image:linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  main .vt-more.vt-less { -webkit-mask-image:linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image:linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
  main .vt-less:not(.vt-more) { -webkit-mask-image:linear-gradient(to right, transparent, #000 36px); mask-image:linear-gradient(to right, transparent, #000 36px); }
  /* Section titles with buttons on the right wrap onto two lines. */
  main h2 { flex-wrap:wrap; }
  /* Room at the bottom so the floating microphone button never covers the last row. */
  main { padding-bottom:96px !important; }
  /* Sourcing map: layer buttons in one sliding row; taller map. */
  .layers { right:14px; overflow-x:auto; scrollbar-width:none; padding-bottom:2px; }
  .layers::-webkit-scrollbar { display:none; }
  .layers .chip, .chip { white-space:nowrap; flex:none; }
  .chip { min-height:0; }
  #map { height:65vh; }
}
@media (max-width:700px) {
  .vv-btn { right:16px !important; bottom:calc(16px + env(safe-area-inset-bottom)) !important; width:52px !important; height:52px !important; }
  .vt-menu-open .vv-btn { display:none !important; }
  .vv-panel { right:10px !important; left:10px; width:auto !important; bottom:calc(78px + env(safe-area-inset-bottom)) !important; }
}

/* Back button (app mode and phones, every page below Home; added by nav.js). */
.vt-back { display:inline-grid; place-items:center; width:40px; height:40px; flex:none; border-radius:10px; cursor:pointer; padding:0;
  color:var(--c-c99c5b,#c99c5b); background:rgba(var(--ink-rgb,255,255,255),.05); border:1px solid rgba(183,137,71,.45); margin-right:-4px; }
.vt-back svg { width:22px; height:22px; }
.vt-back:active { background:rgba(183,137,71,.18); }
@media (max-width:380px) { header img { height:26px !important; } }
