:root {
  --st-bg: #f0f2f6;
  --st-panel-bg: #ffffff;
  --st-text: #0e1116;
  --st-muted: #6c757d;
  --st-border: rgba(49, 51, 63, 0.08);
  --st-primary: #ff4b4b;
}

.st-body {
  background: var(--st-bg);
  color: var(--st-text);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

.st-header {
  background: var(--st-panel-bg);
  border-bottom: 1px solid var(--st-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.st-brand {
  font-size: 1.5rem;
}

.st-nav-link {
  color: var(--st-muted);
  text-decoration: none;
  margin-left: 1.5rem;
  font-weight: 600;
  position: relative;
  padding-bottom: 0.25rem;
}

.st-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
  border-radius: 999px;
}

.st-nav-link:hover {
  color: var(--st-text);
}

.st-nav-link.active {
  color: var(--st-primary);
}

.st-nav-link.active::after {
  background: var(--st-primary);
}

.st-main {
  padding: 2.5rem 0 3.5rem;
}

.st-flash {
  background: #fff3cd;
  border: 1px solid rgba(255, 193, 7, 0.35);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #8a6d3b;
  margin-bottom: 1.5rem;
}

.st-panel {
  background: var(--st-panel-bg);
  border-radius: 1.1rem;
  box-shadow: 0 10px 25px rgba(49, 51, 63, 0.08);
  padding: 1.75rem;
}

.st-panel-title {
  font-weight: 600;
  color: var(--st-text);
}

.btn-primary {
  background: var(--st-primary);
  border-color: var(--st-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background: #ff6b6b;
  border-color: #ff6b6b;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(15, 15, 15, 0.1);
  color: var(--st-text);
}

.btn-secondary:hover,
.btn-secondary:focus {
  border-color: rgba(15, 15, 15, 0.25);
  color: var(--st-text);
}

.form-control,
.form-select {
  border-radius: 0.75rem;
  border: 1px solid rgba(49, 51, 63, 0.18);
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(255, 75, 75, 0.6);
  box-shadow: 0 0 0 0.2rem rgba(255, 75, 75, 0.15);
}

.st-chat-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.st-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.st-stage-pill {
  background: rgba(255, 75, 75, 0.1);
  color: var(--st-primary);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.st-summary {
  font-size: 0.9rem;
  line-height: 1.4;
}

.st-chat-history {
  background: #ffffff;
  border: 1px solid var(--st-border);
  border-radius: 1rem;
  padding: 1.25rem;
  max-height: 420px;
  overflow-y: auto;
}

.st-chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.st-chat-message.user {
  align-items: flex-end;
}

.st-chat-message.assistant {
  align-items: flex-start;
}

.st-role-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--st-muted);
}

.st-chat-bubble {
  max-width: 100%;
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid rgba(49, 51, 63, 0.08);
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
}

.st-chat-message.user .st-chat-bubble {
  background: var(--st-primary);
  border-color: var(--st-primary);
  color: #ffffff;
}

.st-chat-message.assistant .st-chat-bubble {
  background: #f6fafd;
  border-color: rgba(64, 120, 255, 0.2);
  color: var(--st-text);
}

.st-chat-form textarea {
  min-height: 140px;
  resize: vertical;
}

.st-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.st-list li {
  font-size: 0.9rem;
  color: var(--st-muted);
  margin-bottom: 0.35rem;
}

.st-expander {
  background: #f8f9fb;
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(49, 51, 63, 0.06);
}

.st-expander summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--st-text);
  list-style: none;
}

.st-expander summary::-webkit-details-marker {
  display: none;
}

.st-expander[open] {
  background: #fff;
  border-color: rgba(255, 75, 75, 0.2);
}

.st-expander[open] summary {
  margin-bottom: 0.75rem;
}

.st-table table {
  width: 100%;
}

.st-table thead {
  position: sticky;
  top: 0;
  background: var(--st-panel-bg);
  z-index: 1;
}

.st-table tbody tr.table-active td {
  background: rgba(255, 75, 75, 0.08);
  color: var(--st-text);
}

.st-code {
  font-family: "Fira Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
  border-radius: 0.9rem;
  background: #f8f9fb;
}

.table-responsive {
  max-height: 320px;
}

.mindmap-card {
  border: 1px dashed rgba(49, 51, 63, 0.2);
  border-radius: 1rem;
  padding: 1rem;
  background: #fbfbfe;
  max-height: 520px;
  overflow-y: auto;
}

.mindmap-node {
  margin-left: 1rem;
  border-left: 2px solid rgba(49, 51, 63, 0.15);
  padding-left: 1rem;
  margin-bottom: 0.75rem;
}

.mindmap-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 75, 75, 0.08);
  color: var(--st-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.mindmap-leaf {
  margin-left: 1.5rem;
  color: #4b5563;
  font-size: 0.9rem;
}
