:root {
  --stimcar-red: #e3032e;
  --stimcar-orange: #ec7004;
  --stimcar-ink: #1d1d1b;
  --stimcar-anthracite: #717171;
  --stimcar-paper: #f7f4f0;
  --stimcar-line: #d9d4cc;
  --stimcar-white: #fff;
  --stimcar-mist: #dbe2e9;
}

* {
  box-sizing: border-box;
}

html, body, #root {
  height: 100%;
  margin: 0;
}

body {
  color: var(--stimcar-ink);
  background: var(--stimcar-paper);
  font-family: Poppins, Segoe UI, sans-serif;
}

a {
  color: var(--stimcar-red);
}

.studio-app {
  flex-direction: column;
  height: 100%;
  display: flex;
}

.studio-app .studio-stage {
  flex: 1;
  height: auto;
  min-height: 0;
}

.studio-app .studio-site, .studio-app .studio-chat {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.studio-account-bar {
  background: var(--stimcar-white);
  border-bottom: 1px solid var(--stimcar-line);
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .4rem .9rem;
  font-size: .8rem;
  display: flex;
}

.studio-account-bar-start {
  flex: 1;
}

.studio-account-bar-end {
  align-items: center;
  gap: .75rem;
  display: flex;
}

.studio-account-bar form {
  margin: 0;
}

.studio-account-bar .button {
  padding: .3rem .65rem;
  font-size: .75rem;
}

.studio-account-apps {
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(28rem, 55vw);
  overflow: hidden;
}

.studio-app:has(.studio-welcome) {
  background: var(--stimcar-ink);
}

.studio-app:has(.studio-welcome) .studio-account-bar {
  z-index: 2;
  color: var(--stimcar-white);
  background: none;
  border-bottom-color: #ffffff1f;
  position: relative;
}

.studio-app:has(.studio-welcome) .studio-account-bar .button-secondary {
  color: var(--stimcar-white);
  background: none;
  border-color: #ffffff47;
}

:is(.studio-app:has(.studio-welcome) .studio-account-bar .button-secondary:hover, .studio-app:has(.studio-welcome) .studio-account-bar .button-secondary:focus-visible) {
  border-color: var(--stimcar-orange);
  color: var(--stimcar-white);
}

.studio-login {
  justify-content: center;
  align-items: center;
  min-height: 100%;
  padding: 2rem 1rem;
  display: flex;
}

.studio-login-card {
  background: var(--stimcar-white);
  border: 1px solid var(--stimcar-line);
  border-radius: 10px;
  width: 100%;
  max-width: 26rem;
  padding: 1.75rem 1.6rem;
}

.studio-login-eyebrow {
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--stimcar-red);
  margin: 0 0 .4rem;
  font-size: .75rem;
  font-weight: 600;
}

.studio-login-card h1 {
  margin: 0 0 .7rem;
  font-size: 1.35rem;
}

.studio-login-card p {
  color: #5c5c58;
  margin: 0 0 1rem;
}

.studio-login-card .button {
  text-decoration: none;
  display: inline-block;
}

.studio-stage {
  height: 100%;
  min-height: 100vh;
  display: grid;
}

.studio-site {
  background: var(--stimcar-white);
  border: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
}

.studio-site-pending {
  color: #5c5c58;
  justify-content: center;
  align-items: center;
  font-size: .95rem;
  display: flex;
}

.studio-resize {
  background: var(--stimcar-line);
  cursor: col-resize;
  border: 0;
  width: 100%;
  height: 100%;
  padding: 0;
}

.studio-resize:hover, .studio-resize:focus-visible {
  background: var(--stimcar-red);
  outline: none;
}

.studio-chat {
  background: var(--stimcar-paper);
  border-left: 1px solid var(--stimcar-line);
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
  padding: 1rem 1rem 1.1rem;
  display: flex;
  overflow: hidden;
}

.studio-chat h1 {
  border-bottom: 2px solid var(--stimcar-red);
  margin: 0 0 .5rem;
  padding-bottom: .5rem;
  font-size: 1.05rem;
}

.studio-lead {
  color: #5c5c58;
  margin: 0 0 .85rem;
  font-size: .85rem;
}

.studio-form {
  flex-direction: column;
  flex: 1;
  gap: .6rem;
  min-height: 0;
  display: flex;
  overflow: auto;
}

.studio-form label {
  font-size: .85rem;
  font-weight: 600;
}

.studio-form input, .studio-form textarea {
  font: inherit;
  border: 1px solid var(--stimcar-line);
  background: var(--stimcar-paper);
  border-radius: 6px;
  padding: .55rem .7rem;
}

.button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 6px;
  padding: .6rem .9rem;
  font-weight: 600;
}

.button-primary {
  background: var(--stimcar-red);
  color: var(--stimcar-white);
}

.button-secondary {
  background: var(--stimcar-white);
  color: var(--stimcar-ink);
  border: 1px solid var(--stimcar-line);
}

.button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.alert {
  color: var(--stimcar-red);
  background: #fde8ec;
  border-radius: 6px;
  padding: .65rem .75rem;
  font-size: .85rem;
}

.session-header {
  border-bottom: 2px solid var(--stimcar-red);
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  margin: 0 0 .5rem;
  padding-bottom: .5rem;
  display: flex;
}

.session-header-titles {
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
  display: flex;
}

.session-header-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .35rem;
  display: flex;
}

.session-header h1 {
  border-bottom: 0;
  margin: 0;
  padding: 0;
}

.session-target {
  color: #555;
  margin: 0;
  font-size: .8rem;
}

.session-target-button {
  color: var(--stimcar-red);
  font: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font-size: .8rem;
}

.session-target-button:hover, .session-target-button:focus-visible {
  outline: none;
  text-decoration: underline;
}

.session-target-button:disabled {
  opacity: .55;
  cursor: not-allowed;
  text-decoration: none;
}

.studio-welcome {
  min-height: 0;
  color: var(--stimcar-white);
  flex: 1;
  justify-content: center;
  align-items: center;
  padding: 2.5rem 1.25rem 3rem;
  display: flex;
  position: relative;
  overflow: auto;
}

.studio-welcome-backdrop {
  background-color: var(--stimcar-ink);
  opacity: 1;
  background-image: linear-gradient(160deg, #e3032e47 0%, #0000 42%), linear-gradient(320deg, #ec700438 0%, #0000 38%), url(/static/image/motif.eea927b171.png);
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: auto, auto, 420px;
  position: absolute;
  inset: 0;
}

.studio-welcome-backdrop:after {
  content: "";
  background: linear-gradient(#1d1d1b8c 0%, #1d1d1bc7 55%, #1d1d1beb 100%);
  position: absolute;
  inset: 0;
}

.studio-welcome-content {
  z-index: 1;
  flex-direction: column;
  gap: 1.75rem;
  width: 100%;
  max-width: 56rem;
  display: flex;
  position: relative;
}

.studio-welcome-hero {
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  animation: .55s both studio-welcome-rise;
  display: flex;
}

.studio-welcome-logo-frame {
  background: var(--stimcar-white);
  border-radius: 1.15rem;
  place-items: center;
  width: 5.75rem;
  height: 5.75rem;
  margin-bottom: .35rem;
  animation: .7s both studio-welcome-logo;
  display: grid;
  box-shadow: 0 14px 34px #00000047;
}

.studio-welcome-logo {
  width: 3.5rem;
  height: auto;
}

.studio-welcome-eyebrow {
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--stimcar-orange);
  margin: 0;
  font-size: .78rem;
  font-weight: 600;
}

.studio-welcome-hero h1 {
  letter-spacing: -.02em;
  max-width: 18ch;
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.45rem);
  font-weight: 700;
  line-height: 1.15;
}

.studio-welcome-lead, .studio-welcome-empty {
  color: #ffffffc7;
  max-width: 34rem;
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

.studio-welcome-empty {
  text-align: center;
  align-self: center;
}

.studio-welcome .alert {
  max-width: 36rem;
  margin: 0 auto;
  animation: .45s both studio-welcome-rise;
}

.studio-target-list {
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

.studio-target-list > li {
  animation: .55s both studio-welcome-rise;
}

.studio-target-list > li:first-child {
  animation-delay: 80ms;
}

.studio-target-list > li:nth-child(2) {
  animation-delay: .16s;
}

.studio-target-list > li:nth-child(3) {
  animation-delay: .24s;
}

.studio-target-option {
  text-align: left;
  width: 100%;
  height: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: var(--stimcar-white);
  border: 1px solid #ffffff24;
  border-radius: 14px;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex;
  overflow: hidden;
  box-shadow: 0 18px 40px #00000047;
}

.studio-target-option:hover, .studio-target-option:focus-visible {
  border-color: var(--stimcar-orange);
  outline: none;
  transform: translateY(-4px);
  box-shadow: 0 22px 48px #00000057;
}

.studio-target-preview {
  aspect-ratio: 16 / 10;
  background: var(--stimcar-mist);
  border-bottom: 1px solid var(--stimcar-line);
  pointer-events: none;
  width: 100%;
  display: block;
  position: relative;
  overflow: hidden;
}

.studio-target-preview-frame {
  transform-origin: 0 0;
  background: var(--stimcar-white);
  border: 0;
  width: 200%;
  height: 200%;
  position: absolute;
  inset: 0;
  transform: scale(.5);
}

.studio-target-preview-fallback {
  width: 100%;
  height: 100%;
  color: var(--stimcar-anthracite);
  text-align: center;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  font-size: .85rem;
  display: flex;
}

.studio-target-option-copy {
  min-width: 0;
  color: var(--stimcar-ink);
  flex-direction: column;
  gap: .35rem;
  padding: 1rem 1.05rem 1.1rem;
  display: flex;
}

.studio-target-option-label {
  letter-spacing: -.01em;
  font-size: 1.05rem;
  font-weight: 700;
  display: block;
}

.studio-target-option-description {
  color: var(--stimcar-anthracite);
  font-size: .88rem;
  font-weight: 400;
  line-height: 1.4;
  display: block;
}

.studio-target-option-action {
  letter-spacing: .02em;
  color: var(--stimcar-red);
  align-items: center;
  margin-top: .45rem;
  font-size: .82rem;
  font-weight: 600;
  display: inline-flex;
}

.studio-target-option:hover .studio-target-option-action, .studio-target-option:focus-visible .studio-target-option-action {
  color: var(--stimcar-orange);
}

@keyframes studio-welcome-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes studio-welcome-logo {
  from {
    opacity: 0;
    transform: scale(.92);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .studio-welcome-hero, .studio-welcome-logo-frame, .studio-welcome .alert, .studio-target-list > li {
    animation: none;
  }

  .studio-target-option, .studio-target-option:hover, .studio-target-option:focus-visible {
    transition: none;
    transform: none;
  }
}

.session-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .35rem;
  margin: 0;
  display: flex;
}

.session-actions .button {
  padding: .35rem .55rem;
  font-size: .75rem;
}

.button-icon-text {
  align-items: center;
  gap: .35rem;
  display: inline-flex;
}

.icon-button {
  justify-content: center;
  align-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
}

.visually-hidden {
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
}

.chat-log {
  overflow-anchor: none;
  flex-direction: column;
  flex: 1;
  gap: .65rem;
  min-height: 0;
  margin-bottom: .75rem;
  display: flex;
  overflow: auto;
}

.chat-item {
  border-left: 3px solid var(--stimcar-red);
  padding-left: .65rem;
  font-size: .9rem;
}

.chat-markdown {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.chat-markdown > :first-child {
  margin-top: .15rem;
}

.chat-markdown > :last-child {
  margin-bottom: 0;
}

.chat-markdown p, .chat-markdown ul, .chat-markdown ol, .chat-markdown pre, .chat-markdown blockquote {
  margin: .35rem 0;
}

.chat-markdown h1, .chat-markdown h2, .chat-markdown h3, .chat-markdown h4 {
  margin: .5rem 0 .25rem;
  font-size: 1em;
  font-weight: 600;
}

.chat-markdown ul, .chat-markdown ol {
  padding-left: 1.2rem;
}

.chat-markdown code {
  background: var(--stimcar-white);
  border-radius: 4px;
  padding: .1em .35em;
  font-family: ui-monospace, Segoe UI Mono, monospace;
  font-size: .85em;
}

.chat-markdown pre {
  border: 1px solid var(--stimcar-line);
  background: var(--stimcar-white);
  border-radius: 6px;
  padding: .55rem .65rem;
  overflow-x: auto;
}

.chat-markdown pre code {
  background: none;
  padding: 0;
}

.chat-markdown table {
  border-collapse: collapse;
  font-size: .8rem;
}

.chat-markdown th, .chat-markdown td {
  border: 1px solid var(--stimcar-line);
  text-align: left;
  padding: .25rem .45rem;
}

.chat-markdown img {
  max-width: 100%;
  height: auto;
}

.chat-item-live {
  opacity: .85;
}

.mr-link {
  margin: 0 0 .65rem;
  font-size: .8rem;
}

.agent-trace {
  border: 1px solid var(--stimcar-line);
  background: #fff;
  border-radius: 6px;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .75rem;
  padding: .55rem .75rem;
  display: flex;
}

.agent-trace-title {
  margin: 0;
  font-size: .8rem;
  font-weight: 600;
}

.starting-request-spinner {
  border: 2px solid var(--stimcar-line);
  border-top-color: var(--stimcar-red);
  border-radius: 50%;
  flex-shrink: 0;
  width: .85rem;
  height: .85rem;
  animation: .7s linear infinite starting-request-spin;
}

@keyframes starting-request-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .starting-request-spinner {
    border-top-color: var(--stimcar-line);
    border-right-color: var(--stimcar-red);
    animation: none;
  }
}

.chat-item-trace strong {
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #5c5c58;
  font-size: .7rem;
  display: block;
}

.chat-item-trace pre {
  white-space: pre-wrap;
  font: inherit;
  margin: .15rem 0 0;
  font-size: .8rem;
}

.chat-form {
  border: 1px solid var(--stimcar-line);
  background: var(--stimcar-white);
  border-radius: 16px;
  flex-direction: column;
  gap: .45rem;
  margin-top: auto;
  padding: .55rem .65rem .5rem;
  display: flex;
  position: relative;
}

.composer-toolbar {
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  display: flex;
}

.chat-form textarea {
  font: inherit;
  resize: none;
  field-sizing: content;
  background: none;
  border: 0;
  border-radius: 0;
  width: 100%;
  min-height: 2.75rem;
  max-height: 10rem;
  padding: .2rem .15rem;
  overflow-y: auto;
}

.chat-form textarea:focus-visible {
  outline: none;
}

.chat-file-input {
  clip: rect(0 0 0 0);
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
}

.studio-stage.is-chat-maximized {
  grid-template-columns: minmax(0, 1fr) !important;
}

.studio-stage.is-chat-maximized .studio-site {
  display: none;
}

.composer-tools {
  align-items: center;
  gap: .15rem;
  display: flex;
}

.composer-tool {
  cursor: pointer;
  color: var(--stimcar-ink);
  background: none;
  border: 0;
}

.composer-tool.is-disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

.composer-tool.is-active {
  color: var(--stimcar-red);
  background: #fde8ec;
}

.inspect-hint {
  color: var(--stimcar-red);
  margin: 0;
  font-size: .75rem;
}

.composer-attach {
  cursor: pointer;
  color: var(--stimcar-ink);
  background: none;
  border: 0;
}

.composer-attach.is-disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

.composer-send {
  background: var(--stimcar-red);
  width: 2rem;
  height: 2rem;
  color: var(--stimcar-white);
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  justify-content: center;
  align-items: center;
  padding: 0;
  display: inline-flex;
}

.composer-send:disabled {
  color: #8a8680;
  cursor: not-allowed;
  background: #d9d4cc;
}

.composer-attach:focus-visible, .composer-tool:focus-visible, .composer-send:focus-visible, .icon-button:focus-visible, .chip-remove:focus-visible {
  outline: 2px solid var(--stimcar-red);
  outline-offset: 2px;
}

.chat-attachments {
  flex-direction: column;
  gap: .35rem;
  margin: .35rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
}

.chat-pending-attachments {
  flex-wrap: wrap;
  gap: .35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
}

.chat-pending-attachments li {
  border: 1px solid var(--stimcar-line);
  background: var(--stimcar-paper);
  border-radius: 999px;
  align-items: center;
  gap: .2rem;
  max-width: 100%;
  padding: .15rem .2rem .15rem .55rem;
  font-size: .75rem;
  display: flex;
}

.chat-pending-attachments li.chat-pending-image {
  border-radius: 10px;
  padding: .2rem;
}

.chat-pending-name {
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 10rem;
  overflow: hidden;
}

.chat-pending-thumb-link {
  border-radius: 6px;
  line-height: 0;
  display: block;
  overflow: hidden;
}

.chat-pending-thumb-link:focus-visible {
  outline: 2px solid var(--stimcar-red);
  outline-offset: 2px;
}

.chat-pending-thumb {
  object-fit: cover;
  background: var(--stimcar-paper);
  width: 4.5rem;
  height: 4.5rem;
  display: block;
}

.chip-remove {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--stimcar-ink);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 999px;
  justify-content: center;
  align-items: center;
  padding: 0;
  display: inline-flex;
}

.chip-remove:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.chat-attachment-image-link {
  border-radius: 6px;
  max-width: 100%;
  line-height: 0;
  display: inline-block;
}

.chat-attachment-image-link:focus-visible {
  outline: 2px solid var(--stimcar-red);
  outline-offset: 2px;
}

.chat-attachment-image {
  border: 1px solid var(--stimcar-line);
  cursor: zoom-in;
  border-radius: 6px;
  max-width: 100%;
  max-height: 12rem;
  display: block;
}

.chat-attachment-file {
  font-size: .85rem;
}

.agent-step-thinking pre {
  color: #5c5c58;
  font-style: italic;
}

.session-layout, .session-column {
  flex-direction: column;
  flex: 1;
  min-height: 0;
  display: flex;
}

.session-history {
  flex-direction: column;
  flex: 1;
  gap: .75rem;
  min-height: 0;
  margin-bottom: .75rem;
  display: flex;
  overflow: auto;
}

.session-history-header {
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  display: flex;
}

.session-history-header h2 {
  margin: 0;
  font-size: .95rem;
}

.session-history-empty {
  color: #5c5c58;
  margin: 0;
  font-size: .9rem;
}

.session-history-list {
  flex-direction: column;
  gap: .35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
}

.session-history-item {
  border: 0;
  border-left: 3px solid var(--stimcar-red);
  text-align: left;
  cursor: pointer;
  width: 100%;
  font: inherit;
  background: none;
  flex-direction: column;
  align-items: flex-start;
  gap: .15rem;
  padding: .55rem .65rem;
  display: flex;
}

.session-history-item:hover, .session-history-item.is-selected {
  background: #0000000a;
}

.session-history-title {
  overflow-wrap: anywhere;
  font-size: .9rem;
  font-weight: 600;
}

.session-history-meta {
  flex-direction: column;
  gap: .1rem;
  display: flex;
}

.session-history-target, .session-history-creator {
  color: #5c5c58;
  overflow-wrap: anywhere;
  font-size: .8rem;
}

@media (max-width: 900px) {
  .studio-stage {
    grid-template-rows: minmax(40vh, 1fr) .55rem minmax(20rem, 45vh);
    grid-template-columns: 1fr !important;
  }

  .studio-stage.is-chat-maximized {
    grid-template-rows: minmax(0, 1fr);
  }

  .studio-resize {
    cursor: row-resize;
  }

  .studio-site, .studio-chat {
    min-height: 0;
  }

  .studio-chat {
    border-left: 0;
    border-top: 1px solid var(--stimcar-line);
    max-height: none;
  }
}

