:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: rgba(17, 17, 18, 0.9);
  --panel-solid: #121214;
  --card: rgba(20, 20, 22, 0.94);
  --card-strong: #18191c;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f2f2f2;
  --muted: #9b9b9f;
  --dim: #6d6d72;
  --ok: #b9ffcc;
  --warn: #ffe1a6;
  --accent: #d7ff6b;
  --danger: #ff9b9b;
  --radius: 16px;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.48);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--chat-width, 392px) 6px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  background: #050505;
}

.chat-panel {
  grid-column: 1;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.76);
  backdrop-filter: blur(22px);
  box-shadow: 18px 0 64px rgba(0, 0, 0, 0.32);
  z-index: 5;
}

.panel-resizer {
  grid-column: 2;
  z-index: 8;
  cursor: col-resize;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.panel-resizer:hover,
.app-shell.is-resizing .panel-resizer {
  background: rgba(215, 255, 107, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #f2f2f2;
  color: #050505;
  font-size: 13px;
  font-weight: 850;
}

.brand h1,
.boardbar h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.1;
}

.brand p,
.board-kicker {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.session-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.project-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.project-strip select {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 12px;
  font-weight: 720;
}

.mini-select {
  height: 36px;
  min-width: 72px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.mini-select:focus {
  border-color: rgba(215, 255, 107, 0.42);
}

.session-strip span {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-strip span:first-child {
  color: var(--ok);
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  overflow: auto;
  padding: 2px 4px 2px 0;
  scroll-behavior: smooth;
}

.chat-empty {
  margin: auto 0;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.45;
}

.chat-message {
  max-width: 86%;
  overflow: visible;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  color: #e5e5e7;
  font-size: 12.5px;
  line-height: 1.25;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-message-text {
  display: inline;
}

.message-token-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1px 5px 2px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(229, 229, 231, 0.58);
  font-size: 9.5px;
  line-height: 1;
  white-space: nowrap;
  vertical-align: 1px;
}

.chat-message.user .message-token-chip {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.055);
  color: rgba(8, 8, 9, 0.5);
}

.chat-message.is-long {
  overflow: visible;
}

.chat-message.user {
  align-self: flex-end;
  background: #e9e9e9;
  color: #080809;
  border-bottom-right-radius: 5px;
}

.chat-message.assistant {
  align-self: flex-start;
  border-color: rgba(215, 255, 107, 0.22);
  background: rgba(215, 255, 107, 0.055);
  border-bottom-left-radius: 5px;
}

.chat-message.is-local {
  opacity: 0.82;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 14px;
}

.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPulse 0.9s infinite ease-in-out;
}

.typing-dots i:nth-child(2) { animation-delay: 0.12s; }
.typing-dots i:nth-child(3) { animation-delay: 0.24s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.28; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.composer {
  display: grid;
  gap: 8px;
}

.attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px 4px 4px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 11px;
}

.attachment-chip .remove {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 13px;
}

.attachment-chip img {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
}

.chat-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.chat-assets img {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 10px;
  object-fit: cover;
}

.composer-shell {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: end;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 11px 12px;
  background: #1f2022;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.composer-shell:focus-within {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.045);
}

.composer-shell textarea {
  width: 100%;
  min-height: 24px;
  max-height: 140px;
  resize: none;
  border: 0;
  border-radius: 0;
  padding: 5px 0 4px;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.composer-shell textarea:focus {
  border: 0;
  box-shadow: none;
}

.composer-icon,
.composer-send {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: #ededed;
  font-size: 24px;
  line-height: 1;
}

.composer-icon:hover,
.composer-send:hover {
  background: rgba(255, 255, 255, 0.08);
}

.composer-send {
  background: #f2f2f2;
  color: #050505;
  font-size: 18px;
  font-weight: 850;
}

.composer-send:disabled {
  cursor: default;
  opacity: 0.7;
}

.board-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-actions {
  flex-wrap: wrap;
}

.board-actions {
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.board-actions::-webkit-scrollbar {
  display: none;
}

.pill-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.pill-btn:hover,
.icon-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.11);
  transform: translateY(-1px);
}

.pill-btn.primary {
  border-color: rgba(215, 255, 107, 0.45);
  background: #d7ff6b;
  color: #050505;
}

.pill-btn.warn {
  border-color: rgba(255, 225, 166, 0.38);
  color: var(--warn);
}

.pill-btn.is-active {
  border-color: rgba(185, 255, 204, 0.44);
  background: rgba(185, 255, 204, 0.14);
  color: var(--ok);
}

.pill-btn.ghost {
  color: var(--muted);
}

.pill-btn.compact {
  min-width: 58px;
  padding: 0 10px;
}

.icon-btn {
  width: 36px;
  padding: 0;
  font-size: 16px;
}

.workspace {
  grid-column: 3;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #050505;
}

.boardbar {
  position: absolute;
  top: 16px;
  left: 18px;
  right: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 8, 9, 0.76);
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.26);
}

.boardbar > div:first-child {
  flex: 0 0 auto;
}

.usage-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.usage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  white-space: nowrap;
}

.usage-chip span {
  color: var(--stage-accent, var(--accent));
  font-size: 13px;
}

.usage-chip.input span {
  color: #75d7ff;
}

.usage-chip.output span {
  color: var(--accent);
}

.usage-chip.cost span {
  color: var(--warn);
}

.usage-chip strong {
  color: #f2f2f2;
  font-size: 12px;
}

.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #050505;
  cursor: crosshair;
}

.viewport.is-panning {
  cursor: grabbing;
}

.viewport.is-moving-card {
  cursor: ns-resize;
}

.canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 32000px;
  height: 18000px;
  transform-origin: 0 0;
}

.canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0 1px, transparent 1.55px) 0 0 / 36px 36px;
  pointer-events: none;
}

.stage-band {
  position: absolute;
  top: 0;
  z-index: 1;
  width: 1640px;
  min-height: 18000px;
  border-left: 1px solid var(--line-strong);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.018);
}

.stage-header {
  position: absolute;
  top: 56px;
  z-index: 3;
  width: 720px;
  pointer-events: none;
}

.stage-header span {
  color: var(--stage-accent);
  font-size: 11px;
  font-weight: 850;
}

.stage-header h3 {
  margin: 8px 0 0;
  color: #f4f4f4;
  font-size: 24px;
  line-height: 1;
}

.stage-header p {
  max-width: 520px;
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 12px;
}

.empty-state {
  position: absolute;
  z-index: 2;
  left: 112px;
  top: 170px;
  width: 440px;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--dim);
  font-size: 13px;
  line-height: 1.5;
}

.shot-card {
  position: absolute;
  z-index: 2;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  width: 960px;
  height: 236px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  user-select: none;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.12s ease, background 0.12s ease;
}

.shot-card:hover {
  border-color: var(--line-strong);
  background: var(--card-strong);
}

.shot-card.is-selected {
  border-color: rgba(215, 255, 107, 0.72);
  box-shadow: 0 0 0 2px rgba(215, 255, 107, 0.13), var(--shadow);
}

.delete-card {
  position: absolute;
  top: -10px;
  right: -10px;
  display: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 155, 155, 0.42);
  border-radius: 50%;
  background: #170707;
  color: var(--danger);
  font-size: 18px;
  line-height: 1;
  z-index: 5;
}

.shot-card.is-selected .delete-card {
  display: grid;
}

.shot-card.is-generating {
  border-color: rgba(215, 255, 107, 0.85);
  opacity: 0.82;
}

.shot-card.is-generating .thumb::after {
  content: "generating";
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  pointer-events: none;
}

.shot-card.status-stale {
  border-color: rgba(255, 225, 166, 0.46);
}

.shot-card.reference-card {
  grid-template-columns: 1fr;
  gap: 8px;
  width: 260px;
  height: auto;
  min-height: 174px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(18, 19, 21, 0.94);
}

.label-reference {
  position: absolute;
  top: -10px;
  left: -10px;
  z-index: 5;
  display: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.shot-card.reference-card.is-selected .label-reference {
  display: grid;
}

.shot-card.reference-card .thumb {
  height: auto;
  border-radius: 9px;
}

.reference-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--dim);
  font-size: 10px;
}

.reference-label strong {
  min-width: 0;
  overflow: hidden;
  color: #f3f3f3;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-label span {
  flex: 0 0 auto;
  color: var(--stage-accent);
  font-weight: 780;
}

.thumb {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #070707;
  width: 100%;
  aspect-ratio: var(--artifact-aspect, var(--project-aspect, 16 / 9));
  height: auto;
  max-height: 100%;
  align-self: start;
  cursor: default;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b0b0c;
}

.shot-card.is-portrait-aspect {
  grid-template-columns: 140px minmax(0, 1fr);
}

.shot-card.is-portrait-aspect .thumb {
  height: 100%;
  width: auto;
  justify-self: center;
}

.generate-shot {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0);
  color: #050505;
  opacity: 0;
  transition: opacity 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.generate-shot span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #d7ff6b;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 16px 42px rgba(215, 255, 107, 0.22);
}

.thumb:hover {
  border-color: rgba(215, 255, 107, 0.46);
  box-shadow: 0 0 0 3px rgba(215, 255, 107, 0.08);
}

.thumb:hover .generate-shot,
.generate-shot:focus-visible {
  opacity: 1;
  background: rgba(0, 0, 0, 0.34);
}

.thumb-status {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(5, 5, 5, 0.72);
  color: #fff;
  font-size: 10px;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.card-kicker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.card-kicker .shot-number {
  color: var(--stage-accent);
}

.ref-add {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(117, 215, 255, 0.35);
  border-radius: 50%;
  background: rgba(117, 215, 255, 0.08);
  color: #bfefff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.ref-add:hover {
  border-color: rgba(117, 215, 255, 0.72);
  background: rgba(117, 215, 255, 0.16);
}

.ref-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 22px;
  margin: -2px 0 7px;
}

.ref-chip,
.ref-more {
  max-width: 108px;
  height: 20px;
  border: 1px solid rgba(117, 215, 255, 0.34);
  border-radius: 6px;
  padding: 0 6px;
  background: rgba(117, 215, 255, 0.08);
  color: #d8f6ff;
  font-size: 9px;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-more {
  display: inline-grid;
  place-items: center;
  color: var(--dim);
}

.shot-card h4 {
  margin: 5px 0 8px;
  color: #fff;
  font-size: 15px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.prompt-editor {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  resize: none;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  padding: 9px;
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  color: #c7c8cb;
  font-size: 12px;
  line-height: 1.34;
  user-select: text;
  cursor: text;
}

.prompt-editor:focus {
  border-color: rgba(215, 255, 107, 0.36);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 3px rgba(215, 255, 107, 0.08);
}

.card-actions {
  margin-top: auto;
}

.card-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.055);
  color: #e8e8e8;
  font-size: 10px;
  font-weight: 780;
}

.card-actions button:hover {
  border-color: rgba(215, 255, 107, 0.42);
}

.reference-picker {
  position: absolute;
  z-index: 8;
  width: 360px;
  max-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(117, 215, 255, 0.32);
  border-radius: 14px;
  background: rgba(12, 13, 15, 0.98);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

.reference-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
}

.reference-picker-head button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.reference-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding: 10px;
}

.reference-pick {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.045);
  color: #dfe2e5;
  text-align: left;
}

.reference-pick.is-picked {
  border-color: rgba(117, 215, 255, 0.82);
  background: rgba(117, 215, 255, 0.14);
  box-shadow: 0 0 0 2px rgba(117, 215, 255, 0.1);
}

.reference-pick img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: #090a0b;
}

.reference-pick span {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: inherit;
  font-size: 9px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-empty {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

.selection-box {
  position: absolute;
  z-index: 3;
  display: none;
  border: 1px solid rgba(215, 255, 107, 0.8);
  border-radius: 8px;
  background: rgba(215, 255, 107, 0.09);
  pointer-events: none;
}

.selection-box.is-visible {
  display: block;
}

.reference-combine-bar {
  position: absolute;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(117, 215, 255, 0.38);
  border-radius: 999px;
  padding: 6px 8px 6px 10px;
  background: rgba(7, 9, 10, 0.92);
  color: #d8f6ff;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.reference-combine-bar span {
  font-size: 11px;
  font-weight: 780;
}

.reference-combine-bar button {
  min-height: 24px;
  border: 1px solid rgba(117, 215, 255, 0.48);
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(117, 215, 255, 0.14);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.viewport.is-drop-target::after {
  content: "Drop image to References";
  position: absolute;
  inset: 18px;
  z-index: 20;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(117, 215, 255, 0.65);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.28);
  color: #d8f6ff;
  font-size: 16px;
  font-weight: 900;
  pointer-events: none;
}

.viewport-footer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.viewport-footer span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(8, 8, 9, 0.72);
  color: var(--muted);
  font-size: 12px;
  backdrop-filter: blur(16px);
}

.terminal-panel {
  position: absolute;
  right: 18px;
  bottom: 52px;
  z-index: 4;
  width: min(620px, calc(100% - 36px));
  max-height: 210px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 8, 9, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.terminal-head span:last-child {
  color: var(--accent);
  text-transform: none;
}

.terminal-log {
  max-height: 166px;
  overflow: auto;
  padding: 8px 10px;
  color: #bfc0c3;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.terminal-line {
  color: #bfc0c3;
}

.terminal-line.error {
  color: var(--danger);
}

.terminal-line.ok {
  color: var(--ok);
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: minmax(300px, var(--chat-width, 340px)) 6px minmax(0, 1fr);
  }

  .chat-panel {
    padding: 16px;
  }

  .boardbar {
    padding: 10px;
  }

  .boardbar > div:first-child {
    display: flex;
  }

  .usage-chip {
    padding: 0 8px;
  }
}
.approval-action {
  display: block;
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid #d7ff6b;
  border-radius: 6px;
  background: #18200f;
  color: #eaffad;
  cursor: pointer;
}

.approval-action:disabled {
  cursor: wait;
  opacity: 0.6;
}
