:root {
  --paper: #f1edf6;
  --paper-2: #e5ddee;
  --paper-3: #d9cfdf;
  --ink: #1a1612;
  --ink-2: #4b4339;
  --ink-3: #8a8073;
  --hug: #c44a3f;
  --hug-2: #a83a30;
  --hug-soft: #ecb8ad;
  --hug-bg: #fae9e0;
  --green: #6b8e6e;
  --green-2: #2f6b40;
  --gold: #b48d4a;
  --line: #d3c8da;
  --serif:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
  --sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(
      ellipse 60% 40% at 85% -5%,
      rgba(132, 102, 178, 0.14) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 70% 50% at -5% 105%,
      rgba(196, 74, 63, 0.07) 0%,
      transparent 55%
    ),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
  background-size:
    auto,
    auto,
    180px 180px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  font-size: 16px;
}

.app {
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
  flex: 1;
}
.left-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---------- Header ---------- */
header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.brand-link {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
.brand-link:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}
.brand-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.brand-text .em {
  color: var(--hug);
  font-weight: 500;
}
.brand-text .small {
  font-size: 17px;
  color: var(--ink-3);
  margin-left: 1px;
}
.tag {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  padding-left: 14px;
  border-left: 1px solid var(--line);
  line-height: 1.3;
}
.tag em {
  font-family: var(--serif);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-2);
  font-size: 12px;
}

.meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--ink-2);
}
.meta .live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}
.meta .live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hug);
  box-shadow: 0 0 0 0 rgba(196, 74, 63, 0.55);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(196, 74, 63, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(196, 74, 63, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(196, 74, 63, 0);
  }
}

/* ---------- Mode tabs (your chat / examples) ---------- */
.mode-tabs {
  display: flex;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-top: -8px;
  padding-bottom: 1px;
}
.mode-tab {
  padding: 6px 0;
  background: transparent;
  border: 0;
  font: 500 11px var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    color 0.08s,
    border-color 0.08s;
}
.mode-tab:hover {
  color: var(--ink-2);
}
.mode-tab.active {
  color: var(--ink);
  border-bottom-color: var(--hug);
}
.restart-chat {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 7px 12px;
  font: 500 11px var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.16s,
    color 0.16s,
    transform 0.16s,
    background 0.16s;
}
.restart-chat:hover {
  border-color: var(--hug);
  background: #fff7f2;
  color: var(--hug);
  transform: translateY(-1px);
}
.app[data-mode="examples"] .restart-chat,
.app[data-mode="import"] .restart-chat {
  display: none;
}
.app[data-mode="chat"] .restart-chat {
  display: inline-flex;
}
/* Fast one-time cycling sweep on page load (visual hint that 3 modes exist) */
.mode-tab.cycling {
  color: var(--ink);
  border-bottom-color: var(--hug-soft);
}

/* ---------- Import chat panel ---------- */
.import-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
.app[data-mode="import"] .import-panel {
  display: flex;
}
.app[data-mode="import"] .scenarios {
  display: none;
}
.app[data-mode="import"] .empty-hint {
  display: none;
}
.app[data-mode="examples"] .import-panel,
.app[data-mode="chat"] .import-panel {
  display: none;
}

.import-sources {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.import-sources .label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  margin-right: 2px;
}
.import-sources .tail {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-left: 6px;
}
.src-rotator {
  display: inline-block;
  min-width: 88px;
  font: 500 13.5px var(--sans);
  color: var(--ink);
  border-bottom: 1px solid var(--hug);
  padding: 0 3px 1px;
  transform: translateY(0);
  opacity: 1;
  transition:
    opacity 0.12s ease,
    transform 0.14s ease;
  will-change: opacity, transform;
}
.src-rotator.flipping {
  opacity: 0;
  transform: translateY(-4px);
}
.sample-callout {
  display: grid;
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(159, 54, 40, 0.22);
  border-radius: 14px;
  background: #fff7f2;
  padding: 14px;
}
.sample-callout .eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--hug);
}
.sample-callout .copy {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-2);
}
.import-paste {
  width: 100%;
  min-height: 130px;
  max-height: 260px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.7);
  padding: 12px 14px;
  font: 13.5px/1.55 var(--sans);
  color: var(--ink);
  outline: none;
  resize: vertical;
  transition:
    border-color 0.15s,
    border-style 0.15s,
    background 0.15s;
}
.import-paste:focus {
  border-color: var(--ink-3);
  border-style: solid;
  background: #fffdf8;
}
.import-paste::placeholder {
  color: var(--ink-3);
  font-style: italic;
}
.import-actions {
  display: grid;
  gap: 10px;
  align-items: start;
}
.load-btn {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  font: 500 12px var(--sans);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.18s,
    transform 0.15s;
}
.load-btn:hover {
  background: var(--hug);
  transform: translateY(-1px);
}
.sample-btn {
  justify-self: start;
  background: var(--hug);
  padding-inline: 20px;
}
.sample-btn:hover {
  background: var(--ink);
}
.source-picker {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  position: relative;
}
.source-picker label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}
.ai-select {
  position: relative;
  width: min(100%, 280px);
}
.ai-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink);
  padding: 10px 12px;
  font: 13px var(--sans);
  cursor: pointer;
  transition:
    border-color 0.16s,
    box-shadow 0.16s,
    transform 0.16s;
}
.ai-select-trigger:hover,
.ai-select.open .ai-select-trigger {
  border-color: var(--hug);
  box-shadow: 0 10px 26px -22px rgba(159, 54, 40, 0.55);
}
.ai-select-trigger:focus-visible {
  outline: 2px solid rgba(159, 54, 40, 0.24);
  outline-offset: 2px;
}
.ai-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.18s;
  opacity: 0.65;
}
.ai-select.open .ai-chevron {
  transform: rotate(225deg) translateY(-2px);
}
.ai-options {
  position: absolute;
  z-index: 8;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: 226px;
  overflow-y: auto;
  display: none;
  padding: 6px;
  border: 1px solid rgba(159, 54, 40, 0.2);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 24px 48px -34px rgba(40, 25, 10, 0.34);
}
.ai-select.open .ai-options {
  display: grid;
  gap: 3px;
}
.ai-options button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  padding: 9px 10px;
  text-align: left;
  font: 13px var(--sans);
  cursor: pointer;
  transition:
    background 0.12s,
    color 0.12s,
    transform 0.12s;
}
.ai-options button:hover,
.ai-options button[aria-selected="true"] {
  background: #fff2ed;
  color: var(--hug);
}
.ai-options button:hover {
  transform: translateX(2px);
}
.import-hint {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-3);
  transition: color 0.15s;
}
.import-hint.is-url-nudge {
  color: var(--hug);
}

/* Elided-turns marker shown inside #convo for long imports */
.msg-elided {
  align-self: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 4px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  width: 70%;
  text-align: center;
  opacity: 0;
  animation: rise 0.7s forwards cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* Claude's review bubble after an import */
.msg.assistant.import-review {
  border-left: 3px solid var(--hug-soft);
  padding-left: 14px;
  margin-top: 4px;
}
.msg.assistant.import-review .review-tag {
  display: inline-block;
  font: 500 10px var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--hug-2);
  margin-bottom: 6px;
}
.llm-label {
  display: inline-block;
  margin-bottom: 7px;
  font: 700 10px var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hug);
}

/* Empty-chat hint, shown only in chat mode with no messages */
.empty-hint {
  display: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--ink-3);
  padding: 12px 4px;
}
.app[data-mode="chat"] .scenarios {
  display: none;
}
.app[data-mode="chat"]:has(#convo:empty) .empty-hint {
  display: block;
}
.app[data-mode="examples"] .empty-hint {
  display: none;
}

/* ---------- Scenario chips ---------- */
.scenarios {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.scenarios .chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 13px 7px;
  font: 500 11.5px var(--sans);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}
.scenarios .chip:hover {
  border-color: var(--ink-2);
  color: var(--ink);
  transform: translateY(-1px);
}
.scenarios .chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ---------- Chat ---------- */
main.chat {
  flex: 1;
  padding: 32px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
#convo {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 10px;
}

.greeting {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 38px;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 8px;
  opacity: 0;
  animation: rise 0.85s 0.05s forwards cubic-bezier(0.2, 0.7, 0.2, 1);
}
.greeting em {
  font-style: italic;
  color: var(--hug);
}

.msg {
  max-width: 88%;
  opacity: 0;
  animation: rise 0.7s forwards cubic-bezier(0.2, 0.7, 0.2, 1);
  scroll-margin-bottom: 170px; /* keep streamed replies clear of sticky composer */
}
.msg.user {
  align-self: flex-end;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 13px 18px;
  border-radius: 18px 18px 4px 18px;
  font-size: 15.5px;
}
.msg.user .msg-text[contenteditable="true"] {
  outline: none;
  min-width: 18ch;
  white-space: pre-wrap;
}
.msg.user .msg-text[contenteditable="true"]:focus {
  box-shadow: 0 0 0 2px rgba(196, 74, 63, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  padding: 2px 4px;
}
.user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}
.user-action-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(138, 128, 115, 0.32);
  background: rgba(255, 255, 255, 0.64);
  color: var(--ink-2);
  border-radius: 50%;
  padding: 0;
  font: 600 12px/1 var(--sans);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease,
    transform 0.12s ease;
}
.user-action-btn:hover {
  border-color: var(--hug-soft);
  color: var(--hug-2);
  background: #fff;
  transform: translateY(-1px);
}
.user-action-btn[disabled] {
  opacity: 0.55;
  cursor: default;
}
.msg.assistant {
  align-self: flex-start;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
}
.msg.assistant strong {
  font-weight: 600;
}
.ai-formatted {
  display: grid;
  gap: 10px;
}
.ai-formatted h2,
.ai-formatted h3,
.ai-formatted h4 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}
.ai-formatted h2 {
  font-size: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
}
.ai-formatted h3 {
  font-size: 19px;
  color: var(--hug);
}
.ai-formatted h4 {
  font-size: 16px;
  font-family: var(--sans);
  font-weight: 700;
}
.ai-formatted p {
  margin: 0;
}
.ai-formatted ul,
.ai-formatted ol {
  margin: 0;
  padding-left: 22px;
}
.ai-formatted li {
  margin: 5px 0;
}
.ai-formatted code {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.92em;
}
.msg.assistant .ans {
  font-family: var(--serif);
  font-weight: 500;
  background: linear-gradient(
    180deg,
    transparent 60%,
    var(--hug-soft) 60%,
    var(--hug-soft) 95%,
    transparent 95%
  );
  padding: 0 2px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* coverage badge appended to assistant msg */
.coverage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  background: var(--hug-bg);
  color: var(--hug-2);
  border: 1px solid var(--hug-soft);
  padding: 2px 10px 3px;
  border-radius: 999px;
  font: 500 10.5px var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  vertical-align: 2px;
}
.coverage svg {
  stroke: var(--hug);
}

/* ---------- Composer ---------- */
.composer-wrap {
  position: sticky;
  bottom: 14px;
  padding-top: 18px;
  background: linear-gradient(to top, var(--paper) 55%, rgba(241, 237, 246, 0));
}

.composer {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px 12px;
  box-shadow: 0 22px 50px -28px rgba(40, 25, 10, 0.22);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}
.composer.is-drop-target {
  border-color: var(--hug-soft);
  background: #fff7f3;
  box-shadow:
    0 0 0 3px rgba(196, 74, 63, 0.14),
    0 22px 50px -28px rgba(40, 25, 10, 0.22);
}
.composer textarea {
  width: 100%;
  border: 0;
  outline: none;
  resize: none;
  font: 16px/1.5 var(--sans);
  color: var(--ink);
  background: transparent;
  min-height: 22px;
  max-height: 140px;
}
.composer textarea::placeholder {
  color: var(--ink-3);
}

.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.composer-tools {
  display: flex;
  gap: 4px;
  align-items: center;
}
.drop-note {
  margin-left: 8px;
  font: 500 11px var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  user-select: none;
}
.iconbtn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s;
}
.iconbtn:hover {
  background: var(--paper-2);
}
.iconbtn.recording {
  background: var(--hug-bg);
  color: var(--hug);
  box-shadow: 0 0 0 3px rgba(196, 74, 63, 0.12);
  animation: mic-pulse 1.1s ease-in-out infinite;
}
.iconbtn.unsupported {
  opacity: 0.38;
  cursor: not-allowed;
}
@keyframes mic-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.send {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.18s,
    background 0.18s;
}
.send:hover {
  transform: translateY(-1px);
  background: var(--hug);
}

/* ---------- Right sidebar ---------- */
.bet-panel {
  position: sticky;
  top: 28px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 36px;
}

.history-panel {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 18px 40px -30px rgba(40, 25, 10, 0.16);
}
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.history-head span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}
.history-new {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  transition:
    border-color 0.18s,
    color 0.18s,
    transform 0.18s;
}
.history-new:hover {
  border-color: var(--hug);
  color: var(--hug);
  transform: translateY(-1px);
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}
.history-empty {
  color: var(--ink-3);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  padding: 8px 2px 4px;
}
.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 10px;
  padding: 8px 8px 8px 10px;
  transition:
    border-color 0.18s,
    background 0.18s;
}
.history-item.active {
  border-color: rgba(159, 54, 40, 0.35);
  background: #fff7f2;
}
.history-open {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.history-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  line-height: 1.25;
}
.history-meta {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 11px;
}
.history-delete {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  transition:
    border-color 0.18s,
    color 0.18s,
    background 0.18s;
}
.history-delete:hover {
  border-color: rgba(159, 54, 40, 0.25);
  background: #fff2ed;
  color: var(--hug);
}

/* ---------- Stakes bar (compact) ---------- */
.risk {
  padding: 0 2px;
}
.risk .head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.risk .head .verdict {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-2);
}
.risk .bar {
  display: flex;
  gap: 3px;
}
.risk .seg {
  flex: 1;
  height: 5px;
  border-radius: 2px;
  background: var(--paper-2);
  transition: background 0.35s;
}
.risk[data-band="low"] .seg.on {
  background: #6b8e6e;
}
.risk[data-band="mid"] .seg.on {
  background: #b48d4a;
}
.risk[data-band="high"] .seg.on {
  background: var(--hug);
}

/* ---------- Bounty card ---------- */
.bounty {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 40px -28px rgba(40, 25, 10, 0.18);
}
.bounty .lead {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}
.bounty .lead em {
  font-style: italic;
  color: var(--ink);
}
.bounty .amount {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 56px;
  letter-spacing: -0.03em;
  color: var(--hug);
  line-height: 1;
  margin: 12px 0 8px;
  display: inline-block;
  transition:
    color 0.35s ease,
    transform 0.3s ease,
    opacity 0.28s ease,
    text-shadow 0.35s ease;
}
.bounty .amount.is-increasing {
  color: var(--green-2);
  transform: scale(1.04);
  text-shadow: 0 0 16px rgba(74, 138, 93, 0.3);
}
.bounty .amount.is-decreasing {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
}
.bounty .amount.is-appearing {
  animation: amount-appear 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
}
@keyframes amount-appear {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.94);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.bounty .sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-3);
}

/* ---------- Primary "Submit a correct claim" CTA ---------- */
.claim-cta {
  width: 100%;
  padding: 14px 16px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  font: 500 13px var(--sans);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
  text-align: center;
}
.claim-cta:hover {
  background: var(--hug);
  transform: translateY(-1px);
}
.terms {
  margin-top: -8px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

/* ---------- Image preview (in composer) ---------- */
.composer .preview {
  display: none;
  margin: 4px 0 10px;
  gap: 8px;
  flex-wrap: wrap;
}
.composer .preview.has-image {
  display: flex;
}
.composer .preview .thumb {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 10px;
  overflow: visible;
  border: 1px solid var(--line);
}
.composer .preview .thumb img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
}
.composer .preview .thumb .x {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.composer .preview .thumb .x:hover {
  background: var(--hug);
}

/* ---------- Image in user message bubble ---------- */
.msg.user .attached-img {
  display: block;
  max-width: 280px;
  max-height: 220px;
  margin: 0 0 8px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.18s ease;
}
.msg.user .attached-img:hover {
  transform: scale(1.015);
}

/* ---------- Lightbox (click attached-img to expand) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 48px;
  cursor: zoom-out;
}
.lightbox.open {
  display: flex;
  animation: lb-fade 0.22s ease;
}
@keyframes lb-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  cursor: default;
}
.lightbox .close {
  position: absolute;
  top: 22px;
  right: 28px;
  background: transparent;
  color: var(--paper);
  border: 0;
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.lightbox .close:hover {
  opacity: 1;
}
.lightbox .caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--paper);
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  opacity: 0.55;
  letter-spacing: 0.04em;
}

/* ---------- Streaming cursor ---------- */
.cursor {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--ink);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 12px 22px;
  font: 500 13.5px var(--sans);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 50;
  box-shadow: 0 22px 40px -10px rgba(0, 0, 0, 0.32);
  max-width: calc(100vw - 32px);
}
.toast .h {
  color: var(--hug-soft);
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Footer micro ---------- */
.micro {
  text-align: center;
  padding: 16px 0 24px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--ink-3);
}
.micro .sep {
  margin: 0 10px;
  color: var(--line);
}
.micro em {
  font-family: var(--serif);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-2);
  font-size: 12px;
}

/* responsive */
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .bet-panel {
    position: static;
    padding-top: 0;
  }
}
@media (max-width: 720px) {
  .greeting {
    font-size: 28px;
  }
  .meta .live {
    display: none;
  }
  .tag {
    display: none;
  }
}
