:root {
  --bg: #f5f2ec;
  --bg-strong: #efe9df;
  --sidebar: rgba(250, 248, 244, 0.94);
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.68);
  --border: rgba(58, 49, 39, 0.1);
  --border-strong: rgba(58, 49, 39, 0.16);
  --text: #211c18;
  --muted: #7b736b;
  --accent: #f36b3b;
  --accent-hover: #df5928;
  --accent-soft: rgba(243, 107, 59, 0.12);
  --success: #0f8b6d;
  --success-soft: rgba(15, 139, 109, 0.14);
  --danger: #b3483f;
  --danger-soft: rgba(179, 72, 63, 0.12);
  --shadow-lg: 0 24px 80px rgba(92, 78, 60, 0.08);
  --shadow-md: 0 18px 44px rgba(92, 78, 60, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  height: 100%;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.95), transparent 36%),
    radial-gradient(circle at bottom right, rgba(244, 233, 222, 0.78), transparent 28%),
    linear-gradient(180deg, #faf8f4 0%, var(--bg) 56%, var(--bg-strong) 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  height: 100vh;
}

.sidebar,
.workspace-header,
.tool-overlay-panel,
.composer-shell {
  animation: float-in 520ms ease both;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 10px 14px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.brand-row,
.brand-lockup,
.workspace-header,
.composer-toolbar,
.composer-toolbar-left,
.composer-toolbar-right,
.workspace-switcher,
.section-header,
.sidebar-footer {
  display: flex;
  align-items: center;
}

.brand-row,
.workspace-header,
.composer-toolbar {
  justify-content: space-between;
}

.brand-lockup {
  gap: 10px;
}

.brand-mark,
.icon-btn,
.nav-icon,
.tool-chip-indicator,
.workspace-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #111111;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 14px;
}

.brand-copy span {
  color: var(--muted);
  font-size: 12px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  cursor: default;
}

.icon-btn span {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1.5px solid rgba(58, 49, 39, 0.32);
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-list,
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-action-btn,
.nav-link,
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 15px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.nav-action-btn,
.recent-item {
  cursor: pointer;
}

.nav-link {
  cursor: default;
  text-decoration: none;
}

a.nav-link,
a.nav-action-btn {
  cursor: pointer;
  text-decoration: none;
}

.nav-action-btn {
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(65, 52, 40, 0.06);
}

.nav-link:hover,
.nav-action-btn:hover,
.recent-item:hover {
  background: rgba(255, 255, 255, 0.84);
}

.nav-link.active,
.recent-item.active {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 0 0 1px rgba(243, 107, 59, 0.16);
}

.nav-icon {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(58, 49, 39, 0.14);
  background: rgba(255, 255, 255, 0.6);
  flex: 0 0 auto;
}

.accent-orange {
  background: rgba(243, 107, 59, 0.18);
  border-color: rgba(243, 107, 59, 0.3);
}

.accent-violet {
  background: rgba(124, 93, 229, 0.16);
  border-color: rgba(124, 93, 229, 0.3);
}

.accent-neutral {
  background: rgba(46, 62, 80, 0.12);
  border-color: rgba(46, 62, 80, 0.22);
}

.sidebar-divider {
  height: 1px;
  margin: 4px 6px;
  background: var(--border);
}

.sidebar-label,
.tool-eyebrow,
.hero-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-recents {
  min-height: 0;
  flex: 1;
}

.recent-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.recent-empty {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.recent-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.recent-title {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.recent-meta {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-footer {
  gap: 10px;
  padding: 6px 8px 0;
}

.workspace-badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, #eb6740, #d9502a);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.workspace-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.main-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100vh;
  padding: 6px 0 18px;
  overflow: hidden;
}

.workspace-header {
  gap: 20px;
  padding: 6px 28px 10px;
}

.workspace-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.workspace-switcher {
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.03em;
  cursor: default;
}

.workspace-switcher-caret {
  color: var(--muted);
  font-size: 13px;
}

.workspace-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.connection-pill,
.tool-chip-button,
.tool-chip,
.secondary-btn,
.send-btn {
  border-radius: 999px;
}

.connection-pill.connected {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(15, 139, 109, 0.18);
}

.connection-pill.warning {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(243, 107, 59, 0.2);
}

.connection-pill.error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(179, 72, 63, 0.2);
}

.hero-subtitle,
.muted-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.tool-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.tool-overlay-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(25, 20, 15, 0.16);
  cursor: pointer;
}

.tool-overlay-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: min(380px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(58, 49, 39, 0.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 243, 236, 0.92));
  box-shadow: var(--shadow-lg);
}

.tool-overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.tool-overlay-header h2 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
}

.tool-overlay-close {
  cursor: pointer;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  overflow-wrap: anywhere;
}

.connection-pill {
  width: 100%;
  padding: 10px 14px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  font-size: 13px;
}

.tool-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tool-status-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.tool-status-card span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tool-status-card strong {
  font-size: 14px;
  line-height: 1.4;
}

.tool-detail-text {
  min-height: 44px;
}

.tool-overlay-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-overlay-section h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary-btn,
.send-btn {
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
}

.send-btn {
  background: #111111;
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(17, 17, 17, 0.16);
}

.send-btn:hover {
  background: #000000;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  border: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

.chat-stage {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 0 22px;
}

.empty-state {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 20px 16px 10px;
  text-align: center;
}

.empty-state h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 54px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.hero-subtitle {
  width: min(100%, 720px);
  font-size: 16px;
}

.suggested-prompts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: min(100%, 980px);
  margin-top: 18px;
}

.suggested-prompt-card {
  min-height: 120px;
  padding: 18px 20px;
  border: 1px solid rgba(58, 49, 39, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  color: #5d544c;
  text-align: left;
  font-size: 16px;
  line-height: 1.45;
  box-shadow: 0 10px 24px rgba(92, 78, 60, 0.05);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  overflow: hidden;
  text-wrap: balance;
}

.suggested-prompt-card:hover {
  transform: translateY(-1px);
  border-color: rgba(243, 107, 59, 0.16);
  box-shadow: 0 16px 30px rgba(92, 78, 60, 0.08);
}

.messages {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 14px 0 8px;
  overflow-y: auto;
}

body.is-empty .messages {
  display: none;
}

body.has-messages .empty-state {
  display: none;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(100%, 760px);
  animation: float-in 320ms ease both;
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: stretch;
}

.message-role {
  color: var(--muted);
  font-size: 12px;
}

.message-bubble {
  padding: 16px 18px;
  border-radius: 24px;
  border: 1px solid rgba(58, 49, 39, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(99, 82, 63, 0.05);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-markdown {
  white-space: normal;
}

.message-markdown > :first-child {
  margin-top: 0;
}

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

.message-markdown p,
.message-markdown ul,
.message-markdown ol,
.message-markdown blockquote,
.message-markdown pre,
.message-markdown h1,
.message-markdown h2,
.message-markdown h3,
.message-markdown h4,
.message-markdown h5,
.message-markdown h6 {
  margin: 0 0 12px;
}

.message-markdown ul,
.message-markdown ol {
  padding-left: 20px;
}

.message-markdown li + li {
  margin-top: 6px;
}

.message-markdown a {
  color: #8b4f1e;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message-markdown code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(76, 58, 40, 0.08);
  font-size: 0.95em;
}

.message-markdown .md-code-block {
  overflow-x: auto;
  padding: 14px 16px;
  border-radius: 16px;
  background: #2b241d;
  color: #f8f1e7;
  white-space: pre;
}

.message-markdown .md-code-block code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.message-markdown blockquote {
  padding-left: 14px;
  border-left: 3px solid rgba(139, 79, 30, 0.28);
  color: #5b5147;
}

.message-markdown .md-table-wrapper {
  overflow-x: auto;
  margin: 0 0 12px;
  border: 1px solid rgba(76, 58, 40, 0.12);
  border-radius: 4px;
  -webkit-overflow-scrolling: touch;
}

.message-markdown table.md-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.95em;
}

.message-markdown table.md-table th,
.message-markdown table.md-table td {
  padding: 8px 10px;
  border: 1px solid rgba(76, 58, 40, 0.18);
  text-align: left;
  vertical-align: top;
  min-width: 160px;
  max-width: 280px;
  word-break: normal;
  overflow-wrap: break-word;
}

.message-markdown table.md-table th {
  background: rgba(139, 79, 30, 0.06);
  font-weight: 600;
}

.message.user .message-bubble {
  background: var(--panel-strong);
}

.message.assistant .message-bubble {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 243, 237, 0.9));
}

.message-bubble.pending {
  opacity: 0.72;
  font-style: italic;
}

.tool-trace {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 12px;
}

.composer-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding-top: 8px;
}

.composer {
  position: relative;
  padding: 14px 18px 12px;
  border: 1px solid rgba(58, 49, 39, 0.08);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-lg);
}

.composer textarea {
  width: 100%;
  min-height: 72px;
  max-height: 220px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  resize: none;
  font-size: 18px;
  line-height: 1.55;
  outline: none;
}

.composer textarea::placeholder {
  color: #9a928a;
}

.composer-toolbar {
  gap: 14px;
  padding-top: 10px;
}

.composer-toolbar-left,
.composer-toolbar-right {
  gap: 10px;
  flex-wrap: wrap;
}

.active-source-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.active-source-chips::-webkit-scrollbar {
  display: none;
}

.composer-toolbar-right {
  justify-content: flex-end;
}

.composer-toolbar-left {
  min-width: 0;
  flex: 1;
}

.composer-icon {
  cursor: pointer;
  flex: 0 0 auto;
}

.tool-chip-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 190px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(58, 49, 39, 0.08);
  background: rgba(255, 255, 255, 0.88);
  color: #5b5147;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(92, 78, 60, 0.05);
}


.tool-chip-button.is-pipeline {
  background: rgba(243, 107, 59, 0.18);
  border-color: rgba(243, 107, 59, 0.28);
  color: #b14a1d;
  cursor: default;
}

.composer-tool-menu {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 8px;
  left: 18px;
  bottom: calc(100% + 12px);
  width: min(320px, calc(100vw - 64px));
  padding: 10px;
  border: 1px solid rgba(58, 49, 39, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
}

.composer-tool-option,
.composer-tool-option-main {
  display: flex;
  align-items: center;
}

.composer-tool-option {
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(58, 49, 39, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  cursor: pointer;
}

.composer-tool-option:hover {
  border-color: rgba(58, 49, 39, 0.14);
}

.composer-tool-option.pipeline-option.is-selected {
  background: rgba(243, 107, 59, 0.18);
  border-color: rgba(243, 107, 59, 0.28);
}

.composer-tool-option-main {
  gap: 10px;
  align-items: flex-start;
}

.composer-tool-option-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.composer-tool-option-title {
  font-size: 14px;
}

.composer-tool-option-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.composer-tool-option-state {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(58, 49, 39, 0.08);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.composer-tool-option-state.is-on {
  background: rgba(15, 139, 109, 0.12);
  border-color: rgba(15, 139, 109, 0.18);
  color: #0f8b6d;
}

.composer-tool-option-state.is-warning {
  background: rgba(243, 107, 59, 0.12);
  border-color: rgba(243, 107, 59, 0.18);
  color: #b65a33;
}

.composer-tool-option-state.is-off {
  background: rgba(58, 49, 39, 0.05);
  border-color: rgba(58, 49, 39, 0.08);
  color: #7b736b;
}

.tool-chip-indicator {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, #a24bea, #7d35d8);
}

.tool-chip-indicator.pipeline {
  background: linear-gradient(180deg, #f6925e, #df5928);
}


.tool-hint {
  font-size: 13px;
  white-space: nowrap;
}

.composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  min-height: 28px;
}

.send-btn {
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

button:disabled {
  opacity: 0.64;
  cursor: not-allowed;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pipeline-main {
  padding: 6px 0 24px;
  overflow: hidden;
}


.pipeline-stage {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  min-height: 0;
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 6px 28px 0;
  overflow-y: auto;
}

.pipeline-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pipeline-section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.pipeline-section-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pipeline-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(58, 49, 39, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.pipeline-empty {
  padding: 18px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 14px;
}

.meeting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.meeting-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.meeting-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(92, 78, 60, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.meeting-card.processed {
  border-color: rgba(243, 107, 59, 0.32);
  box-shadow: 0 16px 30px rgba(243, 107, 59, 0.1);
}

.meeting-card.processed:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(243, 107, 59, 0.16);
}

.meeting-card.readonly {
  background: rgba(255, 255, 255, 0.66);
}

.meeting-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.meeting-card-heading strong {
  font-size: 15px;
  line-height: 1.35;
  word-break: break-word;
}

.meeting-card-meta {
  font-size: 13px;
}

.meeting-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.accent-btn {
  min-width: 0;
  min-height: 0;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(243, 107, 59, 0.24);
}

.accent-btn:hover {
  background: var(--accent-hover);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill.status-uploaded {
  background: rgba(58, 49, 39, 0.08);
  color: var(--muted);
  border-color: rgba(58, 49, 39, 0.14);
}

.status-pill.status-progress {
  background: rgba(124, 93, 229, 0.16);
  color: #4f37b7;
  border-color: rgba(124, 93, 229, 0.28);
}

.status-pill.status-done {
  background: rgba(15, 139, 109, 0.08);
  color: var(--success);
  border-color: rgba(15, 139, 109, 0.18);
}

.status-pill.status-failed {
  background: rgba(196, 64, 64, 0.1);
  color: #a33a3a;
  border-color: rgba(196, 64, 64, 0.24);
  cursor: help;
}

#review-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.review-drawer {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  width: min(880px, 100%);
  height: min(88vh, 760px);
  padding: 24px;
  overflow: hidden;
  z-index: 1;
}

@media (max-width: 560px) {
  #review-overlay {
    padding: 12px;
  }

  .review-drawer {
    width: 100%;
    height: calc(100vh - 24px);
  }
}

.review-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  padding-right: 4px;
}

.review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.review-loading {
  padding: 18px 0;
  text-align: center;
}

.review-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.review-input:focus {
  border-color: rgba(243, 107, 59, 0.4);
  box-shadow: 0 0 0 3px rgba(243, 107, 59, 0.12);
}

.review-textarea {
  resize: vertical;
  min-height: 64px;
}

select.review-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237b736b' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.review-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.review-section {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.review-section[open] {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(92, 78, 60, 0.05);
}

.review-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.review-section-summary::-webkit-details-marker {
  display: none;
}

.review-section-summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 180ms ease;
  flex: 0 0 auto;
}

.review-section[open] .review-section-summary::after {
  transform: rotate(45deg);
}

.review-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}

.review-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(58, 49, 39, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.review-section[open] .review-section-count {
  background: rgba(243, 107, 59, 0.16);
  color: #b14a1d;
}

.review-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 18px 18px;
}

.review-add-btn {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.review-add-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border-style: solid;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.artifact-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding: 14px 36px 14px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.artifact-row .review-field:has(textarea),
.artifact-row > .review-checkbox {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .artifact-row {
    grid-template-columns: 1fr;
  }
}

.artifact-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.artifact-remove:hover {
  color: var(--danger);
  border-color: rgba(179, 72, 63, 0.32);
}

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

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .workspace-header {
    padding: 10px 18px 12px;
  }

  .workspace-switcher {
    font-size: 24px;
  }

  .chat-stage {
    padding: 0 14px;
  }

  .messages,
  .composer-shell {
    width: 100%;
  }

  .suggested-prompts {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .sidebar {
    padding: 14px 10px;
  }

  .workspace-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .composer-meta,
  .composer-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .composer-toolbar-left {
    width: 100%;
  }

  .composer-toolbar-right {
    justify-content: space-between;
  }

  .empty-state {
    padding-top: 28px;
  }

  .empty-state h1 {
    font-size: 34px;
  }

  .suggested-prompt-card {
    min-height: 0;
    font-size: 15px;
  }

  .composer {
    padding: 14px 14px 12px;
    border-radius: 24px;
  }

  .composer textarea {
    font-size: 16px;
  }

  .tool-overlay-panel {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .tool-status-grid {
    grid-template-columns: 1fr;
  }

  .composer-tool-menu {
    left: 12px;
    right: 12px;
    width: auto;
  }
}

.artifact-row-readonly {
  display: block;
}

.proposition-text {
  font-weight: 600;
}

.proposition-quote {
  font-size: 0.9em;
  margin: 4px 0;
}

.proposition-field {
  font-size: 0.9em;
}

.passage-text {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.9em;
  margin: 6px 0 0;
}


/* Session footer, admin page */

.sidebar-footer {
  flex-wrap: wrap;
}

.sign-out-btn {
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--panel-soft);
  cursor: pointer;
  font-size: 13px;
}

.sign-out-btn:hover {
  background: var(--panel-strong);
}

.admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.admin-form .review-input {
  min-width: 240px;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 640px;
}

.upload-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-field .secondary-btn {
  align-self: flex-start;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  word-break: break-all;
}

.admin-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-actions {
  white-space: nowrap;
}

.admin-action-btn {
  margin-right: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  cursor: pointer;
  font-size: 12px;
}

.admin-action-btn.danger {
  color: var(--danger);
  border-color: var(--danger-soft);
}

.secret-panel {
  margin: 12px 0;
  padding: 14px 16px;
  border: 1px solid var(--accent-soft);
  border-radius: 12px;
  background: var(--accent-soft);
}

.secret-panel h3 {
  margin: 0;
  font-size: 15px;
}

.secret-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-top: 8px;
}

.secret-row code {
  user-select: all;
  word-break: break-all;
  background: var(--panel-strong);
  padding: 4px 8px;
  border-radius: 6px;
}

.auth-panel {
  max-width: 420px;
  margin: 15vh auto 0;
  padding: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--panel-soft);
  text-align: center;
}

.auth-panel h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.auth-panel p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

html:has(body.landing),
body.landing {
  height: auto;
  overflow: auto;
}

.landing-header,
.landing-section,
.landing-cta,
.landing-footer {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  text-decoration: none;
}

.landing .send-btn,
.landing .secondary-btn {
  min-width: 0;
  min-height: 44px;
  padding: 10px 18px;
}

.landing-hero {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 72px 0 56px;
  text-align: center;
}

.landing-hero h1 {
  margin: 14px 0 16px;
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.landing-lede {
  max-width: 600px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.landing-hero .button-row,
.landing-cta .button-row {
  justify-content: center;
}

.landing-section {
  padding: 48px 0;
}

.landing-section h2,
.landing-cta h2 {
  margin: 0 0 20px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.landing-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.landing-card h3,
.landing-steps h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.landing-card p,
.landing-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.landing-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.landing-steps li {
  padding: 20px 0 0;
  border-top: 2px solid var(--accent);
  counter-increment: step;
}

.landing-steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.landing-cta {
  margin-top: 24px;
  padding: 48px 24px;
  border-radius: 20px;
  background: #111111;
  color: #ffffff;
  text-align: center;
}

.landing-cta p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
}

.landing-cta .send-btn {
  background: #ffffff;
  color: #111111;
}

.landing-cta .send-btn:hover {
  background: #f1ede7;
}

.landing-cta .secondary-btn {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.landing-footer {
  padding: 32px 0 40px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 560px) {
  .landing-header-signup {
    display: none;
  }

  .landing-hero {
    padding: 40px 0 32px;
  }

  .landing-section {
    padding: 32px 0;
  }
}

.calendar-row {
  cursor: pointer;
}

.calendar-row.selected td {
  background: var(--accent-soft);
}

.event-day {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.event-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.bot-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}
