/* Money Saver tile theme overlay. Styling only — does not change screener logic. */
:root {
  --navy: #0b1f3a;
  --tile-from: #3b6ccc;
  --tile-to: #16315c;
  --tile-grad: linear-gradient(180deg, color-mix(in srgb, var(--tile-from) 72%, #1a2332) 0%, var(--tile-to) 100%);
  --page-text-shadow: 0 1px 1px rgba(11, 31, 58, 0.6), 0 0 6px rgba(11, 31, 58, 0.28);
  --tile-shadow: 0 1px 0 rgba(255, 255, 255, 0.26) inset, 0 8px 20px rgba(11, 31, 58, 0.2);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --touch: 44px;
  --ms-font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --color-up: #9cc4ff;
  --color-down: #f0c35a;
  --color-ink: #fff;
  --color-muted: rgba(255, 255, 255, 0.86);
  --color-faint: rgba(255, 255, 255, 0.72);
  --color-bg: transparent;
  --color-surface: transparent;
  --color-line: rgba(255, 255, 255, 0.28);
  --color-line-strong: rgba(255, 255, 255, 0.42);
  --color-wash: rgba(11, 31, 58, 0.28);
  --color-accent: rgba(255, 255, 255, 0.22);
  --color-accent-fg: #fff;
}

html[data-ms-site="india"] {
  --tile-from: #d0922a;
  --tile-to: #1e3a6e;
  --color-up: #f0c35a;
  --color-down: #9cc4ff;
}

html.dark,
html.dark:root {
  --color-up: #9cc4ff;
  --color-down: #f0c35a;
  --color-ink: #fff;
  --color-muted: rgba(255, 255, 255, 0.86);
  --color-faint: rgba(255, 255, 255, 0.72);
  --color-bg: transparent;
  --color-surface: transparent;
  --color-line: rgba(255, 255, 255, 0.28);
  --color-line-strong: rgba(255, 255, 255, 0.42);
  --color-wash: rgba(11, 31, 58, 0.28);
  --color-accent: rgba(255, 255, 255, 0.22);
  --color-accent-fg: #fff;
  --color-surface-2: transparent;
}

html[data-ms-site="india"].dark,
html[data-ms-site="india"].dark:root {
  --color-up: #f0c35a;
  --color-down: #9cc4ff;
}

html {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 18% 8%, rgba(255, 214, 170, 0.55) 0%, transparent 46%),
    radial-gradient(ellipse at 92% 14%, rgba(190, 164, 214, 0.55) 0%, transparent 48%),
    radial-gradient(ellipse at 80% 78%, rgba(212, 164, 116, 0.5) 0%, transparent 50%),
    radial-gradient(ellipse at 8% 86%, rgba(61, 90, 128, 0.65) 0%, transparent 48%),
    linear-gradient(180deg, #8aa2c8 0%, #b9adc4 42%, #c4b197 100%) !important;
}

html, body, .min-h-screen, .bg-bg, .text-ink {
  font-family: var(--ms-font);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: #fff;
  background: transparent !important;
  padding-top: var(--safe-top);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
}

/* Keep only page wrappers transparent so the wallpaper shows through.
   Do not target .bg-bg on inputs, the app header, or cards. */
body .min-h-screen.bg-bg,
.min-h-screen.bg-bg.text-ink {
  background: transparent !important;
  color: #fff !important;
}

.text-ink, .text-muted, .text-faint,
h1, h2, h3, p, legend, th, td, label, span, li, footer {
  color: inherit;
}

header .text-ink,
header .text-muted,
header h1, header p,
main .text-ink,
main .text-muted,
main .text-faint,
main h1, main h2, main h3, main p, main legend, main th,
footer, footer p {
  color: #fff !important;
  text-shadow: var(--page-text-shadow);
}

main .text-up, .text-up { color: var(--color-up) !important; text-shadow: var(--page-text-shadow); }
main .text-down, .text-down { color: var(--color-down) !important; text-shadow: var(--page-text-shadow); }

/* Hide the original photo header; replaced by .ms-banner-slot in ms-theme.js */
div[style*="url(/banner.jpg)"],
div[style*="url('/banner.jpg')"],
div[style*='url("/banner.jpg")'] {
  display: none !important;
}

.ms-banner-slot {
  width: 100%;
}

.ms-banner-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: var(--touch);
  padding: 0.55rem 0.7rem;
  border-radius: 23px;
  color: #fff;
  text-decoration: none;
  background: var(--tile-grad);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 6px 14px rgba(11, 31, 58, 0.22);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.ms-banner-tile:active {
  transform: scale(0.98);
  filter: brightness(0.96);
}

.ms-banner-icon {
  position: relative;
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  border-radius: 23%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(11, 8, 6, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 6px 14px rgba(11, 31, 58, 0.22);
}

.ms-banner-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ms-banner-external {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 2px rgba(11, 31, 58, 0.35);
}

.ms-banner-copy { flex: 1; min-width: 0; }

.ms-banner-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 1px 1px rgba(11, 31, 58, 0.75), 0 0 6px rgba(11, 31, 58, 0.4);
}

.ms-banner-line {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 1px rgba(11, 31, 58, 0.75), 0 0 6px rgba(11, 31, 58, 0.4);
}

/* Page app bar and result/filter cards as 28px squircles */
header.rounded-xl,
html body header,
main section,
main aside,
main .rounded-xl,
main .overflow-x-auto,
[data-ms-site] header {
  background: var(--tile-grad) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 28px !important;
  color: #fff !important;
  box-shadow: var(--tile-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
}
html[data-ms-site="india"] header.sticky {
  margin: 0.6rem 1rem 0;
  width: auto;
  border-bottom: 0 !important;
}

header .text-sm,
header .text-xs,
main .text-xs,
main .text-sm.font-medium,
th, thead, thead button {
  font-size: 13px;
  font-weight: 600;
}

table {
  color: #fff;
  border-collapse: collapse;
}

table thead {
  border-bottom-color: rgba(255, 255, 255, 0.28) !important;
}

td, th { text-shadow: var(--page-text-shadow); }

/* White input fields stay readable — beat utility classes such as .bg-bg */
html body input,
html body select,
html body textarea,
html body input.bg-bg,
html body select.bg-bg,
html body textarea.bg-bg,
html body input.bg-surface,
html body select.bg-surface {
  background: #fff !important;
  background-color: #fff !important;
  background-image: none !important;
  color: #1a2332 !important;
  text-shadow: none !important;
  border-color: #d9dee8 !important;
  min-height: var(--touch);
  font-family: inherit;
}

input::placeholder, textarea::placeholder {
  color: #4a5568 !important;
  opacity: 1;
}

/* Keep slider thumbs visible; leave the numeric fields white */
[role="slider"] {
  background: #fff !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
}

/* Chips and action buttons on a dark tile */
main button {
  color: #fff;
  text-shadow: var(--page-text-shadow);
}

main button.bg-bg,
main button.bg-surface,
main button.border-line {
  background: rgba(11, 31, 58, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
}

main button.bg-accent,
main button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Dark-mode toggle on the app bar */
header button {
  background: rgba(11, 31, 58, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  color: #fff !important;
}

.ms-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0 0.85rem;
  border-radius: 999px;
  background: rgba(11, 31, 58, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: var(--page-text-shadow);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.ms-home-link:active {
  background: rgba(11, 31, 58, 0.5);
}

footer {
  color: #fff !important;
  text-shadow: var(--page-text-shadow);
}

footer a { color: #fff; }

/* Dialogs / industry picker portals often attach to body */
[role="dialog"], [data-radix-dialog-content], [data-state][role="dialog"] {
  background: var(--tile-grad) !important;
  color: #fff !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: var(--tile-shadow);
}

[role="dialog"] input, [role="dialog"] select {
  background: #fff !important;
  color: #1a2332 !important;
  text-shadow: none !important;
}

@media (max-width: 640px) {
  .sd-lbl { display: none; }
}
