/* ---------- icons ---------- */

svg.i {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
svg.i .d {
  fill: currentColor;
  fill-opacity: 0.18;
  stroke: none;
}
[data-icon] {
  display: inline-grid;
  place-items: center;
}

/* ---------- header ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 18px 10px;
}
.topbar-title {
  flex: 1;
  min-width: 0;
}
.topbar-title h1 {
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-title p {
  font-size: 12.5px;
  color: var(--soft);
}
.logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--p2), var(--p1));
  color: var(--onp);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--p2) 35%, transparent);
}
.logo svg.i {
  width: 26px;
  height: 26px;
}
.icon-btn {
  width: var(--tap);
  height: var(--tap);
  flex: none;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

/* ---------- layout ---------- */

.app {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 4px 18px 0;
}
.screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.sec {
  font-size: 14px;
  font-weight: 800;
  margin-top: 2px;
}
.sec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.sec-note {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.hint {
  font-size: 13.5px;
  color: var(--soft);
}
.hint--icon,
.hint--mic {
  display: flex;
  gap: 8px;
  align-items: center;
}
.hint--mic {
  justify-content: center;
}

/* ---------- hero and stats ---------- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: none;
  border-radius: 28px;
  padding: 18px 20px;
  color: var(--onp);
  background: linear-gradient(135deg, var(--p1), var(--p2));
  box-shadow: 0 16px 30px color-mix(in srgb, var(--p1) 28%, transparent);
}
.hero-deco {
  position: absolute;
  right: -28px;
  top: -34px;
  width: 180px;
  height: 180px;
  fill: none;
  stroke: var(--glow);
  stroke-width: 1.2;
  opacity: 0.24;
  pointer-events: none;
}
.hero-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
.hero-money {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hero small,
.card-amount small {
  font-size: 0.62em;
  font-weight: 600;
  margin-right: 2px;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.hero-chips > span {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 12px;
  background: color-mix(in srgb, var(--onp) 15%, transparent);
}
.hero--link {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.hero--link .row-main > span {
  color: inherit;
  opacity: 0.85;
}

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mini {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  min-width: 0;
}
.mini span {
  font-size: 11.5px;
  color: var(--soft);
}
.mini b {
  display: block;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}
.mini .badge {
  color: inherit;
}

.badge {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
}
.badge.red,
.mini .badge.red {
  background: var(--redbg);
  color: var(--red);
}
.badge.green,
.mini .badge.green {
  background: var(--greenbg);
  color: var(--green);
}
.badge.accent {
  background: var(--tint);
  color: var(--accent);
}
.red {
  color: var(--red);
}
.green {
  color: var(--green);
}

.engine {
  align-self: center;
  min-height: 32px;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--soft);
  font-size: 12px;
}

/* ---------- lists ---------- */

.list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2px 14px;
}
.list > li + li {
  border-top: 1px solid var(--line);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 0;
}
.row--button {
  background: none;
  border: 0;
  text-align: left;
  text-decoration: none;
}
.row-main {
  flex: 1;
  min-width: 0;
}
.row-main b {
  display: block;
  font-size: 15.5px;
  overflow-wrap: anywhere;
}
.row-main > span {
  display: block;
  font-size: 12.5px;
  color: var(--soft);
  overflow: hidden;
  text-overflow: ellipsis;
}
.av {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 800;
  font-size: 17px;
  background: var(--tint);
  color: var(--accent);
}
.amt {
  text-align: right;
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.amt > span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.amt.zero {
  color: var(--soft);
}
.chevron {
  color: var(--soft);
}
.entry {
  flex-wrap: wrap;
}
/* On a narrow phone the undo button moves below instead of squeezing the text. */
.entry .row-main {
  flex-basis: 150px;
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--soft);
}
.searchbox input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}
.searchbox:focus-within {
  border-color: var(--accent);
}

.empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  padding: 28px 16px;
  color: var(--soft);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
}
.empty strong {
  color: var(--ink);
}

/* ---------- buttons and fields ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  font-weight: 800;
  text-decoration: none;
  text-align: center;
}
.btn:active,
.row--button:active,
.candidate:active,
.choice:active {
  transform: scale(0.99);
}
.btn--main {
  border: 0;
  background: linear-gradient(135deg, var(--p1), var(--p2));
  color: var(--onp);
}
.btn--soft {
  border: 0;
  background: var(--tint);
  color: var(--accent);
}
.btn--mini {
  width: auto;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
}
.entry .btn--mini {
  margin-left: 52px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
.actions > * {
  flex: 1 1 0;
  min-width: 0;
}
.field {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 13px;
  border: 0;
  border-radius: 14px;
  background: var(--tint);
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
}
.chip svg.i {
  width: 16px;
  height: 16px;
}
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 7px;
  background: var(--glow);
  color: #4a3405;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  vertical-align: middle;
}
.pill {
  padding: 2px 9px;
  border-radius: 999px;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
}
.pill.green {
  background: var(--greenbg);
}
.pill.warn {
  background: var(--warnbg);
  color: var(--warn);
}

/* ---------- notice ---------- */

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 12px 12px 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  background: var(--warnbg);
  color: var(--warn);
  font-size: 13.5px;
}
.notice-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.notice-text strong,
.notice-text span {
  display: block;
}
.notice .btn--mini {
  margin-top: 8px;
}
.notice .icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: transparent;
  border-color: transparent;
}

/* ---------- bottom bar and mic ---------- */

.nav {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(536px, calc(100% - 20px));
  display: grid;
  grid-template-columns: 1fr 1fr 88px 1fr 1fr;
  align-items: center;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.nav > button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: var(--tap);
  border: 0;
  background: none;
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
}
.nav > button.on {
  color: var(--accent);
}
.mic-slot {
  display: grid;
  justify-items: center;
}
.mic {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--p2), var(--p1));
  color: var(--onp);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--p2) 50%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.mic svg.i {
  width: 34px;
  height: 34px;
}
.mic-slot .mic {
  margin-top: -40px;
  border: 5px solid var(--bg);
  width: 80px;
  height: 80px;
}
.mic.is-ready {
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--p2) 30%, transparent);
}
.mic.is-processing {
  cursor: progress;
}
.mic:disabled {
  background: var(--line);
  color: var(--soft);
  box-shadow: none;
}

/* ---------- sheets ---------- */

.veil {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(8, 9, 22, 0.56);
}
.sheet {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(var(--nav-space) + 24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(540px, calc(100% - 20px));
  max-height: calc(100dvh - var(--nav-space) - 40px - env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 30px;
  background: var(--card);
  box-shadow: 0 -10px 40px rgba(8, 9, 22, 0.25);
  animation: rise 0.22s ease-out;
}
@keyframes rise {
  from {
    translate: 0 24px;
    opacity: 0.4;
  }
}
.card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  
  padding: 12px 20px 20px;
  text-align: center;
}
.grab {
  align-self: center;
  width: 44px;
  height: 4px;
  flex: none;
  border-radius: 4px;
  background: var(--line);
}
.seal {
  align-self: center;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 24px;
}
.seal svg.i {
  width: 38px;
  height: 38px;
}
.seal.red {
  background: var(--redbg);
}
.seal.green {
  background: var(--greenbg);
}
.seal.accent {
  background: var(--tint);
  color: var(--accent);
}
.seal.warn {
  background: var(--warnbg);
  color: var(--warn);
}
.card-kicker {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
.card-amount {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.card-kind {
  margin-top: -8px;
  font-weight: 700;
  color: var(--soft);
}
.card-title {
  font-size: 21px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.card-question {
  font-size: 23px;
  line-height: 1.3;
  text-align: left;
}
.card-body {
  font-size: 15px;
}
.card-items > span {
  display: block;
  font-size: 13px;
  color: var(--soft);
}
.card-items > b {
  overflow-wrap: anywhere;
}
.card-heard {
  font-size: 13px;
  color: var(--soft);
  overflow-wrap: anywhere;
}
.message {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  text-align: left;
  overflow-wrap: anywhere;
}
.fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg);
  text-align: left;
}
.fact div > span {
  display: block;
  font-size: 12px;
  color: var(--soft);
}
.fact--pair > div {
  flex: 1;
}
.fact--pair > div:last-child {
  text-align: right;
}
.choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 128px;
  padding: 18px 8px;
  border-radius: 24px;
  border: 1.5px solid color-mix(in srgb, currentColor 40%, transparent);
  font-size: 17px;
  font-weight: 800;
}
.choice.red {
  background: var(--redbg);
}
.choice.green {
  background: var(--greenbg);
}
.choice small {
  font-size: 12px;
  font-weight: 600;
}
.choice-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 18px;
  background: currentColor;
}
.choice-icon svg.i {
  width: 28px;
  height: 28px;
  stroke-width: 2.2;
  color: var(--card);
}
.candidates {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.candidates:empty {
  display: none;
}
.candidate {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
  text-align: left;
}
.candidate .av {
  width: 40px;
  height: 40px;
}
.candidate-name {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.candidate-meta {
  font-size: 12.5px;
  font-weight: 700;
  text-align: right;
}
.ask-form {
  display: flex;
  gap: 8px;
}
.ask-form .btn {
  width: auto;
  min-width: 72px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.summary-cell {
  padding: 10px 4px;
  border-radius: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.summary-cell dt {
  font-size: 12px;
  color: var(--soft);
}
.summary-cell dd {
  font-size: 19px;
  font-weight: 800;
}

/* typing sheet */
.textform {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 16px;
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  background: var(--bg);
}
.textform input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: 0;
  background: transparent;
  outline: none;
}
.send {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--p2), var(--p1));
  color: var(--onp);
}

/* ---------- listening ---------- */

.listen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 30px;
  text-align: center;
  color: var(--onp);
  background: linear-gradient(180deg, var(--p1), var(--p2));
  /* The finger stays on the mic underneath: releasing must still reach it. */
  pointer-events: none;
}
.listen .btn {
  pointer-events: auto;
  width: auto;
  min-width: 160px;
  color: var(--ink);
}
.listen-title {
  font-size: 22px;
  font-weight: 800;
}
.rings {
  --level: 0;
  display: grid;
  place-items: center;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--onp) 20%, transparent) 0 38%,
    color-mix(in srgb, var(--onp) 12%, transparent) 39% 55%,
    color-mix(in srgb, var(--onp) 6%, transparent) 56% 70%,
    transparent 71%
  );
  transform: scale(calc(1 + var(--level, 0) * 0.12));
}
.core {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--onp);
  color: var(--p1);
}
.core svg.i {
  width: 52px;
  height: 52px;
}
.wave {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 52px;
}
.wave i {
  width: 5px;
  height: 18px;
  border-radius: 5px;
  background: var(--glow);
  opacity: 0.5;
}
.wave i:nth-child(2n) { height: 32px; }
.wave i:nth-child(3n) { height: 46px; }
.wave i:nth-child(5n) { height: 24px; }
.listen.is-ready .wave i,
.listen.is-processing .wave i {
  opacity: 1;
  animation: wave 0.9s ease-in-out infinite alternate;
}
.wave i:nth-child(2n) { animation-delay: 0.12s !important; }
.wave i:nth-child(3n) { animation-delay: 0.27s !important; }
.wave i:nth-child(5n) { animation-delay: 0.4s !important; }
@keyframes wave {
  to {
    transform: scaleY(0.35);
  }
}
.listen-said {
  min-height: 70px;
  max-width: 460px;
  font-size: 22px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.listen-hint {
  font-size: 13.5px;
  opacity: 0.85;
}

/* ---------- settings ---------- */

.opt {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 14px;
}
.opt.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}
.opt-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  padding: 8px 0;
  border: 0;
  background: none;
  text-align: left;
}
.opt-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 14px;
}
.radio {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line);
}
.opt.on .radio {
  border: 7px solid var(--accent);
}
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
}
.opt .seg {
  background: var(--bg);
}
.seg button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--soft);
  font-weight: 800;
  font-size: 13.5px;
}
.seg button.on {
  background: linear-gradient(135deg, var(--p1), var(--p2));
  color: var(--onp);
}
.prov {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choices ~ .prov {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.prov-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.prov-head a {
  margin-left: auto;
  font-size: 13px;
  color: var(--accent);
}
.key-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.key-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: 0;
  background: transparent;
  outline: none;
}
.key-row:focus-within {
  border-color: var(--accent);
}
.key-row .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.set-status {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.set-status--ok,
.set-status--error,
.set-status--warn,
.set-status--busy {
  padding: 9px 12px;
  border-radius: 14px;
  font-weight: 700;
}
.set-status--ok {
  background: var(--greenbg);
  color: var(--green);
}
.set-status--error {
  background: var(--redbg);
  color: var(--red);
}
.set-status--warn,
.set-status--busy {
  background: var(--warnbg);
  color: var(--warn);
}
.set-status--muted {
  color: var(--soft);
}
.models summary {
  min-height: 32px;
  cursor: pointer;
  font-size: 13px;
  color: var(--soft);
}
.labelled {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  font-size: 13px;
}
.choices {
  display: grid;
  gap: 8px;
}
.choice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
}
.choice-row:has(input:checked) {
  border-color: var(--accent);
  background: var(--tint);
}
.choice-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
.choice-row > span {
  flex: 1;
  font-weight: 700;
}
.swatch {
  display: grid;
  grid-template-rows: 1.4fr 1fr;
  gap: 5px;
  width: 84px;
  height: 62px;
  flex: none;
  padding: 7px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.swatch i {
  border-radius: 8px;
  background: linear-gradient(135deg, var(--p1), var(--p2));
}
.swatch u {
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--line);
}
.langs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.lang {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 66px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  text-align: left;
}
.lang b {
  display: block;
  font-size: 16px;
}
.lang > span > span {
  display: block;
  font-size: 11.5px;
  color: var(--soft);
}
.lang.on {
  border-color: var(--accent);
  background: var(--tint);
  color: var(--accent);
}
.lang--soon {
  opacity: 0.6;
  cursor: default;
}
.panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.panel--icon {
  align-items: center;
  text-align: center;
}

/* ---------- short screens: a tighter sheet so the choices stay in view ---------- */

@media (max-height: 700px) and (max-width: 979px) {
  .card {
    gap: 8px;
  }
  .seal {
    width: 48px;
    height: 48px;
    border-radius: 18px;
  }
  .seal svg.i {
    width: 28px;
    height: 28px;
  }
  .card-amount {
    font-size: 40px;
  }
  .card-question {
    font-size: 19px;
  }
  .choice {
    min-height: 0;
    padding: 10px 6px;
  }
  .choice-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }
  .grab {
    display: none;
  }
}

/* ---------- small phones ---------- */

@media (max-width: 380px) {
  .hero-money {
    font-size: 38px;
  }
  .actions {
    flex-wrap: wrap;
  }
  .actions > * {
    flex-basis: 104px;
  }
}

/* ---------- wide screens: side rail, two columns, side sheet ---------- */

.desk-talk {
  display: none;
}

@media (min-width: 980px) {
  :root {
    --rail: 104px;
    --nav-space: 0px;
  }
  body {
    padding: 0 0 24px var(--rail);
  }
  .topbar,
  .app {
    width: min(1120px, 100%);
  }
  .topbar {
    padding-top: 22px;
  }
  .screen--home {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
  }
  .screen--home[hidden] {
    display: none;
  }
  .screen--narrow {
    width: min(620px, 100%);
  }
  .nav {
    top: 0;
    bottom: 0;
    left: 0;
    transform: none;
    width: var(--rail);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 8px;
    border-width: 0 1px 0 0;
    border-radius: 0;
    box-shadow: none;
  }
  .nav > button[data-nav="settings"] {
    margin-top: auto;
  }
  .nav .mic-slot {
    display: none;
  }
  .desk-talk {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 30px 20px 20px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--card);
  }
  .desk-talk .mic {
    width: 100px;
    height: 100px;
    box-shadow: 0 0 0 14px color-mix(in srgb, var(--p2) 14%, transparent), 0 14px 30px color-mix(in srgb, var(--p2) 40%, transparent);
  }
  .desk-talk .mic svg.i {
    width: 46px;
    height: 46px;
  }
  .desk-talk .mic:disabled {
    box-shadow: none;
  }
  .desk-hint {
    font-weight: 800;
  }
  .desk-talk .textform {
    width: 100%;
    border-color: var(--line);
  }
  .desk-talk .textform:focus-within {
    border-color: var(--accent);
  }
  /* The sheet sits beside the mic, so a question can be answered by voice. */
  .veil {
    left: var(--rail);
    background: rgba(8, 9, 22, 0.18);
    pointer-events: none;
  }
  .sheet {
    left: auto;
    right: 24px;
    bottom: 24px;
    transform: none;
    width: 440px;
    max-height: calc(100dvh - 48px);
    border-radius: 30px;
    border: 1px solid var(--line);
  }
  .card {
    padding-bottom: 24px;
  }
}

/* ---------- Hindi with English underneath ---------- */

.bi {
  display: inline-block;
  max-width: 100%;
  line-height: 1.25;
  vertical-align: middle;
}
.bi small {
  display: block;
  font-size: max(0.7em, 9.5px);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.72;
}
.card-amount .bi,
.hero-money .bi {
  font-size: inherit;
}
.engine {
  line-height: 1.3;
}

/* ---------- sort and period chips ---------- */

.filters {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
}
.filter {
  min-height: var(--tap);
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--soft);
  font-size: 13.5px;
  font-weight: 800;
}
.filter.on {
  border-color: transparent;
  background: linear-gradient(135deg, var(--p1), var(--p2));
  color: var(--onp);
}
.filters--small .filter {
  min-height: 40px;
  font-size: 12.5px;
}
.day {
  margin: 4px 2px -6px;
  font-size: 13px;
  color: var(--soft);
}
.message {
  max-height: 180px;
  flex: none;
  overflow-y: auto;
  white-space: pre-line;
  font-size: 13.5px;
}
.summary-cell dt .bi {
  line-height: 1.2;
}

/* ---------- listening banner while a question is open ---------- */

.listen.compact {
  inset: calc(10px + env(safe-area-inset-top)) auto auto 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 20px));
  gap: 4px;
  padding: 12px 16px;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.listen.compact .rings,
.listen.compact .wave,
.listen.compact .listen-hint {
  display: none;
}
.listen.compact .listen-title {
  font-size: 17px;
}
.listen.compact .listen-said {
  min-height: 0;
  font-size: 16px;
}
.listen.compact .btn {
  min-height: 36px;
  padding: 4px 12px;
}

.topbar-title p:empty {
  display: none;
}

/* ---------- short laptop screens: keep mic and typing in view ---------- */

@media (min-width: 980px) and (max-height: 780px) {
  .topbar {
    padding: 12px 18px 6px;
  }
  .col {
    gap: 9px;
  }
  .screen--home .hero {
    padding: 10px 18px;
  }
  .screen--home .hero-money {
    font-size: 34px;
  }
  .screen--home .hero-chips {
    position: absolute;
    right: 16px;
    bottom: 10px;
  }
  .mini {
    padding: 7px 12px;
  }
  .desk-talk {
    gap: 8px;
    padding: 18px 18px 12px;
  }
  .desk-talk .mic {
    width: 72px;
    height: 72px;
  }
  .desk-talk .mic svg.i {
    width: 34px;
    height: 34px;
  }
}
