/* Portal phone / desktop view mode */

:root {
  --portal-phone-ratio: 9 / 19.5;
  --portal-phone-max-w: 430px;
  --portal-focus-bar-h: 48px;
}

html.portal-view--phone.portal-view--active body {
  background: #0f172a;
  /* ارتفاع پایدار زیر نوار آدرس مرورگر؛ safe-area برای ناچ/هوم */
  height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

html.portal-view--phone.portal-view--active body.has-site-bg {
  background-size: cover;
  background-position: center;
}

/* Full-viewport phone aspect shell — fills screen, keeps phone ratio */
html.portal-view--phone.portal-view--active #dashboard {
  --portal-header-height: 48px;
  width: min(100%, 100svh * var(--portal-phone-ratio), var(--portal-phone-max-w));
  flex: 1 1 auto;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  margin: 0 auto;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  background: var(--ui-bg, #f8f9fa);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35), 0 24px 64px rgba(0, 0, 0, 0.45);
  position: relative;
  box-sizing: border-box;
}

html.portal-view--phone.portal-view--active #dashboard .header {
  padding: 6px 6px;
  gap: 4px;
  flex-wrap: nowrap;
  min-height: var(--portal-header-height);
  position: relative;
  top: auto;
  z-index: 1100;
  overflow: visible;
}

html.portal-view--phone.portal-view--active #dashboard .header-left {
  flex: 1 1 auto;
  min-width: 0;
}

html.portal-view--phone.portal-view--active #dashboard .header-left h1 {
  font-size: 0.72rem;
  max-width: none;
  line-height: 1.25;
}

html.portal-view--phone.portal-view--active #dashboard .header-right {
  gap: 2px;
  flex-shrink: 0;
}

html.portal-view--phone.portal-view--active #dashboard .header-right .user-info .user-details {
  display: none;
}

html.portal-view--phone.portal-view--active #dashboard .header-right .lang-switch {
  display: inline-flex;
  margin: 0;
  margin-inline-end: 0;
  position: relative;
  z-index: 1300;
}

html.portal-view--phone.portal-view--active #dashboard .header-right .lang-switch-toggle {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  color: #fff;
}

html.portal-view--phone.portal-view--active #dashboard .header-right .lang-switch-toggle:hover,
html.portal-view--phone.portal-view--active #dashboard .header-right .lang-switch.is-open .lang-switch-toggle {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

html.portal-view--phone.portal-view--active #dashboard .header-right .lang-switch-icon {
  font-size: 0.72rem;
  color: inherit;
}

/* منوی زبان گوشی: چپ‌چین، برچسب کوتاه En / فا / 中 */
html.portal-view--phone.portal-view--active #dashboard .header-right .lang-switch-menu {
  left: 0;
  right: auto;
  inset-inline-start: 0;
  inset-inline-end: auto;
  min-width: 7.5rem;
  z-index: 1400;
  text-align: left;
  direction: ltr;
}

html.portal-view--phone.portal-view--active #dashboard .header-right .lang-switch-option {
  justify-content: flex-start;
  gap: 0.65rem;
  text-align: left;
  direction: ltr;
}

html.portal-view--phone.portal-view--active #dashboard .header-right .lang-switch-option-code {
  min-width: 1.75rem;
  font-size: 0.9rem;
  font-weight: 800;
  opacity: 1;
}

html.portal-view--phone.portal-view--active #dashboard .header-right .lang-switch-option-name {
  font-size: 0.82rem;
}

html.portal-view--phone.portal-view--active #dashboard .header-right #userInfo {
  gap: 0;
  margin: 0;
}

html.portal-view--phone.portal-view--active #dashboard .header-right #userInfo .user-avatar,
html.portal-view--phone.portal-view--active #dashboard .header-right #userInfo img {
  width: 26px;
  height: 26px;
}

html.portal-view--phone.portal-view--active #dashboard .btn-header-icon {
  width: 28px;
  height: 28px;
  font-size: 12px;
  border-radius: 6px;
}

html.portal-view--phone.portal-view--active #dashboard .portal-view-toggle {
  gap: 0;
  padding: 1px;
  border-radius: 8px;
}

html.portal-view--phone.portal-view--active #dashboard .portal-view-toggle .btn-header-icon {
  width: 26px;
  height: 26px;
  font-size: 11px;
  border-radius: 6px;
}

html.portal-view--phone.portal-view--active #dashboard .portal-chat-launcher .btn-header-icon {
  width: 28px;
  height: 28px;
}

html.portal-view--phone.portal-view--active #dashboard .portal-chat-badge {
  font-size: 0.58rem;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  top: -2px;
  inset-inline-end: -2px;
}

html.portal-view--phone.portal-view--active #dashboard .main-content {
  flex: 1;
  min-height: 0;
  padding: 8px 10px 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Compact horizontal / wrap nav for all sections */
html.portal-view--phone.portal-view--active #dashboard .portal-layout {
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

html.portal-view--phone.portal-view--active #dashboard .portal-sidebar {
  width: 100%;
  position: static;
  max-height: none;
  overflow: visible;
  padding: 0;
  flex-shrink: 0;
}

html.portal-view--phone.portal-view--active #dashboard .portal-nav-home {
  margin-bottom: 6px;
}

html.portal-view--phone.portal-view--active #dashboard .portal-nav-group-header {
  font-size: 0.72rem;
  margin: 6px 0 4px;
  padding: 6px 8px;
}

html.portal-view--phone.portal-view--active #dashboard .portal-nav-grid,
html.portal-view--phone.portal-view--active #dashboard .portal-sidebar .portal-nav-group-items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

html.portal-view--phone.portal-view--active #dashboard .portal-sidebar .portal-nav-item {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 8px 4px;
  font-size: 0.68rem;
  line-height: 1.2;
  min-height: 58px;
  border-radius: 10px;
}

html.portal-view--phone.portal-view--active #dashboard .portal-sidebar .portal-nav-item i {
  font-size: 1.05rem;
  margin: 0;
}

html.portal-view--phone.portal-view--active #dashboard .portal-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  width: 100% !important;
  max-width: 100% !important;
}

html.portal-view--phone.portal-view--active #dashboard .portal-layout {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: 100%;
}

html.portal-view--phone.portal-view--active #dashboard .content-section {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

html.portal-view--phone.portal-view--active #dashboard .table-container,
html.portal-view--phone.portal-view--active #dashboard .data-table {
  max-width: 100%;
}

html.portal-view--phone.portal-view--active #dashboard .data-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Section focus: hide icon menu, fill screen with content */
html.portal-view--phone.portal-focus--section #dashboard .portal-sidebar {
  display: none !important;
}

html.portal-view--phone.portal-focus--section #dashboard .portal-layout {
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

html.portal-view--phone.portal-focus--section #dashboard .main-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html.portal-view--phone.portal-focus--section #dashboard .portal-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.portal-section-back-bar {
  display: none;
  flex-shrink: 0;
  margin: 0 0 8px;
  border-radius: 10px;
}

html.portal-view--phone.portal-focus--section .portal-section-back-bar:not([hidden]) {
  display: flex;
}

html:not(.portal-view--phone) .portal-section-back-bar {
  display: none !important;
}

/* Prevent desktop floating chat windows while in phone browse mode */
html.portal-view--phone:not(.portal-focus--chat) #portalChatWindows {
  display: none !important;
  pointer-events: none !important;
}

/* Never let the chat focus shell steal taps while browsing */
html.portal-view--phone:not(.portal-focus--chat) .portal-chat-mobile,
.portal-chat-mobile[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* View toggle buttons */
.portal-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.18);
}

.portal-view-toggle .btn-header-icon {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  opacity: 0.72;
}

.portal-view-toggle .btn-header-icon.is-active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.22);
}

/* Focus bar shared */
.portal-focus-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--portal-focus-bar-h);
  padding: 6px 10px;
  background: linear-gradient(
    120deg,
    var(--ui-sidebar-bg) 0%,
    color-mix(in srgb, var(--ui-accent-deep) 70%, var(--ui-sidebar-bg)) 55%,
    var(--ui-accent-hover) 100%
  );
  color: #fff;
  flex-shrink: 0;
  z-index: 5;
}

.portal-focus-bar strong {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-focus-back {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.portal-focus-back:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ——— Chat mobile messenger ——— */
.portal-chat-mobile {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  /* فاصله از نوار ابزار مرورگر / ناوبری گوشی + کیبورد */
  bottom: max(0px, var(--portal-vv-bottom, 0px));
  z-index: 1200;
  flex-direction: column;
  background: var(--ui-bg, #f8f9fa);
  box-sizing: border-box;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

html.portal-view--phone.portal-focus--chat .portal-chat-mobile {
  display: flex;
}

html.portal-view--phone.portal-focus--chat .portal-chat-mobile-thread .portal-chat-win-foot {
  padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  background: var(--ui-surface, #fff);
}

html.portal-view--phone.portal-focus--chat #dashboard > .header,
html.portal-view--phone.portal-focus--chat #dashboard > .main-content {
  visibility: hidden;
  pointer-events: none;
}

.portal-chat-mobile-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  direction: rtl;
}

.portal-chat-mobile-list {
  width: 100%;
  min-width: 0;
  display: none;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}

.portal-chat-mobile-thread {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: none;
  flex-direction: column;
  background: #f1f5f9;
}

.portal-chat-mobile.is-list .portal-chat-mobile-list {
  display: flex;
  width: 100%;
  max-width: none;
}

.portal-chat-mobile.is-list .portal-chat-mobile-thread {
  display: none !important;
}

.portal-chat-mobile.is-thread .portal-chat-mobile-thread {
  display: flex;
  width: 100%;
}

.portal-chat-mobile.is-thread .portal-chat-mobile-list {
  display: none !important;
}

.portal-chat-mobile.is-thread .portal-focus-list-back {
  display: inline-flex;
}

.portal-chat-mobile.is-list .portal-focus-list-back {
  display: none !important;
}

.portal-chat-mobile.is-thread .portal-focus-back span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.portal-focus-list-back {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-focus-list-back:hover {
  background: rgba(255, 255, 255, 0.22);
}

.portal-chat-mobile-threads {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.portal-chat-mobile-thread-item {
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--ui-border, #e2e8f0);
  background: #fff;
  text-align: start;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: inherit;
  color: inherit;
}

.portal-chat-mobile-thread-item:hover,
.portal-chat-mobile-thread-item:active {
  background: #f8fafc;
}

.portal-chat-mobile-thread-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.portal-chat-mobile-thread-top strong {
  font-size: 0.92rem;
  color: #0f172a;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-chat-mobile-thread-time {
  font-size: 0.72rem;
  color: #64748b;
  flex-shrink: 0;
}

.portal-chat-mobile-thread-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.portal-chat-mobile-thread-preview {
  font-size: 0.8rem;
  color: #64748b;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-chat-mobile-thread-unread {
  min-width: 1.4em;
  height: 1.4em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ui-brand, #0f766e);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-chat-mobile-threads-empty {
  padding: 24px 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.88rem;
}

.portal-chat-mobile-newchat {
  flex-shrink: 0;
  border-top: 1px solid var(--ui-border, #e2e8f0);
  background: #fff;
}

.portal-chat-mobile-newchat-toggle {
  appearance: none;
  width: 100%;
  border: 0;
  background: #f8fafc;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ui-brand, #0f766e);
  cursor: pointer;
}

.portal-chat-mobile-newchat-toggle[aria-expanded='true'] {
  background: #ecfdf5;
}

.portal-chat-mobile-newchat-body {
  max-height: 45vh;
  overflow: auto;
  border-top: 1px solid var(--ui-border, #e2e8f0);
}

.portal-chat-mobile-newchat-body[hidden] {
  display: none !important;
}

html.portal-view--phone.portal-focus--chat .portal-chat-mobile-list #portalChatContacts {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  max-height: none !important;
  height: auto;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column;
}

html.portal-view--phone.portal-focus--chat .portal-chat-mobile-list #portalChatContacts[hidden] {
  display: flex !important;
}

html.portal-view--phone.portal-focus--chat .portal-chat-contacts-list {
  flex: 1;
  overflow: auto;
  max-height: 40vh;
}

html.portal-view--phone.portal-focus--chat .portal-chat-mobile-thread #portalChatWindows {
  position: static !important;
  inset: auto !important;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  padding: 0;
  gap: 0;
  pointer-events: auto;
}

html.portal-view--phone.portal-focus--chat .portal-chat-mobile-thread .portal-chat-window {
  width: 100% !important;
  max-width: none !important;
  height: 100%;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

html.portal-view--phone.portal-focus--chat .portal-chat-mobile-thread .portal-chat-window.is-minimized {
  height: 100%;
}

html.portal-view--phone.portal-focus--chat .portal-chat-mobile-thread .portal-chat-window.is-minimized .portal-chat-win-body,
html.portal-view--phone.portal-focus--chat .portal-chat-mobile-thread .portal-chat-window.is-minimized .portal-chat-win-foot {
  display: flex;
}

html.portal-view--phone.portal-focus--chat .portal-chat-mobile-thread .portal-chat-win-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

html.portal-view--phone.portal-focus--chat .portal-chat-mobile-thread #portalChatWindows:not(:has(.portal-chat-window))::before {
  content: none;
  display: none;
}

html.portal-view--phone.portal-focus--chat #portalChatLauncher > #portalChatContacts {
  /* contacts moved into mobile shell */
}

/* Inquiry detail: landscape phone shell for readable fields */
html.portal-view--phone.portal-view--active.portal-focus--inquiry #dashboard {
  --portal-phone-max-w: 960px;
  width: min(100vw, calc(100dvh * 19.5 / 9), var(--portal-phone-max-w));
  height: min(100dvh, calc(100vw * 9 / 19.5));
  max-height: 100dvh;
}

/* ——— Inquiry focus (phone) ——— */
html.portal-view--phone.portal-focus--inquiry #dashboard > .header,
html.portal-view--phone.portal-focus--inquiry #dashboard > .main-content,
html.portal-view--phone.portal-focus--inquiry #dashboard > .portal-section-back-bar {
  visibility: hidden;
  pointer-events: none;
}

/* Modal hosted inside phone shell (#dashboard > .inq-phone-focus-modal) */
html.portal-view--phone.portal-focus--inquiry #dashboard > .modal.inq-phone-focus-modal {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 1400 !important;
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  background: var(--ui-bg, #f8f9fa) !important;
  overflow: hidden;
  pointer-events: auto !important;
}

html.portal-view--phone.portal-focus--inquiry #dashboard > .modal.inq-phone-focus-modal .modal-content.inq-detail-modal {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex !important;
  flex-direction: column;
  box-shadow: none !important;
  overflow: hidden;
  padding: 0 !important;
}

html.portal-view--phone.portal-focus--inquiry #dashboard > .modal.inq-phone-focus-modal .modal-header {
  display: none !important;
}

html.portal-view--phone.portal-focus--inquiry #dashboard > .modal.inq-phone-focus-modal .modal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}

html.portal-view--phone.portal-focus--inquiry .inq-detail {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

html.portal-view--phone.portal-focus--inquiry .inq-phone-focus-bar {
  display: flex;
}

html.portal-view--phone.portal-focus--inquiry .inq-phone-delete {
  margin-inline-start: auto;
  border-color: rgba(254, 202, 202, 0.75);
  color: #fecaca;
  background: rgba(185, 28, 28, 0.35);
}

html.portal-view--phone.portal-view--active .toast-container {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(100vw, 100dvh * var(--portal-phone-ratio), var(--portal-phone-max-w));
  max-width: var(--portal-phone-max-w);
  box-sizing: border-box;
  padding-inline: 10px;
}

.inq-phone-focus-bar {
  display: none;
}

.inq-detail-layout {
  display: block;
}

.inq-detail-layout .inq-panels {
  display: contents;
}

html.portal-view--phone .inq-detail-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  height: 100%;
  direction: rtl;
}

html.portal-view--phone .inq-detail-layout .inq-wf-strip {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 6px;
  padding: 4px 2px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

html.portal-view--phone .inq-detail-layout .inq-wf-row {
  width: max-content;
  min-width: 100%;
}

html.portal-view--phone .inq-detail-layout .inq-wf-cell:not(.inq-wf-cell--marker) {
  flex: 0 0 72px;
  min-width: 72px;
  max-width: 88px;
}

html.portal-view--phone .inq-detail-layout .inq-tabs {
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 88px;
  min-width: 88px;
  max-width: 100px;
  min-height: 0;
  border-bottom: none;
  border-inline-end: 1px solid var(--ui-border-strong, #94a3b8);
  overflow-y: auto;
  overflow-x: hidden;
  gap: 2px;
  padding: 6px 4px;
  background: var(--ui-surface-muted, #f1f5f9);
}

html.portal-view--phone .inq-detail-layout .inq-tab {
  bottom: auto;
  border-radius: 8px;
  border: 1px solid transparent;
  border-bottom: 1px solid transparent;
  writing-mode: horizontal-tb;
  white-space: normal;
  font-size: 0.68rem;
  padding: 8px 4px;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  line-height: 1.15;
}

html.portal-view--phone .inq-detail-layout .inq-tab::before,
html.portal-view--phone .inq-detail-layout .inq-tab::after {
  display: none !important;
}

html.portal-view--phone .inq-detail-layout .inq-tab.active {
  background: #fff;
  border-color: var(--ui-border-strong, #94a3b8);
  color: var(--ui-text, #0f172a);
  z-index: 2;
}

html.portal-view--phone .inq-detail-layout .inq-panels {
  grid-column: 2;
  grid-row: 2;
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
}

/* Landscape inquiry: readable fields that wrap to new rows */
html.portal-view--phone.portal-focus--inquiry .inq-detail-layout .inq-tabs {
  width: 76px;
  min-width: 76px;
  max-width: 86px;
}

html.portal-view--phone.portal-focus--inquiry .inq-detail-layout .inq-panels {
  padding: 12px 14px 16px;
  font-size: 0.95rem;
}

html.portal-view--phone.portal-focus--inquiry .inq-panel.active {
  border: none;
  border-radius: 0;
  padding: 4px 2px 12px;
  background: transparent;
}

html.portal-view--phone.portal-focus--inquiry .form-row,
html.portal-view--phone.portal-focus--inquiry .inq-cargo-form .inq-cargo-row,
html.portal-view--phone.portal-focus--inquiry .inq-financial-form .inq-financial-row,
html.portal-view--phone.portal-focus--inquiry .inq-detail .form-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px 12px !important;
  align-items: flex-end;
}

html.portal-view--phone.portal-focus--inquiry .form-row > .form-group,
html.portal-view--phone.portal-focus--inquiry .inq-cargo-form .inq-cargo-row > .form-group,
html.portal-view--phone.portal-focus--inquiry .inq-financial-form .inq-financial-row > .form-group,
html.portal-view--phone.portal-focus--inquiry .inq-detail .form-row > .form-group {
  flex: 1 1 180px !important;
  min-width: min(180px, 100%) !important;
  max-width: 100%;
  margin-bottom: 0;
}

html.portal-view--phone.portal-focus--inquiry .inq-cargo-form .inq-cargo-row-text > .form-group,
html.portal-view--phone.portal-focus--inquiry .form-row > .form-group:has(textarea) {
  flex: 1 1 100% !important;
  min-width: 100% !important;
}

html.portal-view--phone.portal-focus--inquiry .inq-detail label,
html.portal-view--phone.portal-focus--inquiry .inq-detail .form-group:not(.float-field) > label {
  font-size: 0.82rem !important;
  line-height: 1.3;
}

html.portal-view--phone.portal-focus--inquiry .inq-detail input,
html.portal-view--phone.portal-focus--inquiry .inq-detail select,
html.portal-view--phone.portal-focus--inquiry .inq-detail textarea {
  font-size: 0.95rem !important;
  min-height: 2.5rem;
}

html.portal-view--phone.portal-focus--inquiry .inq-fleet-split {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

html.portal-view--phone.portal-focus--inquiry .inq-vin-grid,
html.portal-view--phone.portal-focus--inquiry .inq-fleet-vins-list {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
}

html.portal-view--phone.portal-focus--inquiry .inq-acl-grid {
  grid-template-columns: minmax(100px, 1.2fr) repeat(4, minmax(48px, 1fr)) !important;
  overflow-x: auto;
}

html.portal-view--phone.portal-view--active.portal-focus--inquiry .toast-container {
  width: min(100vw, calc(100dvh * 19.5 / 9), 960px);
  max-width: 960px;
}

/* Hide phone-only chrome on desktop */
html.portal-view--desktop .portal-chat-mobile,
html:not(.portal-view--phone) .portal-chat-mobile,
html.portal-view--desktop .inq-phone-focus-bar,
html:not(.portal-view--phone) .inq-phone-focus-bar {
  display: none !important;
}
