:root {
  --page-navy: #0d1b2a;
  --page-blue: #12324a;
  --page-cream: #f7f1e3;
  --panel: rgba(248, 245, 238, 0.96);
  --panel-strong: #fffdf8;
  --panel-muted: rgba(255, 255, 255, 0.78);
  --ink: #102033;
  --muted: #556476;
  --accent: #0d9488;
  --accent-deep: #0f3d56;
  --accent-soft: #d8f4ef;
  --accent-bright: #12b3a6;
  --sun: #ff9f1c;
  --gold-soft: #ffe1b0;
  --border: rgba(16, 32, 51, 0.12);
  --shadow: 0 28px 80px rgba(6, 20, 32, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 159, 28, 0.22), transparent 24%),
    radial-gradient(circle at 85% 15%, rgba(18, 179, 166, 0.14), transparent 18%),
    linear-gradient(135deg, var(--page-navy) 0%, var(--page-blue) 46%, #1f5666 100%);
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 24px auto;
  display: grid;
  gap: 20px;
}

.hero-band,
.chat-panel {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-band {
  padding: 22px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(540px, 1fr);
  gap: 18px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-band::after {
  content: "";
  position: absolute;
  inset: auto -90px -90px auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(18, 179, 166, 0.18), transparent 70%);
  pointer-events: none;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 14px 28px rgba(13, 148, 136, 0.26);
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--sun) 100%);
}

.hero-copy-block {
  display: grid;
  align-content: center;
  gap: 10px;
}

.hero-topline {
  display: flex;
  align-items: center;
  gap: 14px;
}

.eyebrow,
.chat-subtitle,
.helper-text,
.control-group span {
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  margin: 0;
  font-weight: 700;
  color: var(--accent-deep);
}

h1,
h2,
.chat-title,
.ops-card p {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  max-width: 14ch;
}

.hero-copy,
.ops-card p {
  font-size: 0.98rem;
  line-height: 1.55;
}

.hero-copy-kannada {
  font-family: "Noto Sans Kannada", sans-serif;
  font-weight: 600;
  color: var(--accent-deep);
  background: linear-gradient(180deg, rgba(216, 244, 239, 0.92), rgba(239, 251, 248, 0.96));
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(13, 148, 136, 0.18);
}

.hero-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.info-card,
.ops-card,
.control-bar,
.composer {
  border: 1px solid var(--border);
}

.info-card,
.ops-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 239, 229, 0.96));
}

.compact-card {
  height: 100%;
}

.stat-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.stat-card h2 {
  font-size: 1rem;
  line-height: 1.3;
}

.stat-card p {
  margin: 0;
}

.stat-label {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 700;
}

.info-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.7;
}

.language-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.language-strip span,
.status-pill,
.prompt-chip,
.ghost-button {
  border-radius: 999px;
  border: 1px solid var(--border);
}

.language-strip span {
  background: linear-gradient(180deg, #fff8ea, #ffe9c7);
  padding: 8px 12px;
  font-size: 0.84rem;
  color: #764400;
  border-color: rgba(255, 159, 28, 0.28);
  font-weight: 600;
}

.chat-panel {
  padding: 22px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 16px;
  min-height: 860px;
}

.chat-header,
.composer-footer,
.status-wrap,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.status-pill {
  background: linear-gradient(180deg, #e7fff8, #cef3ec);
  color: var(--accent-deep);
  padding: 10px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  border-color: rgba(13, 148, 136, 0.22);
}

.status-pill[data-mode="working"] {
  background: linear-gradient(180deg, #fff2cf, #ffe0a4);
  color: #8c5a00;
}

.status-pill[data-mode="live"] {
  background: linear-gradient(180deg, #d9fff3, #b8f3e0);
  color: #0c5c47;
}

.status-pill[data-mode="error"] {
  background: linear-gradient(180deg, #ffe3e0, #ffc9c3);
  color: #8a1c1c;
}

.ghost-button,
.prompt-chip,
.send-button,
select {
  font: inherit;
}

.ghost-button,
.prompt-chip,
select {
  background: var(--panel-strong);
}

.ghost-button,
.prompt-chip {
  cursor: pointer;
}

.ghost-button {
  padding: 10px 14px;
  color: var(--accent-deep);
  font-weight: 600;
}

.ghost-link {
  text-decoration: none;
  color: inherit;
}

.is-hidden {
  display: none;
}

.control-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(239, 247, 251, 0.96), rgba(255, 252, 247, 0.96));
  border-color: rgba(15, 61, 86, 0.12);
}

.control-group {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
}

select {
  border: 1px solid rgba(15, 61, 86, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.quick-prompts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.category-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.category-chip {
  border: 1px solid rgba(15, 61, 86, 0.12);
  border-radius: 16px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #eff7fb, #ffffff);
  color: var(--accent-deep);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.category-chip:hover {
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: 0 10px 20px rgba(13, 61, 86, 0.08);
}

.scope-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(15, 61, 86, 0.12);
  background: linear-gradient(180deg, rgba(232, 246, 255, 0.98), rgba(250, 253, 255, 0.98));
}

.scope-label,
.scope-text {
  margin: 0;
}

.scope-label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 700;
  flex: 0 0 auto;
}

.scope-text {
  color: var(--ink);
  font-weight: 600;
}

.prompt-chip {
  padding: 12px 14px;
  color: var(--accent-deep);
  font-weight: 600;
  border-color: rgba(13, 148, 136, 0.16);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.message-action {
  margin-top: 14px;
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #f3fffc, #dcf7f0);
  color: var(--accent-deep);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.feedback-button {
  border: 1px solid rgba(15, 61, 86, 0.14);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.feedback-button:hover {
  border-color: rgba(13, 148, 136, 0.36);
  color: var(--accent-deep);
}

.feedback-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.message-action:hover {
  border-color: rgba(13, 148, 136, 0.4);
  background: linear-gradient(180deg, #ffffff, #d4f5ee);
}

.prompt-chip:hover,
.ghost-button:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: rgba(13, 148, 136, 0.42);
  box-shadow: 0 10px 20px rgba(13, 61, 86, 0.08);
}

.chat-thread {
  border-radius: 24px;
  padding: 22px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 246, 250, 0.94)),
    linear-gradient(135deg, rgba(13, 148, 136, 0.04), rgba(255, 159, 28, 0.05));
  border: 1px solid rgba(15, 61, 86, 0.12);
}

.message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.message.user {
  flex-direction: row-reverse;
}

.avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 10px 20px rgba(15, 61, 86, 0.18);
  background: linear-gradient(135deg, var(--accent-deep), var(--accent-bright));
}

.message.user .avatar {
  background: linear-gradient(135deg, #c46a00, var(--sun));
}

.bubble {
  max-width: min(82%, 860px);
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  border: 1px solid rgba(15, 61, 86, 0.1);
  box-shadow: 0 8px 18px rgba(9, 28, 41, 0.05);
}

.message.user .bubble {
  background: linear-gradient(180deg, #fff6de, #ffebc1);
  border-color: rgba(255, 159, 28, 0.18);
}

.bubble p {
  margin: 0;
  line-height: 1.6;
}

.bubble p + p {
  margin-top: 10px;
}

.composer {
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(244, 249, 251, 0.96));
  border-color: rgba(15, 61, 86, 0.12);
}

textarea {
  width: 100%;
  border: 0;
  resize: vertical;
  min-height: 92px;
  font: inherit;
  color: var(--ink);
  background: transparent;
  outline: none;
}

.send-button {
  border: 0;
  border-radius: 18px;
  padding: 12px 18px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--sun) 0%, #ff6b35 100%);
  box-shadow: 0 14px 28px rgba(255, 107, 53, 0.26);
}

.send-button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.send-button:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.typing .bubble {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(29, 27, 24, 0.42);
  animation: bounce 1.2s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .hero-band {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    min-height: 700px;
  }

  .hero-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    background: #eef6f5;
  }

  .page-shell {
    width: 100%;
    margin: 0;
    gap: 0;
  }

  .hero-band,
  .chat-panel {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .hero-band {
    padding: 14px 16px;
    display: block;
    background: #fffdf8;
    border-bottom: 1px solid rgba(15, 61, 86, 0.1);
  }

  .hero-meta-grid {
    display: none;
  }

  .hero-band::after,
  .hero-copy,
  .eyebrow {
    display: none;
  }

  .hero-copy-block {
    gap: 0;
  }

  .hero-topline {
    gap: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    box-shadow: none;
  }

  h1 {
    max-width: none;
    font-size: 1.08rem;
    line-height: 1.22;
  }

  .hero-topline::after {
    content: "KannadaBridge";
    font-weight: 700;
    color: var(--accent-deep);
  }

  .chat-panel {
    min-height: calc(100vh - 71px);
    padding: 14px 12px 12px;
    gap: 10px;
    grid-template-rows: auto auto auto 1fr auto;
    background: #f8fbfa;
  }

  .chat-header {
    align-items: flex-start;
    gap: 8px;
  }

  .chat-title {
    font-size: 1.04rem;
  }

  .chat-subtitle,
  .quick-prompts,
  .scope-banner {
    display: none;
  }

  .status-wrap {
    width: 100%;
    align-items: stretch;
    flex-direction: row;
  }

  .action-row {
    margin-left: auto;
    flex-direction: row;
  }

  .status-pill,
  .ghost-button {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .control-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    background: #fff;
  }

  .control-group {
    gap: 0;
    font-size: 0.82rem;
    min-width: 0;
  }

  .control-group span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  select {
    min-height: 42px;
    border-radius: 10px;
    padding: 9px 8px;
    font-size: 0.76rem;
    width: 100%;
  }

  .category-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .category-bar::-webkit-scrollbar {
    display: none;
  }

  .category-chip {
    flex: 0 0 auto;
    max-width: 180px;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .chat-thread {
    min-height: 330px;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
  }

  .message {
    gap: 8px;
    margin-bottom: 12px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 10px;
    font-size: 0.7rem;
  }

  .bubble {
    max-width: 100%;
    padding: 12px 13px;
    border-radius: 15px;
    font-size: 0.9rem;
  }

  .feedback-actions {
    gap: 6px;
  }

  .feedback-button,
  .message-action {
    font-size: 0.74rem;
    padding: 7px 9px;
  }

  .composer {
    padding: 10px;
    border-radius: 16px;
    background: #fff;
  }

  textarea {
    min-height: 74px;
    font-size: 0.95rem;
  }

  .composer-footer {
    align-items: stretch;
    gap: 8px;
    flex-direction: column;
  }

  .helper-text {
    margin: 0;
    font-size: 0.8rem;
  }

  .send-button {
    min-height: 44px;
    border-radius: 12px;
    padding: 10px 14px;
  }
}
