/* GeM's own chrome — deep blue bar, white paper, saffron accent — on a conversation
   with the registration filling in beside it. */
:root {
  --gem: #16287a;
  --gem-2: #2440a8;
  --gem-t: #eef1fb;
  --accent: #ff7a00;
  --accent-t: #fff6ec;
  --ink: #161924;
  --ink2: #474e63;
  --muted: #8b90a0;
  --line: #e3e6ef;
  --ok: #1f8a53;
  --ok-t: #eaf7f0;
  --bad: #c2384a;
  --bad-t: #fdeef0;
  --paper: #f3f5fb;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.55 "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  display: flex;
  flex-direction: column;
}

/* ── header + progress ─────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  background: var(--gem);
  color: #fff;
}
.mark {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: #fff;
  color: var(--gem);
  padding: 2px 10px;
  border-radius: 6px;
}
.topbar .title {
  font-size: 14px;
  opacity: 0.95;
}
.spacer {
  flex: 1;
}
.privacy {
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
}
.bar {
  height: 4px;
  background: #dde2f2;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.5s ease;
}

/* ── two columns: the conversation, and the record ─────────────────────────── */
.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 20px 24px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

/* ── the conversation ──────────────────────────────────────────────────────── */
.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.who {
  font-weight: 700;
  color: var(--gem);
}
.step {
  color: var(--muted);
}
.thread {
  list-style: none;
  margin: 0;
  padding: 18px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 16px;
  animation: land 0.25s ease;
}
.msg .en {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.msg.bot {
  align-self: flex-start;
  background: var(--gem-t);
  border-bottom-left-radius: 4px;
}
.msg.you {
  align-self: flex-end;
  background: var(--gem-2);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg.note {
  align-self: center;
  max-width: 90%;
  font-size: 14px;
  background: var(--bad-t);
  color: var(--bad);
}
@keyframes land {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* the heard identifier, waiting for "सही है?" */
.confirm {
  margin: 0 18px 12px;
  padding: 14px 16px;
  border: 2px solid var(--accent);
  border-radius: 14px;
  background: var(--accent-t);
}
.confirm-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
}
.confirm-value {
  width: 100%;
  margin: 8px 0 10px;
  font:
    700 24px/1.2 ui-monospace,
    "SF Mono",
    Menlo,
    monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.confirm-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.confirm-or {
  font-size: 13px;
  color: var(--muted);
}

/* the options, under the question that asked for them */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.options.spent {
  opacity: 0.45;
  pointer-events: none;
}
.options.spent .chip {
  cursor: default;
}

/* an answer kept, with a way to change it */
.receipt {
  align-self: flex-start;
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
  color: var(--ok);
  background: var(--ok-t);
  padding: 5px 12px;
  border-radius: 999px;
  animation: land 0.25s ease;
}
.receipt b {
  color: var(--ink);
}
.chip {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.chip em {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.chip:hover {
  border-color: var(--gem-2);
  background: var(--gem-t);
}

.dock {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.mic {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ring {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #eef0f8;
  border: 2px solid var(--line);
  display: block;
  position: relative;
}
.ring::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: var(--muted);
}
.mic.live .ring {
  border-color: var(--accent);
  background: var(--accent-t);
}
.mic.live .ring::after {
  background: var(--accent);
  animation: beat 1.3s ease-in-out infinite;
}
@keyframes beat {
  50% {
    transform: scale(1.35);
    opacity: 0.65;
  }
}
.mic-label {
  font-size: 14px;
  color: var(--ink2);
}

/* ── the record ────────────────────────────────────────────────────────────── */
.sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--gem);
}
.count {
  font-weight: 400;
  color: var(--muted);
}
.rows {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  flex: 1;
  overflow-y: auto;
}
.row {
  display: grid;
  grid-template-columns: 18px 1fr;
  column-gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
}
.row .icon {
  grid-row: span 3;
  color: var(--muted);
  font-weight: 700;
}
.row .k {
  color: var(--muted);
  font-size: 12px;
}
.row .v {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.row .change {
  grid-column: 2;
  justify-self: start;
  font-size: 12px;
  margin-top: 2px;
}
.row .empty {
  color: var(--line);
  font-weight: 400;
}
.row.done {
  cursor: pointer;
}
.row.done:hover {
  background: var(--paper);
}
.row.done .icon {
  color: var(--ok);
}
.row.active {
  background: var(--gem-t);
}
.row.active .icon,
.row.active .k {
  color: var(--gem);
}
.row.confirm {
  background: var(--accent-t);
}
.row.confirm .icon {
  color: var(--accent);
}
.row.todo {
  opacity: 0.55;
}
.row.editing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--gem-t);
}
.row.editing .k {
  width: 100%;
}
.edit-in {
  flex: 1;
  min-width: 140px;
  font: inherit;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.sheet-note {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* ── controls ──────────────────────────────────────────────────────────────── */
.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  background: var(--gem-2);
  color: #fff;
}
.btn.big {
  font-size: 16px;
  padding: 12px 30px;
  background: var(--accent);
}
.btn.done {
  background: var(--ok);
}
.btn.small {
  font-size: 13px;
  padding: 6px 12px;
}
.link {
  font: inherit;
  font-size: 13px;
  border: 0;
  background: none;
  color: var(--gem-2);
  cursor: pointer;
  padding: 0;
}

/* ── phone width: the record goes under the conversation ──────────────────── */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }
  .chat {
    min-height: 60vh;
  }
  .msg {
    max-width: 90%;
  }
}

/* Answers the register gave us, and the wait while it is asked. */
.src {
  margin-left: 0.4rem;
  font-size: 0.72rem;
  font-style: normal;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  white-space: nowrap;
}

.checking {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}

.checking .dots {
  display: inline-flex;
  gap: 0.2rem;
}

.checking .dots i {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s infinite;
}

.checking .dots i:nth-child(2) {
  animation-delay: 0.2s;
}

.checking .dots i:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

/* The end of the registration: submitted, and the portal's code to log in with. */
.login {
  margin: 0.6rem 0.9rem 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: 0.6rem;
  background: var(--ok-t);
}

.login-head {
  font-weight: 600;
  color: var(--ink);
}

.login-head .tick {
  color: var(--ok);
}

.login-id {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  color: var(--ink2);
}

.login-say {
  margin: 0.5rem 0 0.6rem;
  font-size: 0.9rem;
  color: var(--ink2);
}

.otp-row {
  display: flex;
  gap: 0.5rem;
}

.otp-in {
  flex: 1;
  padding: 0.5rem 0.7rem;
  font-size: 1.1rem;
  letter-spacing: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: #fff;
}

.demo {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.login-done {
  margin-top: 0.6rem;
  font-weight: 600;
  color: var(--ok);
}

/* Powered-by watermark. Beside the controls, out of the way of every one of them. */
.watermark {
  /* At the end of the control bar, without pushing the controls off centre. */
  position: absolute;
  right: 16px;
  bottom: 8px;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
  opacity: 0.8;
}

.watermark b {
  color: var(--gem);
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* The AI rides high and small, the way a trademark does on a logo. */
.watermark sup {
  font-size: 0.6em;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: super;
  margin-left: 1px;
  color: var(--accent);
}

/* The way out when the text does not arrive. */
.otp-wait {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--ink2);
}

.otp-wait .link {
  margin-left: 0.5rem;
}

.screen-code {
  margin-top: 0.7rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--gem);
  color: #fff;
  text-align: center;
}

.screen-code-say {
  display: block;
  font-size: 0.78rem;
  opacity: 0.85;
}

.screen-code b {
  font-size: 2rem;
  letter-spacing: 0.7rem;
  line-height: 1.5;
}

/* The end of a registration, and the way into the next one. */
.done {
  margin: 0.6rem 0.9rem 0.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: 0.6rem;
  background: var(--ok-t);
  text-align: center;
}

.done-head {
  font-weight: 600;
  color: var(--ok);
}

.done-say {
  margin: 0.35rem 0 0.7rem;
  font-size: 0.85rem;
  color: var(--ink2);
}
