/* Phone layout and native safe areas. Loaded after Tailwind to preserve
   these rules without changing desktop styles or module data loading. */
:root { --hq-safe-top: env(safe-area-inset-top, 0px); --hq-safe-bottom: env(safe-area-inset-bottom, 0px); }
.vl-mobile-tabs { display: none; }
.vl-native-settings h3 { font-weight: 700; }
.vl-native-settings > p, .vl-native-settings small { color: var(--vl-text-secondary, #64748b); font-size: 13px; }
.vl-native-settings > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; border-bottom: 1px solid var(--vl-border); }
.vl-native-settings small { display: block; margin-top: 4px; }
.vl-native-settings button, .vl-camera-button { flex-shrink: 0; border: 1px solid var(--vl-border); border-radius: 10px; padding: 10px 16px; min-height: 44px; background: var(--vl-bg-card); color: var(--vl-text-primary); }
.vl-camera-button { display: inline-flex; align-items: center; margin: 8px 4px; font-size: 14px; font-weight: 600; }
.vl-native-settings button:disabled { opacity: .5; }
.vl-native-locked #app, .vl-native-locked #vl-portal { visibility: hidden !important; pointer-events: none !important; }
#vl-native-lock { position: fixed; inset: 0; z-index: 2147483647; display: grid; place-items: center; background: #1e2533; color: #f8fafc; padding: max(24px, var(--hq-safe-top)) 24px max(24px, var(--hq-safe-bottom)); }
#vl-native-lock > div { width: min(100%, 360px); text-align: center; }
.vl-native-lock-mark { font: 700 48px Lora, serif; color: #c19b65; }
#vl-native-lock h1 { margin: 20px 0; font-size: 28px; font-weight: 700; }
#vl-native-lock p { margin: 16px 0; color: #c8d0dc; }
#vl-native-lock button { display: block; width: 100%; min-height: 48px; border-radius: 12px; padding: 12px; margin: 12px 0; background: #c19b65; color: #1e2533; font-weight: 700; }
#vl-native-lock button + button { background: transparent; color: #f8fafc; border: 1px solid #64748b; }
#vl-native-lock button:disabled { opacity: .5; }

@media (max-width: 1023px) {
  .vl-app-shell { min-height: 100dvh; }
  .vl-mobile-header { padding-top: calc(10px + var(--hq-safe-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .vl-sidebar { padding-top: calc(20px + var(--hq-safe-top)); padding-bottom: calc(20px + var(--hq-safe-bottom)); overscroll-behavior: contain; }
  .vl-main-content { min-width: 0; padding-bottom: calc(88px + var(--hq-safe-bottom)); }
  .vl-mobile-tabs { position: fixed; inset: auto 0 0; z-index: 110; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + var(--hq-safe-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid var(--vl-border); background: var(--vl-bg-card, #fff); box-shadow: 0 -3px 20px rgba(15,23,42,.08); }
  .vl-mobile-tabs button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; border-radius: 10px; color: var(--vl-text-secondary, #64748b); font-size: 11px; }
  .vl-mobile-tabs [aria-current="page"] { color: var(--vl-text-primary, #2f3a4e); background: var(--vl-bg-selected, #f1e8dd); font-weight: 700; }
  .vl-mobile-tabs .vl-nav-icon { width: 22px; height: 22px; }
  .vl-mobile-unread { position: absolute; top: 0; left: calc(50% + 8px); min-width: 16px; height: 16px; padding-inline: 3px; border-radius: 50%; background: var(--vl-gold, #c19b65); color: #1e2533; font-size: 10px; }
  .vl-keyboard-open .vl-mobile-tabs { display: none; }
  .vl-login-screen { min-height: 100dvh; padding: max(20px, var(--hq-safe-top)) 16px max(20px, var(--hq-safe-bottom)); }
  .vl-login-screen > div { padding: 24px; }
  .vl-agent-dropdown { max-width: calc(100vw - 40px); min-width: min(280px, calc(100vw - 40px)); }
  .th-directory-layout, .ch-layout { height: var(--hq-workspace-height, calc(100dvh - 285px - var(--hq-safe-top) - var(--hq-safe-bottom))); min-height: 300px; }
  .vl-keyboard-open .ch-layout { min-height: 260px; }
}
@media (max-width: 760px) {
  .th-tab-row .vl-page-tabs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; min-width: 0; padding-bottom: 6px; }
  .th-tab-row .vl-page-tab { flex-shrink: 0; white-space: nowrap; }
}
@media (max-width: 640px) {
  .vl-main-content { padding-inline: max(12px, env(safe-area-inset-left)); }
  #vl-view-content { min-width: 0; overflow-wrap: anywhere; }
  .vl-main-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  .vl-main-content select, .vl-main-content textarea, .vl-login-screen input { font-size: 16px; min-height: 44px; max-width: 100%; }
  .vl-main-content button:not(.ch-reaction):not(.tc-day):not(.tc-event) { min-height: 44px; }
  .vl-main-content .overflow-x-auto { overscroll-behavior-x: contain; }
  .vl-main-content .grid > *, .vl-main-content .flex > * { min-width: 0; }
  .vl-main-content header h1 { font-size: 22px; }
  .vl-native-settings > div { align-items: flex-start; }
  .vl-main-content [role="dialog"], #vl-portal [role="dialog"] { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px - var(--hq-safe-top) - var(--hq-safe-bottom)); overflow-y: auto; }
  #account-crop-canvas, #account-crop-canvas + div { max-width: 100%; }
}
