/* J&K Housing & Urban Development — shared design system.
   Official government-portal look: white masthead with the State emblem,
   navy navigation, tricolour accents, Noto Sans / Noto Serif for Hindi and
   English. Light theme only, so a presenter's dark-mode laptop can't flip it. */
:root {
  --navy-900: #071c3d;
  --navy-800: #0b2a55;
  --navy-700: #123a73;
  --navy-600: #1d4f99;
  --navy-50:  #eef3fb;
  --saffron:  #e8830c;
  --saffron-600: #c96d05;
  --saffron-50:  #fff4e6;
  --green:    #138808;
  --green-600:#11702f;
  --green-50: #eaf6ee;
  --bg:       #f3f5f9;
  --surface:  #ffffff;
  --surface-2:#f7f9fc;
  --line:     #dde3ec;
  --line-2:   #edf1f6;
  --ink:      #0e1a2b;
  --ink-2:    #45546b;
  --ink-3:    #7c889c;
  --danger:   #c62828;
  --danger-50:#fdecec;
  --warn:     #b86e00;
  --success:  #1b7f3b;
  --radius:   12px;
  --radius-lg:16px;
  --shadow-1: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.07);
  --shadow-2: 0 6px 16px rgba(16,24,40,.09);
  --shadow-3: 0 18px 44px rgba(7,28,61,.20);
  --f-sans:   'Anek Latin', 'Anek Devanagari', 'Noto Sans', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-serif:  'Anek Latin', 'Anek Devanagari', 'Noto Serif', 'Noto Serif Devanagari', Georgia, serif;
  color-scheme: light;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--f-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
img { display: block; }
.ic { flex-shrink: 0; display: inline-block; vertical-align: middle; }
:focus-visible { outline: 3px solid rgba(232,131,12,.6); outline-offset: 2px; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
main { flex: 1; width: 100%; }
[hidden] { display: none !important; }

/* ─── Government strip ─── */
.gov-strip { background: var(--navy-900); color: #d6e0f0; font-size: .78rem; }
.gov-strip .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.strip-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.strip-l .sep { opacity: .35; }
.strip-r { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.strip-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.28);
  background: transparent; color: #fff; border-radius: 6px; padding: 4px 10px; font-size: .76rem; font-weight: 600;
}
.strip-btn:hover { background: rgba(255,255,255,.1); }
.strip-btn.off { color: #aebbd2; }
.lang-toggle { display: inline-flex; border: 1px solid rgba(255,255,255,.28); border-radius: 6px; overflow: hidden; }
.lang-btn { border: none; background: transparent; color: #d6e0f0; font-weight: 700; font-size: .76rem; padding: 4px 11px; }
.lang-btn.active { background: #fff; color: var(--navy-800); }
html[lang="hi"] body { font-family: var(--f-sans); }

/* ─── Masthead ─── */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead .container { display: flex; align-items: center; gap: 18px; min-height: 92px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; min-width: 0; }
.brand img { height: 64px; width: auto; }
.brand-rule { width: 1px; align-self: stretch; margin: 18px 0; background: var(--line); }
.brand-hi { font-family: var(--f-serif); font-weight: 700; font-size: 1.24rem; color: var(--navy-800); line-height: 1.3; }
.brand-en { font-family: var(--f-serif); font-weight: 600; font-size: .98rem; color: var(--ink); line-height: 1.3; }
.brand-sub { font-size: .76rem; color: var(--ink-3); letter-spacing: .2px; margin-top: 2px; }
.mast-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.mast-badge {
  display: flex; align-items: center; gap: 12px; padding: 9px 16px 9px 10px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
}
.mast-badge .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--saffron-50); color: var(--saffron-600); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; box-shadow: 0 2px 8px rgba(7,28,61,.08); }
.mast-badge .ico img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.mast-badge b { display: block; font-size: .92rem; color: var(--navy-800); line-height: 1.25; }
.mast-badge small { font-size: .74rem; color: var(--ink-3); }
.tricolor { height: 4px; background: linear-gradient(90deg, #FF9933 0 33.34%, #ffffff 33.34% 66.67%, #138808 66.67%); box-shadow: inset 0 -1px 0 rgba(0,0,0,.04); }

/* ─── Main navigation ─── */
.mainnav { background: var(--navy-800); position: sticky; top: 0; z-index: 60; box-shadow: 0 2px 8px rgba(7,28,61,.25); }
.mainnav .container { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.mainnav .container::-webkit-scrollbar { display: none; }
.mainnav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; color: #d9e3f3; text-decoration: none;
  font-size: .88rem; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent;
}
.mainnav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.mainnav a.active { color: #fff; border-bottom-color: var(--saffron); background: rgba(255,255,255,.08); }
.mainnav .nav-note { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: #ffd29b; font-size: .76rem; font-weight: 700; padding: 0 4px; white-space: nowrap; }

/* ─── Page hero ─── */
.page-hero {
  color: #fff;
  background:
    radial-gradient(900px 360px at 88% -20%, rgba(232,131,12,.22), transparent 60%),
    radial-gradient(700px 300px at 0% 120%, rgba(19,136,8,.16), transparent 60%),
    linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
}
.page-hero .container { display: grid; grid-template-columns: 1.45fr 1fr; gap: 36px; align-items: center; padding-top: 38px; padding-bottom: 40px; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #ffc47f; }
.page-hero h1 { font-family: var(--f-serif); font-weight: 700; font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.25; margin: 10px 0; letter-spacing: -.2px; }
.page-hero p { color: #cfdaee; max-width: 640px; font-size: 1rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-stat { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 9px 16px; min-width: 110px; }
.hero-stat b { display: block; font-size: 1.2rem; line-height: 1.3; }
.hero-stat span { font-size: .74rem; color: #c3cfe4; }
.hero-card { background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-3); }
.hero-card h3 { display: flex; align-items: center; gap: 8px; font-size: .95rem; color: var(--navy-800); margin-bottom: 14px; }
.steps { list-style: none; display: grid; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--saffron-50); color: var(--saffron-600); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; font-size: .85rem; }
.steps b { display: block; font-size: .9rem; color: var(--ink); line-height: 1.35; }
.steps span { font-size: .8rem; color: var(--ink-2); }

/* ─── Sections ─── */
.section { padding: 30px 0 40px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--f-serif); font-size: 1.4rem; font-weight: 700; color: var(--navy-800); display: flex; align-items: center; gap: 12px; }
.section-head h2::before { content: ''; width: 5px; height: 26px; border-radius: 3px; background: linear-gradient(var(--saffron), var(--green)); }
.section-head p { color: var(--ink-2); font-size: .9rem; max-width: 640px; margin-top: 4px; }
.section-note { font-size: .8rem; color: var(--ink-3); font-weight: 600; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 10px 16px;
  background: var(--navy-800); color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.2;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--navy-700); }
.btn:active { transform: translateY(1px); }
.btn.outline { background: var(--surface); color: var(--navy-800); border-color: var(--navy-800); }
.btn.outline:hover { background: var(--navy-50); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--navy-600); background: var(--surface-2); }
.btn.saffron { background: var(--saffron); }
.btn.saffron:hover { background: var(--saffron-600); }
.btn.green { background: var(--green-600); }
.btn.green:hover { background: #0c5a25; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.sm { padding: 7px 12px; font-size: .8rem; border-radius: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 5px 10px; font-size: .78rem; font-weight: 600; color: var(--ink-2);
}
.icon-btn:hover { border-color: var(--navy-600); color: var(--navy-800); }
.round-close {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.round-close:hover { background: var(--surface-2); color: var(--ink); }

/* ─── Service card (citizen) ─── */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.svc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .2s, border-color .2s;
}
.svc-card:hover { box-shadow: var(--shadow-2); border-color: #c8d2e1; }
.svc-head { display: flex; gap: 14px; align-items: flex-start; padding: 18px 18px 14px; border-bottom: 1px solid var(--line-2); }
.mod-ico { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--cl, var(--navy-50)); color: var(--c, var(--navy-800)); flex-shrink: 0; }
.svc-title { font-weight: 700; font-size: 1.04rem; color: var(--ink); line-height: 1.35; }
.svc-desc { font-size: .82rem; color: var(--ink-2); margin-top: 3px; line-height: 1.45; }
.svc-body { padding: 10px 18px 2px; flex: 1; }
.svc-qs-lbl { display: flex; justify-content: space-between; font-size: .7rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-3); margin: 4px 0 2px; }
.svc-qs { list-style: none; }
.svc-q {
  width: 100%; background: none; border: none; border-bottom: 1px dashed var(--line); text-align: left;
  padding: 9px 2px; display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--ink); line-height: 1.45;
}
.svc-qs li:last-child .svc-q { border-bottom: none; }
.svc-q .ic { color: var(--ink-3); margin-top: 3px; }
.svc-q .ic:last-child { margin-left: auto; opacity: 0; transition: opacity .15s, transform .15s; }
.svc-q:hover { color: var(--navy-700); }
.svc-q:hover .ic { color: var(--saffron-600); }
.svc-q:hover .ic:last-child { opacity: 1; transform: translateX(2px); }
.svc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 18px 18px; }
.svc-actions .btn { padding: 11px 10px; }

/* ─── Dialogs ─── */
.overlay {
  display: none; position: fixed; inset: 0; z-index: 200; background: rgba(7,28,61,.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  align-items: flex-start; justify-content: center; padding: 28px 16px; overflow-y: auto;
}
.overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 820px;
  box-shadow: var(--shadow-3); overflow: hidden; border-top: 5px solid var(--c, var(--navy-800));
  animation: rise .25s ease-out both;
}
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal, .av-panel { animation: none; } }
.modal-hdr { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 3; }
.modal-hdr h2 { font-size: 1.12rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.modal-hdr p { font-size: .8rem; color: var(--ink-2); margin-top: 2px; }
.modal-hdr-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; border-radius: 8px; padding: 7px 12px; font-size: .82rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.seg button.active { background: var(--navy-800); color: #fff; box-shadow: var(--shadow-1); }
.modal-body { padding: 20px 20px 26px; }

/* ─── Search & Voice Bar ─── */
.search-wrap {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.voice-hint {
  font-size: .88rem;
  color: var(--navy-800);
  margin-bottom: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mic-state {
  margin-top: 8px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--ink-2);
  min-height: 18px;
}
.mic-state.red { color: var(--danger); }
.mic-state.grn { color: var(--green-600); }
.mic-state:empty { display: none; }

.transcript { display: none; margin-top: 14px; margin-bottom: 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.transcript.show { display: block; }
.lbl { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-3); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.transcript-q { font-size: 1rem; color: var(--ink); }
.response { display: none; margin-top: 12px; margin-bottom: 18px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green-600); border-radius: 12px; padding: 14px 16px; }
.response.show { display: block; }
.response-lbl-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.response-lbl { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--green-600); display: inline-flex; align-items: center; gap: 6px; }
.response-src { font-size: .72rem; font-weight: 700; color: var(--green-600); background: var(--green-50); border-radius: 20px; padding: 2px 10px; }
.response-tools { margin-left: auto; display: flex; gap: 6px; }
.response-txt { font-size: .98rem; line-height: 1.8; color: var(--ink); }
.response-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.wave { display: none; align-items: flex-end; gap: 2px; height: 16px; }
.wave.show { display: flex; }
.wave span { width: 3px; border-radius: 2px; background: var(--green-600); animation: wave .7s ease-in-out infinite alternate; }
.wave span:nth-child(2) { animation-delay: .1s; } .wave span:nth-child(3) { animation-delay: .2s; }
.wave span:nth-child(4) { animation-delay: .3s; } .wave span:nth-child(5) { animation-delay: .15s; }
@keyframes wave { from { height: 3px; } to { height: 16px; } }
.spin { display: none; width: 16px; height: 16px; border: 2.5px solid var(--line); border-top-color: var(--navy-800); border-radius: 50%; animation: spin .7s linear infinite; }
.spin.show { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.or-row { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin: 18px 0 12px; }
.or-row::before, .or-row::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.txt-row { display: flex; gap: 8px; align-items: center; }
.txt-row input, .field {
  flex: 1; min-width: 0; padding: 0 14px; height: 42px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); outline: none; font-size: .95rem; transition: border-color .15s, box-shadow .15s;
}
.txt-row input:focus, .field:focus { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(29,79,153,.15); }
.txt-row input::placeholder, .field::placeholder { color: var(--ink-3); }
.txt-row .btn,
.txt-row .btn-mic {
  height: 42px;
  flex-shrink: 0;
}
.avatar-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--navy-800);
  color: #fff;
  border: 1px solid var(--navy-700);
  border-radius: 10px;
  padding: 0 14px;
  height: 42px;
  font-weight: 600;
  font-size: .86rem;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 2px 8px rgba(7,28,61,.14);
}
.avatar-search-btn:hover {
  background: var(--navy-900);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(7,28,61,.24);
}
.avatar-search-btn:active {
  transform: translateY(0);
}
.avatar-search-btn svg, .avatar-search-btn .ic {
  color: #ffca80;
}
@media (max-width: 560px) {
  .txt-row .mic-lbl,
  .txt-row #askBtn span { display: none; }
  .txt-row .btn-mic,
  .txt-row #askBtn { padding: 0 12px; }
  .avatar-search-btn span { display: none; }
  .avatar-search-btn { padding: 0 12px; }
}

.qs-section { margin-top: 22px; }
.qs-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: .92rem; color: var(--navy-800); padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.qs-sub { font-size: .76rem; color: var(--ink-3); font-weight: 500; }
.qs-title .btn { margin-left: auto; }
.qs-list { display: flex; flex-direction: column; gap: 6px; }
.q-chip {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: .9rem; line-height: 1.45; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.q-chip .ic { color: var(--ink-3); margin-top: 3px; }
.q-chip:hover { border-color: var(--navy-600); background: var(--navy-50); }
.q-chip.active { border-color: var(--saffron); background: var(--saffron-50); }

/* ─── Avatar ─── */
.av-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 380px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #1d4f99, #071c3d 75%);
  display: flex; align-items: center; justify-content: center; border: 3px solid transparent; transition: border-color .3s;
}
.av-stage.speaking { border-color: var(--green); }
.av-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.av-placeholder { width: 104px; height: 104px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); border-color: rgba(255,255,255,.45); } }
.av-live { position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; background: rgba(7,28,61,.7); color: #fff; border-radius: 20px; padding: 4px 10px; font-size: .72rem; font-weight: 700; letter-spacing: .5px; }
.av-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; }
.av-status { text-align: center; font-size: .86rem; font-weight: 600; color: var(--ink-2); margin: 10px 0; min-height: 20px; }
.av-chat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; height: 180px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.av-chat:empty::before { content: attr(data-empty); color: var(--ink-3); font-size: .86rem; margin: auto; text-align: center; max-width: 360px; }
.av-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 8px;
  box-shadow: var(--shadow-1);
}
.av-controls .field {
  flex: 1 1 auto;
  min-width: 120px;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: .9rem;
  box-shadow: none;
  color: var(--ink);
}
.av-controls .field:focus { outline: none; }
.av-controls .btn {
  flex-shrink: 0;
  height: 40px;
  border-radius: 12px;
  padding: 0 14px;
  font-size: .84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .2s ease;
}

/* ChatGPT Voice Mode / Mic Button */
.btn-mic,
.av-controls .btn#genMic,
.av-controls .btn#exMic {
  position: relative;
  background: var(--navy-800);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 0 16px;
  height: 40px;
  cursor: pointer;
  overflow: visible;
}
.btn-mic:hover:not(:disabled),
.av-controls .btn#genMic:hover:not(:disabled),
.av-controls .btn#exMic:hover:not(:disabled) {
  background: var(--navy-700);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* Active / Listening State (ChatGPT Signature Emerald Green & Pulse) */
.btn-mic.listening,
.btn-mic.mic-on,
.av-controls .btn#genMic.listening,
.av-controls .btn#genMic.mic-on,
.av-controls .btn#exMic.listening,
.av-controls .btn#exMic.mic-on {
  background: linear-gradient(135deg, #10a37f, #059669) !important;
  border-color: #34d399 !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(16, 163, 127, 0.45) !important;
}

/* Radar pulse ring */
.mic-pulse-ring {
  display: none;
  position: absolute;
  inset: -4px;
  border-radius: 26px;
  border: 2px solid rgba(16, 163, 127, 0.7);
  pointer-events: none;
}
.listening .mic-pulse-ring,
.mic-on .mic-pulse-ring {
  display: block;
  animation: chatgptPulseRing 1.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}
@keyframes chatgptPulseRing {
  0% { transform: scale(0.96); opacity: 0.95; }
  60% { transform: scale(1.1); opacity: 0.2; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* Dancing Sound Wave Bars */
.mic-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 12px;
  margin-left: 3px;
}
.mic-wave span {
  display: inline-block;
  width: 2.5px;
  height: 100%;
  background: #fff;
  border-radius: 2px;
  animation: chatgptWave 0.7s ease-in-out infinite alternate;
}
.mic-wave span:nth-child(1) { animation-delay: 0.1s; height: 35%; }
.mic-wave span:nth-child(2) { animation-delay: 0.3s; height: 100%; }
.mic-wave span:nth-child(3) { animation-delay: 0.5s; height: 60%; }

@keyframes chatgptWave {
  0% { transform: scaleY(0.35); }
  100% { transform: scaleY(1); }
}

/* Send button inside avatar controls */
.av-controls .btn#exAsk,
.av-controls .btn#genAsk {
  background: var(--saffron);
  color: #fff;
  border: 1px solid var(--saffron-600);
  border-radius: 12px;
}
.av-controls .btn#exAsk:hover:not(:disabled),
.av-controls .btn#genAsk:hover:not(:disabled) {
  background: var(--saffron-600);
  transform: translateY(-1px);
}
.av-controls .btn#exAsk:disabled,
.av-controls .btn#genAsk:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Interrupt stop button */
.btn-stop,
.av-controls .btn#genInterrupt,
.av-controls .btn#exInterrupt {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1.5px solid #fca5a5 !important;
  border-radius: 12px !important;
  padding: 0 14px !important;
  height: 40px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer;
  white-space: nowrap !important;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.12) !important;
  width: auto !important;
}
.btn-stop svg rect,
.av-controls .btn#genInterrupt svg rect,
.av-controls .btn#exInterrupt svg rect {
  fill: currentColor !important;
}
.btn-stop:hover:not(:disabled),
.av-controls .btn#genInterrupt:hover:not(:disabled),
.av-controls .btn#exInterrupt:hover:not(:disabled) {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #f87171 !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.22) !important;
}
.btn-stop:disabled,
.av-controls .btn#genInterrupt:disabled,
.av-controls .btn#exInterrupt:disabled {
  background: #f9fafb !important;
  color: #9ca3af !important;
  border-color: #e5e7eb !important;
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}
.av-controls .btn#genEnd {
  border-radius: 12px;
}

@media (max-width: 540px) {
  .av-controls {
    flex-wrap: wrap;
  }
  .av-controls .field {
    flex: 1 1 100%;
    border-bottom: 1px solid var(--line-2);
    margin-bottom: 4px;
  }
}

.bubble { max-width: 86%; padding: 9px 13px; border-radius: 14px; font-size: .9rem; line-height: 1.55; }
.bubble.user { align-self: flex-end; background: var(--navy-800); color: #fff; border-bottom-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; }
.bubble .tag { display: flex; align-items: center; gap: 4px; font-size: .64rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--green-600); margin-bottom: 3px; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }

/* ─── Prompt box ─── */
.prompt-box { margin-top: 16px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.prompt-box summary { cursor: pointer; padding: 11px 14px; font-weight: 700; font-size: .86rem; color: var(--navy-800); list-style: none; display: flex; align-items: center; gap: 8px; }
.prompt-box summary::-webkit-details-marker { display: none; }
.prompt-box summary::after { content: '▾'; margin-left: auto; color: var(--ink-3); transition: transform .2s; }
.prompt-box[open] summary::after { transform: rotate(180deg); }
.prompt-box .prompt-note { padding: 0 14px 8px; font-size: .76rem; color: var(--ink-2); }
.prompt-box pre {
  margin: 0 12px 12px; padding: 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}

/* ─── Floating assistant ─── */
.fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 150; display: flex; align-items: center; gap: 12px;
  background: var(--navy-800); color: #fff; border: 2px solid rgba(255,255,255,.9); border-radius: 40px;
  padding: 8px 20px 8px 8px; box-shadow: var(--shadow-3); text-align: left; transition: transform .2s, background .2s, box-shadow .2s;
}
.fab:hover { transform: translateY(-2px); background: var(--navy-700); box-shadow: 0 12px 32px rgba(11,42,85,.45); }
.fab-ico {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy-700);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 4px 12px rgba(0, 0, 0, 0.3);
}
.fab-ico img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.fab-ico::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #10a37f;
  border: 2.5px solid var(--navy-800);
  box-shadow: 0 0 8px rgba(16, 163, 127, 0.9);
}
.fab-ico::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 153, 51, 0.65);
  animation: fabPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}
@keyframes fabPulse {
  0% { transform: scale(0.96); opacity: 0.95; }
  60% { transform: scale(1.16); opacity: 0.15; }
  100% { transform: scale(1.24); opacity: 0; }
}
.fab b { display: block; font-size: .9rem; line-height: 1.25; }
.fab small { color: #c3cfe4; font-size: .74rem; }
.fab.hidden { display: none; }

.panel-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(7,28,61,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.panel-backdrop.open { display: flex; }
.av-panel {
  width: 100%;
  max-width: 560px;
  min-width: 0;
  box-sizing: border-box;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  animation: rise .25s ease-out both;
  display: flex;
  flex-direction: column;
}
.av-panel-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--navy-800);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 3;
  width: 100%;
  box-sizing: border-box;
}
.av-panel-hdr .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--saffron); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.av-panel-hdr .ico.avatar-ico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  border: 2px solid var(--saffron);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  padding: 0;
}
.av-panel-hdr .ico.avatar-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.av-panel-hdr h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.av-panel-hdr p { font-size: .76rem; color: #c3cfe4; }
.av-panel-hdr .round-close { margin-left: auto; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.av-panel-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.chip-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 2px;
  scrollbar-width: thin;
}
.chip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .84rem;
  line-height: 1.4;
  color: var(--ink);
  text-align: left;
  white-space: normal;
  word-break: break-word;
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--saffron); background: var(--saffron-50); }
.chip .ic { flex-shrink: 0; margin-top: 2px; }
.chip span { flex: 1 1 auto; min-width: 0; }

.related { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; width: 100%; }
.related .chip {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; box-sizing: border-box;
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); text-align: left; font-size: .88rem; line-height: 1.45; white-space: normal; word-break: break-word;
  cursor: pointer; transition: all .15s ease;
}
.related .chip:hover { border-color: var(--navy-600); background: var(--navy-50); transform: translateY(-1px); }
.related .chip .ic { flex-shrink: 0; margin-top: 3px; color: var(--saffron-600); }
.related .chip span { flex: 1 1 auto; min-width: 0; }

/* ─── Stop-voice pill ─── */
.stop-audio { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 400; display: none; align-items: center; gap: 8px; background: var(--navy-900); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 22px; padding: 8px 16px; font-weight: 600; font-size: .82rem; box-shadow: var(--shadow-3); }
.stop-audio.show { display: inline-flex; }
.stop-audio .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: blink 1s infinite; }

/* ─── Voice engine indicator + notice ─── */
.strip-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.strip-btn.fallback .dot { background: #f59e0b; }
.strip-btn.off .dot { background: #7c889c; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 450; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  width: max-content; max-width: min(580px, calc(100vw - 28px)); display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid #f59e0b;
  border-radius: 12px; box-shadow: var(--shadow-3); padding: 12px 12px 12px 14px; font-size: .86rem; line-height: 1.5;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast > .ic { color: #d97706; margin-top: 2px; }
.toast-x { border: none; background: none; color: var(--ink-3); padding: 2px; margin-left: 4px; display: inline-flex; }
.toast-x:hover { color: var(--ink); }

/* ─── Footer ─── */
.site-foot { background: var(--navy-900); color: #c3cfe4; font-size: .82rem; margin-top: auto; }
.site-foot .container { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; padding-top: 28px; padding-bottom: 22px; }
.foot-brand { display: flex; gap: 12px; align-items: center; }
.foot-brand img { height: 52px; width: auto; opacity: .95; }
.foot-brand b { display: block; color: #fff; font-family: var(--f-serif); font-size: .98rem; line-height: 1.35; }
.site-foot h4 { color: #fff; font-size: .8rem; letter-spacing: .8px; text-transform: uppercase; margin-bottom: 8px; }
.site-foot p { line-height: 1.6; }
.foot-help { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 1.05rem; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.1); }
.foot-bottom .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 14px; grid-template-columns: none; font-size: .74rem; color: #93a3bd; }

/* ─── Mobile ─── */
@media (max-width: 900px) {
  .page-hero .container { grid-template-columns: 1fr; }
  .site-foot .container { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .mast-badge { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .container { padding: 0 14px; }
  .gov-strip .container { min-height: 38px; }
  .strip-l .en, .strip-l .sep { display: none; }
  .strip-btn > span:last-child { display: none; }
  .masthead .container { min-height: 70px; gap: 10px; }
  .brand { gap: 10px; }
  .brand img { height: 46px; }
  .brand-rule { margin: 14px 0; }
  .brand-hi { font-size: .98rem; }
  .brand-en { font-size: .78rem; }
  .brand-sub { display: none; }
  .mainnav a { padding: 11px 12px; font-size: .84rem; }
  .mainnav .nav-note { display: none; }
  .page-hero .container { padding-top: 22px; padding-bottom: 24px; gap: 18px; }
  .page-hero h1 { font-size: 1.45rem; }
  .page-hero p { font-size: .9rem; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
  .hero-stat { min-width: 0; padding: 8px 12px; }
  .hero-stat b { font-size: 1.05rem; }
  .hero-card { display: none; }
  .section { padding: 20px 0 96px; }
  .section-head h2 { font-size: 1.15rem; }
  .svc-grid { grid-template-columns: 1fr; gap: 14px; }
  .svc-head { padding: 14px 14px 12px; }
  .svc-body { padding: 6px 14px 0; }
  .svc-actions { padding: 10px 14px 14px; }
  .svc-q { font-size: .86rem; }

  .overlay { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; max-width: none; }
  .modal-hdr { padding: 12px 14px; flex-wrap: wrap; gap: 10px; }
  .modal-hdr .mod-ico { width: 40px; height: 40px; }
  .modal-hdr h2 { font-size: 1rem; }
  .modal-hdr-actions { width: 100%; justify-content: space-between; }
  .seg { flex: 1; }
  .seg button { flex: 1; justify-content: center; }
  .modal-body { padding: 14px 14px 28px; }
  .voice-box { padding: 20px 14px 16px; }
  .mic-btn { width: 72px; height: 72px; }
  .qs-title .btn { margin-left: 0; width: 100%; }
  .av-stage { aspect-ratio: 4 / 3; max-height: 40vh; }
  .av-chat { height: 150px; }
  .av-controls .btn { flex: 1 1 auto; }
  .panel-backdrop { padding: 0; }
  .av-panel { max-width: none; max-height: 100%; height: 100%; border-radius: 0; }

  .fab { right: 14px; bottom: 14px; padding: 5px; border-radius: 50%; }
  .fab > span:last-child { display: none; }
  .fab-ico { width: 54px; height: 54px; }
  .stop-audio { top: auto; bottom: 84px; }
  .toast { bottom: 150px; }
  .site-foot .container { grid-template-columns: 1fr; gap: 16px; padding-top: 22px; }
  .site-foot { padding-bottom: 70px; }
}
