/* WebView — mobile-first, touch-friendly */
@font-face {
  font-family: 'Montserrat-SemiBold';
  src: url('fonts/Montserrat-SemiBold.eot');
  src: url('fonts/Montserrat-SemiBold.eot?#iefix') format('embedded-opentype'),
       url('fonts/Montserrat-SemiBold.woff2') format('woff2'),
       url('fonts/Montserrat-SemiBold.woff') format('woff'),
       url('fonts/Montserrat-SemiBold.ttf')  format('truetype'),
       url('fonts/Montserrat-SemiBold.svg#Montserrat SemiBold') format('svg');
}
@font-face {
  font-family: 'Montserrat-Medium';
  src: url('fonts/Montserrat-Medium.eot');
  src: url('fonts/Montserrat-Medium.eot?#iefix') format('embedded-opentype'),
       url('fonts/Montserrat-Medium.woff2') format('woff2'),
       url('fonts/Montserrat-Medium.woff') format('woff'),
       url('fonts/Montserrat-Medium.ttf')  format('truetype'),
       url('fonts/Montserrat-Medium.svg#Montserrat Medium') format('svg');
}

:root {
  --color-bg: #f1f5f9;
  --color-surface: #ffffff;
  --color-text: background: rgba(0, 20, 80, 1);
  --color-text-muted: rgba(0, 20, 80, 0.6);
  --color-border: rgba(217, 223, 227, 1);
  --color-primary: rgba(0, 237, 165, 1);
  --color-primary-hover: #4f46e5;
  --color-primary-end: #7c3aed;
  --gradient-primary: rgba(0, 237, 165, 1);
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-success: #6366f1;
  --min-touch: 44px;
  /* --radius: 15px; */
  --radius: 0;
  --radius-lg: 16px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --header-h: 56px;
  --bottom-nav-h: 64px;
  --montserrat-medium: 'Montserrat-Medium', "Helvetica Neue", Arial, sans-serif;
  --montserrat-semibold: 'Montserrat-SemiBold', "Helvetica Neue", Arial, sans-serif;
  --color-label: #001450;
  --color-menu-item: #001350;
  --color-disabled: rgba(233, 233, 233, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  font-family: var(--montserrat-medium);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  /* background: var(--color-bg); */
  min-height: 100vh;
  min-height: 100dvh;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Session landing (/webview/i?sessionId=&flowType=): full-viewport loader only, no chrome */
body.webview-session-landing .side-menu-overlay,
body.webview-session-landing .side-menu {
  display: none !important;
}

#app.app--session-landing .app-header {
  display: none !important;
}

#app.app--session-landing .main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
  min-height: calc(100dvh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bank-account-pick {
  text-align: left;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.bank-account-pick--selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.bank-account-pick-name {
  font-weight: 600;
}

.bank-account-pick-num {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--header-h);
  padding: 0 12px;
  background: rgb(241 245 248);
  border-bottom: 1px solid var(--color-border);
}

/* Home: dark gradient header with logo */
#app[data-route="providers"] .app-header {
  /* background: linear-gradient(160deg, #1e3a5f 0%, #312e81 50%, #4c1d95 100%); */
  /* background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 15v30L30 60 0 45V15z' fill='none' stroke='rgba(255,255,255,0.06)' stroke-width='0.5'/%3E%3C/svg%3E"), linear-gradient(160deg, #1e3a5f 0%, #312e81 50%, #4c1d95 100%); */
  border-bottom: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.app-header-home {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#app[data-route="providers"] .app-header-home {
  display: flex;
}

#app[data-route="providers"] .app-header .back-btn,
#app[data-route="providers"] .app-header .app-title {
  display: none !important;
}

.header-logo {
  width: 40px;
  height: 40px;
}

.header-logo svg,
.header-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}

#app[data-route="providers"] .header-logo text {
  fill: #fff;
}

#app[data-route="providers"] .header-logo path {
  stroke: rgba(255,255,255,0.5);
}

/* Search and close icons: light on dark header so they show on iPhone */
#app[data-route="providers"] .app-header-slot .search-bar-icon,
#app[data-route="providers"] .app-header-slot .search-close-btn {
  color: rgba(255,255,255,0.95);
}
#app[data-route="providers"] .app-header-slot .search-close-btn:hover,
#app[data-route="providers"] .app-header-slot .search-close-btn:focus-visible {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

.header-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.back-btn {
  position: absolute;
  left: 12px;
  width: var(--min-touch);
  height: var(--min-touch);
  min-width: var(--min-touch);
  min-height: var(--min-touch);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #000;
  border-radius: var(--radius);
}

.back-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.back-btn-chevron {
  display: block;
  flex-shrink: 0;
}

.back-btn:hover,
.back-btn:focus-visible {
  background: var(--color-bg);
}

.back-btn[hidden] {
  display: none !important;
}

.app-header-actions {
  position: absolute;
  right: 12px;
  top: 0;
  display: flex;
  align-items: center;
  height: var(--header-h);
  z-index: 2;
}

/* Subcategories: header link to Payment history (hidden on other routes via #app[data-route]) */
.app-header-history {
  display: none;
  width: var(--min-touch);
  height: var(--min-touch);
  min-width: var(--min-touch);
  min-height: var(--min-touch);
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: #000;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-header-history-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.app-header-history svg {
  display: block;
  flex-shrink: 0;
}

#app[data-route="subcategories"] .app-header-history {
  display: flex;
}

.app-header-history:hover,
.app-header-history:focus-visible {
  background: var(--color-bg);
}

.app-header-theme {
  display: none;
  width: var(--min-touch);
  height: var(--min-touch);
  min-width: var(--min-touch);
  min-height: var(--min-touch);
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app-header-theme:not([hidden]) {
  display: flex;
}

.app-header-theme[hidden] {
  display: none !important;
}

.app-header-theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.app-header-theme-icon svg {
  display: block;
  flex-shrink: 0;
}

.app-header-theme-icon--sun {
  display: none;
}

html[data-theme="dark"] .app-header-theme-icon--moon {
  display: none;
}

html[data-theme="dark"] .app-header-theme-icon--sun {
  display: flex;
}

.app-header-theme:hover,
.app-header-theme:focus-visible {
  background: var(--color-bg);
}

#app.app--session-landing .app-header-theme {
  display: none !important;
}

.back-btn[data-back-state="loading"],
.back-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.back-btn[data-back-state="loading"]:hover,
.back-btn[data-back-state="loading"]:focus-visible,
.back-btn:disabled:hover,
.back-btn:disabled:focus-visible {
  background: none;
}

.app-title {
  font-size: 1rem;
  font-weight: 600;
  max-width: calc(100% - 148px);
}

/* Main content */
.main {
  flex: 1;
  overflow: auto;
  padding: 16px 0;
  padding-bottom: calc(16px + var(--bottom-nav-h));
  -webkit-overflow-scrolling: touch;
  background-color: rgb(241 245 248)
}

.main.main--providers {
  padding-top: 0;
}

#content {
  min-height: 200px;
}

/* Search bar */
.search-bar-wrap {
  position: fixed;
  top: 56px;
  left: 20px;
  right: 20px;
  z-index: 10;
  width: calc(100% - 40px);
  margin: auto;
  background: rgb(241 245 248);
  padding: 10px 0 4px 0;
}
.search-bar-wrap .search-bar {width: 100%;}

[data-route="providers"] .search-bar-wrap {top: 0; padding: 20px 0}

.search-bar-row {
  position: relative;
}

.search-bar-row .search-bar {
  margin-bottom: 8px;
}

.search-close-btn {
  display: none;
  width: 36px;
  height: 36px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 3;
  -webkit-appearance: none;
  appearance: none;
}

.search-bar-row .search-close-btn {
  position: absolute;
  left: 20px;
  top: 31px;
  transform: translateY(calc(-50% - 5px));
}

.search-close-btn:hover,
.search-close-btn:focus-visible {
  color: var(--color-text);
}

.search-close-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.show-search-view .search-close-btn {
  display: none!important;
  display: flex;
  display: -webkit-flex;
}

/* When search view is open, hide blocks above the card grid so taps land on cards not on quick actions */
.show-search-view .total-pending-block,
.show-search-view .quick-actions {
  display: none;
}

.show-search-view .search-bar-input {
  /* padding: 15px 12px 15px 40px; */
  position: relative;
  z-index: 1;
}

/* #app[data-route="providers"] .show-search-view .search-bar-input {
  padding: 15px 12px 15px 70px;
} */

.search-bar {
  position: relative;
  width: calc(100% - 40px);
  margin: 0 auto 16px auto;
}

.search-bar--solo { display: none; }

.search-bar-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  pointer-events: none;
  z-index: 2;
}

.search-bar-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.search-bar-input {
  display: block;
  width: 100%;
  min-height: var(--min-touch);
  padding: 12px 12px 12px 40px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 30px;
  /* border-radius: var(--radius-lg); */
  /* box-shadow: var(--shadow); */
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s ease-in-out;
}

.search-bar-input::placeholder {
  color: #BDBDBD;
  font-family: var(--montserrat-medium);
  font-size: 14px;
}

.search-bar-input:hover {
  border-color: var(--color-primary);
}

.search-bar-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.search-hidden {
  display: none !important;
}

[data-route="providers"] .app-header {display: none;}

#app.theme-toggle-on[data-route="providers"] .app-header {
  display: flex;
  min-height: 0;
  height: 0;
  overflow: visible;
  padding: 0;
  background: transparent;
  border: none;
  pointer-events: none;
}

#app.theme-toggle-on[data-route="providers"] .app-header-home {
  display: none !important;
}

#app.theme-toggle-on[data-route="providers"] .app-header-actions {
  pointer-events: auto;
  z-index: 20;
  top: calc(12px + env(safe-area-inset-top, 0px));
}

.payment-history-bar {
  position: relative;
  /* width: calc(100% - 40px); */
  margin: 0 auto 20px auto;
}

.payment-history-bar-link {
  position: relative;
  display: block;
  min-height: var(--min-touch);
  padding: 20px 12px 20px 40px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 400;
  color: var(--color-text);
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative; border-radius: 20px; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(92.4deg, #00EDA5 4.34%, #0091FF 94.38%) border-box; border: 1px solid transparent; box-shadow: 0px 0px 6px 0px #00000005, -1px 1px 14px 2px #54A78214;
}

.payment-history-bar-link .search-bar-icon {
  pointer-events: none;
  background: #DCFCED;
  padding: 6px;
  border-radius: 20px;
  height: 32px;
  width: 32px;
  left: 20px;
  right: auto
}

.payment-history-bar-label {
  display: block;
  line-height: 1.3;
  font-family: var(--montserrat-semibold);
  font-weight: 600;
  color: var(--color-label);
  font-size: 13px;
  margin: 0 0 0 25px
}

.payment-history-bar-link:hover {
  border-color: var(--color-primary);
}

.payment-history-bar-link:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.payment-history-bar-link:focus:not(:focus-visible) {
  box-shadow: none;
}

.payment-history-bar-link:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

/* Provider types slider (homepage and search) */
.provider-types-slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 20px 12px 7px;
  margin: 30px 0 0 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: fixed;
  top: 125px;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgb(241 245 248);
}
.provider-types-slider:not(:has(.provider-type-chip:nth-child(2))) {
  display: none;
}
.provider-types-slider::-webkit-scrollbar {
  display: none;
}
.provider-type-chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: 2px solid transparent;
  /* border-radius: var(--radius); */
  border-radius: 20px;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.provider-type-chip:hover {
  color: var(--color-text);
  border-color: var(--color-primary);
}
.provider-type-chip--active {
  color: var(--color-menu-item);
  position: relative; border-radius: 20px; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(92.4deg, #00EDA5 4.34%, #0091FF 94.38%) border-box; border: 1px solid transparent; box-shadow: 0px 0px 6px 0px #00000005, -1px 1px 14px 2px #54A78214;
}
.provider-type-chip--active:hover {
  color: var(--color-menu-item);
  position: relative; border-radius: 20px; background: linear-gradient(#fff, #fff) padding-box, linear-gradient(92.4deg, #00EDA5 4.34%, #0091FF 94.38%) border-box; border: 1px solid transparent; box-shadow: 0px 0px 6px 0px #00000005, -1px 1px 14px 2px #54A78214;
}

/* Subcategories: drop scrollport padding so content cannot show in the gap above the sticky tabs. */
#app[data-route="subcategories"] .main {
  padding-top: 0;
}

#app[data-route="subcategories"] .subcategories-inline {
  padding-top: 16px;
}

/* Subcategories inline products: sticky tab bar (not fixed like homepage; no search bar above) */
#app[data-route="subcategories"] .subcategories-inline .subcategories-tabs.provider-types-slider {
  position: sticky;
  top: 0;
  z-index: 8;
  left: auto;
  right: auto;
  margin: 0 0 12px 0;
  padding: 12px 12px 10px;
  background: rgb(241 245 248);
}

/* Searchable subcategory picker (ESIM Country, and any later DROPDOWN_PICKERS entry). */
#app[data-route="subcategories"] .subcategories-inline .subcategory-picker {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: 0 0 12px 0;
  padding: 12px 20px 10px;
  background: rgb(241 245 248);
}

.subcategory-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: var(--min-touch);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: left;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 15px;
  box-shadow: 0px 0px 6px 0px #00000005, -1px 1px 14px 2px #54A78214;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.subcategory-picker-trigger:hover,
.subcategory-picker-trigger:focus-visible {
  color: var(--color-menu-item);
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(92.4deg, #00EDA5 4.34%, #0091FF 94.38%) border-box;
  border: 1px solid transparent;
}

.subcategory-picker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subcategory-picker-chevron {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  transition: transform 0.15s;
}

.subcategory-picker-chevron svg {
  display: block;
  width: 20px;
  height: 20px;
}

.subcategory-picker-trigger[aria-expanded="true"] .subcategory-picker-chevron {
  transform: rotate(180deg);
}

.subcategory-picker-panel {
  position: absolute;
  left: 20px;
  right: 20px;
  z-index: 9;
  margin-top: 8px;
  padding: 10px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0px 0px 6px 0px #00000005, -1px 1px 14px 2px #54A78214;
}

.subcategory-picker-panel[hidden] {
  display: none;
}

.subcategory-picker-panel .search-bar {
  width: 100%;
  margin: 0 0 8px 0;
}

.subcategory-picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 50vh;
  overflow: auto;
}

.subcategory-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.subcategory-picker-option[hidden] {
  display: none;
}

.subcategory-picker-option--selected {
  color: var(--color-menu-item);
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(92.4deg, #00EDA5 4.34%, #0091FF 94.38%) border-box;
  border: 1px solid transparent;
  box-shadow: 0px 0px 6px 0px #00000005, -1px 1px 14px 2px #54A78214;
}

.subcategory-picker-option--key {
  outline: 2px solid rgba(0, 145, 255, 0.35);
  outline-offset: -2px;
}

.subcategory-picker-thumb {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.subcategory-picker-option-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subcategory-picker-empty {
  margin: 4px 4px 2px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.subcategory-picker-empty[hidden] {
  display: none;
}

/* Total Pending Bills (home) */
.total-pending-block {
  display: none;
  margin-bottom: 16px;
}

.total-pending-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 4px 0;
}

.total-pending-amount {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

/* Quick actions (home) */
.quick-actions {
  display: none; /* hidden for now */
  flex-direction: row;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 88px;
  padding: 16px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.quick-action-btn:hover,
.quick-action-btn:focus-visible {
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}

.quick-action-icon {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.quick-action-icon svg {
  width: 100%;
  height: 100%;
}

.quick-action-label {
  font-size: 0.8125rem;
  font-weight: 500;
}

.quick-actions-dots {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.quick-actions-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background 0.2s;
}

.quick-actions-dot--active {
  background: var(--color-primary);
}

/* Providers scroll inside .main. The banner, search, and chips stick together as one stack. */
#app[data-route="providers"] {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

#app[data-route="providers"] .main {
  min-height: 0;
}

#app[data-route="providers"] .home-chrome {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  background: var(--main-bg-color, rgb(241 245 248));
}

#app[data-route="providers"] .home-chrome .home-ads,
#app[data-route="providers"] .home-chrome .search-bar-wrap,
#app[data-route="providers"] .home-chrome .provider-types-slider {
  position: relative;
  top: auto;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  transform: none;
  height: auto;
}

#app[data-route="providers"] .home-chrome .home-ads {
  margin-bottom: 8px;
  padding: 0 16px;
  scroll-padding-inline: 16px;
  background: var(--main-bg-color, rgb(241 245 248));
}

#app[data-route="providers"] .home-chrome .search-bar-wrap {
  padding: 12px 20px 0;
}

#app[data-route="providers"] .home-chrome .provider-types-slider {
  padding: 12px 20px 8px;
}

@media (max-width: 767px) {
  #app[data-route="providers"] .home-chrome .home-ads {
    margin-bottom: 2px;
  }

  #app[data-route="providers"] .home-chrome .provider-types-slider {
    padding-top: 8px;
  }
}

/* Home promo banners */
.home-ads {
  position: relative;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 30px 0 0;
}

#app.display-ads {
  --home-ads-h: 140px;
}

#app.display-ads[data-route="providers"] .home-ad {
  flex: 0 0 100%;
  height: var(--home-ads-h);
  scroll-snap-align: start;
}

#app.display-ads[data-route="providers"] #content.show-search-view .home-ads {
  display: none;
}

.home-ads[hidden] {
  display: none;
}

.home-ads::-webkit-scrollbar {
  display: none;
}

.home-ad {
  flex: 0 0 80%;
  height: 160px;
  scroll-snap-align: center;
  border-radius: 16px;
  overflow: hidden;
}

.home-ad-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
}

.home-ad--loaded .home-ad-img {
  opacity: 1;
}

@media (min-width: 768px) {
  .home-ad {
    flex: 0 0 480px;
    max-width: 480px;
  }

  #app.display-ads[data-route="providers"] .home-ad {
    flex: 0 0 480px;
    max-width: 480px;
  }
}

/* Cards grid (providers, categories, subcategories, products) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0;
  align-items: flex-start;
}

@media (min-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
}

/* Inside pages: categories, subcategories, products -> one card per row */
#app[data-route="categories"] #content .card-grid,
#app[data-route="subcategories"] #content .card-grid,
#app[data-route="products"] #content .card-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

#app[data-route="categories"] #content .card-grid .card,
#app[data-route="subcategories"] #content .card-grid .card,
#app[data-route="products"] #content .card-grid .card {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
  justify-content: flex-start;
  width: calc(100% - 40px);
  box-sizing: border-box;
  text-align: left;
  background: white;
  border-radius: 15px;
  margin: auto
}

#app[data-route="categories"] #content .card-grid .card .card-thumb,
#app[data-route="subcategories"] #content .card-grid .card .card-thumb,
#app[data-route="products"] #content .card-grid .card .card-thumb {
  margin: 0;
  grid-column: 1;
}

#app[data-route="categories"] #content .card-grid .card .card-title,
#app[data-route="subcategories"] #content .card-grid .card .card-title,
#app[data-route="products"] #content .card-grid .card .card-title {
  grid-column: 2;
}

#app[data-route="categories"] #content .card-grid .card .card-meta,
#app[data-route="subcategories"] #content .card-grid .card .card-meta,
#app[data-route="products"] #content .card-grid .card .card-meta,
#app[data-route="categories"] #content .card-grid .card .card-price,
#app[data-route="subcategories"] #content .card-grid .card .card-price,
#app[data-route="products"] #content .card-grid .card .card-price {
  grid-column: 2;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--min-touch);
  padding: 16px;
  /* border-left: 1px solid var(--color-border); */
  /* border-radius: var(--radius); */
  /* box-shadow: var(--shadow); */
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:active,
.card:hover,
.card:focus-visible {
  /* border-color: var(--color-primary); */
  /* box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2); */
}

.card-thumb {
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
  border-radius: 50%;
  object-fit: cover;
  /* background: var(--color-bg); */
  border: 2px solid #F4F4F4;
  box-sizing: content-box;
}

.card-title {
  font-size: 0.7rem;
  font-weight: normal;
  /* margin-bottom: 4px; */
  color: #02164D;
}

.card-meta {
  font-size: 0.6rem;
  color: var(--color-text-muted);
}

.card-price {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* Provider sections (homepage) — scroll-margin so scrollIntoView clears fixed search + slider */
.provider-section {
  scroll-margin-top: 220px;
  background: white;
  margin: 30px;
  border-radius: 20px;
}

.provider-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #02164D;
  margin-bottom: 0;
  padding-bottom: 4px;
  padding: 15px 15px 0 15px
}

.provider-section-view-all {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--color-primary);
  text-decoration: none;
}

.provider-section-view-all:hover,
.provider-section-view-all:focus-visible {
  text-decoration: underline;
}

.provider-section-error {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
  padding: 8px 0;
}

.provider-section-categories {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.provider-section-categories::-webkit-scrollbar {
  display: none;
}

.provider-section-categories .card-grid {
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 100px;
  gap: 0;
  width: max-content;
}

.providers-search-view .card-grid {
  grid-template-columns: none;
  grid-auto-columns: 100px;
}

.provider-section-categories .card,
.providers-search-view .card {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

/* Two-screen providers: homepage (default) vs search view (subcategories as cards) */
.providers-search-view {
  display: none;
}

.show-search-view .providers-homepage {
  display: none;
}

.show-search-view .providers-search-view {
  display: block;
}

@media (min-width: 480px) {
  .provider-section-categories .card-grid {
    gap: 16px;
  }
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  gap: 12px;
  color: var(--color-text-muted);
  animation: loadingFadeIn 0.25s ease-out;
}

#main:has(> #content > .loading:not(.card-grid)) {
  display: flex;
  flex-direction: column;
}

#main:has(> #content > .loading:not(.card-grid)) > #content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

#content > .loading:not(.card-grid) {
  width: 100%;
  flex: 1;
}

@keyframes loadingFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1.2s ease-in-out infinite;
}

.loading-lottie {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.loading-lottie svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--color-border) 25%, var(--color-bg) 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

.skeleton-card {
  height: 120px;
}

.provider-section-categories .skeleton-card {
  height: 10px;
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error */
.error-banner {
  padding: 12px 16px;
  background: var(--color-error-bg);
  border: 1px solid var(--color-error);
  color: var(--color-error);
  width: calc(100% - 40px);
  margin: 10px auto;
  border-radius: 16px;
}

.error-banner p {
  font-size: 13px;
  padding: 2px
}

.error-banner button {
  min-height: var(--min-touch);
  padding: 0 16px;
  background: var(--color-error);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  margin: 10px 0 0 0;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
}

.empty-state-image {
  width: 120px;
  max-width: 55%;
  height: auto;
  margin-bottom: 16px;
  display: block;
  flex-shrink: 0;
}

.empty-state-title {
  font-family: var(--montserrat-semibold);
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: rgba(2, 22, 77, 1);
}

.empty-state p {
  font-size: 16px;
  line-height: 22px;
  margin-top: 8px;
  color: rgba(2, 22, 77, 1)
}

/* Product detail */
.detail-section {
  background: var(--color-surface);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 1);
  /* box-shadow: var(--shadow); */
  padding: 16px;
  width: calc(100% - 40px);
  margin: auto;
}

.detail-section h2 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-text-muted);
}

.detail-product-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(0, 20, 80, 1);
  margin-bottom: 12px;
  line-height: 1.3;
}

.detail-section-figure {
  margin: 0 0 16px;
  border-radius: 12px;
  overflow: hidden;
}

.detail-section-image {
  display: block;
  max-width: 60%;
  max-height: 200px;
  margin: 10px auto;
  object-fit: contain;
  vertical-align: middle;
}

.detail-section-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.detail-section-meta .detail-row:first-child {
  /* padding-top: 0; */
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  /* border-bottom: 1px solid var(--color-border); */
  font-size: 0.9375rem;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row--block {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.detail-row--block .detail-value {
  font-weight: 400;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-label {
  color: rgba(103, 115, 148, 1);
  font-family: var(--montserrat-medium);
  font-size: 12px
}

.detail-value {
  font-weight: 500;
  color: rgba(2, 22, 77, 1);
  font-size: 12px;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--min-touch);
  padding: 0 20px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--gradient-primary);
  color: rgba(2, 22, 77, 1);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--gradient-primary);
}

.btn-primary:disabled {
  background-color: var(--color-disabled);
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

.btn-gradient {
  background: var(--gradient-primary) !important;
  border: none;
}

.btn-gradient:hover,
.btn-gradient:focus-visible {
  opacity: 0.95;
  filter: brightness(1.05);
}

.btn-secondary:disabled,
.btn-gradient:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: rgba(2, 22, 77, 1);
  border: 1.5px solid rgba(2, 22, 77, 1);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(0, 237, 165, 0.12);
}

.btn-block {
  width: calc(100% - 40px); margin: 10px auto 0 auto; display: block; text-align: center; line-height: 43px; border-radius: 52px; color: rgba(2, 22, 77, 1); font-size: 14px; text-transform: uppercase; font-family: var(--montserrat-semibold);
}

.page-actions-row {
  display: flex;
  gap: 12px;
  width: calc(100% - 40px);
  margin: 10px auto 0 auto;
}

.page-actions-row .page-actions-row-btn {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
  display: block;
  text-align: center;
  line-height: 43px;
  border-radius: 52px;
  color: rgba(2, 22, 77, 1);
  font-size: 14px;
  text-transform: uppercase;
  font-family: var(--montserrat-semibold);
}

.detail-action--recharge,
.detail-action--plans {
  background: transparent;
  border: 1px solid var(--color-primary);
}

/* Forms */
.form-group {
  margin: 20px;
}

.form-group label {
  display: block;
  font-size: 0.775rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-group input, .form-group select {
  width: 100%;
  min-height: var(--min-touch);
  padding: 0 15px;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 100px;
}

.form-group input {
  background: var(--color-surface);
}

.input-mobile-number {
  font-variant-numeric: tabular-nums;
}

.form-group select {
  padding-right: 40px;
  font-family: inherit;
  color: inherit;
  background-color: var(--color-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2212%22 height=%2212%22 viewBox=%220 0 12 12%22 fill=%22none%22 stroke=%22%23001450%22 stroke-opacity=%220.6%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 4.5 6 7.5 9 4.5%22/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
  -webkit-appearance: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.form-group .hint,
.form-group .error-msg {
  font-size: 0.8125rem;
  margin-top: 4px;
}

.form-group .error-msg {
  color: var(--color-error);
}

/* Biller card (form pages) */
.biller-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  /* box-shadow: var(--shadow); */
  margin-bottom: 20px;
  width: calc(100% - 40px);
  margin: auto;
}

.biller-card-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  /* background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%); */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}

.biller-card-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.biller-card-letter {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.biller-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}

/* Plan picker (plans recharge flow) */
.plan-picker-heading {
  margin-bottom: 8px;
}

.plan-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 20px 20px;
}

.plan-option {
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.plan-option__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.plan-option__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: var(--min-touch);
  padding: 14px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.plan-option__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.plan-option__title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-label);
}

.plan-option__price {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary);
  font-family: var(--montserrat-semibold);
}

.plan-option__indicator {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  position: relative;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.plan-option__indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease;
}

.plan-option:hover .plan-option__content,
.plan-option:focus-within .plan-option__content {
  border-color: rgba(0, 237, 165, 0.45);
}

.plan-option:has(.plan-option__input:checked) .plan-option__content {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
  background: rgba(0, 237, 165, 0.06);
}

.plan-option:has(.plan-option__input:checked) .plan-option__indicator {
  border-color: var(--color-primary);
}

.plan-option:has(.plan-option__input:checked) .plan-option__indicator::after {
  transform: translate(-50%, -50%) scale(1);
}

.plan-option:has(.plan-option__input:focus-visible) .plan-option__content {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 237, 165, 0.25);
}

/* Receipt / confirmation */
.receipt-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.receipt-card.success {
  border-color: var(--color-success);
  background: #f0fdfa;
}

.receipt-ref {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.receipt-ref strong {
  color: var(--color-text);
}

/* Payment history list / Recent Payments */
.recent-payments-top {
  width: calc(100% - 40px);
  margin: 0 auto 8px auto;
}

.recent-payments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0 0 8px 0;
}

.recent-payments-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
}

.history-date-sheet-trigger {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-primary);
  border-radius: var(--radius);
  cursor: pointer;
  background: #DCFCED;
  border-radius: 50%;
}

html[data-theme="light"] .history-date-sheet-trigger:hover,
html[data-theme="light"] .history-date-sheet-trigger:focus-visible {
  background: var(--color-bg);
  color: var(--color-text);
}

.history-date-sheet-trigger-icon {
  display: block;
  color: rgba(2, 22, 77, 1)
}

.recent-payments-date-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 350px;
  box-sizing: border-box;
  padding: 0 8px 0 16px;
  margin: 0 0 4px 0;
  background: #FFFFFF;
  border: 1px solid rgba(2, 22, 77, 1);
  border-radius: 52px;
  font-family: var(--montserrat-medium, "Helvetica Neue", Arial, sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(2, 22, 77, 1);
}

.recent-payments-date-filter-label {
  flex: 1;
  min-width: 0;
  color: #000;
  letter-spacing: 0.02em;
}

.recent-payments-date-filter-clear {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--min-touch, 44px);
  height: var(--min-touch, 44px);
  margin: -4px -6px -4px 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg, 12px);
  background: transparent;
  color: rgba(2, 22, 77, 1);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

/* History date range bottom sheet */
.history-date-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.2s;
}

.history-date-sheet.history-date-sheet--open {
  visibility: visible;
  pointer-events: auto;
}

.history-date-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.history-date-sheet--open .history-date-sheet-overlay {
  opacity: 1;
}

.history-date-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  background: var(--color-surface);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  padding-bottom: env(safe-area-inset-bottom, 0);
  overflow: visible;
}

.history-date-sheet--open .history-date-sheet-panel {
  transform: translateY(0);
}

.history-date-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.history-date-sheet-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text);
}

.history-date-sheet-close {
  width: var(--min-touch, 44px);
  height: var(--min-touch, 44px);
  min-width: var(--min-touch, 44px);
  min-height: var(--min-touch, 44px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius);
}

.history-date-sheet-close:hover,
.history-date-sheet-close:focus-visible {
  background: var(--color-bg);
  color: var(--color-text);
}

.history-date-sheet-body {
  position: relative;
  overflow: visible;
  padding: 16px;
  flex: 1;
  min-height: 0;
}

.history-date-sheet-body .date-range {
  display: none;
  margin-bottom: 0;
}

/* Inline jQuery date range picker in sheet: hide anchor field, fit calendar */
.history-date-sheet-body .date-range--picker-inline .form-group {
  position: relative;
}

.history-date-sheet-body .history-date-range-label-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.history-date-sheet-body .history-date-range-input--inline {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* History sheet: jQuery date range picker visual skin (single month, design mock) */
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin {
  --history-drp-accent: #0d6efd;
  --history-drp-range-fill: #e7f1ff;
  --history-drp-text: #0f172a;
  --history-drp-muted: #94a3b8;
  --history-drp-cell-radius: 10px;
  --history-drp-card-radius: 24px;
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 20px 18px 18px;
  border: none;
  background: var(--color-surface, #fff);
  border-radius: var(--history-drp-card-radius);
  box-shadow: var(--shadow-md, 0 4px 24px rgba(15, 23, 42, 0.1));
  font-family: var(--montserrat-medium, "Helvetica Neue", Arial, sans-serif);
  font-size: 14px;
  line-height: 1.3;
  color: var(--history-drp-text);
  -webkit-font-smoothing: antialiased;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin .month-wrapper {
  float: none;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
  box-sizing: border-box;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin .month-wrapper table {
  float: none;
  width: 100% !important;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  box-sizing: border-box;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.month2 {
  display: none;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption {
  height: auto;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption th {
  padding: 0 0 14px 0;
  vertical-align: middle;
  border: none;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption .month-name {
  text-align: left;
  text-transform: none;
  font-family: var(--montserrat-semibold, var(--montserrat-medium));
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--history-drp-text);
  line-height: 1.2;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin .month-element {
  font-weight: 700;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption > th:first-of-type,
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption > th:last-of-type {
  /* Match day column width (1/7); fixed 40px was shrinking SU/SA columns for the whole grid */
  width: 14.2857%;
  max-width: 14.2857%;
  text-align: center;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption > th.month-name {
  width: 71.4286%;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption .prev,
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption .next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--min-touch, 44px);
  height: var(--min-touch, 44px);
  max-width: 100%;
  padding: 0;
  margin: 0 auto;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--history-drp-text);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption .prev:hover,
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption .next:hover,
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption .prev:focus-visible,
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table.caption .next:focus-visible {
  background: var(--color-bg, #f1f5f9);
  color: var(--history-drp-accent);
}

/* Hide weekday names (SU–SA); plugin row stays in DOM for structure only */
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin thead tr.week-name {
  display: none;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table td {
  padding: 2px;
  vertical-align: middle;
  border: none;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day {
  box-sizing: border-box;
  min-height: 40px;
  padding: 0;
  margin: 0;
  line-height: 40px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--history-drp-muted);
  cursor: default;
  transition: background 0.12s ease, color 0.12s ease;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.first-date-selected,
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.last-date-selected {
  border-radius: var(--history-drp-cell-radius);
}

/* Adjacent month days visible (vendor hides by default) */
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.lastMonth,
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.nextMonth {
  display: block !important;
  color: var(--history-drp-muted);
  opacity: 0.85;
  font-weight: 500;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.toMonth.valid {
  color: var(--history-drp-text);
  cursor: pointer;
  font-weight: 600;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.toMonth.valid:hover {
  background: rgba(15, 23, 42, 0.06);
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.toMonth.hovering {
  background: var(--history-drp-range-fill);
  color: var(--history-drp-text);
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.checked {
  background-color: var(--history-drp-range-fill) !important;
  color: var(--history-drp-text) !important;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.first-date-selected,
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.last-date-selected {
  background-color: var(--history-drp-accent) !important;
  color: #fff !important;
  font-weight: 700;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.lastMonth.checked,
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.nextMonth.checked {
  background-color: transparent !important;
  color: var(--history-drp-muted) !important;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.real-today {
  background-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.15);
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.real-today.checked,
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.real-today.first-date-selected,
.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.real-today.last-date-selected {
  box-shadow: none;
}

.history-date-sheet-body .date-picker-wrapper.history-date-picker-skin .gap {
  display: none !important;
}

html[data-theme="dark"] .history-date-sheet-panel {
  background: var(--color-surface, #121212);
}

html[data-theme="dark"] .history-date-sheet-body .date-picker-wrapper.history-date-picker-skin {
  --history-drp-text: #fff;
  --history-drp-muted: rgba(155, 155, 155, 1);
  --history-drp-range-fill: rgba(255, 255, 255, 0.16);
  background: var(--color-surface, #121212);
  color: #fff;
}

html[data-theme="dark"] .history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.toMonth.valid {
  color: #fff;
}

html[data-theme="dark"] .history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.toMonth.valid:hover {
  background: #fff;
  color: #0f172a;
}

html[data-theme="dark"] .history-date-sheet-body .date-picker-wrapper.history-date-picker-skin table .day.real-today {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.history-date-sheet-footer {
  padding: 12px 16px 40px 16px;
  flex-shrink: 0;
  /* border-top: 1px solid var(--color-border); */
}

.card.card--loading {
  opacity: 0.65;
  pointer-events: none;
}

.transaction-list {
  list-style: none;
}

.list-card-list {
  margin-top: 16px;
}

.transaction-item {
  display: block;
  padding: 16px;
  /* background: var(--color-surface); */
  /* border: 1px solid var(--color-border); */
  /* border-radius: var(--radius); */
  text-decoration: none;
  color: inherit;
  /* transition: border-color 0.15s, box-shadow 0.15s; */
  /* box-shadow: var(--shadow); */
  width: calc(100% - 40px);
  margin: 0 auto 12px auto
}

.transaction-item:hover,
.transaction-item:focus-visible {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

/* Recent Payments card layout: icon left, body middle, amount right */
.transaction-item.list-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.list-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.transaction-item .list-card-icon {display: none;}

.list-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-card-body .product-name {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-text);
}

.list-card-body .date {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.list-card-amount {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-text);
  flex-shrink: 0;
}

.transaction-item .row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.transaction-item .product-name {
  font-weight: 500;
}

.transaction-item .date {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

/* Breadcrumb / nav */
.breadcrumb {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
}

/* Date range (history) */
.date-range {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (min-width: 480px) {
  .date-range {
    grid-template-columns: 1fr 1fr;
  }
}

.date-range .history-date-range-input.date-picker {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: auto;
  min-height: 44px;
  line-height: 1.25;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border, #e2e8f0);
  font-size: 0.9375rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--color-text, #0f172a);
  background: var(--color-surface, #fff);
}

/* Activation code display */
.activation-code {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  word-break: break-all;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
  padding: 12px;
  background: var(--color-bg);
  border-radius: var(--radius);
  margin-top: 8px;
}

.activation-code-value {
  flex: 1;
  min-width: 0;
}

.activation-code-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: -4px -4px 0 0;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #64748b);
  border-radius: var(--radius);
  cursor: pointer;
}

.activation-code-copy:hover,
.activation-code-copy:focus-visible {
  color: var(--color-text, #0f172a);
  background: var(--color-surface, #fff);
}

.activation-code-copy .icon-copy,
.activation-code-copy .icon-check {
  display: block;
}

.activation-code-copy .icon-check,
.activation-code-copy.is-copied .icon-copy {
  display: none;
}

.activation-code-copy.is-copied .icon-check {
  display: block;
}

.activation-code-copy.is-copied {
  color: var(--color-primary);
}

.qr-placeholder {
  width: 160px;
  height: 160px;
  margin: 12px auto;
  background: var(--color-bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: var(--bottom-nav-h);
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  border-radius: 50%;
  transition: color 0.2s;
}

a.bottom-nav-item:hover,
a.bottom-nav-item:focus-visible {
  color: rgba(255,255,255,0.9);
}

.bottom-nav-icon {
  width: 24px;
  height: 24px;
}

.bottom-nav-item--placeholder {
  pointer-events: none;
}

.bottom-nav-item--menu-trigger {
  pointer-events: auto;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
}

.bottom-nav-item--menu-trigger:hover,
.bottom-nav-item--menu-trigger:focus-visible {
  color: rgba(255,255,255,0.9);
}

/* Side menu overlay and panel */
.side-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 25;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.side-menu-overlay.side-menu--open {
  visibility: visible;
  opacity: 1;
}

.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--color-surface);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 26;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.side-menu.side-menu--open {
  transform: translateX(0);
}

.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}

.side-menu-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.side-menu-close {
  width: var(--min-touch);
  height: var(--min-touch);
  min-width: var(--min-touch);
  min-height: var(--min-touch);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius);
}

.side-menu-close:hover,
.side-menu-close:focus-visible {
  background: var(--color-bg);
  color: var(--color-text);
}

.side-menu-list {
  padding: 8px 0;
}

.side-menu-list a {
  display: block;
  padding: 14px 16px;
  min-height: var(--min-touch);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
}

.side-menu-list a:hover,
.side-menu-list a:focus-visible {
  background: var(--color-bg);
}

.side-menu-list .side-menu-empty,
.side-menu-list .side-menu-error {
  padding: 20px 16px;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.bottom-nav-item--center {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  margin: 0 -4px;
}

.bottom-nav-item--active.bottom-nav-item--center {
  background: var(--gradient-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  color: #fff;
}

.bottom-nav-item--active:not(.bottom-nav-item--center) {
  color: #fff;
}

.bottom-nav-item--active .bottom-nav-icon {
  stroke: currentColor;
}

/* Floating action button */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  right: 20px;
  z-index: 15;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover,
.fab:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.fab-icon {
  width: 28px;
  height: 28px;
}

/* Bills — MUNICIPALITY year-selection list */
.bills-municipality-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bills-municipality-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.bills-municipality-card.is-checked {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.bills-municipality-checkbox {
  flex-shrink: 0;
  margin-top: 4px;
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
}

.bills-municipality-card-body {
  flex: 1;
  min-width: 0;
  display: block;
}

.bills-municipality-empty {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  padding: 8px 0;
}

.bills-municipality-totals {
  font-weight: 500;
}

.bills-pharmacy-description {
  font-size: 13px; margin: 10px 0;
}

.form-group .bills-scan-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group .bills-scan-row input {
  flex: 1;
  min-width: 0;
  width: auto;
}

.form-group .bills-scan-btn {
  flex-shrink: 0;
}

.bills-qr-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  padding: 16px 0 env(safe-area-inset-bottom, 0);
}

.bills-qr-scan-overlay .bills-qr-scan-close {
  align-self: flex-end;
  margin: 0 16px 8px;
}

.bills-qr-scan-overlay .qr-scan {
  flex: 1;
  min-height: 0;
}

/* QR scan (temporary MVP, #/qr-scan) */
.qr-scan {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qr-scan-preview {
  position: relative;
  width: 100%;
  max-height: 50vh;
  min-height: 200px;
  background: #0f172a;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.qr-scan-video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 50vh;
  object-fit: cover;
}

.qr-scan-status {
  font-family: var(--montserrat-medium);
  font-size: 0.9375rem;
  color: var(--color-label);
  text-align: center;
  line-height: 1.4;
}

.qr-scan-status--muted {
  color: var(--color-text-muted);
}

.qr-scan-error {
  margin-top: -8px;
}

.qr-scan-result {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.qr-scan-result-title {
  font-family: var(--montserrat-semibold);
  font-size: 0.875rem;
  color: var(--color-label);
  margin-bottom: 8px;
}

.qr-scan-result-value {
  font-family: var(--montserrat-medium);
  font-size: 0.875rem;
  color: var(--color-label);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

@media print {
  .app-header,
  .page-actions,
  .side-menu,
  .side-menu-overlay,
  .error-banner,
  .activation-code-copy {
    display: none !important;
  }

  html,
  body,
  #app,
  #main,
  #content {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
    color: #000 !important;
  }

  .receipt-card,
  .receipt-card.success {
    box-shadow: none !important;
    background: #fff !important;
    border: 1px solid #000 !important;
    color: #000 !important;
    margin: 0 !important;
  }

  .receipt-ref,
  .receipt-ref strong,
  .detail-label,
  .detail-value,
  .hint,
  .activation-code {
    color: #000 !important;
  }
}