:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --faint: #94a3b8;
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --danger: #dc2626;
    --font: "Noto Sans", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
.app-main { min-height: 100dvh; }

/* ---------- shell ---------- */
.chat-shell {
    width: 100%; height: clamp(520px, 80dvh, 780px);
    display: flex; flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
    box-shadow: 0 6px 24px rgba(15, 23, 42, .08);
}

.chat-header {
    flex-shrink: 0;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 20px;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.chat-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-title h2 { margin: 0; font-size: 18px; font-weight: 600; }
.chat-title p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.title-icon { font-size: 28px !important; color: var(--primary); }
.chat-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.speak-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }

/* ---------- language selector ---------- */
.lang-select { display: inline-flex; padding: 3px; background: #eef2f7; border-radius: 999px; }
.lang-option {
    border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px;
    padding: 6px 16px; border-radius: 999px; cursor: pointer;
}
.lang-option.selected { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }
.lang-option:focus-visible, .icon-btn:focus-visible, .round-btn:focus-visible, .text-field:focus-visible {
    outline: 2px solid var(--primary-light); outline-offset: 2px;
}

/* ---------- messages ---------- */
.messages {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.msg-row { display: flex; }
.msg-row.user { justify-content: flex-end; }
.msg-row.bot { justify-content: flex-start; }

.bubble {
    max-width: min(72%, 640px);
    padding: 10px 14px; border-radius: 14px;
    overflow-wrap: anywhere; line-height: 1.5; font-size: 15px;
}
.user .bubble { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; border-bottom-right-radius: 4px; box-shadow: 0 2px 8px rgba(59, 130, 246, .25); }
.bot .bubble { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, .05); }
.bubble.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.bubble .plain { white-space: pre-wrap; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.voice-mark { font-size: 16px !important; vertical-align: -3px; margin-right: 4px; opacity: .85; }

.meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; min-height: 24px; }
.time { font-size: 11px; opacity: .65; }
.audio-controls { display: inline-flex; align-items: center; gap: 2px; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: 0; border-radius: 50%;
    background: transparent; color: var(--primary); cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: #eff6ff; }
.icon-btn.light { color: var(--muted); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn .rzi { font-size: 20px; }

.empty { margin: auto; text-align: center; color: var(--faint); padding: 24px; }
.empty .empty-icon { font-size: 72px !important; opacity: .5; }
.empty h3 { margin: 12px 0 4px; font-size: 18px; font-weight: 600; color: var(--muted); }
.empty p { margin: 0; font-size: 14px; }

.typing { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #cbd5e1; border-top-color: var(--primary);
    animation: spin .8s linear infinite; display: inline-block; margin: 0 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- input ---------- */
.chat-footer {
    flex-shrink: 0; background: var(--surface);
    border-top: 1px solid var(--border); box-shadow: 0 -2px 8px rgba(0, 0, 0, .05);
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
}
.input-bar { display: flex; align-items: center; gap: 10px; }
.text-field {
    flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--text);
    background: #f8fafc; border: 1px solid var(--border); border-radius: 24px; padding: 12px 20px;
}
.text-field:disabled { opacity: .6; }

.round-btn {
    flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; border: 1px solid transparent;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.round-btn:disabled { opacity: .45; cursor: default; }
.round-btn.primary { background: linear-gradient(135deg, var(--primary-light), var(--primary)); color: #fff; box-shadow: 0 4px 12px rgba(59, 130, 246, .3); }
.round-btn.ghost { background: #f1f5f9; color: var(--primary); border-color: var(--border); }
.round-btn.ghost:hover:not(:disabled) { background: #e2e8f0; }

.recording-pill {
    flex: 1; display: flex; align-items: center; gap: 10px;
    padding: 12px 20px; border-radius: 24px; background: #fef2f2; color: var(--danger);
    font-size: 15px; font-variant-numeric: tabular-nums;
}
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
    .chat-header { padding: 10px 14px; }
    .chat-title p { display: none; }
    .messages { padding: 14px 12px; }
    .bubble { max-width: 88%; }
    .chat-footer { padding-left: 12px; padding-right: 12px; }
    .speak-toggle span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .spinner, .rec-dot { animation: none; }
}

.bubble .plain.pending { font-style: italic; opacity: .85; }

/* ---------- company dashboard ---------- */
html { scroll-behavior: smooth; }


/* IIA Mumbai landing page */
.landing {
    min-height: 100dvh;
    color: #102942;
    background: #fff;
}

.brand-bar, .landing-grid {
    max-width: 1320px;
    margin-inline: auto;
    padding-inline: clamp(20px, 5vw, 72px);
}

.brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 84px;
    border-bottom: 1px solid #dbe5ee;
}

.brand-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 24px;
}

.brand-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.wordmark { display: block; min-width: 0; }

.wordmark img {
    display: block;
    width: clamp(112px, 15vw, 176px);
    max-width: 100%;
    max-height: 52px;
    object-fit: contain;
    object-position: left center;
}

.landing-intro em { color: #08786f; }
.solutions-link { color: #174a82; font-size: 14px; text-decoration: none; }
.solutions-link span { margin-left: 4px; color: #08786f; }
.solutions-link:hover { text-decoration: underline; }
.wordmark:focus-visible, .solution-link:focus-visible, .solutions-link:focus-visible { outline: 2px solid #08786f; outline-offset: 4px; }

.voice-hero {
    padding: clamp(12px, 3vw, 40px) clamp(12px, 4vw, 56px);
    color: #102942;
    background:
        radial-gradient(ellipse at 12% 85%, #aedcf0 0%, transparent 54%),
        radial-gradient(ellipse at 88% 18%, #ade8d9 0%, transparent 60%),
        linear-gradient(145deg, #eff7ff, #e7edf9);
}

.voice-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(24px, 5vw, 72px);
    max-width: 1200px;
    margin-inline: auto;
    padding: clamp(28px, 5vw, 68px);
    border: 1px solid #fff;
    border-radius: clamp(24px, 4vw, 52px);
    background: linear-gradient(150deg, #ffffffcb, #ffffff5c 70%);
    box-shadow: inset 0 1px 4px #fff, 0 16px 48px #27466d1c;
    -webkit-backdrop-filter: blur(20px) saturate(130%);
    backdrop-filter: blur(20px) saturate(130%);
}

.voice-hero h1 {
    max-width: 16ch;
    margin: 0;
    font-size: clamp(36px, 5.4vw, 72px);
    font-weight: 700;
    letter-spacing: -.045em;
    line-height: 1.05;
    text-wrap: balance;
}

.voice-hero p {
    max-width: 44ch;
    margin: 18px 0 24px;
    color: #304e64;
    font-size: clamp(16px, 1.7vw, 19px);
    line-height: 1.55;
}

.voice-hero-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    font-weight: 600;
}

.voice-hero-actions a:focus-visible { outline: 2px solid #174a82; outline-offset: 4px; }

.voice-hero-primary {
    padding: 10px 30px;
    border: 1px solid #fff;
    border-radius: 999px;
    color: #102942;
    background: linear-gradient(175deg, #f8fffc 4%, #c2f5e7 46%, #89dece 100%);
    box-shadow: inset 0 1px 3px #fff, 0 5px 16px #1c72632b;
    text-decoration: none;
}

.voice-hero-primary:hover {
    color: #102942;
    background: linear-gradient(175deg, #fff 4%, #d5fff4 46%, #a2eadd 100%);
}

.voice-hero-primary > span { display: flex; }
.voice-hero-primary .rzi { font-size: 22px; }

.voice-hero-preview {
    position: relative;
    width: 100%;
    max-width: 480px;
    justify-self: end;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid #fff;
    border-radius: clamp(17px, 3vw, 34px);
    background: #18434c;
    box-shadow: 0 14px 30px #19364e38, 0 0 0 5px #ffffff70;
}

.voice-hero-preview::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 5px #ffffffa8;
    content: "";
    pointer-events: none;
}

.voice-hero-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 32%;
}

.voice-hero-preview-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 6px 12px;
    border: 1px solid #ffffff70;
    border-radius: 999px;
    background: #102942db;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
}

@media (max-width: 640px) {
    .voice-hero-inner { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 15px; }
    .voice-hero h1 { font-size: clamp(32px, 8vw, 40px); }
    .voice-hero p { margin-block: 12px 16px; }
    .voice-hero-primary { width: 100%; }
    .voice-hero-preview { grid-row: 1; justify-self: start; max-width: none; height: clamp(145px, 42vw, 220px); }
}

.landing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
    align-items: center;
    gap: clamp(32px, 5vw, 80px);
    padding-block: clamp(32px, 6vh, 68px);
}

.event-label {
    margin: 0 0 22px;
    color: #08786f;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.landing-intro h2 {
    margin: 0;
    font-size: clamp(48px, 5.8vw, 84px);
    font-weight: 700;
    letter-spacing: -.065em;
    line-height: 1;
}

.landing-intro em { font-style: normal; }
.intro-copy {
    max-width: 65ch;
    margin: 24px 0 28px;
    color: #435b70;
    font-size: 16px;
    line-height: 1.7;
}

.starter-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.starter-topics p { width: 100%; margin: 0 0 4px; color: #435b70; font-size: 13px; }
.starter-topics button {
    color: #174a82;
    background: #f5f9fc;
    border: 1px solid #dbe5ee;
    border-radius: 999px;
    padding: 8px 12px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.starter-topics button span { margin-left: 4px; color: #08786f; }
.starter-topics button:hover:not(:disabled) { background: #e8f7f5; border-color: #08786f; }
.starter-topics button:focus-visible { outline: 2px solid #08786f; outline-offset: 3px; }
.starter-topics button:disabled { opacity: .55; cursor: default; }

.landing .chat-shell {
    --primary: #174a82;
    --primary-light: #2666a6;
    color: var(--text);
    height: clamp(530px, 78dvh, 740px);
    border-radius: 22px;
    box-shadow: 0 22px 60px #1029421a;
}

@media (max-width: 860px) {
    .landing-grid { grid-template-columns: minmax(0, 1fr); }
    .landing-intro h2 { max-width: 13ch; }
    .landing-intro br { display: none; }
}

@media (max-width: 420px) {
    .brand-bar { flex-wrap: wrap; gap: 4px 16px; padding-block: 10px; }
    .brand-links { justify-content: flex-start; }
    .landing-intro h2 { font-size: clamp(38px, 12vw, 48px); }
}

.solutions {
    background: #fff;
    border-top: 1px solid #dbe5ee;
    color: #102942;
    scroll-margin-top: 16px;
}

.solutions-inner {
    max-width: 1320px;
    margin-inline: auto;
    padding: clamp(44px, 7vw, 88px) clamp(20px, 5vw, 72px);
}

.solutions h2 {
    margin: 0;
    font-size: clamp(32px, 4vw, 48px);
    letter-spacing: -.045em;
    line-height: 1.1;
}

.solutions-intro { margin: 14px 0 26px; color: #435b70; }

.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, max(290px, calc((100% - 32px) / 3))), 1fr));
    gap: 16px;
}

.solution-card {
    padding: 24px;
    border: 1px solid #dbe5ee;
    border-radius: 14px;
    background: #fff;
}

.solution-feature { background: #e8f7f5; border-color: #b4dfd9; }
.solution-card h3 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.02em; }
.solution-card p { margin: 0; color: #435b70; font-size: 14px; line-height: 1.6; }
.solution-card .solution-status { margin-bottom: 8px; color: #17655d; font-size: 12px; font-weight: 600; }

.solution-link {
    display: inline-block;
    margin-top: 16px;
    color: #174a82;
    font-size: 14px;
    font-weight: 600;
    text-underline-offset: 3px;
}
.solution-link span { margin-left: 3px; }

@media (hover: hover) {
    .solution-card:hover {
        border-color: #8dc9c3;
        box-shadow: 0 10px 24px #10294214;
    }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .solution-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
    .solution-card:hover { transform: translateY(-4px); }
}
