:root {
  view-transition-name: page;
}

@keyframes vt-fade-in {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes vt-fade-out {
  from {
    opacity: 1
  }

  to {
    opacity: 0
  }
}

::view-transition-old(page) {
  animation: vt-fade-out 320ms ease both;
}

::view-transition-new(page) {
  animation: vt-fade-in 320ms ease both;
}

html,
body {
  margin: 0;
  padding: 0;
}

:root {
  --blue-active: #165ef8;
  --blue-active-bg: #e5ecfd;

  --bg: #f5f6fb;
  --surface: #ffffff;
  --text: #131419;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 16px;
  --shadow: none;

  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
}

/* Roboto WOFF2 subsets (latin-ext + latin) with local() fallback for iOS/Safari */
/* Weight 300 */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: local("Roboto Light"), local("Roboto-Light"), local("Roboto 300"),
    url("../assets/fonts/roboto_300_latinext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: local("Roboto Light"), local("Roboto-Light"), local("Roboto 300"),
    url("../assets/fonts/roboto_300_latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Weight 400 */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Roboto"), local("Roboto Regular"), local("Roboto-Regular"),
    url("../assets/fonts/roboto_400_latinext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Roboto"), local("Roboto Regular"), local("Roboto-Regular"),
    url("../assets/fonts/roboto_400_latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Weight 500 */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local("Roboto Medium"), local("Roboto-Medium"), local("Roboto 500"),
    url("../assets/fonts/roboto_500_latinext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local("Roboto Medium"), local("Roboto-Medium"), local("Roboto 500"),
    url("../assets/fonts/roboto_500_latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Weight 700 */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("Roboto Bold"), local("Roboto-Bold"), local("Roboto 700"),
    url("../assets/fonts/roboto_700_latinext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local("Roboto Bold"), local("Roboto-Bold"), local("Roboto 700"),
    url("../assets/fonts/roboto_700_latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Weight 900 */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: local("Roboto Black"), local("Roboto-Black"), local("Roboto 900"),
    url("../assets/fonts/roboto_900_latinext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: local("Roboto Black"), local("Roboto-Black"), local("Roboto 900"),
    url("../assets/fonts/roboto_900_latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Unified family name so `font-family: "Roboto"` works on iOS */
@font-face {
  font-family: "Roboto";
  src: url("../assets/fonts/roboto_light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../assets/fonts/roboto_regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../assets/fonts/roboto_medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../assets/fonts/roboto_bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../assets/fonts/roboto_black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

html,
body {
  height: 100%;
  /* Allow native pull-to-refresh and scroll chaining */
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

/* Ensure root also prefers local Roboto on iOS */
html {
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* Images and media */
img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Core layout helpers */
.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: max(env(safe-area-inset-top), 60px) var(--space-4) calc(80px + var(--space-4) + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.page-main {
  width: 100%;
  padding-top: calc(80px + env(safe-area-inset-top));
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: var(--space-4) 0 var(--space-5);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  box-shadow: var(--shadow);
}

.card__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.card__left p {
  margin: 0;
  font-weight: 500;
}

/* Logout label (uses the active blue color in light mode) */
.logout-text {
  color: var(--blue-active);
}

/* Buttons */
.button,
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  /* comfortable tap target */
  padding: 0 var(--space-4);
  border-radius: 999px;
  background: var(--blue-active);
  color: #fff;
  font-weight: 600;
}

.button--secondary {
  background: var(--blue-active-bg);
  color: var(--blue-active);
}

/* Typography */
.page-title,
.dashboard-section-title {
  font-weight: 500;
  font-size: 1.7em;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin: var(--space-4) 0;
}

.category-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #131419;
  margin: var(--space-4) 0 var(--space-2);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

header.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6em;
  padding: 21px 16px;
  padding-top: calc(21px + constant(safe-area-inset-top));
  padding-top: calc(21px + env(safe-area-inset-top));
  background: var(--bg);
  width: 100%;
  left: 0;
  right: 0;
  position: fixed;
  top: 0;
  z-index: 9999;
  min-height: calc(60px + constant(safe-area-inset-top));
  min-height: calc(60px + env(safe-area-inset-top));
  box-sizing: border-box;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  contain: layout paint;
  box-shadow: none !important;
  border-bottom: none !important;
}

@media (prefers-color-scheme: dark) {
  header.app-header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  }
}

/* Globalny selektor dla .app-header (inline styles w HTML) */
.app-header {
  box-shadow: none !important;
  border: none !important;
  border-bottom: none !important;
}

html[data-theme="light"] .app-header,
html:not([data-theme]) .app-header {
  box-shadow: none !important;
  border: none !important;
  border-bottom: none !important;
}

@media (prefers-color-scheme: dark) {
  .app-header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  }
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.6em;
}

header .header-title {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0 5px;
  font-size: 18px;
  font-weight: 500;
  color: #131419;
  line-height: 1;
}

.header-title {
  opacity: 0;
  transition: opacity 0.1s ease-in-out;
}

.header-title.fade-in {
  opacity: 1;
}

/* Bottom navigation bar */
.bottom-nav {
  width: 100%;
  height: calc(80px + env(safe-area-inset-bottom));
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
  position: fixed;
  bottom: 0;
  left: 0;
  background-color: var(--bg);
  z-index: 99;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav__tab {
  width: 25%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 20px;
  text-align: center;
  position: relative;
  color: #52575f;
}

.bottom-nav__tab img {
  height: 24px;
  margin: 0 auto 9px;
  display: block;
}

.bottom-nav__tab--active::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 63px;
  height: 32px;
  background-color: var(--blue-active-bg);
  border-radius: 16px;
  z-index: 0;
}

.bottom-nav__tab--active img {
  position: relative;
  z-index: 1;
}

.bottom-nav__tab span {
  font-size: 0.7em;
  /* legacy size */
  font-weight: 500;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  line-height: 1;
  display: block;
}

.bottom-nav__active-text {
  color: var(--blue-active);
}

.font-numeric {
  font-family: "Roboto Numbers", "Roboto", system-ui, -apple-system, "Segoe UI",
    Arial, sans-serif;
  font-weight: 500;
}

.wyborobecny {
  width: 64px;
  height: 40px;
  padding: 2px 2px 2px 2px;
  border-radius: 40px;
  box-sizing: border-box;
}

.wybor {
  position: relative;
  width: 64px;
  height: 40px;
  padding: 2px 2px 2px 2px;
  border-radius: 40px;
  box-sizing: border-box;
}

.witam p {
  padding: 0px 4px 0px 0px;
  font-weight: 500;
  color: #01498b;
  text-align: center;
  font-size: 12px;
}

.house {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 2px 2px 2px 2px;
  box-sizing: border-box;
  margin: 0 auto;
}

#dok1 {
  position: relative;
  left: 8px;
  top: 12px;
  width: 8px;
  height: 8px;
}

#dok2 {
  position: relative;
  width: 24px;
  height: 24px;
}

#dok3 {
  position: relative;
  left: 6px;
  bottom: 11px;
  width: 12px;
  height: 8px;
}

#dok {
  position: relative;
  width: 24px;
  height: 24px;
  bottom: 7px;
  left: 18px;
}

.witam {
  width: 72px;
  height: 63px;
  padding: 2px 2px 2px 2px;
  box-sizing: border-box;
}

.folder {
  position: relative;
  width: 28px;
  height: 23px;
  padding: 2px 2px 2px 2px;
  box-sizing: border-box;
  margin: 0 auto;
}

#kod {
  position: relative;
  left: 17px;
  width: 24px;
  height: 24px;
}

#kod img {
  position: absolute;
}

#kod2 {
  left: 17px;
}

#kod3 {
  top: 16px;
  left: 17px;
}

#kod4 {
  top: 16px;
}

#kod5 {
  top: 8px;
  left: 7px;
}

#kod6 {
  top: 6px;
  left: 12px;
}

#kod7 {
  top: 8px;
  left: 17px;
}

#more {
  position: relative;
  width: 23px;
  height: 23px;
  margin: 0 auto;
}

#more img {
  position: absolute;
}

#more2 {
  top: 10px;
  left: 10px;
}

#more3 {
  top: 10px;
  left: 6px;
}

#more4 {
  top: 10px;
  left: 14px;
}

/* === ios-pwa-shell: iOS Safari + Home Screen fullscreen Web App === */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --app-height: 100dvh;
  --vv-offset-top: 0px;
  --vv-offset-left: 0px;
  /* content row heights (safe-area is ADDED, not double-counted) */
  --header-bar: 56px;
  --header-h: calc(var(--header-bar) + var(--sat));
  --nav-bar: 56px;
  --nav-h: calc(var(--nav-bar) + var(--sab));
  --page-pad-x: 16px;
}

html {
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: -webkit-fill-available;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  min-height: var(--app-height, 100dvh);
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  position: relative;
  box-sizing: border-box;
  /* stop iOS text size inflation */
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Fixed top bar — height includes notch; content sits below sat */
header.app-header,
.app-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: var(--header-h) !important;
  min-height: var(--header-h) !important;
  max-height: var(--header-h) !important;
  padding-top: var(--sat) !important;
  padding-left: max(var(--page-pad-x), var(--sal)) !important;
  padding-right: max(var(--page-pad-x), var(--sar)) !important;
  padding-bottom: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  z-index: 10050 !important;
  transform: none !important;
  -webkit-transform: none !important;
  will-change: auto !important;
  /* fill status bar area in standalone translucent mode */
  background-clip: border-box;
}

/* Fixed bottom tab bar — height includes home indicator */
.bottom-nav {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: var(--nav-h) !important;
  min-height: var(--nav-h) !important;
  max-height: var(--nav-h) !important;
  padding-top: 0 !important;
  padding-bottom: var(--sab) !important;
  padding-left: var(--sal) !important;
  padding-right: var(--sar) !important;
  box-sizing: border-box !important;
  z-index: 10050 !important;
  transform: none !important;
  -webkit-transform: none !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: space-around !important;
}

.bottom-nav__tab {
  flex: 1 1 0;
  height: 100%;
  max-height: var(--nav-bar);
  padding-top: 8px !important;
  padding-bottom: 4px !important;
  justify-content: flex-start !important;
  box-sizing: border-box !important;
}

.bottom-nav__tab--active::before {
  top: 6px !important;
}

/* Main scroll content — never under header/nav */
body.dashboard-page,
.dashboard-page {
  padding-top: var(--header-h) !important;
  padding-bottom: var(--nav-h) !important;
  min-height: var(--app-height, 100dvh);
  max-width: 100%;
  overflow-x: hidden;
}

.page-container {
  min-height: auto !important;
  width: 100%;
  max-width: 100%;
  padding-left: max(var(--page-pad-x), var(--sal)) !important;
  padding-right: max(var(--page-pad-x), var(--sar)) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* pages that put content in .page-main (services, more) */
.page-main {
  width: 100%;
  max-width: 100%;
  padding-top: var(--header-h) !important;
  padding-bottom: calc(var(--nav-h) + 12px) !important;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* pages with page-container but no page-main (qr) still need offsets — see qr.css */

/* Floating CTAs */
.floating-add-doc-btn,
.floating-action-btn {
  bottom: calc(var(--nav-h) + 12px) !important;
  right: max(16px, var(--sar)) !important;
  left: auto !important;
  max-width: calc(100% - 32px - var(--sal) - var(--sar));
  z-index: 10040 !important;
}

/* Full-screen overlays (camera, service panel, help) */
.camera-section,
.svc-panel,
.qr-enter-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: var(--app-height, 100dvh) !important;
  max-height: var(--app-height, 100dvh) !important;
  z-index: 12000 !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}

.camera-section .app-header,
.camera-section header.app-header,
.camera-section .dowod-header {
  z-index: 12010 !important;
  height: var(--header-h) !important;
  min-height: var(--header-h) !important;
  padding-top: var(--sat) !important;
}

.camera-overlay-content,
.qr-overlay-content {
  padding-top: calc(var(--header-h) + 8px) !important;
  padding-left: max(16px, var(--sal)) !important;
  padding-right: max(16px, var(--sar)) !important;
  padding-bottom: calc(16px + var(--sab)) !important;
  box-sizing: border-box;
  max-width: 100%;
}

/* Service detail panel */
.svc-panel {
  overflow: hidden !important;
}
.svc-panel__chrome {
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 100%;
}
.svc-panel__header {
  flex: 0 0 auto;
  min-height: var(--header-h) !important;
  height: var(--header-h) !important;
  padding-top: var(--sat) !important;
  padding-left: max(10px, var(--sal)) !important;
  padding-right: max(10px, var(--sar)) !important;
  box-sizing: border-box !important;
}
.svc-panel__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.svc-panel__body {
  padding-left: max(16px, var(--sal)) !important;
  padding-right: max(16px, var(--sar)) !important;
  padding-bottom: calc(20px + var(--sab)) !important;
  max-height: none !important;
}
.svc-panel__dock {
  flex: 0 0 auto;
  padding-left: max(16px, var(--sal)) !important;
  padding-right: max(16px, var(--sar)) !important;
  padding-bottom: calc(10px + var(--sab)) !important;
}
.svc-toast {
  bottom: calc(var(--nav-h) + 16px) !important;
  left: 50% !important;
  max-width: min(420px, calc(100% - 32px)) !important;
  z-index: 13000 !important;
}

/* Document detail pages (no bottom nav) */
body:not(:has(.bottom-nav)) .page-main,
body.no-bottom-nav {
  padding-bottom: calc(16px + var(--sab)) !important;
}

/* Dowod-family main content under fixed header */
.dowod-header ~ main,
body > main {
  /* fallback; pages set their own */
}

/* Standalone home-screen polish */
@media all and (display-mode: standalone) {
  html,
  body {
    overscroll-behavior: none;
    background-color: var(--bg, #f5f6fb);
  }
  /* status bar blends with header bg */
  header.app-header,
  .app-header {
    /* already padded by --sat */
  }
}

html.ios-standalone,
html.ios-standalone body {
  overscroll-behavior: none;
  /* prevent pull-to-refresh shift of fixed bars */
  overflow-x: hidden;
}

html.ios-device body {
  /* iOS momentum */
  -webkit-overflow-scrolling: touch;
}

/* Prefer fill-available on old iOS when dvh flaky */
@supports (-webkit-touch-callout: none) {
  body {
    min-height: -webkit-fill-available;
  }
  .camera-section,
  .svc-panel {
    min-height: -webkit-fill-available;
  }
}

/* Kill legacy fixed chrome sizes that cause overlap */
.bottom-nav[style],
header.app-header[style] {
  /* inline styles still lose to !important rules above */
}

/* === global-header-crest: red Polish eagle mark everywhere === */
#inicjaly1,
.header-crest,
.svc-panel__crest {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc173e;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

#inicjaly1 img,
.header-crest img,
.header-crest__img,
.svc-panel__crest img {
  width: 32px !important;
  height: 32px !important;
  display: block !important;
  object-fit: cover;
  filter: none !important;
  opacity: 1 !important;
  -webkit-filter: none !important;
}

[data-theme="dark"] #inicjaly1,
[data-theme="dark"] .header-crest,
[data-theme="dark"] .svc-panel__crest {
  background: #dc173e !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] #inicjaly1 img,
[data-theme="dark"] .header-crest img,
[data-theme="dark"] .header-crest__img,
[data-theme="dark"] .svc-panel__crest img {
  filter: none !important;
  opacity: 1 !important;
}

/* Consistent card denseness across tabs */
.page-title {
  font-size: 1.65rem;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text, #131419);
}


/* nuclear-global-crest */
#inicjaly1,
.header-crest {
  width: 32px !important;
  height: 32px !important;
  flex: 0 0 32px !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  background: #dc173e !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#inicjaly1 img,
.header-crest img,
.header-crest__img {
  width: 32px !important;
  height: 32px !important;
  filter: none !important;
  opacity: 1 !important;
  object-fit: cover !important;
}

/* === fixed-app-shell: stationary top/bottom chrome, scrollable center === */
html:has(body.fixed-app-shell) {
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body.fixed-app-shell {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: var(--app-height, 100dvh) !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  -webkit-overflow-scrolling: auto !important;
}

body.fixed-app-shell.dashboard-page > #wybor-p,
body.fixed-app-shell > .page-container,
body.fixed-app-shell > .page-main {
  position: fixed !important;
  top: var(--header-h) !important;
  right: 0 !important;
  bottom: var(--nav-h) !important;
  left: 0 !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none;
}

body.fixed-app-shell.dashboard-page > #wybor-p::-webkit-scrollbar,
body.fixed-app-shell > .page-container::-webkit-scrollbar,
body.fixed-app-shell > .page-main::-webkit-scrollbar {
  display: none;
}

body.fixed-app-shell.dashboard-page > #wybor-p {
  margin: 0 !important;
  padding-top: 35px !important;
  padding-bottom: 16px !important;
  justify-content: flex-start !important;
}

body.fixed-app-shell > .page-container {
  padding-top: 0 !important;
  padding-bottom: 12px !important;
}

body.fixed-app-shell > .page-container > .page-main,
body.fixed-app-shell > .page-main {
  padding-top: 0 !important;
  padding-bottom: 12px !important;
}

/* Services uses an inner page-main: it owns the vertical scroll. */
body.fixed-app-shell > .page-container:has(> .page-main) {
  overflow-y: hidden !important;
}

body.fixed-app-shell > .page-container > .page-main {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none;
}

body.fixed-app-shell > .page-container > .page-main::-webkit-scrollbar {
  display: none;
}
