/* ============================================================
 AI BHOOMI · Soil Health Card AI — Glassmorphic 3D UI
 Inspired by Framer + FlutterFlow visual language.
 ============================================================ */

:root {
 /* Brand & gradients */
 --grad-bg: radial-gradient(1200px 800px at 10% 5%, #15294a 0%, transparent 60%),
 radial-gradient(900px 700px at 95% 90%, #0a8636 0%, transparent 55%),
 radial-gradient(700px 600px at 60% 40%, #6d28d9 0%, transparent 60%),
 linear-gradient(155deg, #050b1a 0%, #0b1430 50%, #050b1a 100%);
 --grad-brand: linear-gradient(135deg, #1f3a8a 0%, #2563eb 50%, #16a34a 100%);
 --grad-ai: linear-gradient(135deg, #6d28d9 0%, #2563eb 60%, #0ea5e9 100%);
 --grad-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
 --grad-glass: linear-gradient(160deg, rgba(255,255,255,.18) 0%,
 rgba(255,255,255,.05) 50%,
 rgba(255,255,255,.02) 100%);

 /* Glass tokens */
 --glass-bg: rgba(15, 23, 42, 0.55);
 --glass-bg-2: rgba(15, 23, 42, 0.40);
 --glass-border: 1px solid rgba(255,255,255,.14);
 --glass-shadow: 0 12px 32px rgba(0,0,0,.45),
 inset 0 1px 0 rgba(255,255,255,.10);
 --glass-blur: saturate(180%) blur(22px);
 --glass-radius: 22px;

 /* Type */
 --ink: #e8edf7;
 --ink-mute: #a6b1cc;
 --ink-soft: #7a87a6;
 --accent: #38bdf8;
 --good: #34d399;
 --warn: #fbbf24;
 --bad: #f87171;

 /* Motion */
 --ease: cubic-bezier(.22, 1, .36, 1);
 --bounce: cubic-bezier(.34, 1.56, .64, 1);
}

/* ───────────── Global ───────────── */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
 font-family: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif;
 color: var(--ink);
 background: var(--grad-bg);
 overflow: hidden;
 display: grid;
 grid-template-columns: 320px 1fr;
 perspective: 1500px;
}

/* Animated aurora behind everything */
body::before, body::after{
 content:""; position:fixed; inset:-30%; z-index:-1;
 background: radial-gradient(circle at 30% 30%, #1e40af55 0%, transparent 50%),
 radial-gradient(circle at 70% 70%, #16a34a40 0%, transparent 55%);
 filter: blur(80px);
 animation: aurora-drift 28s var(--ease) infinite alternate;
}
body::after{
 animation-duration: 36s;
 animation-direction: alternate-reverse;
 background: radial-gradient(circle at 80% 20%, #6d28d955 0%, transparent 55%),
 radial-gradient(circle at 20% 80%, #f59e0b35 0%, transparent 60%);
}
@keyframes aurora-drift{
 0% { transform: rotate(0deg) translate(0,0); }
 100% { transform: rotate(8deg) translate(40px,-30px); }
}

/* ───────────── Sidebar ───────────── */
.sidebar{
 position: relative;
 margin: 14px 0 14px 14px;
 padding: 18px 16px 14px;
 border-radius: var(--glass-radius);
 border: var(--glass-border);
 background: var(--glass-bg);
 backdrop-filter: var(--glass-blur);
 -webkit-backdrop-filter: var(--glass-blur);
 box-shadow: var(--glass-shadow);
 display: flex; flex-direction: column;
 overflow: hidden;
 transform: translateZ(0);
 animation: slideIn-L .8s var(--ease) both;
}
.sidebar::before{
 content:""; position:absolute; inset:0;
 background: var(--grad-glass);
 pointer-events:none; border-radius: inherit;
}

.brand{
 display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
 padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand .logo{
 width: 44px; height: 44px; display:grid; place-items:center;
 font-size: 24px; border-radius: 14px;
 background: var(--grad-ai);
 box-shadow: 0 8px 22px rgba(109,40,217,.45),
 inset 0 1px 0 rgba(255,255,255,.4);
 animation: float 5s ease-in-out infinite;
}
.brand-name{font-weight: 700; font-size: 16px; letter-spacing: .3px}
.brand-sub{font-size: 11px; color: var(--ink-mute); margin-top: 2px}

@keyframes float{
 0%,100%{ transform: translateY(0) rotate(0) }
 50% { transform: translateY(-3px) rotate(2deg) }
}

.new-chat{
 width: 100%;
 padding: 11px 14px;
 border-radius: 14px;
 border: 1px solid rgba(255,255,255,.18);
 background: var(--grad-brand);
 color: #fff; font-weight: 600; font-size: 13px;
 cursor: pointer; margin-bottom: 8px;
 box-shadow: 0 6px 16px rgba(31,58,138,.35),
 inset 0 1px 0 rgba(255,255,255,.25);
 transition: transform .25s var(--bounce), box-shadow .25s var(--ease);
 text-align: left;
}
.new-chat:hover{
 transform: translateY(-2px) scale(1.02);
 box-shadow: 0 12px 26px rgba(31,58,138,.55),
 inset 0 1px 0 rgba(255,255,255,.3);
}
.new-chat:active{ transform: translateY(0) scale(.99); }

.nav-title{
 font-size: 10.5px; color: var(--ink-soft); text-transform: uppercase;
 letter-spacing: 1.1px; margin: 16px 0 6px;
}
.history{flex: 1; overflow-y: auto; padding-right: 4px}
.history::-webkit-scrollbar{width:5px}
.history::-webkit-scrollbar-thumb{background:rgba(255,255,255,.1); border-radius:5px}
.history-item{
 padding: 9px 11px; border-radius: 12px; font-size: 12px;
 color: var(--ink-mute); cursor: pointer; margin-bottom: 4px;
 transition: all .2s var(--ease);
 border: 1px solid transparent;
}
.history-item:hover{
 background: rgba(255,255,255,.06);
 border-color: rgba(255,255,255,.12);
 color: var(--ink); transform: translateX(2px);
}
.history-item.active{
 background: rgba(56,189,248,.14); color: #fff;
 border-color: rgba(56,189,248,.30);
}

.provider-status{
 margin-top: 14px; padding: 12px;
 border-radius: 16px; border: 1px solid rgba(255,255,255,.1);
 background: rgba(255,255,255,.04);
}
.ps-title{font-size: 10.5px; color: var(--ink-soft);
 text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 8px}
.ps-list{font-size: 11px; line-height: 1.7; color: var(--ink-mute)}
.ps-list .ok::before{content:"●"; color: var(--good); margin-right: 5px}
.ps-list .off::before{content:"●"; color: var(--ink-soft); margin-right: 5px}

.footer-mark{
 margin-top: 12px; padding-top: 12px; font-size: 10px;
 border-top: 1px solid rgba(255,255,255,.08);
 color: var(--ink-soft); text-align: center; line-height: 1.5;
}

/* ───────────── Main Chat Pane ───────────── */
.main{
 margin: 14px 14px 14px 14px;
 border-radius: var(--glass-radius);
 border: var(--glass-border);
 background: var(--glass-bg-2);
 backdrop-filter: var(--glass-blur);
 -webkit-backdrop-filter: var(--glass-blur);
 box-shadow: var(--glass-shadow);
 display: flex; flex-direction: column;
 overflow: hidden;
 position: relative;
 animation: slideIn-R .8s var(--ease) both;
}
.main::before{
 content:""; position:absolute; inset:0;
 background: var(--grad-glass); pointer-events:none;
 border-radius: inherit;
}

.topbar{
 position: relative;
 padding: 18px 26px;
 display: flex; justify-content: space-between; align-items: center;
 border-bottom: 1px solid rgba(255,255,255,.08);
 background: linear-gradient(180deg, rgba(255,255,255,.05), transparent);
 z-index: 2;
}
.topbar h1{
 font-size: 18px; font-weight: 700;
 background: linear-gradient(90deg, #fff 0%, #93c5fd 50%, #34d399 100%);
 background-clip: text; -webkit-background-clip: text;
 color: transparent; letter-spacing: .3px;
}
.topbar .sub{
 font-size: 11.5px; color: var(--ink-mute); margin-top: 4px;
 letter-spacing: .8px; text-transform: uppercase;
}

.form-toggle{
 padding: 10px 16px;
 border-radius: 12px; border: 1px solid rgba(255,255,255,.18);
 background: rgba(255,255,255,.06);
 color: var(--ink); font-weight: 600; font-size: 13px;
 cursor: pointer; backdrop-filter: blur(10px);
 transition: all .25s var(--bounce);
}
.form-toggle:hover{
 background: rgba(34,197,94,.18);
 border-color: rgba(34,197,94,.5);
 transform: translateY(-2px) scale(1.02);
 box-shadow: 0 8px 20px rgba(34,197,94,.25);
}

.messages{
 flex: 1; overflow-y: auto; padding: 26px;
 display: flex; flex-direction: column; gap: 16px;
 position: relative; z-index: 2;
 scroll-behavior: smooth;
}
.messages::-webkit-scrollbar{width:7px}
.messages::-webkit-scrollbar-thumb{
 background: rgba(255,255,255,.1); border-radius: 7px;
}

.msg{
 display: flex; gap: 12px; max-width: 85%;
 animation: msg-in .55s var(--ease) both;
}
.msg.ai{ align-self: flex-start; }
.msg.user{ align-self: flex-end; flex-direction: row-reverse; }

@keyframes msg-in{
 0% { opacity: 0; transform: translateY(18px) scale(.96); filter: blur(6px); }
 100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.avatar{
 width: 36px; height: 36px; flex-shrink: 0;
 border-radius: 12px; display: grid; place-items: center;
 font-size: 18px; font-weight: 700;
 box-shadow: 0 6px 14px rgba(0,0,0,.25),
 inset 0 1px 0 rgba(255,255,255,.25);
}
.ai-av{ background: var(--grad-ai); }
.user-av{ background: var(--grad-warm); }

.bubble{
 position: relative;
 padding: 13px 16px;
 border-radius: 18px;
 border: 1px solid rgba(255,255,255,.10);
 background: rgba(15,23,42,.55);
 backdrop-filter: blur(14px) saturate(180%);
 box-shadow: 0 10px 24px rgba(0,0,0,.30),
 inset 0 1px 0 rgba(255,255,255,.08);
 font-size: 13.5px; line-height: 1.55;
 transform-style: preserve-3d;
 transition: transform .3s var(--ease);
}
.msg.user .bubble{
 background: linear-gradient(135deg, rgba(37,99,235,.55), rgba(31,58,138,.55));
 border-color: rgba(96,165,250,.35);
 box-shadow: 0 10px 24px rgba(37,99,235,.30),
 inset 0 1px 0 rgba(255,255,255,.20);
}
.msg.user .bubble:hover, .msg.ai .bubble:hover{
 transform: translateY(-2px) rotateX(2deg);
}
.bubble p { margin: 4px 0; }
.bubble code{
 background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 5px;
 font-size: 11.5px; color: #93c5fd;
}
.bubble ul{ margin: 6px 0 6px 18px; }

.bubble .actions{
 margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px;
}
.bubble .actions button{
 padding: 7px 12px; border-radius: 10px; font-size: 12px;
 border: 1px solid rgba(255,255,255,.16);
 background: rgba(255,255,255,.06); color: var(--ink);
 cursor: pointer; font-weight: 600;
 transition: all .2s var(--bounce);
}
.bubble .actions button:hover{
 background: rgba(56,189,248,.18); transform: translateY(-1px) scale(1.04);
 border-color: rgba(56,189,248,.4);
 box-shadow: 0 6px 14px rgba(56,189,248,.3);
}
.bubble .actions button.alt{
 background: linear-gradient(135deg, rgba(34,197,94,.4), rgba(16,163,74,.4));
 border-color: rgba(34,197,94,.6);
}
.bubble .actions button.primary{
 background: var(--grad-brand);
 border-color: rgba(255,255,255,.25); color: #fff;
}

/* Composer */
.composer{
 position: relative; z-index: 2;
 padding: 14px 22px 18px;
 display: flex; gap: 10px; align-items: flex-end;
 border-top: 1px solid rgba(255,255,255,.08);
 background: linear-gradient(0deg, rgba(0,0,0,.25), transparent);
}
.composer textarea{
 flex: 1;
 padding: 13px 16px;
 font-family: inherit; font-size: 13.5px; color: var(--ink);
 border: 1px solid rgba(255,255,255,.14);
 border-radius: 16px;
 background: rgba(15,23,42,.6);
 backdrop-filter: blur(14px);
 resize: none;
 min-height: 52px; max-height: 160px;
 transition: all .25s var(--ease);
}
.composer textarea::placeholder{ color: var(--ink-soft); }
.composer textarea:focus{
 outline: none;
 border-color: rgba(56,189,248,.6);
 box-shadow: 0 0 0 4px rgba(56,189,248,.15),
 0 8px 22px rgba(56,189,248,.20);
}
#send{
 padding: 13px 22px;
 border-radius: 16px;
 border: 0;
 background: var(--grad-brand);
 color: #fff; font-weight: 700; font-size: 14px;
 cursor: pointer;
 box-shadow: 0 8px 22px rgba(31,58,138,.45),
 inset 0 1px 0 rgba(255,255,255,.25);
 transition: all .3s var(--bounce);
}
#send:hover{
 transform: translateY(-2px) scale(1.04);
 box-shadow: 0 12px 30px rgba(31,58,138,.6),
 inset 0 1px 0 rgba(255,255,255,.35);
}
#send:active{ transform: scale(.97); }
#send:disabled{ opacity: .5; cursor: wait; }

/* ───────────── Tables / forecast inside bubbles ───────────── */
.table-mini{
 width: 100%; margin-top: 8px;
 border-collapse: collapse; font-size: 12px;
 background: rgba(0,0,0,.25); border-radius: 10px; overflow: hidden;
}
.table-mini th, .table-mini td{
 padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.table-mini th{
 background: rgba(56,189,248,.18); color: #93c5fd;
 font-weight: 600; text-align: left;
}

/* iframe maps inside bubble */
.map-frame{
 width: 100%; height: 240px; margin-top: 8px;
 border: 1px solid rgba(255,255,255,.15);
 border-radius: 12px; box-shadow: 0 6px 16px rgba(0,0,0,.4);
}

/* ───────────── Map Polygon Modal ───────────── */
.map-modal{
 position: fixed; inset: 0;
 background: rgba(2,8,23,.65);
 backdrop-filter: blur(8px);
 display: none;
 align-items: center; justify-content: center;
 z-index: 100;
 animation: fade-in .35s var(--ease);
}
.map-modal.open{ display: flex; }
@keyframes fade-in{
 from{ opacity:0; backdrop-filter: blur(0); }
 to { opacity:1; }
}
.map-modal-inner{
 width: min(92vw, 1280px); height: min(88vh, 880px);
 display: flex; flex-direction: column;
 border-radius: 24px;
 border: var(--glass-border);
 background: var(--glass-bg);
 backdrop-filter: var(--glass-blur);
 box-shadow: 0 30px 80px rgba(0,0,0,.65);
 overflow: hidden;
 animation: scale-in .45s var(--bounce);
}
@keyframes scale-in{
 from{ transform: scale(.92) translateY(30px); opacity: 0; }
 to { transform: scale(1) translateY(0); opacity: 1; }
}

.map-header{
 padding: 16px 22px;
 display: flex; justify-content: space-between; align-items: center;
 border-bottom: 1px solid rgba(255,255,255,.08);
 background: linear-gradient(180deg, rgba(255,255,255,.05), transparent);
}
.map-header h3{
 background: linear-gradient(90deg, #fff, #34d399);
 background-clip: text; -webkit-background-clip: text; color: transparent;
 font-size: 17px; font-weight: 700;
}
.map-header .sub{ color: var(--ink-mute); font-size: 12px; margin-top: 2px; }
.close{
 width: 36px; height: 36px; border-radius: 12px;
 border: 1px solid rgba(255,255,255,.16);
 background: rgba(255,255,255,.06); color: var(--ink);
 font-size: 16px; cursor: pointer;
 transition: all .2s var(--bounce);
}
.close:hover{
 background: rgba(248,113,113,.18); transform: rotate(90deg) scale(1.05);
 border-color: rgba(248,113,113,.4);
}

.map-toolbar{
 padding: 12px 18px;
 display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
 border-bottom: 1px solid rgba(255,255,255,.06);
}
.map-toolbar input{
 flex: 1; min-width: 200px;
 padding: 9px 14px; border-radius: 11px;
 border: 1px solid rgba(255,255,255,.12);
 background: rgba(15,23,42,.65); color: var(--ink);
 font-size: 12.5px; transition: border-color .2s, box-shadow .2s;
}
.map-toolbar input:focus{
 outline: none; border-color: rgba(56,189,248,.6);
 box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}
.map-toolbar button{
 padding: 9px 14px; border-radius: 11px; font-size: 12.5px;
 border: 1px solid rgba(255,255,255,.16);
 background: rgba(255,255,255,.06); color: var(--ink);
 cursor: pointer; font-weight: 600; transition: all .2s var(--bounce);
}
.map-toolbar button:hover{ transform: translateY(-1px); }
.map-toolbar button.primary{
 background: var(--grad-brand); color: #fff;
 border-color: rgba(255,255,255,.25);
 box-shadow: 0 6px 16px rgba(31,58,138,.4);
}
.map-toolbar button.primary:disabled{
 opacity: .55; cursor: not-allowed; box-shadow: none;
}
.map-info{
 font-size: 11.5px; color: var(--ink-mute);
 font-family: 'Courier New', monospace;
}

.map-canvas{
 flex: 1; position: relative; background: #0a1126;
}

.map-footer{
 padding: 10px 18px; font-size: 11.5px; color: var(--ink-mute);
 border-top: 1px solid rgba(255,255,255,.06);
 background: rgba(0,0,0,.2);
}

/* Centroid pulse marker on map */
.aibhoomi-pulse{
 width: 16px; height: 16px;
 border-radius: 50%;
 background: #34d399;
 border: 2px solid #fff;
 box-shadow: 0 0 0 0 rgba(52,211,153,.7);
 animation: aibhoomi-ring 1.4s ease-out infinite;
}
@keyframes aibhoomi-ring{
 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.7); }
 70% { box-shadow: 0 0 0 22px rgba(52,211,153,0); }
 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.shutter-flash{
 position:absolute; inset:0; background:#fff; opacity:0;
 pointer-events:none; z-index:50;
 animation: shutter .55s ease-out forwards;
}
@keyframes shutter{
 0% { opacity: 0; }
 20% { opacity: .85; }
 100% { opacity: 0; }
}

/* ───────────── Farmer Form Side Panel ───────────── */
.form-panel{
 position: fixed; top: 14px; right: -460px; bottom: 14px;
 width: 440px; max-width: 92vw;
 border-radius: 22px;
 border: var(--glass-border);
 background: var(--glass-bg);
 backdrop-filter: var(--glass-blur);
 box-shadow: 0 30px 60px rgba(0,0,0,.55);
 display: flex; flex-direction: column; overflow: hidden;
 z-index: 80;
 transition: right .55s var(--bounce);
}
.form-panel.open{ right: 14px; }

.fp-head{
 padding: 16px 20px;
 display: flex; justify-content: space-between; align-items: center;
 border-bottom: 1px solid rgba(255,255,255,.08);
}
.fp-head h3{
 background: linear-gradient(90deg, #fff, #fbbf24);
 background-clip: text; -webkit-background-clip: text; color: transparent;
 font-size: 16px;
}

.fp-body{ flex: 1; overflow-y: auto; padding: 16px 20px; }
.fp-body fieldset{
 border: 1px solid rgba(255,255,255,.10); border-radius: 14px;
 padding: 12px 14px 10px; margin-bottom: 14px;
 background: rgba(255,255,255,.025);
 transition: border-color .2s, transform .25s var(--ease);
}
.fp-body fieldset:hover{
 border-color: rgba(56,189,248,.30);
 transform: translateY(-1px);
}
.fp-body legend{
 padding: 0 8px; font-size: 11.5px; color: var(--accent);
 font-weight: 600; letter-spacing: .8px; text-transform: uppercase;
}
.fp-body label{
 display: flex; flex-direction: column; gap: 4px;
 margin: 8px 0; font-size: 12px; color: var(--ink-mute);
}
.fp-body input, .fp-body select{
 padding: 9px 12px;
 border: 1px solid rgba(255,255,255,.12);
 border-radius: 11px;
 background: rgba(15,23,42,.65);
 color: var(--ink); font-size: 13px; font-family: inherit;
 transition: border-color .2s, box-shadow .2s;
}
.fp-body input:focus, .fp-body select:focus{
 outline: none;
 border-color: rgba(56,189,248,.6);
 box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}
.grid2{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.crops{
 display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px;
 font-size: 12px;
}
.crops label{ display: flex; align-items: center; gap: 6px; flex-direction: row; }
.crops input{ width: auto; }

.fp-foot{
 padding: 14px 20px;
 border-top: 1px solid rgba(255,255,255,.08);
 background: linear-gradient(0deg, rgba(0,0,0,.20), transparent);
}
.fp-foot .primary{
 width: 100%;
 padding: 14px; border-radius: 14px; border: 0;
 background: var(--grad-brand); color: #fff;
 font-weight: 700; font-size: 14px; cursor: pointer;
 box-shadow: 0 12px 28px rgba(31,58,138,.55),
 inset 0 1px 0 rgba(255,255,255,.30);
 transition: transform .25s var(--bounce);
}
.fp-foot .primary:hover{
 transform: translateY(-2px) scale(1.02);
}
.fp-foot .primary:disabled{ opacity: .6; cursor: wait; }

/* Form auto-fill flash */
.fp-body input.flash{
 animation: field-flash 1.2s var(--ease);
}
@keyframes field-flash{
 0% { background: rgba(34,197,94,.35); border-color: rgba(34,197,94,.6); }
 100% { background: rgba(15,23,42,.65); }
}

/* ───────────── Slide-in animations ───────────── */
@keyframes slideIn-L{
 from{ transform: translateX(-40px); opacity: 0; }
 to { transform: translateX(0); opacity: 1; }
}
@keyframes slideIn-R{
 from{ transform: translateX(40px); opacity: 0; }
 to { transform: translateX(0); opacity: 1; }
}

/* ───────────── PDF Loading Overlay ───────────── */
.pdf-overlay{
 position: fixed; inset: 0;
 background: rgba(2,8,23,.72);
 backdrop-filter: blur(10px);
 z-index: 200;
 display: grid; place-items: center;
 animation: fade-in .3s var(--ease);
}
.pdf-overlay-card{
 padding: 32px 40px;
 border-radius: 22px; border: var(--glass-border);
 background: var(--glass-bg);
 backdrop-filter: var(--glass-blur);
 box-shadow: 0 30px 80px rgba(0,0,0,.7);
 text-align: center; max-width: 420px;
 animation: scale-in .5s var(--bounce);
}
.pdf-overlay-card .ring{
 width: 64px; height: 64px; margin: 0 auto 18px;
 border: 4px solid rgba(255,255,255,.12);
 border-top: 4px solid var(--accent);
 border-radius: 50%;
 animation: spin 1s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }
.pdf-overlay-card h4{
 font-size: 17px; font-weight: 700;
 background: linear-gradient(90deg, #fff, #34d399);
 background-clip: text; -webkit-background-clip: text; color: transparent;
 margin-bottom: 6px;
}
.pdf-overlay-card p{ font-size: 12.5px; color: var(--ink-mute); }
.pdf-overlay-card .step{
 margin-top: 10px; font-size: 11px; color: var(--accent);
 font-family: 'Courier New', monospace;
}

/* ───────────── Toast / status ───────────── */
.toast{
 position: fixed; bottom: 30px; left: 50%;
 transform: translateX(-50%);
 padding: 12px 20px; border-radius: 14px;
 border: 1px solid rgba(34,197,94,.35);
 background: rgba(20,83,45,.85);
 backdrop-filter: blur(14px);
 color: #d1fae5; font-size: 13px; font-weight: 600;
 box-shadow: 0 12px 30px rgba(0,0,0,.5);
 z-index: 250;
 animation: toast-up .4s var(--bounce), toast-down .4s var(--ease) 3.4s forwards;
}
.toast.error{
 border-color: rgba(248,113,113,.35);
 background: rgba(127,29,29,.85);
 color: #fecaca;
}
@keyframes toast-up{
 from{ transform: translate(-50%, 30px); opacity: 0; }
 to { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes toast-down{
 to{ transform: translate(-50%, 30px); opacity: 0; }
}

/* ───────────── Responsive ───────────── */
@media (max-width: 980px){
 body{ grid-template-columns: 1fr; }
 .sidebar{ display: none; }
 .main{ margin: 8px; }
}


/* ───────────── Sector Results Panel + QGIS-style Scan ───────────── */
.sect-results{
 position: absolute; top: 64px; right: 14px; bottom: 60px;
 width: 340px;
 border-radius: 18px;
 border: 1px solid rgba(255,255,255,.18);
 background: rgba(15,23,42,.78);
 backdrop-filter: saturate(180%) blur(18px);
 -webkit-backdrop-filter: saturate(180%) blur(18px);
 box-shadow: 0 24px 60px rgba(0,0,0,.55),
 inset 0 1px 0 rgba(255,255,255,.08);
 display: flex; flex-direction: column;
 z-index: 5;
 overflow: hidden;
 animation: sect-slide-in .55s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes sect-slide-in{
 from{ transform: translateX(40px); opacity: 0; }
 to { transform: translateX(0); opacity: 1; }
}
.sect-results .sr-head{
 padding: 14px 18px 10px;
 font-weight: 700; font-size: 14px; color: #fff;
 border-bottom: 1px solid rgba(255,255,255,.10);
 background: linear-gradient(135deg, rgba(15,118,110,.28), transparent);
}
.sect-results .sr-head small{
 display: block; font-weight: 500; font-size: 10.5px;
 color: var(--ink-mute); margin-top: 3px; font-style: italic;
}
.sect-results .sr-summary{
 display: grid; grid-template-columns: repeat(4, 1fr);
 gap: 6px; padding: 10px 14px;
 border-bottom: 1px solid rgba(255,255,255,.08);
 background: rgba(15,118,110,.10);
}
.sect-results .sr-summary > div{
 text-align: center;
 background: rgba(255,255,255,.04);
 padding: 6px 4px; border-radius: 9px;
}
.sect-results .sr-summary b{
 display: block; font-size: 16px; color: #34d399; line-height: 1.1;
}
.sect-results .sr-summary small{
 display: block; font-size: 9px; color: var(--ink-mute);
 margin-top: 1px; text-transform: uppercase; letter-spacing: .5px;
}
.sect-results .sr-body{
 flex: 1; overflow-y: auto;
 padding: 8px 12px;
}
.sect-results .sr-row{
 display: grid; grid-template-columns: 44px 1fr 1.05fr;
 gap: 8px; align-items: center;
 padding: 8px 10px; margin: 4px 0;
 border-radius: 11px;
 background: rgba(255,255,255,.03);
 border: 1px solid rgba(255,255,255,.06);
 border-left: 3px solid var(--c, #9aa0a6);
 transition: transform .18s ease, background .18s ease;
}
.sect-results .sr-row:hover{
 transform: translateX(-2px);
 background: rgba(56,189,248,.10);
}
.sect-results .sr-code{
 font-family: 'Courier New', monospace;
 font-size: 16px; font-weight: 700; color: var(--c);
 text-align: center;
}
.sect-results .sr-score{
 font-size: 18px; font-weight: 700; color: #fff; line-height: 1;
}
.sect-results .sr-score small{
 font-size: 11px; opacity: .55; font-weight: 500;
}
.sect-results .sr-verd{
 font-size: 10px; color: var(--c); margin-top: 1px;
}
.sect-results .sr-stats{
 font-size: 10.5px; color: var(--ink); line-height: 1.35;
 text-align: right; font-family: 'Courier New', monospace;
}
.sect-results .sr-stats small{ color: var(--ink-mute); }
.sect-results .sr-foot{
 padding: 12px 14px;
 border-top: 1px solid rgba(255,255,255,.08);
 display: flex; flex-direction: column; gap: 6px;
 background: linear-gradient(0deg, rgba(0,0,0,.3), transparent);
}
.sect-results .sr-btn{
 padding: 11px 14px;
 border-radius: 12px;
 border: 1px solid rgba(255,255,255,.16);
 background: rgba(255,255,255,.06);
 color: #fff; font-weight: 600; font-size: 12.5px;
 cursor: pointer; font-family: inherit;
 transition: transform .25s var(--bounce), background .25s ease;
}
.sect-results .sr-btn.primary{
 background: var(--grad-brand);
 border-color: rgba(255,255,255,.25);
 box-shadow: 0 8px 20px rgba(31,58,138,.45);
}
.sect-results .sr-btn:hover{ transform: translateY(-2px) scale(1.02); }
.sect-results .sr-btn.ghost:hover{
 background: rgba(56,189,248,.16);
 border-color: rgba(56,189,248,.35);
}
.sect-results .sr-loading{
 flex: 1; display: grid; place-items: center;
 text-align: center; padding: 20px;
}
.sect-results .sr-loading p{
 color: var(--ink-mute); font-size: 12px; margin-top: 12px;
 line-height: 1.5;
}
.sect-results .sr-ring{
 width: 56px; height: 56px;
 border: 4px solid rgba(255,255,255,.10);
 border-top: 4px solid #34d399;
 border-radius: 50%;
 animation: spin 1s linear infinite;
 margin: 0 auto;
}
.sect-results .sr-body::-webkit-scrollbar{ width:5px }
.sect-results .sr-body::-webkit-scrollbar-thumb{
 background: rgba(255,255,255,.1); border-radius: 5px;
}

/* ── QGIS-style sweeping scan line over the map ────────────────── */
.aibhoomi-scan{
 position: absolute; left: 0; right: 0; top: 0;
 height: 4px; pointer-events: none;
 background: linear-gradient(90deg,
 transparent 0%,
 rgba(56,189,248,.4) 12%,
 rgba(34,211,153,.85) 50%,
 rgba(56,189,248,.4) 88%,
 transparent 100%);
 filter: drop-shadow(0 0 14px rgba(34,211,153,.95))
 drop-shadow(0 0 28px rgba(56,189,248,.55));
 z-index: 4;
 animation: aibhoomi-sweep 4.5s linear infinite;
}
@keyframes aibhoomi-sweep{
 0% { transform: translateY(0); opacity: 0; }
 10% { opacity: 1; }
 90% { opacity: 1; }
 100% { transform: translateY(min(640px, 90vh)); opacity: 0; }
}

/* The capture-time pulse marker styles (already used by map_modal.js) */
.aibhoomi-pulse-wrap{
 width: 18px; height: 18px; position: relative;
}
.aibhoomi-pulse-wrap .dot{
 position: absolute; inset: 4px;
 background: #34d399; border-radius: 50%;
 border: 2px solid #fff;
 box-shadow: 0 0 6px rgba(52,211,153,.8);
}
.aibhoomi-pulse-wrap .ring,
.aibhoomi-pulse-wrap .ring.r2{
 position: absolute; inset: 0;
 border: 2px solid rgba(52,211,153,.7);
 border-radius: 50%;
 animation: aibhoomi-ring-pulse 1.6s ease-out infinite;
}
.aibhoomi-pulse-wrap .ring.r2{ animation-delay: .8s; }
@keyframes aibhoomi-ring-pulse{
 0% { transform: scale(.8); opacity: .9; }
 100% { transform: scale(2.6); opacity: 0; }
}

/* hide on small screens to keep map usable */
@media (max-width: 880px){
 .sect-results{ display: none; }
}


/* ───────────── SVG icon sizing (prevents auto-fill bloat) ───────────── */
svg.ic {
 width: 16px;
 height: 16px;
 flex-shrink: 0;
 vertical-align: middle;
 stroke-linecap: round;
 stroke-linejoin: round;
 display: inline-block;
}
.brand .logo svg { width: 22px; height: 22px; color: #fff; }

button.new-chat,
button.form-toggle,
.map-toolbar button,
.fp-foot .primary,
#send,
.composer button {
 display: inline-flex;
 align-items: center;
 gap: 8px;
 line-height: 1.25;
}
button.new-chat svg.ic,
button.form-toggle svg.ic,
.map-toolbar button svg.ic,
.fp-foot .primary svg.ic,
#send svg.ic,
.composer button svg.ic {
 width: 16px; height: 16px;
}
button.close svg.ic {
 width: 14px; height: 14px;
}
button.close { padding: 0; display: grid; place-items: center; }
.brand .logo {
 width: 44px; height: 44px;
 display: grid; place-items: center;
}
.bubble svg.ic { width: 14px; height: 14px; }
button#send svg.ic { width: 18px; height: 18px; }

/* ───────────── Bigger map, tighter results panel ───────────── */
.map-modal-inner {
 width: min(96vw, 1480px);
 height: min(92vh, 940px);
}
.map-canvas { min-height: 480px; }

/* Results panel — narrower so map gets more breathing room */
.sect-results {
 width: 320px;
 max-width: 30vw;
}
@media (max-width: 1100px) {
 .sect-results { width: 270px; max-width: 36vw; }
}
@media (max-width: 880px) {
 .sect-results { display: none; }
}

/* Live preview sector grid (white outlines drawn before capture) */
.aibhoomi-preview-tip {
 position: absolute;
 bottom: 12px; left: 14px;
 background: rgba(15, 23, 42, .85);
 backdrop-filter: blur(10px);
 padding: 7px 12px;
 border-radius: 10px;
 border: 1px solid rgba(34, 211, 153, .35);
 color: #d1fae5; font-size: 12px;
 font-weight: 600;
 z-index: 4;
 pointer-events: none;
 animation: msg-in .3s var(--ease);
}
.aibhoomi-preview-tip b { color: #34d399; }

/* Screenshot thumb in results panel */
.sr-thumb {
 width: 100%;
 height: 110px;
 margin: 8px 0 4px;
 border-radius: 10px;
 object-fit: cover;
 border: 1px solid rgba(255, 255, 255, .12);
}


/* ───────────── Sector mini-table inside chat bubble ───────────── */
.bubble .sect-mini {
 margin-top: 10px;
 font-size: 11px;
 border-collapse: collapse;
 width: 100%;
 background: rgba(0,0,0,.30);
 border-radius: 10px;
 overflow: hidden;
}
.bubble .sect-mini th {
 background: rgba(56,189,248,.18);
 color: #93c5fd;
 font-weight: 600;
 padding: 6px 8px;
 text-align: left;
 border-bottom: 1px solid rgba(255,255,255,.10);
 font-size: 10.5px;
}
.bubble .sect-mini td {
 padding: 5px 8px;
 border-bottom: 1px solid rgba(255,255,255,.06);
 color: var(--ink);
 font-family: 'Courier New', monospace;
 font-size: 11px;
}
.bubble .sect-mini tr:last-child td {
 border-bottom: 0;
}
.bubble .sect-mini tr:hover td {
 background: rgba(56,189,248,.08);
}

/* ───────────── Sector Score Bars ───────────── */
.sector-bar-wrap {
 position: relative;
 width: 80px;
 height: 18px;
 background: rgba(255,255,255,.06);
 border-radius: 9px;
 overflow: hidden;
}
.sector-bar {
 position: absolute;
 top: 0; left: 0;
 height: 100%;
 border-radius: 9px;
 transition: width 0.8s cubic-bezier(.4,0,.2,1);
 animation: sector-bar-fill 1s ease-out forwards;
}
.sector-bar-label {
 position: absolute;
 top: 0; left: 0; right: 0;
 text-align: center;
 font-size: 10px;
 font-weight: 700;
 line-height: 18px;
 color: #fff;
 text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
@keyframes sector-bar-fill {
 from { width: 0; }
}

/* ───────────── PDF Report Card in Chat ───────────── */
.pdf-report-card {
 background: rgba(16, 185, 129, 0.08);
 border: 1px solid rgba(16, 185, 129, 0.25);
 border-radius: 14px;
 padding: 16px;
 margin-top: 8px;
}
.pdf-report-card h4 {
 margin: 0 0 12px 0;
 font-size: 14px;
 color: #10b981;
}
.report-stats {
 display: flex;
 gap: 16px;
 margin-bottom: 12px;
}
.report-stats .stat {
 display: flex;
 flex-direction: column;
 align-items: center;
 padding: 8px 12px;
 background: rgba(255,255,255,.04);
 border-radius: 10px;
 border: 1px solid rgba(255,255,255,.08);
}
.report-stats .stat-val {
 font-size: 18px;
 font-weight: 700;
 color: #fff;
}
.report-stats .stat-lbl {
 font-size: 10px;
 color: #94a3b8;
 margin-top: 2px;
}
.pdf-report-card .actions {
 display: flex;
 gap: 10px;
 margin-top: 12px;
}
.pdf-report-card .btn {
 display: inline-flex;
 align-items: center;
 gap: 6px;
 padding: 8px 16px;
 border-radius: 10px;
 font-size: 12px;
 font-weight: 600;
 cursor: pointer;
 text-decoration: none;
 border: none;
 transition: all 0.2s ease;
}
.pdf-report-card .btn.primary {
 background: linear-gradient(135deg, #10b981, #059669);
 color: #fff;
}
.pdf-report-card .btn.primary:hover {
 transform: translateY(-2px);
 box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.pdf-report-card .btn.alt {
 background: rgba(255,255,255,.08);
 color: #e2e8f0;
 border: 1px solid rgba(255,255,255,.12);
}
.pdf-report-card .btn.alt:hover {
 background: rgba(255,255,255,.14);
}

/* ───────────── Print Report button — primary action ───────────── */
.bubble .actions button.primary {
 background: var(--grad-brand);
 color: #fff;
 font-weight: 700;
 border-color: rgba(255,255,255,.30);
 box-shadow: 0 6px 16px rgba(31,58,138,.40);
}
.bubble .actions button.s3 {
 background: rgba(34,211,153,.16);
 border-color: rgba(34,211,153,.35);
 color: #d1fae5;
}


/* ───────────── Brand + partner logos in the sidebar ───────────── */
.brand-logo-img {
 width: 48px;
 height: 48px;
 border-radius: 14px;
 object-fit: contain;
 background: #fff;
 padding: 4px;
 box-shadow: 0 8px 22px rgba(15, 118, 110, .35),
 inset 0 1px 0 rgba(255, 255, 255, .8);
 animation: float 5s ease-in-out infinite;
}
.partner-strip {
 display: flex; gap: 8px; justify-content: center; align-items: center;
 margin-bottom: 10px;
 padding: 8px 6px;
 background: rgba(255, 255, 255, .04);
 border: 1px solid rgba(255, 255, 255, .08);
 border-radius: 10px;
}
.partner-strip img {
 height: 18px;
 width: auto;
 object-fit: contain;
 filter: brightness(1.3) saturate(1.05) opacity(.92);
}
.rurtech-mini {
 display: flex; align-items: center; gap: 8px;
 background: linear-gradient(90deg, rgba(11,20,48,.85), rgba(31,58,138,.55));
 border: 1px solid rgba(34, 211, 153, .25);
 border-radius: 10px;
 padding: 6px 10px;
 margin-bottom: 6px;
 font-size: 10.5px;
 color: #d1fae5;
}
.rurtech-mini img {
 height: 24px;
 width: auto;
 background: #fff;
 border-radius: 5px;
 padding: 2px 4px;
}
.rurtech-mini b { color: #34d399; }
.govt-mini {
 font-size: 9.5px; color: var(--ink-soft);
 text-align: center; padding-top: 4px;
 border-top: 1px solid rgba(255, 255, 255, .06);
}

/* Ambient Startup-India watermark on the page background */
body::before {
 background-image:
 radial-gradient(circle at 30% 30%, #1e40af55 0%, transparent 50%),
 radial-gradient(circle at 70% 70%, #16a34a40 0%, transparent 55%),
 url('/static/logos/startup_india.png');
 background-size: cover, cover, 280px;
 background-position: center, center, calc(100% - 30px) calc(100% - 30px);
 background-repeat: no-repeat, no-repeat, no-repeat;
 opacity: .85;
}


/* ═══════════════════════════════════════════════════════════════════════
 NDVI Satellite Overlay — Sentinel-2 Crop Detection Animations
 ═══════════════════════════════════════════════════════════════════════ */

/* Acquisition scan animation (shows while data is being fetched) */
.ndvi-acquisition-scan {
 position: absolute; inset: 0; pointer-events: none; z-index: 10;
 overflow: hidden;
}
.ndvi-scan-line {
 position: absolute; left: 0; right: 0; top: 0;
 height: 3px;
 background: linear-gradient(90deg,
 transparent 0%, #00e676 20%, #76ff03 50%, #00e676 80%, transparent 100%);
 box-shadow: 0 0 20px rgba(0, 230, 118, 0.8), 0 0 60px rgba(0, 230, 118, 0.4);
 animation: ndvi-sweep 2.4s ease-in-out infinite;
}
.ndvi-scan-label {
 position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
 background: rgba(0, 20, 40, 0.92);
 border: 1px solid rgba(0, 230, 118, 0.6);
 border-radius: 12px;
 padding: 12px 20px;
 color: #a7f3d0;
 font-size: 13px;
 font-family: 'Inter', monospace;
 letter-spacing: 0.3px;
 backdrop-filter: blur(8px);
 display: flex; align-items: center; gap: 10px;
 animation: ndvi-pulse-glow 1.5s ease-in-out infinite alternate;
}
.ndvi-scan-dot {
 width: 8px; height: 8px; border-radius: 50%;
 background: #00e676;
 animation: ndvi-dot-blink 0.8s ease infinite;
}

/* Persistent subtle scan line while NDVI overlay is active */
.ndvi-persistent-scan {
 position: absolute; left: 0; right: 0; top: 0;
 height: 2px; pointer-events: none; z-index: 5;
 background: linear-gradient(90deg,
 transparent 0%, rgba(0,230,118,0.3) 30%, rgba(118,255,3,0.5) 50%,
 rgba(0,230,118,0.3) 70%, transparent 100%);
 animation: ndvi-sweep 6s linear infinite;
 will-change: transform, opacity;
}

/* Legend */
.ndvi-legend {
 position: absolute; bottom: 20px; left: 16px; z-index: 8;
 background: rgba(5, 11, 26, 0.92);
 border: 1px solid rgba(52, 211, 153, 0.4);
 border-radius: 12px;
 padding: 14px 16px;
 min-width: 200px;
 backdrop-filter: blur(12px);
 animation: ndvi-slide-up 0.5s var(--ease) forwards;
}
.ndvi-legend-title {
 font-size: 13px; font-weight: 700; color: #e8edf7;
 margin-bottom: 10px;
}
.ndvi-legend-ramp {
 height: 12px; border-radius: 6px;
 background: linear-gradient(90deg,
 #3c508c 0%, #a0643c 17%, #dcc832 33%, #78c832 50%,
 #1eb41e 67%, #006400 100%);
 margin-bottom: 4px;
}
.ndvi-legend-labels {
 display: flex; justify-content: space-between;
 font-size: 10px; color: #94a3b8; margin-bottom: 8px;
}
.ndvi-legend-row {
 display: flex; align-items: center; gap: 8px;
 font-size: 11px; color: #cbd5e1; margin-bottom: 4px;
}
.ndvi-legend-row span {
 width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0;
}
.ndvi-legend-note {
 font-size: 10px; color: #64748b; margin-top: 8px;
 font-style: italic; border-top: 1px solid rgba(255,255,255,0.1);
 padding-top: 6px;
}

/* Provenance chain */
.ndvi-provenance {
 position: absolute; top: 12px; left: 12px; right: 12px; z-index: 8;
 background: rgba(5, 11, 26, 0.88);
 border: 1px solid rgba(0, 230, 118, 0.3);
 border-radius: 10px;
 padding: 10px 14px;
 backdrop-filter: blur(8px);
 animation: ndvi-slide-down 0.5s var(--ease) forwards;
}
.ndvi-prov-chain {
 display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
 font-size: 11px; color: #a7f3d0;
}
.ndvi-prov-step {
 background: rgba(0, 230, 118, 0.1);
 border: 1px solid rgba(0, 230, 118, 0.3);
 border-radius: 6px;
 padding: 3px 8px;
 font-weight: 500;
}
.ndvi-prov-arrow { color: #4ade80; font-size: 14px; }
.ndvi-prov-formula {
 background: rgba(34, 197, 94, 0.15);
 border-color: rgba(34, 197, 94, 0.5);
 font-family: 'JetBrains Mono', monospace;
 font-size: 10px;
}
.ndvi-prov-final {
 background: rgba(34, 211, 153, 0.2);
 border-color: #34d399;
 color: #6ee7b7;
 font-weight: 700;
}
.ndvi-prov-meta {
 font-size: 10px; color: #64748b; margin-top: 6px;
}

/* Fade out class */
.ndvi-fade-out {
 animation: ndvi-fade 0.4s ease forwards;
}

/* ── Keyframes ────────────────────────────────────────── */
@keyframes ndvi-sweep {
 0% { transform: translateY(-3px); opacity: 0.3; }
 8% { opacity: 0.7; }
 92% { opacity: 0.7; }
 100% { transform: translateY(650px); opacity: 0.3; }
}
@keyframes ndvi-pulse-glow {
 0% { box-shadow: 0 0 10px rgba(0,230,118,0.3); }
 100% { box-shadow: 0 0 25px rgba(0,230,118,0.6), 0 0 60px rgba(0,230,118,0.2); }
}
@keyframes ndvi-dot-blink {
 0%, 100% { opacity: 1; }
 50% { opacity: 0.3; }
}
@keyframes ndvi-slide-up {
 from { opacity: 0; transform: translateY(20px); }
 to { opacity: 1; transform: translateY(0); }
}
@keyframes ndvi-slide-down {
 from { opacity: 0; transform: translateY(-15px); }
 to { opacity: 1; transform: translateY(0); }
}
@keyframes ndvi-fade {
 from { opacity: 1; }
 to { opacity: 0; }
}


/* ───────────── TTS Auto-Speak Toggle Button ───────────── */
.composer #tts-btn,
.composer #tts-stop-btn {
 width: 44px;
 height: 44px;
 border-radius: 50%;
 border: 2px solid rgba(52, 211, 153, 0.4);
 background: rgba(52, 211, 153, 0.12);
 color: #6ee7b7;
 display: flex;
 align-items: center;
 justify-content: center;
 cursor: pointer;
 transition: all 0.2s ease;
 margin-right: 6px;
 flex-shrink: 0;
}
.composer #tts-btn:hover {
 background: rgba(52, 211, 153, 0.25);
 border-color: rgba(52, 211, 153, 0.75);
 box-shadow: 0 0 12px rgba(52, 211, 153, 0.3);
 transform: scale(1.06);
}
.composer #tts-btn.tts-off {
 border-color: rgba(255,255,255,.12);
 background: rgba(255,255,255,.04);
 color: #64748b;
}
.composer #tts-stop-btn {
 border-color: rgba(239, 68, 68, 0.5);
 background: rgba(239, 68, 68, 0.15);
 color: #fca5a5;
 animation: tts-stop-pulse 1.4s ease-in-out infinite;
}
.composer #tts-btn .ic,
.composer #tts-stop-btn .ic { width: 18px; height: 18px; }

@keyframes tts-stop-pulse {
 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
 50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* AI avatar glow while speaking */
.ai-av.speaking {
 background: linear-gradient(135deg, #34d399, #059669) !important;
 box-shadow: 0 0 0 3px rgba(52,211,153,.35),
 0 0 18px rgba(52,211,153,.5);
 animation: tts-avatar-breathe 1.6s ease-in-out infinite;
}
@keyframes tts-avatar-breathe {
 0%, 100% { box-shadow: 0 0 0 3px rgba(52,211,153,.35), 0 0 12px rgba(52,211,153,.4); }
 50% { box-shadow: 0 0 0 6px rgba(52,211,153,.2), 0 0 28px rgba(52,211,153,.6); }
}

/* ───────────── Voice / Microphone Button ───────────── */
.composer #mic-btn {
 width: 52px;
 height: 52px;
 border-radius: 50%;
 border: 2px solid rgba(99, 102, 241, 0.35);
 background: rgba(99, 102, 241, 0.12);
 color: #a5b4fc;
 display: flex;
 align-items: center;
 justify-content: center;
 cursor: pointer;
 transition: all 0.2s ease;
 margin-right: 8px;
 flex-shrink: 0;
 box-shadow: 0 0 0 0 rgba(99,102,241,0);
}
.composer #mic-btn:hover {
 background: rgba(99, 102, 241, 0.25);
 border-color: rgba(99, 102, 241, 0.7);
 color: #c7d2fe;
 box-shadow: 0 0 14px rgba(99,102,241,0.35);
 transform: scale(1.06);
}
.composer #mic-btn .ic {
 width: 24px;
 height: 24px;
}
.composer #mic-btn.recording {
 background: linear-gradient(135deg, #ef4444, #dc2626);
 color: #fff;
 border-color: #ef4444;
 box-shadow: 0 0 18px rgba(239,68,68,0.5);
 animation: mic-pulse 1.2s ease-in-out infinite;
}

@keyframes mic-pulse {
 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
 50% { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
}

/* ───────────── Voice Recording Indicator ───────────── */
.voice-indicator {
 position: fixed;
 bottom: 100px;
 left: 50%;
 transform: translateX(-50%);
 background: rgba(15, 23, 42, 0.95);
 backdrop-filter: blur(16px);
 border: 1px solid rgba(255,255,255,.12);
 border-radius: 24px;
 padding: 12px 24px;
 color: #f1f5f9;
 font-size: 13px;
 font-weight: 500;
 display: flex;
 align-items: center;
 gap: 10px;
 z-index: 9999;
 box-shadow: 0 8px 32px rgba(0,0,0,.4);
 animation: voice-slide-up 0.3s ease-out;
}
.voice-indicator.recording {
 border-color: rgba(239, 68, 68, 0.4);
}
.voice-indicator.processing {
 border-color: rgba(99, 102, 241, 0.4);
}
.voice-indicator .voice-pulse {
 width: 12px;
 height: 12px;
 border-radius: 50%;
 background: #ef4444;
 animation: voice-pulse-dot 0.8s ease-in-out infinite;
}
@keyframes voice-pulse-dot {
 0%, 100% { transform: scale(1); opacity: 1; }
 50% { transform: scale(1.4); opacity: 0.5; }
}
@keyframes voice-slide-up {
 from { transform: translate(-50%, 20px); opacity: 0; }
 to { transform: translate(-50%, 0); opacity: 1; }
}


/* ───────────── Sector-wise Cards with TTS ───────────── */
.sector-cards-wrap {
 margin-top: 14px;
 background: rgba(255,255,255,.03);
 border: 1px solid rgba(255,255,255,.08);
 border-radius: 12px;
 padding: 12px;
}
.sector-cards-header {
 display: flex;
 justify-content: space-between;
 align-items: center;
 margin-bottom: 12px;
 font-size: 13px;
 font-weight: 600;
 color: #e2e8f0;
}
.sector-tts-all {
 background: linear-gradient(135deg, #6366f1, #8b5cf6);
 color: #fff;
 border: none;
 padding: 6px 14px;
 border-radius: 20px;
 font-size: 11px;
 font-weight: 600;
 cursor: pointer;
 transition: all 0.2s ease;
}
.sector-tts-all:hover {
 transform: translateY(-1px);
 box-shadow: 0 4px 12px rgba(139,92,246,.3);
}

.sector-cards {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
 gap: 10px;
}

.sector-card {
 background: rgba(15,23,42,.6);
 border: 1px solid rgba(255,255,255,.08);
 border-radius: 10px;
 padding: 10px 12px;
 transition: all 0.2s ease;
}
.sector-card:hover {
 border-color: rgba(99,102,241,.3);
 background: rgba(15,23,42,.8);
}

.sector-card-head {
 display: flex;
 align-items: center;
 gap: 10px;
 margin-bottom: 8px;
}
.sector-card-code {
 width: 36px;
 height: 36px;
 border-radius: 8px;
 display: flex;
 align-items: center;
 justify-content: center;
 font-weight: 700;
 color: #fff;
 font-size: 13px;
 text-shadow: 0 1px 2px rgba(0,0,0,.4);
 flex-shrink: 0;
}
.sector-card-info {
 flex: 1;
 min-width: 0;
}
.sector-card-title {
 font-size: 13px;
 font-weight: 700;
 color: #f1f5f9;
}
.sector-card-sub {
 font-size: 11px;
 color: #94a3b8;
 margin-top: 2px;
}
.grade {
 display: inline-block;
 padding: 1px 7px;
 border-radius: 10px;
 font-size: 10px;
 font-weight: 700;
 margin-left: 6px;
 vertical-align: middle;
}
.grade-A { background: rgba(22,163,74,.2); color: #4ade80; }
.grade-B { background: rgba(245,158,11,.2); color: #fbbf24; }
.grade-C { background: rgba(239,68,68,.2); color: #f87171; }

.sector-tts-btn {
 width: 32px;
 height: 32px;
 border-radius: 50%;
 border: 1px solid rgba(255,255,255,.12);
 background: rgba(255,255,255,.04);
 color: #cbd5e1;
 cursor: pointer;
 display: flex;
 align-items: center;
 justify-content: center;
 transition: all 0.2s ease;
 flex-shrink: 0;
}
.sector-tts-btn:hover {
 background: rgba(99,102,241,.2);
 color: #a5b4fc;
}
.sector-tts-btn.loading {
 animation: tts-spin 1s linear infinite;
 background: rgba(99,102,241,.3);
}
.sector-tts-btn.playing {
 background: linear-gradient(135deg, #10b981, #059669);
 color: #fff;
}
@keyframes tts-spin {
 to { transform: rotate(360deg); }
}

.sector-card-bar {
 position: relative;
 height: 18px;
 background: rgba(255,255,255,.06);
 border-radius: 9px;
 overflow: hidden;
 margin-bottom: 10px;
}
.sector-card-bar .sector-bar {
 position: absolute;
 top: 0; left: 0;
 height: 100%;
 border-radius: 9px;
 transition: width 0.8s cubic-bezier(.4,0,.2,1);
}
.sector-card-bar .sector-bar-label {
 position: absolute;
 top: 0; left: 0; right: 0;
 text-align: center;
 font-size: 11px;
 font-weight: 700;
 line-height: 18px;
 color: #fff;
 text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.sector-card-grid {
 display: grid;
 grid-template-columns: repeat(4, 1fr);
 gap: 6px;
 margin-bottom: 8px;
}
.sector-card-grid > div {
 background: rgba(255,255,255,.04);
 border-radius: 6px;
 padding: 6px;
 text-align: center;
}
.sector-card-grid .lbl {
 display: block;
 font-size: 9px;
 color: #94a3b8;
 text-transform: uppercase;
 letter-spacing: 0.05em;
}
.sector-card-grid b {
 display: block;
 font-size: 12px;
 color: #f1f5f9;
 margin-top: 2px;
}

.sector-card-dose {
 font-size: 11px;
 color: #cbd5e1;
 background: rgba(99,102,241,.08);
 padding: 6px 8px;
 border-radius: 6px;
 margin-bottom: 6px;
}
.sector-card-dose b {
 color: #a5b4fc;
}
.sector-card-deficits {
 font-size: 11px;
 color: #fbbf24;
 margin-top: 4px;
}
.sector-card-deficits b {
 color: #f59e0b;
 margin-right: 4px;
}


/* ───────────── Email OTP Login Modal ───────────── */
.login-modal {
 position: fixed;
 inset: 0;
 z-index: 10000;
 display: flex;
 align-items: center;
 justify-content: center;
 background: rgba(5, 11, 26, 0.85);
 backdrop-filter: blur(8px);
}
.login-modal.login-hidden { display: none; }

.login-card {
 width: 380px;
 max-width: 92vw;
 background: linear-gradient(160deg, #0f1f3a 0%, #0a1426 100%);
 border: 1px solid rgba(99, 102, 241, 0.3);
 border-radius: 18px;
 padding: 28px;
 box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
 animation: login-pop 0.3s cubic-bezier(.4,0,.2,1);
}
@keyframes login-pop {
 from { transform: translateY(20px) scale(0.96); opacity: 0; }
 to { transform: translateY(0) scale(1); opacity: 1; }
}
.login-head { text-align: center; margin-bottom: 22px; }
.login-logo { font-size: 40px; }
.login-head h2 {
 margin: 8px 0 4px; color: #fff; font-size: 22px; letter-spacing: 0.5px;
}
.login-head p { margin: 0; color: #94a3b8; font-size: 12px; }

.login-body label {
 display: block; color: #cbd5e1; font-size: 12px;
 margin: 12px 0 6px; font-weight: 600;
}
.login-body input {
 width: 100%; box-sizing: border-box;
 padding: 12px 14px; border-radius: 10px;
 border: 1px solid rgba(255,255,255,0.12);
 background: rgba(255,255,255,0.04); color: #f1f5f9;
 font-size: 15px; outline: none; transition: border-color 0.2s;
}
.login-body input:focus { border-color: #6366f1; }
#login-code { letter-spacing: 8px; text-align: center; font-size: 22px; font-weight: 700; }

.login-btn {
 width: 100%; margin-top: 16px; padding: 12px;
 border: none; border-radius: 10px; cursor: pointer;
 background: linear-gradient(135deg, #16a34a, #0a8636);
 color: #fff; font-size: 14px; font-weight: 700;
 transition: transform 0.15s, box-shadow 0.2s;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(22,163,74,0.35); }

.login-link {
 display: block; width: 100%; margin-top: 12px;
 background: none; border: none; color: #818cf8;
 font-size: 12px; cursor: pointer; text-align: center;
}
.login-link:hover { color: #a5b4fc; text-decoration: underline; }

.login-msg { margin-top: 14px; text-align: center; font-size: 13px; color: #e2e8f0; min-height: 18px; }
.login-devcode {
 display: none; margin-top: 10px; text-align: center;
 font-size: 13px; color: #fbbf24;
 background: rgba(245,158,11,0.1); border: 1px dashed rgba(245,158,11,0.4);
 border-radius: 8px; padding: 8px;
}
.login-devcode b { font-size: 18px; letter-spacing: 3px; }
