/* --- FinAI design system cards (v3.4.1) --- */
.finai-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  padding: 16px 18px;
  margin: 12px 0;
}
.finai-card .card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.finai-card .card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.finai-card .card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green { background: color-mix(in srgb, var(--win) 18%, transparent); color: var(--win-ink); }
.badge-red { background: color-mix(in srgb, var(--action) 18%, transparent); color: var(--action); }
.badge-amber { background: color-mix(in srgb, var(--coin) 18%, transparent); color: var(--coin-ink); }
.badge-blue { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info-ink); }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.metrics-grid.compact { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.metric { padding: 8px 10px; border-radius: 10px; background: var(--paper-2); }
.metric-label { font-size: 11px; color: var(--muted); }
.metric-value { font-size: 14px; font-weight: 700; margin-top: 2px; }
.market-hero-price {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
  background: none;
  color: var(--ink);
}
.sim-bars { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.sim-row { display: grid; grid-template-columns: 88px 1fr 88px; gap: 10px; align-items: center; }
.sim-label { font-size: 12px; color: var(--muted); }
.sim-track { height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.sim-fill { height: 100%; border-radius: 999px; }
.sim-val { font-size: 12px; font-weight: 600; text-align: right; }

/* Interactive Monte Carlo widget */
.finai-mc-widget { position: relative; }
.finai-mc-widget.mc-loading .mc-fan-host { opacity: 0.55; }
.mc-fan-host { margin: 8px 0 12px; min-height: 200px; }
.finai-mc-fan-chart { width: 100%; height: auto; display: block; }
.mc-fan-band { fill: color-mix(in srgb, var(--rare) 22%, transparent); stroke: none; }
.mc-fan-median { stroke: var(--info); stroke-width: 2.5; }
.mc-target-line { stroke: var(--coin); stroke-width: 1.5; stroke-dasharray: 6 4; }
.mc-fan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.mc-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.mc-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.mc-swatch.band { background: color-mix(in srgb, var(--rare) 35%, transparent); }
.mc-swatch.median { background: var(--info); }
.mc-swatch.target { background: var(--coin); }
.mc-controls { display: grid; gap: 12px; margin: 12px 0; }
.mc-control {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.mc-control input[type="range"] { width: 100%; }
.mc-num-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 8px;
}
.mc-target-input::placeholder { color: var(--muted); opacity: 0.8; }
.mc-target-note {
  font-size: 11px;
  color: var(--coin-ink);
}
.mc-risk-fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.mc-risk-fieldset legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.mc-disclaimer { font-size: 11px; margin-top: 8px; }
.mc-success-wrap { margin-left: auto; }
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.card-action-btn {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--rare) 12%, transparent);
  color: var(--ink);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: normal;
  line-height: 1.35;
  text-align: left;
  max-width: 100%;
}
.card-action-btn:hover { background: color-mix(in srgb, var(--rare) 22%, transparent); }
.finai-macro-card .macro-indicators { margin: 8px 0; }
.finai-risk-card .sector-breakdown { margin: 8px 0; }
.finai-steps-card .roadmap-list { margin: 8px 0 0; padding-left: 20px; }
.finai-card-text p { margin: 0; color: var(--ink); line-height: 1.5; }
.finai-clarification-card .clarification-questions {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--ink);
}
.finai-clarification-card .clarification-questions li { margin: 6px 0; }
.missing-pieces {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 4px;
}
.missing-pieces .piece {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--coin) 45%, transparent);
  background: color-mix(in srgb, var(--coin) 6%, transparent);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.missing-pieces .piece.filled {
  border-style: solid;
  border-color: color-mix(in srgb, var(--win) 55%, transparent);
  background: color-mix(in srgb, var(--win) 10%, transparent);
  animation: piece-snap 0.45s ease-out;
}
.missing-pieces .piece-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.missing-pieces .piece-value { font-weight: 600; color: var(--ink); text-transform: capitalize; }
.missing-pieces .piece.empty .piece-value { font-weight: 400; color: var(--muted); text-transform: none; }
.missing-pieces .piece-choices { display: flex; flex-wrap: wrap; gap: 4px; }
.missing-pieces .piece-choice {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--coin) 50%, transparent);
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.missing-pieces .piece-choice:hover { background: color-mix(in srgb, var(--coin) 18%, transparent); }
.finai-clarification-card .pieces-note { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
@keyframes piece-snap {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .missing-pieces .piece.filled { animation: none; }
}
@media (max-width: 520px) {
  .missing-pieces { grid-template-columns: 1fr; }
}
.rule-twist {
  margin: 14px 0 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--coin) 40%, transparent);
  background: color-mix(in srgb, var(--coin) 5%, transparent);
}
.rule-twist.call-first { border-color: color-mix(in srgb, var(--win) 55%, transparent); background: color-mix(in srgb, var(--win) 6%, transparent); }
.rule-twist-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.rule-twist-prompt { margin: 6px 0 10px; font-weight: 600; color: var(--ink); }
.rule-twist-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-twist-choices button,
.bias-spot-choices button {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--coin) 50%, transparent);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.rule-twist-choices button:hover:not(:disabled) { background: color-mix(in srgb, var(--coin) 18%, transparent); }
.rule-twist-choices button:disabled { cursor: default; opacity: 0.55; }
.rule-twist-choices button.picked { opacity: 1; border-color: color-mix(in srgb, var(--action) 70%, transparent); }
.rule-twist-choices button.right { opacity: 1; border-color: color-mix(in srgb, var(--win) 80%, transparent); background: color-mix(in srgb, var(--win) 16%, transparent); animation: piece-snap 0.45s ease-out; }
.rule-twist-result { margin: 10px 0 0; font-size: 13px; color: var(--ink); }
.bias-spot {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--rare) 50%, transparent);
  background: color-mix(in srgb, var(--rare) 7%, transparent);
  animation: piece-snap 0.45s ease-out;
}
.bias-spot.kept { border-color: color-mix(in srgb, var(--win) 55%, transparent); }
.bias-spot p { margin: 0; }
.bias-spot-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.bias-spot-quote { margin-top: 2px !important; font-style: italic; color: var(--muted); }

.bias-spot-result { margin-top: 8px !important; font-size: 13px; color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .bias-spot { animation: none; }
}
.rule-held { display: block; }
.rule-held.open { display: block; animation: piece-snap 0.35s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .rule-twist-choices button.right, .rule-held.open { animation: none; }
}
.finai-error-card .error-detail {
  margin: 8px 0 0;
  color: var(--action);
  line-height: 1.45;
}
.finai-fx-card .market-hero-price { margin-bottom: 8px; }

/* Track B — decision intelligence + autonomous monitor */

.portfolio-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.portfolio-score-item {
  padding: 10px;
  border-radius: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.portfolio-score-label { font-size: 12px; color: var(--muted); }
.portfolio-score-value { font-size: 20px; font-weight: 700; margin-top: 4px; }

.finai-comparison-card .comparison-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.finai-comparison-card .comparison-side {
  padding: 12px;
  border-radius: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.comparison-side-title {
  font-weight: 700;
  margin-bottom: 8px;
  white-space: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.comparison-dimensions-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}
.comparison-dimensions-table th,
.comparison-dimensions-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}
.comparison-verdict {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--raised);
}

.public-demo-banner {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--raised);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.public-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 8px 16px;
  color: var(--muted);
  font-size: 12px;
}

.public-footer span {
  margin-right: auto;
}

.public-footer a {
  color: var(--ink);
}

.legal-page {
  width: min(760px, calc(100% - 32px));
  margin: 32px auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  line-height: 1.6;
}

.legal-page h1,
.legal-page h2 {
  margin-top: 0;
}

.legal-page h2 {
  margin-top: 24px;
}

.legal-page a {
  color: var(--ink);
}

.chat-game-title {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.2;
  color: var(--ink);
}
.chat-game form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.chat-game form label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.chat-game form input,
.chat-game form button,
.chat-game > button {
  font: inherit;
  font-size: 13px;
}
.chat-game form input[type="number"],
.chat-game form input[type="text"] {
  width: 100%;
  max-width: none;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--scrim);
  color: var(--ink);
}
.chat-game-why {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.chat-game-step {
  margin: 2px 0 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--world-home);
}
.answer-covered {
  position: relative;
  min-height: 84px;
  padding: 28px 16px 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--coin) 35%, transparent);
  background: var(--raised);
  box-shadow: inset 0 0 0 7px color-mix(in srgb, var(--coin) 6%, transparent);
}
.answer-covered::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--raised);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--coin) 16%, transparent);
}
.answer-covered-note {
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.answer-covered.is-opening {
  animation: letter-open 0.28s ease forwards;
}
@keyframes letter-open {
  to { transform: translateY(-8px); opacity: 0; }
}
.puzzle-tray,
.puzzle-bank {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 8px;
}
.puzzle-tray {
  min-height: 64px;
  padding: 8px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--coin) 55%, transparent);
}
.puzzle-tray:empty::before {
  content: "Place it here";
  color: var(--muted);
  font-size: 12px;
}
.puzzle-tray[data-hint]:empty::before { content: attr(data-hint); }
.puzzle-tray.is-hot {
  border-style: solid;
  background: color-mix(in srgb, var(--coin) 8%, transparent);
}
.puzzle-tray.is-shaking { animation: tray-shake 0.28s ease; }
@keyframes tray-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.chat-game.is-wrong .puzzle-tray { border-color: var(--action); }
.puzzle-tile.is-set { animation: tile-set 0.18s ease; }
@keyframes tile-set {
  from { transform: translateY(-6px); }
  to { transform: none; }
}
.puzzle-tile.is-dragging { opacity: 0.35; }
.puzzle-ghost {
  position: fixed;
  z-index: 80;
  margin: 0;
  pointer-events: none;
  transform: rotate(-2deg);
  box-shadow: var(--shadow-card);
}
.chat-game[data-game="fee"] .puzzle-tile,
.chat-game[data-game="inflation"] .puzzle-tile {
  background: var(--raised);
}
.chat-game[data-game="puzzle"] .puzzle-tray,
.chat-game[data-game="city"] .puzzle-tray { counter-reset: piece; }
.chat-game[data-game="puzzle"] .puzzle-tray .puzzle-tile,
.chat-game[data-game="city"] .puzzle-tray .puzzle-tile {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.chat-game[data-game="puzzle"] .puzzle-tray .puzzle-tile::before,
.chat-game[data-game="city"] .puzzle-tray .puzzle-tile::before {
  counter-increment: piece;
  content: counter(piece);
  flex: 0 0 auto;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  background: color-mix(in srgb, var(--coin) 22%, transparent);
  color: var(--world-home);
  font-size: 12px;
  line-height: 1.4em;
  text-align: center;
}
.chat-game[data-game="call"] .puzzle-tile[data-dir="higher"]::before { content: "↑ "; }
.chat-game[data-game="call"] .puzzle-tile[data-dir="flat"]::before { content: "– "; }
.chat-game[data-game="call"] .puzzle-tile[data-dir="lower"]::before { content: "↓ "; }
.puzzle-tile {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
}
.puzzle-tile:hover { border-color: color-mix(in srgb, var(--coin) 55%, transparent); }
.puzzle-rank {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(48px, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.puzzle-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--paper-2);
  overflow: hidden;
}
.puzzle-bar i {
  display: block;
  height: 100%;
  background: var(--info);
}
.chat-game form button,
.chat-game > button.chat-scene-start,
.chat-game > button.chat-city-load,
.chat-game > button.chat-quest-save,
.chat-game > button.chat-call-start,
.chat-game > button.puzzle-lock,
.chat-game button.puzzle-lock {
  width: 100%;
  padding: 10px 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--info) 22%, transparent);
  border: 1px solid transparent;
}
.chat-game button.puzzle-lock:not(:disabled),
.chat-game .chat-call-lock:not(:disabled) {
  background: color-mix(in srgb, var(--coin) 28%, transparent);
  border-color: color-mix(in srgb, var(--coin) 70%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .puzzle-tile.is-set,
  .puzzle-tray.is-shaking,
  .answer-covered.is-opening,
  .chat-game .puzzle-tile:hover,
  .answer-covered.is-inking::before,
  .chat-game .lesson-meter i,
  .chat-game .bite-fill { animation: none; transform: none; transition: none; }
}
.chat-game {
  padding: 14px 14px 16px;
  border-radius: 22px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}
.chat-game-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}
.chat-game-title::before {
  content: "";
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 2.5px solid var(--on-color);
  box-shadow: 0 3px 0 var(--on-color);
  background: var(--coin) center / 22px no-repeat;
}
.chat-game[data-game="fee"] .chat-game-title::before {
  background-color: var(--coin);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='18' r='8' fill='%23fff' stroke='%232b241c' stroke-width='2'/%3E%3Cpath d='M11 11l2 4 3-4 3 4 2-4' fill='none' stroke='%232b241c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.chat-game[data-game="inflation"] .chat-game-title::before {
  background-color: var(--rare);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8 14c0-6 16-6 16 2v10H8V14z' fill='%23fff' stroke='%232b241c' stroke-width='2'/%3E%3Ccircle cx='13' cy='18' r='1.4' fill='%232b241c'/%3E%3Ccircle cx='19' cy='18' r='1.4' fill='%232b241c'/%3E%3Cpath d='M13 22c1.4 1.4 4.6 1.4 6 0' fill='none' stroke='%232b241c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
.chat-game[data-game="call"] .chat-game-title::before {
  background-color: var(--info);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8 8h12l4 4v12H8z' fill='%23fff' stroke='%232b241c' stroke-width='2'/%3E%3Cpath d='M16 14v8M12 18h8' fill='none' stroke='%232b241c' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
.chat-game[data-game="impulse"] .chat-game-title::before {
  background-color: var(--action);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 6l8 4v7c0 5-3.4 8-8 9-4.6-1-8-4-8-9V10z' fill='%23fff' stroke='%232b241c' stroke-width='2'/%3E%3C/svg%3E");
}
.chat-game[data-game="flaw"] .chat-game-title::before {
  background-color: var(--coin);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='14' cy='14' r='6' fill='%23fff' stroke='%232b241c' stroke-width='2'/%3E%3Cpath d='M18 18l6 6' stroke='%232b241c' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");
}
.chat-game[data-game="advisor"] .chat-game-title::before {
  background-color: var(--win);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M7 9h14v10H12l-5 4V9z' fill='%23fff' stroke='%232b241c' stroke-width='2'/%3E%3C/svg%3E");
}
.chat-game[data-game="city"] .chat-game-title::before,
.chat-game[data-game="puzzle"] .chat-game-title::before {
  background-color: var(--info);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M7 22V12h5v10M14 22V8h6v14M22 22v-6h4v6' fill='%23fff' stroke='%232b241c' stroke-width='2'/%3E%3C/svg%3E");
}
.chat-game[data-game="quest"] .chat-game-title::before,
.chat-game[data-game="cards"] .chat-game-title::before,
.chat-game[data-game="ask"] .chat-game-title::before {
  background-color: var(--card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 7l2.2 5.2L24 15l-5.8 2.2L16 23l-2.2-5.8L8 15l5.8-2.8z' fill='%23fff' stroke='%232b241c' stroke-width='1.8'/%3E%3C/svg%3E");
}
.chat-game .chat-game-why,
.chat-game .chat-game-note,
.chat-game .chat-game-line,
.chat-game label,
.chat-game .aurin-keep,
.chat-game .aurin-question {
  color: var(--raised);
}
.chat-game .chat-game-step {
  display: inline-block;
  margin: 2px 0 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--on-color);
  color: var(--coin-ink);
  font-weight: 800;
}
.chat-game .finn {
  width: 68px;
  height: 68px;
}
.chat-game .aurin-name { color: var(--world-home); }
.chat-game .puzzle-tray {
  min-height: 78px;
  border-radius: 18px;
  border: 3px dashed var(--on-color);
  background: var(--card);
}
.chat-game .puzzle-tray:empty::before {
  color: var(--action-shadow);
  font-weight: 800;
}
.chat-game .puzzle-tray.is-hot {
  background: var(--card);
  border-style: solid;
}
.chat-game .puzzle-tile {
  border: 2.5px solid var(--on-color);
  border-radius: 16px;
  background: var(--card);
  color: var(--on-color);
  font-weight: 800;
  box-shadow: 0 4px 0 var(--on-color);
}
.chat-game .puzzle-tile:hover {
  transform: translateY(-2px);
  border-color: var(--on-color);
}
.chat-game .puzzle-tile:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--on-color);
}
.chat-game[data-game="fee"] .puzzle-tile,
.chat-game[data-game="inflation"] .puzzle-tile {
  background: var(--raised);
}
.chat-game form input[type="number"],
.chat-game form input[type="text"],
.chat-game input[type="text"] {
  border: 2.5px solid var(--on-color);
  border-radius: 14px;
  background: var(--card);
  color: var(--on-color);
  font-weight: 700;
}
.chat-game form button,
.chat-game > button.chat-scene-start,
.chat-game > button.chat-city-load,
.chat-game > button.chat-quest-save,
.chat-game > button.chat-call-start,
.chat-game > button.puzzle-lock,
.chat-game button.puzzle-lock,
.chat-game .chat-call-lock {
  border: 3px solid var(--on-color);
  border-radius: 16px;
  background: var(--info);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 4px 0 var(--info);
}
.chat-game button.puzzle-lock:disabled,
.chat-game .chat-call-lock:disabled {
  background: var(--card);
  color: var(--action-shadow);
  border-color: var(--muted);
  box-shadow: none;
}
.chat-game button.puzzle-lock,
.chat-game .chat-call-lock {
  display: none;
}
.chat-game .puzzle-tray.is-board {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  border-style: solid;
  border-color: var(--muted);
  background:
    var(--raised) padding-box,
    var(--panel);
}
.chat-game[data-game="city"] .puzzle-tray.is-board {
  flex-direction: column;
}
.chat-game .board-slot {
  position: relative;
  flex: 1 1 140px;
  min-height: 76px;
  margin: 0;
  padding: 22px 8px 8px;
  border-radius: 14px;
  border: 2.5px dashed var(--on-color);
  background: var(--card);
  box-shadow: inset 0 0 0 3px var(--card);
}
.chat-game[data-game="city"] .board-slot { flex: 1 1 auto; }
.chat-game .board-slot-no {
  position: absolute;
  top: 4px;
  left: 8px;
  color: var(--action-shadow);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chat-game .board-slot .puzzle-tile {
  width: 100%;
  min-height: 44px;
}
.chat-game .board-slot.is-hot,
.chat-game.is-inking .board-slot:has(.puzzle-tile) {
  background: var(--card);
  border-style: solid;
}
.chat-game .puzzle-tray.is-lanes { flex-wrap: nowrap; }
.chat-game .is-lanes .board-slot {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}
.chat-game .puzzle-bank.is-hand,
.chat-game .puzzle-bank.is-ruler {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
}
.chat-game .is-hand .puzzle-tile,
.chat-game .is-ruler .puzzle-tile {
  flex: 1 1 120px;
  width: auto;
}
.chat-game .is-ruler {
  align-items: flex-end;
  padding: 8px 4px 0;
  border-top: 3px solid var(--on-color);
}
.chat-game[data-game="puzzle"] .board-slot .puzzle-tile::before,
.chat-game[data-game="city"] .board-slot .puzzle-tile::before { content: none; }
.chat-game .lesson-board { display: grid; gap: 8px; margin: 0 0 8px; }
.chat-game .lesson-picture {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  height: 120px;
}
.chat-game .lesson-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chat-game .lesson-label { color: var(--line); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.chat-game .lesson-meter {
  flex: 1;
  display: flex;
  align-items: flex-end;
  border: 2.5px solid var(--on-color);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.chat-game .lesson-meter i {
  display: block;
  width: 100%;
  height: 0;
  background: var(--info);
  transition: height 0.25s ease;
}
.lesson-col[data-side="right"] .lesson-meter i { background: var(--action); }
.chat-game .bite-meter {
  position: relative;
  height: 16px;
  border: 2.5px solid var(--on-color);
  border-radius: 999px;
  background: var(--card);
  overflow: hidden;
}
.chat-game .bite-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--coin);
  transition: width 0.25s ease;
}
.chat-game .bite-notch {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  margin-left: -1.5px;
  background: var(--on-color);
}
.chat-game .lesson-readout { margin: 0; color: var(--raised); font-size: 13px; font-weight: 700; }
.chat-game .year-track { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-game .year-mark {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 8px;
  border: 2.5px solid var(--on-color);
  border-radius: 12px;
  background: var(--card);
  color: var(--on-color);
  font-weight: 800;
  box-shadow: 0 3px 0 var(--on-color);
  cursor: pointer;
}
.chat-game .year-mark.is-selected { background: var(--line); color: var(--ink); }
.chat-game .year-mark.is-truth { background: var(--info); color: var(--ink); }
.chat-game-stars,
.map-stars {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
.chat-jargon {
  min-height: 44px;
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.chat-jargon-note,
.chat-game-disclaimer {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
}
.chat-game button:focus-visible,
.year-mark:focus-visible,
.chat-jargon:focus-visible,
.rule-twist-choices button:focus-visible,
.bias-spot-choices button:focus-visible,
.map-choice:focus-visible,
.map-rate:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
.bias-spot-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bias-spot-choices button {
  border: 1px solid color-mix(in srgb, var(--rare) 60%, transparent);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.map-try { display: grid; gap: 8px; margin-top: 12px; }
.map-rate {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
@media (max-width: 390px) {
  .chat-game {
    max-width: 100%;
    padding: 10px;
    box-shadow: none;
  }
  .chat-game form {
    flex-direction: column;
    align-items: stretch;
  }
  .chat-game input[type="number"],
  .chat-game input[type="text"],
  .chat-game input[type="range"] {
    max-width: 100%;
    width: 100%;
  }
  .map-sheet { padding: 8px; }
  .map-sheet-card { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-game .finn,
  .chat-game .lesson-meter i,
  .chat-game .bite-fill,
  .chat-game .puzzle-tile,
  .year-mark,
  .map-sheet .finn {
    animation: none;
    transition: none;
  }
}
.chat-game .call-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  height: 36px;
  margin: 0 0 8px;
  border: 2.5px solid var(--on-color);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.chat-game .call-track span {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--action-shadow);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.call-track span + span { border-left: 2px solid var(--on-color); }
.chat-game .call-stamp,
.chat-game .call-close {
  position: absolute;
  top: 6px;
  width: 14px;
  height: 22px;
  margin-left: -7px;
  border: 2.5px solid var(--on-color);
  border-radius: 7px;
}
.chat-game .call-stamp { background: var(--info); }
.chat-game .call-close { background: var(--coin); height: 10px; top: 12px; }
.answer-covered:not(:has(.answer-covered-note)) { display: none; }
.answer-covered.is-inking::before {
  animation: seal-wobble 0.18s ease-in-out infinite;
}
@keyframes seal-wobble {
  50% { transform: rotate(-10deg) scale(1.12); }
}
.chat-game .chat-game-result {
  border: 2.5px solid var(--on-color);
  border-radius: 14px;
  background: var(--card);
  color: var(--panel);
  font-weight: 700;
}
.answer-covered {
  border-radius: 20px;
  border: 3px solid var(--on-color);
  background: var(--card);
  box-shadow: 0 5px 0 var(--raised);
}
.answer-covered::before {
  width: 26px;
  height: 26px;
  margin-left: -13px;
  border: 2.5px solid var(--on-color);
  background: var(--raised);
  box-shadow: 0 2px 0 var(--on-color);
}
.answer-covered-note {
  color: var(--line);
  font-weight: 800;
}
.chat-scene-choices,
.chat-fee-choices,
.chat-call-dirs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 8px;
}
.chat-call-dirs {
  flex-direction: row;
}
.chat-call-dirs button {
  flex: 1;
  text-align: center;
}
.chat-scene-choices button,
.chat-fee-choices button,
.chat-call-dirs button {
  width: 100%;
  min-height: 44px;
  text-align: left;
}
.chat-call-dirs button { text-align: center; }
.chat-game-result {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--info) 10%, transparent);
}
.chat-game > label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 13px;
}

.plan-set-label {
  margin-right: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pane-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  z-index: 6;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}
.pane-resize:hover,
.pane-resize.is-dragging {
  background: color-mix(in srgb, var(--info) 45%, transparent);
}
.pane-resize-side { right: 0; }

@media (max-width: 980px) {
  .pane-resize-side { display: none; }
}

.cooldown-offer {
  margin: 14px 0 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--info) 50%, transparent);
  background: color-mix(in srgb, var(--info) 6%, transparent);
}
.cooldown-offer.parked { border-color: color-mix(in srgb, var(--win) 55%, transparent); }
.cooldown-offer p { margin: 0; }
.cooldown-kicker {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cooldown-line { margin-top: 6px !important; color: var(--ink); }
.cooldown-offer [data-cooldown-park] {
  margin-top: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--info) 60%, transparent);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.cooldown-offer [data-cooldown-park]:hover:not(:disabled) { background: color-mix(in srgb, var(--info) 18%, transparent); }
.cooldown-offer [data-cooldown-park]:disabled { cursor: default; opacity: 0.6; }
.cooldown-result { margin-top: 8px !important; font-size: 13px; color: var(--ink); }
.morning-brief-strip {
  margin: 0 18px 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}
.brief-row { display: flex; flex-wrap: wrap; gap: 6px; }
.brief-chip {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.brief-chip-label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brief-note,
.brief-empty {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.desk-contract h4,
.advisor-monitor h4 {
  margin: 10px 0 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Arcade Night components */
.btn-game {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--action);
  color: var(--on-action);
  box-shadow: var(--press-shadow);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--motion-tap) ease, box-shadow var(--motion-tap) ease;
}
.btn-game:active {
  transform: translateY(5px);
  box-shadow: 0 0 0 var(--action-shadow);
}
.btn-game-secondary {
  background: var(--raised);
  color: var(--ink);
  box-shadow: var(--press-shadow-soft);
}
.btn-game-secondary:active { box-shadow: 0 0 0 var(--bg); }
.sheet-primary { width: 100%; margin-top: 12px; }
.btn-text {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.map-sheet .map-choice { box-shadow: 0 4px 0 var(--bg); }

.pill-xp,
.pill-streak {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--ink);
  font-family: var(--font-ui); font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
}
.pill-xp { color: var(--coin-ink); border-color: var(--coin); }
.pill-streak { color: var(--world-home); }

.rarity-common { border: 1px solid var(--line); }
.rarity-rare { border: 1px solid var(--info); }
.rarity-epic {
  border: 1px solid var(--rare);
  box-shadow: 0 0 16px color-mix(in srgb, var(--rare) 35%, transparent);
}
.sheet {
  position: fixed;
  z-index: var(--z-sheet);
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-5) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}
.toast {
  position: fixed;
  z-index: var(--z-toast);
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .btn-game { transition: none; }
  .btn-game:active { transform: none; }
}
