/* AI builder: chat panel + live canvas (matches ui_kits/schooka-app/Create.jsx) */

.builder-shell { display: block; }

.builder {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Chat panel ---------- */

.builder-chat {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--border-soft);
}

.builder-chat__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-soft);
}
.builder-chat__title { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.builder-chat__credits {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-700);
  background: var(--yellow-100);
  border-radius: var(--radius-pill);
  padding: 5px 11px;
}
.builder-chat__credits svg { color: var(--yellow-600); }
.builder-chat__subtitle { font-size: 12.5px; color: var(--text-muted); }

.builder-chat__scroll { flex: 1; overflow-y: auto; }
.builder-chat__messages,
#typing {
  padding: 18px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#typing { padding-top: 14px; padding-bottom: 4px; }

.builder-chat__footer {
  padding: 12px 16px 16px;
  background: var(--surface-card);
  border-top: 1px solid var(--border-soft);
}

/* ---------- Bubbles ---------- */

.bubble-row { display: flex; gap: 10px; }
.bubble-row--me { flex-direction: row-reverse; }

.bubble-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-100);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bubble-avatar img { width: 32px; margin-bottom: -2px; }

.bubble-image {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  overflow: hidden;
  width: 280px;
  max-width: 78%;
  box-shadow: 0 1px 0 rgba(30, 42, 99, .06);
}
.bubble-image__img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  background: var(--blue-100);
  animation: bubble-image-in .25s var(--ease-bounce);
}
.bubble-image__caption {
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes bubble-image-in {
  from { transform: scale(.9); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.bubble {
  max-width: 78%;
  padding: 10px 14px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-wrap;
}
.bubble--bot {
  background: var(--surface-card);
  color: var(--ink-900);
  border: 1px solid var(--border-soft);
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 1px 0 rgba(30, 42, 99, .06);
}
.bubble--me {
  background: var(--ink-900);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
}

/* Question card (agent asks with tappable answers) */

.question-card {
  background: var(--yellow-100);
  border: 2px solid var(--yellow-500);
  border-radius: 16px;
  padding: 14px 16px;
  max-width: 92%;
}
.question-card__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.question-card__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--yellow-500);
  color: var(--ink-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.question-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
}
.question-card__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.question-card__chip {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 16px;
  min-height: 40px;
  background: var(--surface-card);
  color: var(--ink-900);
  border: 2px solid var(--ink-900);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform var(--speed-fast) var(--ease-out), box-shadow var(--speed-fast) var(--ease-out);
}
.question-card__chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sticker); }
.question-card__chip:active { transform: translateY(2px); box-shadow: none; }
.credits-exhausted__copy {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  margin: 10px 0 0;
}

.question-card__hint {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--yellow-600);
}

/* Narration carousel (consecutive clips self-assemble into one card) */

.narration-card {
  width: min(300px, 88%);
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(30, 42, 99, .06);
}
.narration-card audio { display: none; }
.narration-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--blue-100);
}
.narration-card__headicon { color: var(--blue-600); flex-shrink: 0; }
.narration-card__headtitle { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; }
.narration-card__counter { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--ink-500); }
.narration-card__body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.narration-card__play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-500);
  color: #fff;
  border: 2px solid var(--ink-900);
  box-shadow: 0 2px 0 var(--ink-900);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--speed-fast) var(--ease-out), box-shadow var(--speed-fast) var(--ease-out);
}
.narration-card--playing .narration-card__play { transform: translateY(2px); box-shadow: none; }
.narration-card__play span { display: inline-flex; } /* kill the inline line-box that skews the svg */
.narration-card__play span[hidden] { display: none; }
.narration-card__meta { flex: 1; min-width: 0; }
.narration-card__titlerow { display: flex; align-items: center; gap: 6px; }
.narration-card__title {
  font-weight: 800;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.narration-card__lang {
  font-size: 10.5px;
  font-weight: 800;
  background: var(--teal-100);
  color: var(--teal-600);
  border-radius: 6px;
  padding: 1px 6px;
  flex-shrink: 0;
}
.narration-card__sub {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.2em;
}
.narration-card__track {
  height: 4px;
  border-radius: 2px;
  background: var(--paper, var(--blue-100));
  margin-top: 6px;
  overflow: hidden;
}
.narration-card__fill {
  height: 100%;
  width: 0;
  background: var(--blue-500);
  border-radius: 2px;
  transition: width .1s linear;
}
.narration-card__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 11px;
}
.narration-card__navbtn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  background: var(--blue-100);
  cursor: pointer;
}
.narration-card__dots { display: flex; gap: 5px; flex: 1; justify-content: center; }
.narration-card__dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  border: none;
  padding: 0;
  background: var(--border-soft);
  cursor: pointer;
  transition: all var(--speed-fast) var(--ease-out);
}
.narration-card__dot--active { width: 18px; background: var(--blue-500); }

/* Structured chat cards (show_card tool: success checklist / info rows) */

.chat-card { border-radius: 16px; padding: 12px 16px; max-width: 88%; min-width: 240px; }
.chat-card--success { background: var(--teal-100); border: 2px solid var(--teal-500); }
.chat-card--info {
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(30, 42, 99, .06);
}
.chat-card__head { display: flex; align-items: center; gap: 8px; }
.chat-card__check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal-500);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-card__title { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.3; }
.chat-card__bullets {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-card__bullets li {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-700);
  display: flex;
  gap: 7px;
}
.chat-card__bullets li::before { content: "•"; color: var(--teal-600); }
.chat-card__rows { display: flex; flex-direction: column; }
.chat-card__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-900);
}
.chat-card__row + .chat-card__row { border-top: 1px solid var(--border-soft); }
.chat-card__rowicon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--blue-100);
  color: var(--blue-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bubble--typing {
  white-space: normal;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
}

.typing-status {
  display: block;
  margin-top: 0;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-muted);
  animation: status-pulse 1.6s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.typing-caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--blue-400);
  border-radius: 2px;
  animation: caret-blink 1s steps(2) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.typing-dots { display: inline-flex; gap: 4px; align-items: center; }
.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-300);
  animation: typing-bounce 1s infinite var(--ease-bounce);
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: none; opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- Chat input ---------- */

.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input {
  flex: 1;
  resize: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 12px;
  border: 2px solid var(--border-soft);
  border-radius: var(--radius-md);
  color: var(--ink-900);
  background: var(--surface-card);
}
.chat-input:focus, .chat-input:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-900);
  cursor: pointer;
  transition: background var(--speed-fast) var(--ease-out), transform var(--speed-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--surface-tint-blue); }
.icon-btn--primary {
  background: var(--brand-primary);
  color: #fff;
  border: var(--outline-ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sticker);
}
.icon-btn--primary:hover { background: var(--brand-primary-hover); transform: translateY(-1px); }
.icon-btn--primary:active { transform: translateY(3px); box-shadow: none; }

/* ---------- Player & touchboard ---------- */

.player { display: flex; flex-direction: column; height: 100vh; }
.player__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.player__wordmark { font-size: var(--text-lg); }
.player__title { font-size: var(--text-lg); }
.player__cover {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--ink-900);
  flex-shrink: 0;
}
.player__cover img { width: 100%; height: 100%; object-fit: cover; }
.player__spacer { flex: 1; }
.player__byline { font-size: var(--text-sm); color: var(--text-muted); font-weight: 700; }
.player__frame { flex: 1; width: 100%; border: none; background: var(--paper); }
.player__frame--teaser { filter: blur(3px) saturate(.9); pointer-events: none; user-select: none; }

/* Signup gate over shared activities */

.signup-gate {
  position: fixed;
  inset: 0;
  background: rgba(30, 42, 99, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 24px;
}
.signup-gate__card {
  background: var(--surface-card);
  border: var(--outline-ink);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-pop);
  padding: 32px 36px 28px;
  max-width: 430px;
  width: 100%;
  text-align: center;
  position: relative;
  animation: gate-in .35s var(--ease-bounce);
}
@keyframes gate-in {
  from { opacity: 0; transform: scale(.92) translateY(14px); }
  to { opacity: 1; transform: none; }
}
.signup-gate__kooka {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--blue-100);
  object-fit: cover;
  object-position: top;
}
.signup-gate__card h2 { font-size: var(--text-xl); margin-top: 10px; }
.signup-gate__card p { color: var(--text-muted); font-weight: 600; font-size: var(--text-sm); margin: 8px 0 18px; }
.signup-gate__login { margin-top: 14px; font-size: var(--text-sm); }

.touchboard { min-height: 100vh; display: flex; flex-direction: column; }
.touchboard__bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-soft);
}
.touchboard__logo { height: 46px; }
.touchboard__bar h1 { font-size: var(--text-xl); }
.touchboard__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 28px;
}
.touchboard-tile { padding: 0; text-decoration: none; color: var(--ink-900); display: block; }
.touchboard-tile:hover { color: var(--ink-900); }
.touchboard-tile__band {
  height: 170px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.touchboard-tile__cover { width: 100%; height: 100%; object-fit: cover; }
.touchboard-tile__kooka { height: 150px; margin-bottom: -8px; }
.touchboard-tile__body { padding: 16px 18px 18px; }
.touchboard-tile__title { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); }
.touchboard-tile__meta { font-size: var(--text-sm); font-weight: 700; color: var(--text-muted); margin-top: 2px; }
.touchboard__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.touchboard__empty p { color: var(--text-muted); font-weight: 600; margin: 0 0 14px; }

/* ---------- Canvas ---------- */

.builder-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  min-width: 0;
}

.builder-canvas__empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
}
.builder-canvas__empty-kooka { width: 150px; }
.builder-canvas__empty-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink-900);
}
.builder-canvas__empty-sub { font-size: 14px; font-weight: 600; color: var(--text-muted); }

.builder-canvas__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-soft);
}
.builder-canvas__bar h2 { font-size: 22px; }
.builder-canvas__cover {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--blue-100);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink-900);
  flex-shrink: 0;
}
.builder-canvas__cover img { width: 100%; height: 100%; object-fit: cover; }
.builder-canvas__bar-spacer { flex: 1; }

.builder-canvas__body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.builder-canvas__frame {
  flex: 1;
  width: 100%;
  border: none;
  background: var(--paper);
}

/* ---------- Customize panel ---------- */

.customize-panel {
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid var(--border-soft);
  overflow-y: auto;
  background: var(--surface-card);
  padding: 16px;
}

.customize-form__head h3 { font-size: var(--text-lg); }
.customize-form__head p { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 14px; }

.cfield { margin-bottom: 14px; }
.cfield__label {
  display: block;
  font-weight: var(--weight-strong);
  font-size: var(--text-sm);
  margin-bottom: 4px;
}
.cfield__hint { font-size: 12px; color: var(--text-faint); font-weight: 700; }

.input--sm { min-height: 38px; padding: var(--space-2) var(--space-3); font-size: var(--text-sm); }

.clist { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.clist__row {
  position: relative;
  border: 2px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 12px 4px;
}
.clist__row .cfield { margin-bottom: 10px; }
.clist__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}
.clist__remove:hover { color: var(--danger); background: var(--coral-100); }

/* ---------- Touchboard builder (pick activities, preview the big board) ---------- */

.tb { display: grid; grid-template-columns: 340px 1fr; height: 100vh; overflow: hidden; }
.tb-side {
  border-right: 1px solid var(--border-soft);
  background: var(--surface-card);
  padding: 22px 20px;
  overflow-y: auto;
}
.tb-back {
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  color: var(--ink-900);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tb-side__title { font-size: var(--text-xl); margin-top: 14px; }
.tb-side__sub { font-size: 13.5px; color: var(--text-muted); font-weight: 600; margin: 4px 0 0; }
.tb-side__label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 18px 0 8px;
}
.tb-rows { display: flex; flex-direction: column; gap: 8px; }
.tb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}
.tb-row__thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--blue-100);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tb-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tb-row__letter { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--blue-600); }
.tb-row__meta { flex: 1; min-width: 0; }
.tb-row__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-row__type { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.tb-row__remove { color: var(--coral-600); }
.tb-empty { font-size: 13px; font-weight: 700; color: var(--text-muted); padding: 8px 2px; }

.tb-board { background: var(--ink-900); display: flex; flex-direction: column; overflow: hidden; }
.tb-board__bar { display: flex; align-items: center; gap: 12px; padding: 16px 24px; }
.tb-board__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.tb-board__hint { font-size: 12.5px; font-weight: 700; color: var(--ink-300); }
.tb-board__spacer { flex: 1; }
.tb-board__stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 0 40px 30px;
  overflow-y: auto;
}
.tb-board__heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  color: #fff;
}
.tb-board__kooka { height: 52px; }
.tb-tiles { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; max-width: 640px; }
.tb-tile {
  width: 180px;
  border: 2px solid var(--ink-900);
  box-shadow: 0 4px 0 rgba(16, 25, 63, .85);
  border-radius: 18px;
  padding: 14px 12px 12px;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: transform var(--speed-fast) var(--ease-out);
}
.tb-tile:hover { transform: translateY(-3px); }
.tb-tile:active { transform: translateY(3px); box-shadow: none; }
.tb-tile--blue { background: var(--blue-100); }
.tb-tile--teal { background: var(--teal-100); }
.tb-tile--yellow { background: var(--yellow-100); }
.tb-tile--coral { background: var(--coral-100); }
.tb-tile__art { height: 74px; max-width: 100%; object-fit: contain; border-radius: 10px; }
.tb-tile__letter {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 44px;
  color: var(--ink-900);
  opacity: .5;
}
.tb-tile__title { display: block; font-family: var(--font-display); font-weight: 800; font-size: 15px; margin-top: 6px; color: var(--ink-900); }
.tb-tile__type { display: block; font-size: 11.5px; font-weight: 800; color: var(--ink-500); }
.tb-board__empty { color: var(--ink-300); font-weight: 700; text-align: center; }
.tb-board__foot { font-size: 13px; font-weight: 700; color: var(--ink-500); }

/* ---------- Chat attachments (paperclip + file chips) ---------- */

.chat-form__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 5px 10px;
  max-width: 240px;
  font-size: 12.5px;
}
.file-chip__icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--blue-100);
  color: var(--blue-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.file-chip__name {
  font-weight: 800;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-chip__meta { font-size: 11px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.file-chip__remove {
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  color: var(--text-muted);
  padding: 0 2px;
}
.bubble-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  max-width: 78%;
}
.bubble-col .bubble { max-width: 100%; }
.bubble-row:not(.bubble-row--me) .bubble-col { align-items: flex-start; }

/* ---------- Empty-canvas animation (twinkling shapes + bobbing Kooka) ---------- */

.builder-canvas__empty { position: relative; overflow: hidden; }
.canvas-twinkle {
  position: absolute;
  opacity: 0;
  animation: canvas-twinkle 3.6s ease-in-out infinite;
}
.canvas-twinkle--circle { width: 14px; height: 14px; border-radius: 50%; border: 3px solid currentColor; }
.canvas-twinkle--square { width: 13px; height: 13px; border-radius: 4px; }
@keyframes canvas-twinkle {
  0%, 100% { opacity: 0; transform: scale(.5) rotate(-10deg); }
  40% { opacity: 1; transform: scale(1) rotate(8deg); }
  70% { opacity: .6; }
}
.canvas-bob { animation: canvas-bob 3.2s ease-in-out infinite; }
@keyframes canvas-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .canvas-twinkle, .canvas-bob { animation: none !important; }
  .canvas-twinkle { opacity: .7; }
}

/* Source-file chips on success cards ("built from lesson-plan.pdf") */

.chat-card__sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--teal-500);
}
.chat-card__source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: var(--teal-600);
  background: var(--surface-card);
  border-radius: 8px;
  padding: 3px 8px;
}

/* Drag-to-attach overlay over the chat panel */

.builder-chat { position: relative; }
.chat-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(227, 238, 252, .85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  pointer-events: none;
}
.chat-drop-overlay__inner {
  width: 100%;
  height: 100%;
  border: 3px dashed var(--blue-500);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--blue-600);
}

/* ---------- In-chat Unlimited upsell card + embedded-checkout modal ---------- */

.upsell-card {
  background: var(--ink-900);
  border-radius: 18px;
  padding: 18px 20px;
  width: min(320px, 92%);
  color: #fff;
}
.upsell-card--dismissed { display: none; }
.upsell-card__head { display: flex; align-items: flex-start; gap: 12px; }
.upsell-card__kooka { height: 56px; flex-shrink: 0; }
.upsell-card__titles { flex: 1; min-width: 0; }
.upsell-card__name { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: #fff; }
.upsell-card__price { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--yellow-500); }
.upsell-card__price span { font-size: 12px; font-weight: 700; color: var(--ink-300); }
.upsell-card__badge {
  background: var(--yellow-500);
  color: var(--ink-900);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  flex-shrink: 0;
}
.upsell-card__copy { margin: 12px 0 0; font-size: 14px; font-weight: 700; color: var(--ink-300); line-height: 1.5; }
.upsell-card__copy b { color: #fff; }
.upsell-card__actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.upsell-card__later {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-300);
}
.upsell-card__fine { margin-top: 10px; font-size: 11.5px; font-weight: 700; color: var(--ink-500); }
.upsell-card__success .upsell-card__copy { margin-top: 6px; }

.upgrade-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(16, 25, 63, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.upgrade-modal__box {
  position: relative;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  width: min(460px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 14px;
}
.upgrade-modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  border: none;
  background: var(--paper);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-700);
  cursor: pointer;
}
.upgrade-modal__mount { min-height: 380px; }
