/*!*****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./src/app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************/
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  background: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.header {
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 1.5rem;
  color: #333;
}

.header p {
  color: #666;
  margin-top: 0.5rem;
}

.thread-selector {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}

.thread-selector input {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  width: 300px;
}

.thread-selector button {
  padding: 0.5rem 1rem;
  background: #0070f3;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.thread-selector button:hover {
  background: #0051cc;
}

.chat-container {
  height: 600px;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

/* Play page (stepcharts + AI) */
.play-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8f9fa;
}
.play-header {
  padding: 1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
}
.play-header h1 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
}
.play-header p {
  margin: 0;
  font-size: 0.95rem;
}
.play-header code {
  font-size: 0.85em;
  background: #e9ecef;
  padding: 0.1em 0.4em;
  border-radius: 4px;
}
.play-header-meta {
  font-size: 0.9rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.play-thread-label {
  flex-shrink: 0;
}
.play-thread-select {
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
  color: #333;
  min-width: 120px;
  max-width: 280px;
}
.play-thread-select:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.2);
}
.play-new-thread {
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
  margin-left: 0.25rem;
}
.play-new-thread:hover {
  color: #0d6efd;
}
.play-loading {
  padding: 2rem;
  text-align: center;
  color: #666;
}
.play-layout-fill {
  flex: 1 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Chat / App mode layout (from langgraph-python demo) */
.play-mode-root {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}
.play-mode-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #e9ecef;
  min-height: 48px;
}
.play-mode-topbar-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  flex-shrink: 0;
}
.mode-toggle {
  display: inline-flex;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  padding: 2px;
  background: #f1f3f5;
}
.mode-toggle-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #666;
}
.mode-toggle-btn.active {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.play-mode-body {
  flex: 1 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}
.play-mode-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.play-mode-chat.full {
  flex: 1 1;
  width: 100%;
}
.play-mode-chat.split {
  width: 33.333%;
  max-width: 420px;
  border-right: 1px solid #e9ecef;
}
.play-mode-app {
  flex: 0 1;
  width: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.play-mode-app.visible {
  flex: 1 1;
  width: auto;
  opacity: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.play-mode-root.chat .play-mode-app {
  display: none;
}

.chat-panel-inner {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0.75rem;
}
.upload-banner {
  font-size: 0.85rem;
  color: #198754;
  margin-bottom: 0.5rem;
}
.doc-upload {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e9ecef;
}
.doc-upload-drop {
  display: block;
  border: 2px dashed #ced4da;
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
}
.doc-upload-drop:hover {
  border-color: #adb5bd;
}
.doc-upload-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
}
.doc-upload-hint {
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.25rem;
}
.doc-upload-btn {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #0d6efd;
  background: #0d6efd;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}
.doc-upload-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.doc-upload-error {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 0.35rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.tool-card {
  margin: 0.35rem 0;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.8rem;
}
.tool-card-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border: none;
  background: #f8f9fa;
  cursor: pointer;
  text-align: left;
}
.tool-card-body {
  padding: 0.5rem;
  max-height: 160px;
  overflow: auto;
}
.tool-card-body pre {
  font-size: 0.7rem;
  white-space: pre-wrap;
}

.play-embed-panel {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}
.research-workspace {
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid #e9ecef;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
}
.workspace-title {
  font-size: 1rem;
  margin: 0 0 0.15rem;
}
.workspace-sub {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 0.5rem;
}
.workspace-section {
  margin-bottom: 0.5rem;
}
.workspace-section-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}
.workspace-badge {
  background: #0d6efd;
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}
.workspace-empty {
  font-size: 0.8rem;
  color: #868e96;
  margin: 0.25rem 0;
}
.workspace-todos,
.workspace-files,
.workspace-sources {
  list-style: none;
  margin: 0;
  padding: 0;
}
.workspace-todos li {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.2rem 0;
}
.workspace-files li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}
.file-row {
  flex: 1 1;
  text-align: left;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  background: #fff;
  cursor: pointer;
}
.file-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
}
.file-path {
  display: block;
  font-size: 0.7rem;
  color: #868e96;
}
.file-dl {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  background: #fff;
}
.workspace-sources a {
  font-size: 0.8rem;
  color: #0d6efd;
}
.file-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.file-modal {
  background: #fff;
  border-radius: 10px;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.file-modal-head {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e9ecef;
}
.file-modal-body {
  padding: 1rem;
  overflow: auto;
  font-size: 0.8rem;
  white-space: pre-wrap;
}

.play-embed {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}
.play-embed-header {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}
.play-open-link {
  color: #0d6efd;
  text-decoration: none;
}
.play-open-link:hover {
  text-decoration: underline;
}
.play-iframe {
  flex: 1 1;
  min-height: 400px;
  width: 100%;
  border: none;
}
.play-proposal-actions {
  padding: 1rem;
  border-top: 1px solid #e9ecef;
  font-size: 0.9rem;
}
.play-proposal-hint {
  margin: 0 0 0.5rem 0;
  color: #666;
}
.play-json-details {
  margin-top: 0.5rem;
}
.play-json-details summary {
  cursor: pointer;
  color: #0d6efd;
}
.play-json-pre {
  margin: 0.5rem 0 0 0;
  padding: 0.75rem;
  background: #f1f3f5;
  border-radius: 6px;
  overflow: auto;
  max-height: 200px;
  font-size: 0.8rem;
}
.play-copy-btn {
  margin-top: 0.5rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
}
.play-copy-btn:hover {
  background: #e9ecef;
}
.play-samples {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}
.play-samples-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: #495057;
}
.play-samples-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.play-sample-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
}
.play-sample-btn:hover:not(:disabled) {
  background: #e9ecef;
}
.play-sample-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* Embedded proposal preview cards in chat */
.proposal-chat-embed {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px;
  margin: 1rem auto;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: center;
}
.proposal-chat-embed-frame {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: #0f1729;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  border: 2px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.proposal-chat-embed:hover .proposal-chat-embed-frame,
.proposal-chat-embed.active .proposal-chat-embed-frame {
  border-color: #0d6efd;
  box-shadow: 0 4px 24px rgba(13, 110, 253, 0.2);
}
.proposal-chat-embed-iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}
.proposal-chat-embed-label {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #212529;
}
.proposal-chat-embed-hint {
  font-size: 0.75rem;
  color: #868e96;
}

@media (max-width: 900px) {
  .play-mode-chat.split {
    width: 100%;
    max-width: none;
    max-height: 40vh;
  }
  .play-mode-root.app .play-mode-body {
    flex-direction: column;
  }
}

