/* =====================================================================================
   "Bharat Kisan UI" theme (from Bharat Kisan UI.pdf): white-dominant #F9FBF9 canvas, premium
   green, milky 88% white cards with a hairline white edge and soft diffuse shadow, 24px cards,
   18px buttons/inputs, white bottom bar with a pale-green indicator.
   Everything is scoped to html.th-pdf, so Settings → "App ka roop → Purana" removes the class
   and the app is exactly as before. Blur only on the two bars (cards sit on plain white).
   ===================================================================================== */
html.th-pdf {
  --bk-primary: #168447; --bk-dark: #0E6135; --bk-pale: #EAF5ED; --bk-accent: #FF9500; --bk-blue: #007AFF;
  --bk-text: #1D1D1F; --bk-muted: #747B75; --bk-border: #E8EDE9; --bk-bg: #F9FBF9;
  --md-primary: var(--bk-primary); --md-surface: var(--bk-bg); --md-surface-container-low: #FFFFFF;
  --md-on-surface: var(--bk-text); --md-on-surface-variant: var(--bk-muted); --md-outline: var(--bk-border);
  --md-secondary-container: var(--bk-pale); --md-on-secondary-container: var(--bk-dark);
  --ink: var(--bk-text); --ink-3: var(--bk-muted); --line: var(--bk-border);
  --g-800: var(--bk-primary); --g-900: var(--bk-dark); --g-100: var(--bk-pale);
  --bk-card-shadow: 0 7px 18px rgba(0, 0, 0, .055);
}
html.th-pdf body { background: var(--bk-bg); color: var(--bk-text); }
html.th-pdf body::before { display: none; }

/* Cards: milky white, white hairline, soft shadow, 24px */
html.th-pdf .card:not(.weather), html.th-pdf .hk, html.th-pdf .dash, html.th-pdf .advisory, html.th-pdf .chat-card,
html.th-pdf .live-card, html.th-pdf .qa-card, html.th-pdf .card.hero-hisab, html.th-pdf .card.stage-hero {
  background: rgba(255, 255, 255, .88) !important;
  border: 1.2px solid rgba(255, 255, 255, .95) !important;
  box-shadow: var(--bk-card-shadow) !important;
  border-radius: 24px;
}
html.th-pdf .card.weather { border-radius: 24px; box-shadow: 0 10px 24px -10px rgba(14, 97, 53, .35) !important; }
html.th-pdf .kpi, html.th-pdf .hero-hisab .kpi, html.th-pdf .dash .dk > div, html.th-pdf .pay-sum .ps > div, html.th-pdf .best .bb > div {
  background: var(--bk-pale); box-shadow: none; border-radius: 16px;
}

/* Type */
html.th-pdf .section h2 { font-size: 20px; font-weight: 700; color: var(--bk-text); letter-spacing: -.2px; }
html.th-pdf .muted { color: var(--bk-muted); }
html.th-pdf .section a, html.th-pdf .section button { color: var(--bk-primary); font-weight: 600; }

/* Buttons: 18px, 52px tall, green with a soft green glow */
html.th-pdf .btn { min-height: 52px; border-radius: 18px; background: var(--bk-primary); color: #fff; font-size: 16px; font-weight: 700;
  box-shadow: 0 6px 14px rgba(22, 132, 71, .20); }
html.th-pdf .btn:active { background: var(--bk-dark); }
html.th-pdf .btn.secondary { background: #fff; color: var(--bk-primary); border: 1px solid var(--bk-border); box-shadow: none; }
html.th-pdf .btn.secondary.danger { background: #FDECEC; color: #D32F2F; border-color: #F6D2D2; }

/* Inputs: white, hairline border, 18px; green 1.5px focus */
html.th-pdf .form input, html.th-pdf .form select.sel, html.th-pdf .form textarea, html.th-pdf .state-select, html.th-pdf .search, html.th-pdf .composer input {
  background: #fff !important; border: 1px solid var(--bk-border) !important; border-radius: 18px; padding: 15px 18px; box-shadow: none;
}
html.th-pdf .form input:focus, html.th-pdf .form select.sel:focus, html.th-pdf .form textarea:focus, html.th-pdf .composer input:focus {
  border: 1.5px solid var(--bk-primary) !important; padding: 14.5px 17.5px; outline: 0; box-shadow: none;
}

/* Chips / segments */
html.th-pdf .chip { background: #fff; border: 1px solid var(--bk-border); box-shadow: none; color: var(--bk-text); }
html.th-pdf .chip[aria-pressed="true"] { background: var(--bk-pale); border-color: transparent; color: var(--bk-dark); font-weight: 600; }
html.th-pdf .seg { background: #fff; border: 1px solid var(--bk-border) !important; box-shadow: none; border-radius: 18px; }
html.th-pdf .seg button[aria-pressed="true"] { background: var(--bk-pale); color: var(--bk-dark); }
html.th-pdf .badge { background: var(--bk-pale); color: var(--bk-dark); }
html.th-pdf .badge.saffron, html.th-pdf .live-dot { background: #FFF1DD; color: #A35A00; }
html.th-pdf .star[aria-pressed="true"] { color: var(--bk-accent); }

/* Bars: off-white top bar, white bottom bar with pale-green pill */
html.th-pdf .topbar, html.th-pdf .subbar { background: rgba(249, 251, 249, .88); box-shadow: 0 1px 0 var(--bk-border); }
html.th-pdf .bottomnav { background: rgba(255, 255, 255, .96); box-shadow: 0 -6px 18px rgba(0, 0, 0, .05); }
html.th-pdf .bottomnav a { font-size: 11px; font-weight: 600; color: var(--bk-muted); }
html.th-pdf .bottomnav a[aria-current="page"] { color: var(--bk-dark); }
html.th-pdf .bottomnav a[aria-current="page"] .pill { background: var(--bk-pale); }

/* Links to outside sources read as links (iOS blue) */
html.th-pdf .reader .src a, html.th-pdf a.src-link { color: var(--bk-blue); }
html.th-pdf .pos { color: var(--bk-primary); } html.th-pdf .neg { color: #D32F2F; }

/* ---------- New Home (mockup): photo hero, compact weather, warning, quick tiles ---------- */
html.th-pdf .topbar .loc-chip { display: none; }
.nh-hero { margin: -8px -16px 0; padding: 16px 16px 72px; min-height: 216px; box-sizing: border-box;
  background: url(bk-hero.jpg) right bottom / cover no-repeat, linear-gradient(180deg, #FFFFFF, #FDF6DC); }
.nh-hero h1 { margin: 16px 0 4px; font-size: 24px; line-height: 1.25; font-weight: 800; color: #1D1D1F; max-width: 62%; }
.nh-hero p { margin: 0; font-size: 14px; color: #3C463F; max-width: 58%; }
.nh-loc { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 20px; background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.08); font: 600 14px/1.2 var(--md-font); color: #1D1D1F; }
.nh-loc svg { width: 18px; height: 18px; color: #168447; } .nh-loc i { font-style: normal; font-size: 11px; color: #747B75; }
.nh-wx { position: relative; z-index: 2; margin-top: -56px; }
.nh-wxc { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 16px; font: inherit; color: inherit; cursor: pointer; }
.nh-wxc .wi svg { width: 52px; height: 52px; }
.nh-wxc .wt, .nh-wxc .wr { display: flex; flex-direction: column; gap: 2px; }
.nh-wxc small { font-size: 12px; color: #747B75; } .nh-wxc .wt b { font-size: 30px; line-height: 1.1; font-weight: 800; color: #1D1D1F; }
.nh-wxc .wr { padding-left: 12px; border-left: 1px solid #E8EDE9; } .nh-wxc .wr b { font-size: 22px; font-weight: 800; color: #1D1D1F; }
.nh-wxc .go svg, .nh-warn .go svg { width: 18px; height: 18px; color: #747B75; }
html.th-pdf .card.nh-warn { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-top: 12px; padding: 14px 16px;
  background: #FFF4F3 !important; border-color: #FFE1DE !important; text-decoration: none; color: #3C463F; font-size: 14px; }
.nh-warn > svg { width: 28px; height: 28px; color: #E53935; } .nh-warn b { display: block; color: #D32F2F; font-size: 16px; margin-bottom: 2px; }
.nh-full { margin-top: 12px; } .nh-full.hidden { display: none; }
.nh-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 8px; }
.nh-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; padding: 12px 8px;
  background: #fff; border-radius: 20px; box-shadow: 0 7px 18px rgba(0,0,0,.055); text-decoration: none; text-align: center; }
.nh-tile svg { width: 32px; height: 32px; stroke-width: 2.2; }
.nh-tile b { font-size: 14px; line-height: 1.25; font-weight: 700; color: #1D1D1F; }
.nh-tile:active { transform: scale(.97); }
.t-up svg { color: #7B3FE4; } .t-leaf svg { color: #34A853; } .t-calc svg { color: #FF9500; }
.t-gov svg { color: #007AFF; } .t-doc svg { color: #E53935; } .t-chat svg { color: #168447; }

/* Bottom bar: active tab becomes a raised green circle (mockup) */
html.th-pdf .bottomnav a[aria-current="page"] .pill { width: 56px; height: 56px; border-radius: 50%; margin-top: -22px; background: linear-gradient(180deg, #1E9A55, #168447);
  box-shadow: 0 8px 18px rgba(22, 132, 71, .35); }
html.th-pdf .bottomnav a[aria-current="page"] .pill svg { color: #fff; }
html.th-pdf .bottomnav a[aria-current="page"] { color: #168447; font-weight: 700; }

/* Tighter cards: tiles sized to their content, KPI rows only as tall as their own content */
.nh-tiles { gap: 8px; margin: 12px 0 4px; }
.nh-tile { min-height: 0; padding: 12px 6px 10px; gap: 6px; border-radius: 18px; }
.nh-tile svg { width: 26px; height: 26px; }
.nh-tile b { font-size: 13px; font-weight: 700; }
.nh-wxc { padding: 12px 14px; gap: 10px; } .nh-wxc .wi svg { width: 44px; height: 44px; } .nh-wxc .wt b { font-size: 26px; } .nh-wxc .wr b { font-size: 20px; }
html.th-pdf .hk-grid { grid-auto-rows: auto; align-items: stretch; gap: 8px; margin-bottom: 12px; }
html.th-pdf .hk { padding: 12px 14px; border-radius: 20px; }
html.th-pdf main > .section { margin-top: 16px; }
html.th-pdf .card.nh-wxc { background: #fff !important; box-shadow: 0 10px 24px rgba(0,0,0,.08) !important; }

/* Hero photo melts into the page: soft fade at top, bottom and the text side, no hard rectangle */
.nh-hero { position: relative; isolation: isolate; background: none; }
.nh-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url(bk-hero.jpg) right bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 58%, transparent 96%), linear-gradient(to right, transparent 0, rgba(0,0,0,.55) 30%, #000 58%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.nh-hero::after { content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(90% 70% at 85% 45%, rgba(253, 246, 220, .7), transparent 70%); }

/* Compact info cards (sized to their content): saved crops, farm advisory, mandi prices */
html.th-pdf .saved-grid { grid-auto-rows: auto; gap: 8px; }
html.th-pdf .card.skpi { padding: 10px 12px; border-radius: 18px; }
html.th-pdf .skpi .sh { min-height: 0; gap: 6px; } html.th-pdf .skpi .sh .ce { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; background: var(--bk-pale); }
html.th-pdf .skpi .sh b { font-size: 14px; }
html.th-pdf .skpi .sv { font-size: 18px; margin-top: 4px; line-height: 1.15; } html.th-pdf .skpi .sa { font-size: 11px; margin-bottom: 2px; }
html.th-pdf .skpi .sr { padding-top: 5px; margin-top: 3px; font-size: 11.5px; border-top-color: var(--bk-border); }
html.th-pdf .skpi .sr b { font-size: 13px; } html.th-pdf .skpi .sr small { font-size: 10.5px; line-height: 1.3; }

html.th-pdf .adv-grid { grid-template-columns: 1fr; gap: 8px; }
html.th-pdf .adv-grid .advisory { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; font-size: 13.5px; line-height: 1.4; color: var(--bk-text); }
html.th-pdf .adv-grid .advisory > svg:first-child { width: 28px; height: 28px; padding: 5px; flex: none; border-radius: 9px; }
html.th-pdf .adv-grid .advisory > span { flex: 1; min-width: 0; }
html.th-pdf .adv-grid .advisory .speak { align-self: center; margin: 0; flex: none; width: 34px; height: 34px; }

html.th-pdf .card.mini-price { width: 132px; padding: 10px 12px; border-radius: 18px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 2px; align-items: center; }
html.th-pdf .mini-price .cd { width: 30px; height: 30px; font-size: 17px; border-radius: 9px; margin: 0; background: var(--bk-pale); }
html.th-pdf .mini-price .mn { font-size: 13.5px; }
html.th-pdf .mini-price .modal { grid-column: 1 / -1; font-size: 18px; margin-top: 4px; color: var(--bk-dark); }
html.th-pdf .mini-price > .muted { grid-column: 1 / -1; font-size: 11px; }
.nh-wxc .wi { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, #8EC5F5, #4E97E0); } .nh-wxc .wi svg { width: 42px; height: 42px; }
html.th-pdf .bottomnav, html.th-pdf .bottomnav a { overflow: visible !important; }
html.th-pdf .bottomnav a[aria-current="page"] .pill { border-radius: 18px; }
html.th-pdf .bottomnav a[aria-current="page"] .pill { margin-top: 0; width: 56px; height: 36px; border-radius: 12px; box-shadow: 0 4px 10px rgba(22, 132, 71, .25); }

/* A little more green on Home: mint page wash, more of the field under the farmer, tinted icon chips */
html.th-pdf body { background: linear-gradient(180deg, #F9FBF9 0, #EDF7EF 520px, #F1F8F2 100%) fixed; }
.nh-hero::before { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 74%, transparent 100%), linear-gradient(to right, transparent 0, rgba(0,0,0,.6) 28%, #000 55%); }
.nh-hero::after { background: radial-gradient(90% 70% at 85% 45%, rgba(253, 246, 220, .7), transparent 70%), linear-gradient(180deg, transparent 55%, rgba(120, 190, 90, .22) 100%); }
.nh-tile svg { box-sizing: content-box; padding: 8px; border-radius: 14px; }
.t-up svg { background: #F1EBFC; } .t-leaf svg { background: #E6F5EA; } .t-calc svg { background: #FFF2E0; }
.t-gov svg { background: #E5F0FF; } .t-doc svg { background: #FDE9E8; } .t-chat svg { background: #E3F3E8; }
html.th-pdf .section h2 { display: flex; align-items: center; gap: 8px; }
html.th-pdf .section h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, #34C759, #168447); flex: none; }
html.th-pdf .hk:first-child, html.th-pdf .card.hero-hisab { background: linear-gradient(150deg, #FFFFFF 40%, #E8F5EC) !important; }

/* Doctor tab: the 1962 doorstep-vet card keeps its red (white text was vanishing on the white card) */
html.th-pdf .card.mvu { background: linear-gradient(135deg, #C62828, #E53935) !important; color: #fff; border: 0 !important; box-shadow: 0 10px 22px -10px rgba(198, 40, 40, .55) !important; }
html.th-pdf .card.mvu .mvu-t span, html.th-pdf .card.mvu b { color: #fff; }
html.th-pdf .card.pest-al { background: #FFF4E5 !important; border: 1px solid #F5C98B !important; }

/* Hero photo merge v2: multiply turns the photo's white sky into the page's own mint, so only the
   farmer and the field remain; the hero carries the page colour so the blend has something to sit on */
.nh-hero { background: linear-gradient(180deg, #F5FAF5 0%, #EFF8F0 100%); }
.nh-hero::before { mix-blend-mode: multiply; }
.nh-hero::after { display: none; }

/* Living farmer: blinks every ~5 s (now and then a quick double blink) and breathes gently.
   The blink is a transparent layer of closed eyelids, sized exactly like the photo and shown for ~120 ms. */
.nh-blink { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: url(bk-hero-blink.png) right bottom / cover no-repeat;   /* eyelids only, transparent elsewhere */
  animation: nh-blink 5.2s steps(1, end) infinite, nh-breathe 4.8s ease-in-out infinite alternate; transform-origin: 85% 100%; }
.nh-hero::before { animation: nh-breathe 4.8s ease-in-out infinite alternate; transform-origin: 85% 100%; }
@keyframes nh-blink {
  0%, 46% { opacity: 0; } 46.5% { opacity: 1; } 48.8% { opacity: 0; }
  92% { opacity: 0; } 92.5% { opacity: 1; } 94.6% { opacity: 0; } 96% { opacity: 1; } 98.2%, 100% { opacity: 0; }
}
@keyframes nh-breathe { from { transform: scale(1) translateY(0); } to { transform: scale(1.012) translateY(-1.5px); } }
@media (prefers-reduced-motion: reduce) { .nh-blink, .nh-hero::before { animation: none; } }
html.th-pdf .card.cw-card { background: #EEF6FF !important; border: 1px solid #B9D7F5 !important; }
