/* Android shell target. This file is loaded only by /mobile-app. */
:root {
  --ym-mobile-navy: #071a3d;
  --ym-mobile-teal: #149ba3;
  --ym-mobile-orange: #ff6236;
  --ym-mobile-surface: #ffffff;
  --ym-mobile-soft: #f4f7fb;
  --ym-mobile-line: #d9e3ef;
  --ym-mobile-muted: #64748b;
  --ym-mobile-nav-height: 68px;
}

body.mobile-app-authenticated {
  background: var(--ym-mobile-soft);
  color: var(--ym-mobile-navy);
}

body.mobile-app-authenticated .shell {
  background: var(--ym-mobile-soft);
  grid-template-rows: auto minmax(0, 1fr);
}

body.mobile-app-authenticated .topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--ym-mobile-navy);
  color: #fff;
  box-shadow: 0 4px 18px rgba(7, 26, 61, 0.16);
}

body.mobile-app-authenticated .topbar .brand small,
body.mobile-app-authenticated .topbar .brand p {
  display: none;
}

body.mobile-app-authenticated .topbar .brand h1 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

body.mobile-app-authenticated .mobile-shell-header-button {
  display: grid;
  width: 38px;
  height: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 22px;
  font-weight: 850;
}

body.mobile-app-authenticated .mobile-shell-header-button[hidden],
body.mobile-app-authenticated .mobile-shell-header-tools[hidden] {
  display: none !important;
}

body.mobile-app-authenticated .mobile-shell-header-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

body.mobile-app-authenticated .mobile-shell-header-tools > span {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--ym-mobile-teal);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

body.mobile-app-authenticated .mobile-shell-header-tools .mobile-shell-header-button {
  width: 34px;
  font-size: 15px;
  letter-spacing: 0.08em;
}

body.mobile-app-authenticated #mobileAppWrap {
  min-height: 0;
  height: 100%;
  padding: 0 0 calc(var(--ym-mobile-nav-height) + env(safe-area-inset-bottom));
  background: var(--ym-mobile-soft);
}

body.mobile-app-authenticated .role-strip,
body.mobile-app-authenticated .quick-grid,
body.mobile-app-authenticated .module-strip,
body.mobile-app-authenticated #mobileRuntimeStatus {
  display: none !important;
}

body.mobile-app-authenticated .webview-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--ym-mobile-soft);
  box-shadow: none;
}

body.mobile-app-authenticated .webview-shell iframe {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: var(--ym-mobile-soft);
}

.mobile-primary-navigation {
  position: fixed;
  z-index: 70;
  inset: auto 0 0;
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: calc(var(--ym-mobile-nav-height) + env(safe-area-inset-bottom));
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ym-mobile-line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -10px 30px rgba(7, 26, 61, 0.1);
  backdrop-filter: blur(18px);
}

body.mobile-app-authenticated .mobile-primary-navigation {
  display: grid;
}

.mobile-primary-navigation button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 54px;
  padding: 4px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ym-mobile-muted);
  font: inherit;
}

.mobile-primary-navigation button > span {
  display: grid;
  place-items: center;
  min-width: 27px;
  height: 24px;
  color: currentColor;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.mobile-primary-navigation button > strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-primary-navigation button.active {
  background: #e9f8f8;
  color: #087f88;
}

.mobile-primary-navigation button:disabled {
  opacity: 0.35;
}

.mobile-module-sheet-backdrop {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  align-items: end;
  padding-top: max(28px, env(safe-area-inset-top));
  background: rgba(4, 13, 30, 0.62);
  backdrop-filter: blur(4px);
}

.mobile-module-sheet-backdrop[hidden] {
  display: none !important;
}

.mobile-module-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(82dvh, 760px);
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: var(--ym-mobile-surface);
  color: var(--ym-mobile-navy);
  box-shadow: 0 -18px 50px rgba(4, 13, 30, 0.25);
}

.mobile-module-sheet > header,
.mobile-module-sheet > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ym-mobile-line);
}

.mobile-module-sheet > header small {
  color: var(--ym-mobile-teal);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-module-sheet > header h2,
.mobile-module-sheet > header p {
  margin: 0;
}

.mobile-module-sheet > header h2 {
  margin-top: 2px;
  font-size: 21px;
}

.mobile-module-sheet > header p {
  margin-top: 4px;
  color: var(--ym-mobile-muted);
  font-size: 12px;
}

.mobile-module-sheet > header button,
.mobile-module-sheet > footer button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--ym-mobile-line);
  border-radius: 12px;
  background: #fff;
  color: var(--ym-mobile-navy);
  font: inherit;
  font-weight: 800;
}

.mobile-module-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 14px 16px 20px;
  overscroll-behavior: contain;
}

.mobile-module-sheet-grid > button {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  min-height: 84px;
  padding: 13px;
  border: 1px solid var(--ym-mobile-line);
  border-radius: 16px;
  background: #f8fbff;
  color: var(--ym-mobile-navy);
  text-align: left;
  font: inherit;
}

.mobile-module-sheet-grid > button.active {
  border-color: #7dd3d8;
  background: #eaf9fa;
}

.mobile-module-sheet-grid span {
  font-size: 14px;
  font-weight: 850;
}

.mobile-module-sheet-grid small {
  color: var(--ym-mobile-muted);
  font-size: 11px;
  line-height: 1.35;
}

.mobile-module-sheet > footer {
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--ym-mobile-line);
  border-bottom: 0;
  color: var(--ym-mobile-muted);
  font-size: 12px;
}

body.mobile-app-authenticated .assistant-fab {
  right: 14px;
  bottom: calc(var(--ym-mobile-nav-height) + 14px + env(safe-area-inset-bottom));
  transform: scale(0.88);
  transform-origin: right bottom;
}

body.mobile-app-authenticated:is(.mobile-costing-takeover, .mobile-quote-workspace-takeover, .mobile-quote-copilot-takeover) #mobileAppWrap {
  padding-bottom: 0;
}

body.mobile-app-authenticated:is(.mobile-costing-takeover, .mobile-quote-workspace-takeover, .mobile-quote-copilot-takeover) .mobile-primary-navigation {
  display: none !important;
}

body.mobile-keyboard-open .mobile-primary-navigation,
body.mobile-keyboard-open .assistant-fab {
  display: none !important;
}

body.mobile-keyboard-open #mobileAppWrap {
  padding-bottom: 0;
}

@media (max-width: 380px) {
  .mobile-module-sheet-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
