/*!*****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./src/app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************/
:root {
  --bg: #212121;
  --bg-sidebar: #171717;
  --bg-elevated: #2f2f2f;
  --bg-hover: #2a2a2a;
  --border: #3a3a3a;
  --text: #ececec;
  --text-muted: #9b9b9b;
  --text-faint: #6e6e6e;
  --accent: #7aa2f7;
  --user-bubble: #2f2f2f;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- App shell ---------- */

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

.main {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---------- Sidebar ---------- */

.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 20px 20px 14px;
}

.sidebar-brand h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar-brand p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-search {
  padding: 0 12px 4px;
}

.sidebar-search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 11px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.sidebar-search input:focus {
  outline: none;
  border-color: var(--accent);
}

.chat-list-empty {
  padding: 12px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.retired-toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding: 10px 12px 6px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  cursor: pointer;
}

.retired-toggle:hover {
  color: var(--text-muted);
}

.chat-item-retired {
  opacity: 0.65;
}

.chat-item-retired:hover,
.chat-item-retired.active {
  opacity: 1;
}

.sidebar-section {
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.chat-list {
  flex: 1 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 8px 16px;
}

.chat-item {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 2px;
}

.chat-item:hover {
  background: var(--bg-hover);
}

.chat-item.active {
  background: var(--bg-elevated);
}

.chat-item-title {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.chat-item-meta .badge {
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge-status-unreviewed {
  color: #d8b45a;
  border-color: #5a4d2a;
}

.badge-status-linked {
  color: #7aa2f7;
  border-color: #3a4a6e;
}

.badge-status-ready {
  color: #6ec9b8;
  border-color: #2f5a50;
}

.badge-status-reconciled {
  color: #9ac48a;
  border-color: #3f5638;
}

.badge-status-archived {
  color: var(--text-faint);
  border-color: var(--border);
}

.badge-status-superseded {
  color: #e0716f;
  border-color: #6e3a3a;
}

.badge-project {
  color: #9ac48a;
  border-color: #3f5638;
}

/* ---------- Status control ---------- */

.status-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-button {
  cursor: pointer;
  background: none;
  font: inherit;
  font-size: 10.5px;
  font-weight: 500;
}

.status-button:hover:not(:disabled) {
  background: var(--bg-hover);
}

.status-error {
  font-size: 12px;
  color: #e0716f;
  white-space: nowrap;
}

.status-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.status-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  width: 340px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

.status-option {
  display: grid;
  grid-template-columns: 10px auto 1fr;
  align-items: baseline;
  grid-gap: 8px;
  gap: 8px;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.status-option:hover:not(:disabled) {
  background: var(--bg-hover);
}

.status-option:disabled {
  opacity: 0.45;
  cursor: default;
}

.status-name {
  font-weight: 550;
  white-space: nowrap;
}

.status-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: right;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  align-self: center;
}

.dot-unreviewed { background: #d8b45a; }
.dot-linked { background: #7aa2f7; }
.dot-ready { background: #6ec9b8; }
.dot-reconciled { background: #9ac48a; }
.dot-archived { background: var(--text-faint); }
.dot-superseded { background: #e0716f; }

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

.meta-panel {
  padding: 8px 24px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  flex-shrink: 0;
}

.chip-editor {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-editor-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-right: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 6px 2px 10px;
  font-size: 12.5px;
}

.chip-icon {
  color: var(--text-faint);
  font-size: 11px;
}

.chip button {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 999px;
}

.chip button:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.chip-editor input {
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  padding: 3px 4px;
  min-width: 110px;
}

.chip-editor input:focus {
  outline: none;
}

.chip-editor input::placeholder {
  color: var(--text-faint);
}

/* ---------- Chat header ---------- */

.chat-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.chat-header h2 {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ---------- Transcript ---------- */

.transcript {
  flex: 1 1;
  overflow-y: auto;
}

.transcript-inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.msg {
  display: flex;
  flex-direction: column;
}

.msg-user {
  align-items: flex-end;
}

.msg-user .msg-body {
  background: var(--user-bubble);
  border-radius: 22px;
  padding: 11px 18px;
  max-width: 78%;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.msg-assistant {
  align-items: flex-start;
}

.msg-assistant .msg-body {
  max-width: 100%;
  overflow-wrap: break-word;
}

.thought-marker {
  font-size: 12.5px;
  color: var(--text-faint);
  font-style: italic;
  margin-bottom: 8px;
}

/* Markdown content inside assistant messages */

.msg-body > * + * {
  margin-top: 0.85em;
}

.msg-body h1,
.msg-body h2,
.msg-body h3,
.msg-body h4 {
  font-weight: 650;
  line-height: 1.3;
  margin-top: 1.4em;
}

.msg-body h1 { font-size: 1.3em; }
.msg-body h2 { font-size: 1.15em; }
.msg-body h3 { font-size: 1.05em; }

.msg-body ul,
.msg-body ol {
  padding-left: 1.4em;
}

.msg-body li + li {
  margin-top: 0.3em;
}

.msg-body code {
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.35em;
  font-size: 0.88em;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

.msg-body pre {
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
}

.msg-body pre code {
  background: none;
  border: none;
  padding: 0;
}

.msg-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 14px;
  color: var(--text-muted);
}

.msg-body table {
  border-collapse: collapse;
  font-size: 0.92em;
}

.msg-body th,
.msg-body td {
  border: 1px solid var(--border);
  padding: 6px 12px;
  text-align: left;
}

.msg-body th {
  background: var(--bg-elevated);
}

.msg-body hr {
  border: none;
  border-top: 1px solid var(--border);
}

/* ---------- Import ---------- */

.import-button {
  display: block;
  margin: 4px 12px 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.import-button:hover,
.import-button.active {
  background: var(--bg-hover);
}

.import-page {
  flex: 1 1;
  overflow-y: auto;
}

.import-inner {
  max-width: 40rem;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.import-inner > h2 {
  font-size: 20px;
  font-weight: 650;
}

.import-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.import-card h3 {
  font-size: 14.5px;
  font-weight: 600;
}

.import-hint {
  font-size: 12.5px;
  color: var(--text-muted);
}

.import-card input,
.import-card textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  width: 100%;
  resize: vertical;
}

.import-card input:focus,
.import-card textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.import-card button {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 16px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.import-card button:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-faint);
}

.import-card button:disabled {
  opacity: 0.6;
  cursor: default;
}

.import-error {
  font-size: 13px;
  color: #e0716f;
}

/* ---------- Intelligence panel ---------- */

.chat-body {
  flex: 1 1;
  display: flex;
  min-height: 0;
}

.intel-panel {
  width: 330px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--bg-sidebar);
  overflow-y: auto;
  padding: 16px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intel-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.intel-title {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  margin-right: auto;
}

.badge-extractor-heuristic {
  color: #d8b45a;
  border-color: #5a4d2a;
}

.badge-extractor-agent {
  color: #b48ae0;
  border-color: #4d3a6e;
}

.badge-extractor-llm {
  color: #7aa2f7;
  border-color: #3a4a6e;
}

.intel-run {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.intel-run:hover:not(:disabled) {
  background: var(--bg-hover);
}

.intel-run:disabled {
  opacity: 0.6;
  cursor: default;
}

.intel-empty,
.intel-summary {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

.intel-section h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 7px;
}

.intel-count {
  color: var(--text-faint);
  font-weight: 500;
}

.intel-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-suggest {
  cursor: pointer;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
}

.chip-suggest:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-faint);
}

.chip-suggest:disabled {
  opacity: 0.5;
  cursor: default;
}

.chip-count {
  color: var(--text-faint);
  font-size: 11px;
}

.pcp-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pcp-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.pcp-name {
  font-size: 13px;
  font-weight: 600;
  margin-right: auto;
}

.pcp-summary {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-muted);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  max-height: 260px;
  overflow-y: auto;
}

.pcp-updated {
  font-size: 11px;
  color: var(--text-faint);
}

.intel-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.intel-item {
  border-left: 2px solid var(--border);
  padding: 5px 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  border-radius: 0 8px 8px 0;
  background: var(--bg);
}

.intel-item a {
  display: block;
}

.intel-item:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.intel-intent {
  border-left-color: #9ac48a;
}

.intel-decision {
  border-left-color: #7aa2f7;
}

.intel-assumption {
  border-left-color: #d8b45a;
}

.intel-question {
  border-left-color: #e0716f;
}

.confidence-low {
  opacity: 0.65;
}

.intel-footer {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: auto;
}

.msg {
  scroll-margin-top: 16px;
}

/* ---------- Reconciliation ---------- */

.recon-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recon-paste {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11.5px;
  width: 100%;
  resize: vertical;
}

.recon-paste:focus {
  outline: none;
  border-color: var(--accent);
}

.recon-done {
  font-size: 12.5px;
  color: var(--text-muted);
}

.recon-view {
  font-size: 13px;
  font-weight: 550;
  color: var(--accent);
}

.recon-view:hover {
  text-decoration: underline;
}

/* ---------- Brief page ---------- */

.brief-page {
  flex: 1 1;
  overflow-y: auto;
}

.brief-inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brief-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-sidebar);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brief-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brief-section-head h3 {
  font-size: 15px;
  font-weight: 650;
}

.brief-pasteback {
  border-color: var(--accent);
}

.brief-proposal {
  border-color: #3f5638;
}

.proposal-changes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.proposal-change {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  padding: 5px 10px;
  background: var(--bg);
  border-radius: 8px;
}

.change-kind {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  min-width: 72px;
}

.change-op {
  font-size: 11px;
  font-weight: 600;
  min-width: 64px;
}

.op-added { color: #9ac48a; }
.op-removed { color: #e0716f; }
.op-modified { color: #d8b45a; }

/* ---------- Login ---------- */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 22rem;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-brand {
  font-size: 18px;
  font-weight: 700;
}

.login-brand span {
  color: var(--text-faint);
  font-weight: 500;
}

.login-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.login-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.login-card input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-card button {
  margin-top: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 16px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
}

.login-card button:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-faint);
}

.login-card button:disabled {
  opacity: 0.6;
}

.login-error {
  font-size: 13px;
  color: #e0716f;
}

/* ---------- Empty state ---------- */

.empty-state {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  padding: 24px;
  text-align: center;
}

.empty-state h2 {
  font-size: 22px;
  font-weight: 650;
  color: var(--text);
}

.empty-state p {
  max-width: 34rem;
  font-size: 14px;
}

