:root {
  --bg: #eef1ef;
  --surface: #fbfcfb;
  --surface-alt: #f3f6f3;
  --surface-strong: #dce5db;
  --ink: #161b17;
  --muted: #5d675f;
  --accent: #a7d61f;
  --accent-strong: #88b813;
  --accent-soft: #ecf7c8;
  --success: #2d7b42;
  --warning: #8d6f17;
  --danger: #a23232;
  --border: #d6ddd6;
  --shadow: 0 14px 34px rgba(28, 36, 29, 0.08);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(167, 214, 31, 0.18), transparent 34%),
    radial-gradient(circle at right bottom, rgba(167, 214, 31, 0.09), transparent 30%),
    linear-gradient(180deg, #f8faf8 0%, var(--bg) 100%);
  background-repeat: no-repeat;
  background-size: 100% 100vh, 100% 100vh, 100% 100vh;
  min-height: 100vh;
  color: var(--ink);
}

.shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px;
}

.section-shell {
  margin-top: 20px;
  display: grid;
  gap: 20px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero h1, .panel h2, .panel h3 { margin: 0 0 12px; }
.hero p, .meta, .muted { color: var(--muted); }

.hero-brand {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.hero-brand-logo-horizontal {
  width: min(100%, 252px);
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(22, 27, 23, 0.12));
}

.hero-actions {
  display: inline-flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  width: auto;
  margin-left: auto;
  flex: 0 0 auto;
}

.hero-actions button {
  width: auto;
  min-width: 140px;
  min-height: 42px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.hero-actions .header-action-button {
  padding: 10px 16px;
  border-radius: 14px;
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--accent-strong);
}

.grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  margin-top: 20px;
}

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

.module-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(243,246,243,0.92));
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.module-card.active,
.module-card:hover {
  border-color: rgba(136, 184, 19, 0.55);
  box-shadow: 0 18px 36px rgba(22, 27, 23, 0.1);
}

.module-card.selected,
.module-card.active.selected {
  border-color: rgba(136, 184, 19, 0.95);
  background: linear-gradient(180deg, rgba(246, 255, 226, 0.98), rgba(232, 248, 204, 0.95));
  box-shadow: 0 0 0 3px rgba(136, 184, 19, 0.22), 0 22px 40px rgba(88, 122, 10, 0.18);
  transform: translateY(-1px);
}

.module-card span {
  color: var(--muted);
}

.section-header {
  display: grid;
  gap: 14px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.breadcrumbs button {
  width: auto;
  padding: 2px 6px;
  border: none;
  background: transparent;
  color: var(--accent);
  border-radius: 8px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

.workspace-sidebar,
.workspace-content {
  display: grid;
  gap: 20px;
  align-content: start;
}

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

.project-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-alt);
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.project-card-top h4 {
  margin: 0 0 4px;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.project-card-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.project-card-mode-note {
  margin: -4px 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.project-lifecycle-hint {
  width: 100%;
  margin-top: 6px;
  line-height: 1.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface);
}

.status-pill.status-active {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.status-pill.status-closed,
.status-pill.status-archived {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}

.status-pill.status-suspended,
.status-pill.status-draft {
  color: #1d4ed8;
  background: #dbeafe;
  border-color: #93c5fd;
}

.project-wizard-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.wizard-stepbar {
  display: flex;
  gap: 8px;
}

.wizard-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  font-weight: 700;
}

.wizard-step.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.danger-button {
  color: #b91c1c;
}

.project-modal-header-actions .danger-button {
  padding: 6px 10px;
  min-height: 34px;
  font-size: 0.8rem;
  border-radius: 10px;
}

.tree-list {
  display: grid;
  gap: 8px;
}

.tree-node {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,0.85);
  color: var(--ink);
  border: 1px solid var(--border);
}

.tree-node.active {
  background: var(--accent-soft);
  border-color: var(--accent-strong);
  color: var(--ink);
}

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

.tab-button {
  width: auto;
  background: rgba(255,255,255,0.88);
  color: var(--ink);
  border: 1px solid var(--border);
}

.tab-button.active {
  background: var(--accent);
  color: #1b250b;
  border-color: var(--accent-strong);
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
}

.status-green {
  color: var(--success);
  border-color: rgba(29, 106, 79, 0.35);
  background: rgba(29, 106, 79, 0.08);
}

.status-yellow {
  color: var(--warning);
  border-color: rgba(164, 106, 20, 0.35);
  background: rgba(164, 106, 20, 0.1);
}

.status-red {
  color: var(--danger);
  border-color: rgba(157, 47, 47, 0.35);
  background: rgba(157, 47, 47, 0.1);
}

input, textarea, select {
  width: 100%;
  font: inherit;
  border-radius: 12px;
}

button {
  font: inherit;
  border-radius: 12px;
}

input, textarea, select {
  border: 1px solid var(--border);
  padding: 12px 14px;
  background: white;
  color: var(--ink);
}

textarea { min-height: 92px; resize: vertical; }

button {
  border: none;
  padding: 12px 14px;
  background: var(--accent);
  color: #182009;
  cursor: pointer;
  font-weight: 700;
}

button:disabled,
button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

button.secondary {
  background: var(--surface-strong);
  color: var(--ink);
}

button.ghost {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--accent-strong);
}

.text-link-button {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.9rem;
  font-weight: 500;
  align-self: flex-start;
  box-shadow: none;
}

.text-link-button:hover,
.text-link-button:focus-visible {
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.stack { display: grid; gap: 12px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metrics-six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metric {
  padding: 14px;
  border-radius: 16px;
  background: var(--accent-soft);
}
.metric strong { display: block; font-size: 1.6rem; margin-top: 6px; }

.list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.list-item, .suggestion {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.8);
}

.list-item.active { border-color: var(--accent); background: var(--accent-soft); }
.conversation-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.conversation-list-card {
  display: grid;
  gap: 12px;
  align-content: space-between;
  min-height: 160px;
}
.conversation-list-button {
  display: grid;
  gap: 8px;
  width: 100%;
  text-align: left;
}
.conversation-list-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: stretch;
  overflow: hidden;
}
.conversation-chat-column,
.conversation-side-column {
  min-width: 0;
  min-height: 0;
}

.conversation-focus-workspace {
  gap: 14px;
}

.conversation-focus-backdrop {
  padding: 28px;
  background: rgba(20, 26, 22, 0.62);
  backdrop-filter: blur(6px);
}

.modal-card.modal-card-conversation-focus {
  width: min(100%, 1360px);
  height: min(100%, calc(100vh - 56px));
  max-height: calc(100vh - 56px);
  padding: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(251, 253, 251, 0.99), rgba(242, 246, 242, 0.97));
}

.conversation-focus-modal {
  min-height: 0;
  height: 100%;
  gap: 16px;
}

.conversation-focus-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 6px 4px 0;
}

.conversation-focus-toolbar-copy {
  min-width: 0;
  gap: 4px;
}

.conversation-focus-toolbar-actions {
  justify-content: flex-end;
}

.conversation-focus-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.conversation-focus-body > .panel.conversation-layout {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.conversation-layout {
  height: 100%;
  min-height: 0;
}

.conversation-chat-header {
  display: grid;
  gap: 4px;
}

.conversation-chat-header .stack {
  gap: 4px;
}

.conversation-chat-header .actions {
  align-items: center;
  gap: 10px;
}

.conversation-chat-header h2,
.conversation-chat-header p {
  margin: 0;
}

.conversation-chat-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.conversation-chat-column > small {
  margin: 0;
  line-height: 1.35;
}

.conversation-chat-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(243,246,243,0.9));
}

.conversation-chat-thread {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 6px 6px 4px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.conversation-bubble-row {
  display: flex;
}

.conversation-bubble-row.incoming {
  justify-content: flex-start;
}

.conversation-bubble-row.assistant,
.conversation-bubble-row.operator {
  justify-content: flex-end;
}

.conversation-bubble {
  display: grid;
  gap: 8px;
  width: min(82%, 720px);
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(22, 27, 23, 0.06);
}

.conversation-bubble.incoming {
  border-top-left-radius: 8px;
}

.conversation-bubble.assistant {
  border-top-right-radius: 8px;
  border-color: rgba(136, 184, 19, 0.38);
  background: linear-gradient(180deg, rgba(244, 251, 220, 0.98), rgba(234, 246, 196, 0.96));
}

.conversation-bubble.operator {
  border-top-right-radius: 8px;
  border-color: rgba(45, 123, 66, 0.28);
  background: linear-gradient(180deg, rgba(228, 245, 233, 0.98), rgba(214, 238, 221, 0.95));
}

.conversation-bubble.pending {
  opacity: 0.72;
}

.conversation-bubble-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.conversation-bubble-content {
  white-space: pre-wrap;
  line-height: 1.55;
}

.conversation-composer {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(136, 184, 19, 0.24);
  background: rgba(255,255,255,0.96);
}

.conversation-composer.is-pending {
  border-color: rgba(45, 123, 66, 0.28);
  box-shadow: 0 10px 24px rgba(22, 27, 23, 0.08);
}

.conversation-composer-copy {
  display: grid;
  gap: 4px;
}

.conversation-composer-copy span {
  color: var(--muted);
  font-size: 0.82rem;
}

.conversation-composer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.conversation-composer textarea {
  min-height: 52px;
  max-height: 120px;
  border-radius: 14px;
  resize: vertical;
  padding: 12px 14px;
}

.conversation-composer-tools {
  display: flex;
  justify-content: flex-start;
}

.conversation-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  font-size: 1.1rem;
  line-height: 1;
}

.conversation-send-button {
  align-self: stretch;
}

.conversation-generate-button {
  background: var(--surface-strong);
  color: var(--ink);
}

.conversation-side-panel {
  max-height: none;
  min-height: 0;
  overflow: visible;
  padding: 16px;
  background: rgba(248, 250, 248, 0.92);
  box-shadow: none;
}

.conversation-side-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.conversation-side-column .panel {
  padding: 16px;
  background: rgba(248, 250, 248, 0.88);
  box-shadow: none;
}

.conversation-side-column h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.conversation-side-column .muted {
  font-size: 0.88rem;
}

.conversation-side-column .list,
.conversation-side-column .suggestion {
  gap: 8px;
}

.conversation-side-column .suggestion,
.conversation-side-column .list-item {
  background: rgba(255,255,255,0.76);
}

.conversation-health-green {
  border-color: rgba(29, 106, 79, 0.45);
  box-shadow: 0 0 0 1px rgba(29, 106, 79, 0.12), var(--shadow);
}

.conversation-health-yellow {
  border-color: rgba(164, 106, 20, 0.45);
  box-shadow: 0 0 0 1px rgba(164, 106, 20, 0.12), var(--shadow);
}

.conversation-health-red {
  border-color: rgba(157, 47, 47, 0.5);
  box-shadow: 0 0 0 1px rgba(157, 47, 47, 0.12), var(--shadow);
}

.messages { max-height: 420px; overflow: auto; display: grid; gap: 10px; }
.message {
  padding: 12px 14px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--border);
}
.message.external { border-left: 4px solid var(--accent); }
.message.operator { border-left: 4px solid var(--success); }

.suggestion small, .message small { display: block; color: var(--muted); margin-top: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions button { width: auto; }
.actions.actions-end { justify-content: flex-end; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.84);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 0;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.data-table th {
  background: rgba(236, 247, 200, 0.72);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.table-filter-row th {
  background: rgba(255,255,255,0.95);
  padding-top: 6px;
  padding-bottom: 8px;
}

.table-filter-input,
.table-filter-select {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  min-height: 34px;
  font-size: 0.82rem;
  border-radius: 10px;
}

.table-filter-select.compact {
  width: auto;
}

.data-table tbody tr:hover {
  background: rgba(167, 214, 31, 0.08);
}

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

.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.table-actions {
  align-items: center;
  justify-content: flex-end;
}

.table-wrap .actions {
  gap: 6px;
}

.table-wrap .actions button {
  padding: 6px 8px;
  min-height: 34px;
  font-size: 0.78rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.compact-form-row {
  align-items: end;
}

.compact-form-row select,
.compact-form-row button {
  margin-bottom: 0;
}

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

.role-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
}

.role-checkbox.disabled {
  opacity: 0.46;
  background: rgba(167, 167, 167, 0.12);
  border-color: rgba(140, 140, 140, 0.35);
}

.role-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.role-checkbox span {
  font-size: 0.92rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.role-checkbox.disabled span {
  color: var(--muted);
}

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

.project-modal-header {
  position: relative;
  align-items: flex-start;
  gap: 20px;
  padding-right: 56px;
}

.project-modal-heading {
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
}

.project-modal-meta {
  margin: 0;
}

.project-modal-header-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.project-modal-header-actions-split {
  width: 100%;
}

.modal-header .icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  font-size: 1.5rem;
  border-radius: 12px;
}

.project-modal-header > .icon-button {
  position: absolute;
  top: 0;
  right: 0;
}

.user-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.15fr);
  gap: 20px;
  align-items: start;
}

.project-membership-section {
  border-color: rgba(136, 184, 19, 0.24);
  background: rgba(251, 253, 247, 0.96);
}

.project-membership-list {
  max-height: 420px;
  overflow: auto;
}

.user-detail-grid .role-checkbox-grid {
  grid-template-columns: 1fr;
}

.account-summary-grid,
.security-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-project-row {
  align-items: center;
  justify-content: space-between;
}

.section-inline-header {
  align-items: flex-start;
  justify-content: space-between;
}

.billing-period-select {
  width: auto;
  min-width: 220px;
}

.two-factor-qr {
  width: 220px;
  max-width: 100%;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
}

.password-field-stack {
  gap: 8px;
}

.password-rules {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.78);
}

.password-rules-title {
  font-size: 0.88rem;
  color: var(--muted);
}

.password-rule,
.password-match-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.password-rule::before,
.password-match-hint::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.password-rule.is-pending,
.password-match-hint.is-pending {
  color: var(--muted);
}

.password-rule.is-invalid,
.password-match-hint.is-invalid {
  color: var(--danger);
}

.password-rule.is-valid,
.password-match-hint.is-valid {
  color: var(--success);
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  font-size: 0.8rem;
  margin-right: 6px;
}

.document-preview {
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.82);
  color: var(--ink);
  white-space: pre-wrap;
  max-height: 420px;
  overflow: auto;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.92rem;
  line-height: 1.45;
}

.project-overview-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.project-overview-copy {
  flex: 1 1 320px;
  min-width: 0;
}

.project-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.project-start-actions {
  flex: 0 1 auto;
  justify-content: flex-end;
}

.project-start-actions select {
  min-width: 260px;
}

.project-lifecycle-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.project-lifecycle-controls-split {
  justify-content: space-between;
}

.project-primary-actions,
.project-secondary-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.project-primary-actions .secondary,
.project-primary-actions .ghost,
.project-secondary-actions .ghost {
  min-height: 40px;
}

.project-primary-actions {
  justify-content: flex-end;
}

.project-secondary-actions {
  justify-content: flex-end;
}

.modal-card.modal-card-compact {
  width: min(100%, 540px);
}

.project-team-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.project-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-settings-grid-single {
  grid-template-columns: 1fr;
  gap: 12px;
}

.field-block span {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.field-panel {
  gap: 10px;
}

.project-settings-block {
  border-color: rgba(136, 184, 19, 0.2);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247, 250, 244, 0.96));
}

.project-assumptions-panel {
  gap: 12px;
}

.project-assumptions-layout {
  gap: 12px;
}

.project-assumptions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.project-assumptions-column {
  gap: 12px;
}

.project-definition-item {
  border: 1px solid rgba(136, 184, 19, 0.2);
  border-radius: 20px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247, 250, 244, 0.96));
}

.project-definition-block-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.project-definition-block-header > .stack {
  min-width: 0;
}

.project-definition-block-header > button {
  width: auto;
  flex: 0 0 auto;
}

.persona-section-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.persona-section-header > h3,
.persona-section-header > .stack {
  min-width: 0;
}

.persona-section-toggle {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  padding: 8px 12px;
  min-height: 36px;
  font-size: 0.84rem;
}

.persona-section-panel {
  gap: 10px;
}

.persona-create-form {
  gap: 10px;
}

.persona-create-form input,
.persona-create-form textarea {
  padding: 10px 12px;
}

.persona-create-form textarea {
  min-height: 76px;
}

.persona-create-form .project-settings-block-actions .secondary {
  width: auto;
  min-height: 34px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.project-definition-heading {
  display: grid;
  gap: 2px;
}

.project-definition-heading h3 {
  margin: 0;
  line-height: 1.15;
}

.project-definition-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.25;
}

.project-definition-edit-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  font-size: 0.95rem;
  border-radius: 10px;
  flex: 0 0 auto;
}

.project-definition-readonly {
  padding: 2px 4px;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.project-definition-readonly-frame,
.project-definition-editor-frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.82);
}

.project-definition-readonly-frame {
  padding: 0;
}

.project-definition-readonly-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: start;
  gap: 4px;
  padding: 2px 4px;
}

.project-definition-readonly-action {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.project-definition-inline-edit-button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.82rem;
  z-index: 1;
}

.project-definition-inline-edit-button:hover,
.project-definition-inline-edit-button:focus-visible {
  background: transparent;
  box-shadow: none;
}

.project-inline-definition-form {
  gap: 8px;
}

.project-definition-editor-frame {
  padding: 0;
}

.project-definition-textarea {
  width: 100%;
  padding: 2px 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  resize: vertical;
  font-size: 0.9rem;
  line-height: 1.4;
}

.project-definition-textarea:focus {
  outline: none;
}

.project-definition-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.compact-button {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 0.82rem;
}

.field-panel textarea {
  min-height: 132px;
}

.project-threshold-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.project-settings-footer {
  display: flex;
  justify-content: flex-end;
}

.project-settings-block-actions {
  display: flex;
  justify-content: flex-end;
}

.persona-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.persona-management-list {
  gap: 14px;
}

.persona-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.persona-card {
  height: 100%;
  padding: 18px;
}

.persona-card-inactive {
  background: linear-gradient(180deg, rgba(249, 250, 249, 0.96), rgba(240, 243, 240, 0.94));
  border-color: #d8dfd8;
}

.persona-card-inactive .persona-card-name,
.persona-card-inactive .persona-field-label,
.persona-card-inactive .persona-field-value {
  color: #5f675f;
}

.persona-card-inactive .persona-card-body {
  background: linear-gradient(180deg, rgba(252, 252, 252, 0.96), rgba(243, 245, 243, 0.94));
  border-color: #d8dfd8;
}

.persona-card-layout {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  height: 100%;
}

.persona-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.persona-card-header-left {
  min-width: 0;
}

.persona-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.persona-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
  min-width: 0;
}

.persona-card-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-self: center;
}

.persona-card-header-actions .compact-button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.76rem;
}

.persona-name-edit-form {
  gap: 6px;
}

.persona-name-input {
  min-width: min(100%, 360px);
}

.persona-card-body {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(136, 184, 19, 0.2);
  border-radius: 20px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247, 250, 244, 0.96));
}

.persona-field-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.persona-field-label {
  padding-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.persona-field-content {
  min-width: 0;
}

.persona-field-frame {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.82);
}

.persona-field-edit-shell {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.82);
  padding: 2px 4px;
}

.persona-field-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: start;
  gap: 4px;
  padding: 2px 4px;
}

.persona-field-value {
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.persona-field-action {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.persona-field-textarea {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  resize: vertical;
  font-size: 0.9rem;
  line-height: 1.4;
}

.persona-field-textarea:focus {
  outline: none;
}

.persona-icon-button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.82rem;
}

.persona-icon-button:hover,
.persona-icon-button:focus-visible {
  background: transparent;
  box-shadow: none;
}

.project-team-member-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.project-team-member-row .actions {
  width: auto;
  flex: 0 0 auto;
}

.project-role-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.login {
  max-width: 480px;
  margin: 48px auto;
}

.login-panel {
  background:
    radial-gradient(circle at top right, rgba(167, 214, 31, 0.2), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243,246,243,0.96));
}

.login-brand {
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-brand-logo {
  width: min(100%, 320px);
  height: auto;
  display: block;
}

.login-title {
  text-align: center;
  margin-bottom: 4px;
}

.status {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 14px;
  background: #1f2a23;
  color: #f7faf7;
  box-shadow: 0 18px 36px rgba(22, 27, 23, 0.18);
  border: 1px solid rgba(167, 214, 31, 0.35);
  animation: toast-in 180ms ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 42, 55, 0.38);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 1000;
}

.modal-card {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 48px rgba(31, 42, 55, 0.18);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.modal-card.modal-card-wide {
  width: min(100%, 1040px);
}

.modal-card.modal-card-project {
  width: min(100%, 1280px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  align-self: start;
  margin-top: 16px;
}

.processing-modal {
  width: min(100%, 460px);
  align-items: center;
  text-align: center;
  padding: 28px;
}

.processing-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(163, 177, 138, 0.35);
  border-top-color: var(--accent-strong);
  animation: processing-spin 0.9s linear infinite;
}

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

@media (max-width: 980px) {
  .grid, .workspace-grid, .conversation-layout, .metrics, .metrics-six, .row {
    grid-template-columns: 1fr;
  }

  .conversation-card-grid {
    grid-template-columns: 1fr;
  }

  .conversation-focus-backdrop {
    padding: 12px;
  }

  .modal-card.modal-card-conversation-focus {
    width: min(100%, 100%);
    height: min(100%, calc(100vh - 24px));
    max-height: calc(100vh - 24px);
    padding: 14px;
  }

  .conversation-focus-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .conversation-focus-toolbar-actions {
    justify-content: flex-start;
  }

  .conversation-chat-shell {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .conversation-chat-thread,
  .conversation-side-panel {
    max-height: none;
  }

  .conversation-bubble {
    width: 100%;
  }

  .project-team-layout {
    grid-template-columns: 1fr;
  }

  .project-settings-grid,
  .project-assumptions-grid,
  .persona-card-grid,
  .project-threshold-grid,
  .persona-form-grid {
    grid-template-columns: 1fr;
  }

  .persona-section-header,
  .persona-card-header {
    grid-template-columns: 1fr;
  }

  .persona-card-header-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .persona-field-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .persona-field-label {
    padding-top: 0;
  }

  .hero {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .hero-brand {
    align-items: flex-start;
  }

  .tab-row,
  .actions {
    width: 100%;
  }

  .hero-actions {
    width: auto;
    margin-left: 0;
  }

  .user-detail-grid {
    grid-template-columns: 1fr;
  }

  .account-summary-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .project-overview-top,
  .project-lifecycle-controls,
  .project-lifecycle-controls-split {
    flex-direction: column;
    align-items: stretch;
  }

  .project-start-actions,
  .project-primary-actions,
  .project-secondary-actions,
  .project-modal-header-actions {
    justify-content: flex-start;
  }

  .project-start-actions select {
    min-width: 0;
    width: 100%;
  }

  .role-checkbox-grid {
    grid-template-columns: 1fr;
  }
}
