:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-soft: #eef2ed;
  --line: #d9dfd7;
  --ink: #17211c;
  --muted: #68746e;
  --accent: #1d766f;
  --accent-strong: #145c56;
  --accent-soft: #dcefed;
  --warn: #a05a12;
  --shadow: 0 18px 42px rgba(27, 41, 34, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.auth-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 28px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 15% 18%, rgba(220, 239, 237, 0.88), transparent 34%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.7), rgba(245, 247, 244, 0.94)),
    var(--bg);
}

.auth-language-switch {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 4;
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(23, 33, 28, 0.08);
}

.auth-language-switch button {
  min-width: 48px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.auth-language-switch button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.auth-panel {
  display: grid;
  gap: 16px;
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 430px);
  align-items: center;
  gap: clamp(32px, 7vw, 110px);
  width: min(1080px, 100%);
  margin: auto;
}

.auth-product-hero {
  display: grid;
  gap: 18px;
  max-width: 560px;
  padding: 18px 0;
}

.product-kicker {
  margin: 0;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.auth-product-hero h1 {
  max-width: 540px;
  margin: 0;
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.auth-product-hero > p {
  max-width: 510px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.auth-workflow-preview {
  display: grid;
  gap: 11px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.auth-workflow-preview li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.auth-workflow-preview li > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #b7d5d0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
}

.auth-workflow-preview li > div {
  display: grid;
  gap: 2px;
  padding-top: 2px;
}

.auth-workflow-preview strong {
  font-size: 13px;
}

.auth-workflow-preview small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.auth-hero-tags span {
  padding: 6px 9px;
  border: 1px solid #c9dfdc;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
}

.auth-brand h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-brand p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-tabs button,
.auth-form button,
.auth-links button,
.text-button,
.text-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.auth-tabs button {
  padding: 9px 12px;
}

.auth-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.auth-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-form button {
  padding: 11px 14px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.auth-inline-action {
  justify-self: start;
  padding: 2px 0;
  border: 0;
  background: transparent;
}

.password-reset-panel {
  display: grid;
  gap: 12px;
}

.password-reset-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-message.error {
  color: #8a3f00;
}

.auth-cta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-cta-row button {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.auth-secondary-cta {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent-strong);
}

.auth-primary-cta {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.auth-cta-row button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(29, 118, 111, 0.15);
}

.auth-intro {
  margin: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
}

.auth-links {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding-top: 4px;
}

.auth-links button,
.text-link {
  padding: 8px 10px;
  color: var(--accent-strong);
  font-size: 13px;
  text-decoration: none;
}

.text-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 33, 28, 0.28);
}

.info-modal-card {
  position: relative;
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 24px 64px rgba(23, 33, 28, 0.2);
}

.info-modal-card h2 {
  margin: 8px 0 14px;
  font-size: 22px;
}

.info-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.info-modal-body {
  display: grid;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.info-modal-body p {
  margin: 0;
}

.info-modal-body strong {
  color: var(--ink);
}

.info-modal-body a {
  color: var(--accent-strong);
  font-weight: 700;
}

.demo-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.demo-preview-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}

.demo-preview-card span {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-preview-card strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.demo-preview-note {
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

.demo-preview-login {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

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

.task-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.task-header,
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.task-header h1,
.app-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.task-header p,
.app-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.task-list {
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.task-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  padding: 10px 12px 2px;
  background: var(--panel);
}

.task-search-label,
.task-filter-label {
  min-width: 0;
}

.task-controls input,
.task-controls select {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--ink);
  outline: none;
  font-size: 12px;
}

.task-controls input:focus,
.task-controls select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.task-filter-label {
  width: 100px;
}

.task-card.archived {
  opacity: 0.82;
}

.task-card.archived .task-status {
  color: var(--warn);
}

.task-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  overflow: hidden;
}

.task-card:hover,
.task-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.task-select {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.task-select:focus-visible,
.task-action-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.task-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

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

.task-status {
  color: var(--accent-strong);
  font-weight: 700;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 7px 7px 0;
  opacity: 0;
  transition: opacity 120ms ease;
}

.task-card:hover .task-actions,
.task-card:focus-within .task-actions,
.task-card.active .task-actions {
  opacity: 1;
}

.task-action-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.task-action-button:hover {
  background: var(--panel);
  color: var(--accent-strong);
}

.task-action-button.danger:hover {
  color: #a12b2b;
}

.task-action-button:disabled {
  cursor: progress;
  opacity: 0.45;
}

.workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px 360px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(100%, 980px);
  min-width: 0;
  min-height: 0;
  justify-self: center;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.workflow-stepper {
  display: grid;
  gap: 8px;
  padding: 12px 22px 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.workflow-stepper ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-stepper li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 4px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.workflow-index {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.workflow-stepper li.active {
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 800;
}

.workflow-stepper li.active .workflow-index,
.workflow-stepper li.complete .workflow-index {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.workflow-stepper li.complete {
  border-color: #9ccbc4;
  color: var(--ink);
}

.workflow-stepper li.locked {
  opacity: 0.55;
}

.workflow-stepper p {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.specification-panel {
  margin: 12px 22px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.workspace-empty-state {
  display: grid;
  align-content: center;
  gap: 12px;
  margin: 20px 22px 4px;
  padding: 24px;
  border: 1px dashed #b7d5d0;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fcfb, #f3f8f5);
}

.workspace-empty-state h3 {
  margin: 0;
  font-size: 20px;
}

.workspace-empty-state p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.quick-starts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-starts button {
  padding: 8px 10px;
  border: 1px solid #b7d5d0;
  border-radius: 8px;
  background: var(--panel);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.quick-starts button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.specification-heading h3 {
  margin: 0;
  font-size: 13px;
}

.specification-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.specification-status {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.specification-status.draft {
  border-color: #ddbe85;
  color: #8b5f16;
  background: #fff8e8;
}

.specification-status.blocked {
  border-color: #e0a0a0;
  color: #8b2e2e;
  background: #fff1f1;
}

.specification-status.verified {
  border-color: #92c8a2;
  color: #267044;
  background: #effaf1;
}

.specification-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.job-progress-panel {
  margin: 12px 22px 0;
  padding: 12px 14px;
  border: 1px solid #b7d5d0;
  border-radius: 8px;
  background: #f2fbf8;
}

.job-progress-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.job-progress-heading h3 {
  margin: 0;
  font-size: 13px;
}

.job-progress-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.job-progress-state {
  padding: 4px 8px;
  border: 1px solid #8ac3b7;
  border-radius: 999px;
  color: #196a5c;
  font-size: 11px;
  font-weight: 700;
  white-space: normal;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.job-progress-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.job-progress-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.job-progress-actions button {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
}

.job-progress-actions button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.engineering-report-panel {
  max-height: min(62vh, 720px);
  margin: 12px 22px 0;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid #b7d5d0;
  border-radius: 8px;
  background: #f8fcfb;
}

.engineering-report-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.engineering-report-heading h3,
.engineering-report-section h4 {
  margin: 0;
  font-size: 13px;
}

.engineering-report-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.engineering-report-download {
  flex: 0 0 auto;
  text-decoration: none;
  white-space: nowrap;
}

.engineering-report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.engineering-report-approve {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  white-space: nowrap;
}

.engineering-report-approve:hover {
  border-color: var(--accent-strong);
}

.manufacturing-delivery-button {
  border-color: #a05a12;
  background: #fff3df;
  color: #7b430e;
  white-space: nowrap;
}

.manufacturing-delivery-button:hover {
  border-color: #7b430e;
}

.manufacturing-trial-form {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
}

.manufacturing-trial-form label {
  display: grid;
  gap: 5px;
}

.manufacturing-trial-form input,
.manufacturing-trial-form textarea {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
  font-size: 11px;
  line-height: 1.4;
}

.manufacturing-trial-form textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.manufacturing-trial-form input:focus,
.manufacturing-trial-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.manufacturing-trial-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.manufacturing-trial-result {
  min-height: 1.2em;
  color: var(--accent-strong);
  line-height: 1.4;
}

.manufacturing-anomaly {
  margin: 8px 0 0;
  color: #a23c32;
}

.engineering-report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.engineering-report-section {
  margin-top: 14px;
}

.engineering-report-process {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.engineering-report-process table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
}

.engineering-report-process th,
.engineering-report-process td {
  padding: 5px 6px;
  border: 1px solid var(--line);
  text-align: left;
}

.report-table-scroll {
  margin-top: 7px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.report-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 11px;
}

.report-table th,
.report-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.report-table th {
  color: var(--muted);
  background: var(--panel-soft);
  font-weight: 700;
}

.report-table tr:last-child td {
  border-bottom: 0;
}

.report-status {
  font-weight: 700;
}

.report-status.pass {
  color: #13795b;
}

.report-status.fail {
  color: #a23c32;
}

.engineering-report-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.engineering-report-kv strong {
  color: var(--ink);
}

.specification-body strong {
  color: var(--ink);
}

.specification-change {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #ddbe85;
  border-radius: 7px;
  background: #fffaf0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.specification-change-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.specification-change-heading strong {
  color: #8b5f16;
}

.specification-change-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(160, 90, 18, 0.16);
}

.specification-change-row code {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.specification-change-row em {
  color: #8b5f16;
  font-style: normal;
  font-weight: 700;
}

.specification-change-clear {
  color: #8b2e2e;
  font-weight: 700;
}

.seed-selection {
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.seed-selection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 11px;
}

.seed-selection-heading span {
  color: var(--muted);
  font-weight: 400;
}

.seed-field {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.seed-field input,
.seed-field textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 4px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
  color: var(--ink);
  font: inherit;
}

.seed-field textarea {
  min-height: 58px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.seed-selection-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.seed-selection-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.seed-library-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.seed-library-picker select {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 4px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
  color: var(--ink);
  font: inherit;
}

.seed-library-status {
  min-height: 14px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.seed-layer-editor {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.seed-layer-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 11px;
}

.seed-layer-table-scroll {
  margin-top: 7px;
  overflow-x: auto;
}

.seed-layer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.seed-layer-table th,
.seed-layer-table td {
  padding: 4px;
  border-bottom: 1px solid rgba(93, 105, 106, 0.14);
  text-align: left;
  white-space: nowrap;
}

.seed-layer-table th {
  color: var(--muted);
  font-weight: 600;
}

.seed-layer-table td:first-child {
  width: 28px;
  color: var(--muted);
  text-align: center;
}

.seed-layer-table input {
  box-sizing: border-box;
  width: 100%;
  min-width: 92px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.seed-layer-table input[type="number"] {
  min-width: 84px;
}

.seed-layer-delete {
  padding: 5px 6px;
  color: #8b2e2e;
}

.seed-layer-validation {
  min-height: 14px;
  margin: 6px 0 0;
  color: #8b2e2e;
  font-size: 10px;
  line-height: 1.35;
}

.seed-json-advanced {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.seed-json-advanced summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}

.material-library-panel {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

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

.material-library-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.material-library-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.material-library-status {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.material-library-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.material-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(93, 105, 106, 0.18);
  border-radius: 6px;
  background: var(--panel-soft);
}

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

.material-card-heading h5 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.material-card-heading p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-status {
  flex: 0 0 auto;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
}

.material-status.ready {
  background: #eef9f1;
  color: #267044;
}

.material-status.review {
  background: #fff4e5;
  color: #8a4e13;
}

.material-card-meta {
  display: grid;
  gap: 3px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.material-card-meta span {
  overflow-wrap: anywhere;
}

.material-card-meta strong {
  display: inline-block;
  min-width: 68px;
  color: var(--ink);
}

.material-preview {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.material-preview summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}

.material-preview table {
  width: 100%;
  margin-top: 5px;
  border-collapse: collapse;
}

.material-preview th,
.material-preview td {
  padding: 3px 4px;
  border-bottom: 1px solid rgba(93, 105, 106, 0.14);
  text-align: right;
}

.material-preview th:first-child,
.material-preview td:first-child {
  text-align: left;
}

.material-validation {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(138, 78, 19, 0.18);
  color: #8a4e13;
  font-size: 10px;
  line-height: 1.35;
}

.specification-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.drawing-intake-panel,
.voice-intake-panel {
  margin: 12px 22px 0;
  padding: 12px 14px;
  border: 1px solid #b7d5d0;
  border-radius: 8px;
  background: #f8fcfb;
}

.voice-intake-panel {
  border-color: var(--line);
  background: var(--panel-soft);
}

.voice-intake-actions,
.voice-pending-actions,
.voice-review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.voice-recording-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
}

#voiceRecordingTimer {
  min-width: 42px;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
}

.voice-audio-preview {
  display: block;
  width: min(100%, 420px);
  height: 34px;
  margin-top: 9px;
}

.voice-pending-actions,
.voice-transcript-review,
.voice-spec-review {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.voice-pending-actions {
  justify-content: flex-start;
}

.voice-review-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.voice-review-heading h4 {
  margin: 0;
  font-size: 12px;
}

.voice-review-heading span {
  color: var(--muted);
  font-size: 10px;
}

#voiceTranscriptInput {
  box-sizing: border-box;
  width: 100%;
  min-height: 100px;
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}

.voice-review-actions {
  margin-top: 8px;
}

.voice-spec-review .drawing-fields {
  max-height: 340px;
}

.drawing-intake-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawing-intake-heading h3,
.drawing-preview-panel h4,
.drawing-fields-panel h4 {
  margin: 0;
  font-size: 13px;
}

.drawing-intake-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.drawing-intake-actions,
.drawing-review-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.drawing-editor-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.drawing-editor-row input, .drawing-editor-row select { flex: 1 1 70px; width: 0; min-width: 0; }
.drawing-target-editor { min-width: 0; padding: 6px 0; border-bottom: 1px solid var(--line); }
.drawing-source-links { display: flex; flex-wrap: wrap; gap: 6px; }
.drawing-field input, .drawing-field select { box-sizing: border-box; max-width: 100%; padding: 5px; }
.job-progress-heading > *, .job-progress-metrics > *, .engineering-report-kv > * { min-width: 0; overflow-wrap: anywhere; }

.drawing-document-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.drawing-document-card {
  display: grid;
  gap: 3px;
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.drawing-document-card:hover,
.drawing-document-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drawing-document-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.drawing-document-meta,
.drawing-empty,
.drawing-ok,
.drawing-issue,
.drawing-field small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.drawing-review {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  margin-top: 12px;
}

.drawing-preview-panel,
.drawing-fields-panel {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.drawing-preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  margin-top: 7px;
  overflow: hidden;
  background: #f1f4f1;
}

.drawing-preview img,
.drawing-preview iframe {
  width: 100%;
  min-height: 300px;
  border: 0;
  object-fit: contain;
}

.drawing-fields {
  display: grid;
  gap: 7px;
  max-height: 390px;
  margin-top: 8px;
  overflow-y: auto;
}

.drawing-field {
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
  gap: 4px;
  padding: 7px;
  border-left: 3px solid var(--line);
  background: #fbfcfb;
}

.drawing-field-confident { border-left-color: #77b99b; }
.drawing-field-review_required { border-left-color: #ddb45d; }
.drawing-field-missing,
.drawing-field-conflict { border-left-color: #d17c7c; }

.drawing-field-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.drawing-field-title em {
  color: var(--warn);
  font-size: 10px;
  font-style: normal;
}

.drawing-field-editor {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  min-height: 34px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  resize: vertical;
}

.drawing-issues {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.drawing-issue {
  padding: 5px 7px;
  border-radius: 4px;
  background: #fff3e5;
  color: #8a4e13;
}

.drawing-ok {
  padding: 5px 7px;
  border-radius: 4px;
  background: #eef9f1;
  color: #267044;
}

.drawing-review-actions {
  margin-top: 9px;
}

.chat-pane > *,
.specification-panel,
.job-progress-panel,
#toleranceDraftPanel,
.specification-grid > *,
.drawing-review > *,
.drawing-document-card {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.task-workspace-scroll {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-wrap: anywhere;
  scrollbar-gutter: stable;
}

@media (max-width: 1024px) {
  .drawing-review { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .task-controls {
    grid-template-columns: 1fr;
  }

  .task-filter-label {
    width: 100%;
  }

  .file-actions {
    flex-wrap: wrap;
    gap: 4px 7px;
  }

  .file-semantic {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .specification-body {
    grid-template-columns: 1fr;
  }

  .specification-change-row {
    grid-template-columns: 1fr;
  }

  .engineering-report-heading {
    display: grid;
  }

  .engineering-report-download {
    width: fit-content;
  }

  .engineering-report-kv {
    grid-template-columns: 1fr;
  }

  .manufacturing-trial-grid {
    grid-template-columns: 1fr 1fr;
  }

  .drawing-review {
    grid-template-columns: 1fr;
  }

  .drawing-intake-heading {
    display: grid;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-label {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.text-button {
  padding: 8px 10px;
  font-size: 12px;
}

.text-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.stream-state {
  min-width: 84px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  text-align: center;
  font-size: 12px;
}

.stream-state.live {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.messages {
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
}

.message {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
}

.message-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bubble {
  width: fit-content;
  max-width: min(760px, 100%);
  padding: 11px 13px;
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
  font-size: 14px;
}

.message.user {
  justify-items: end;
}

.message.user .bubble {
  background: var(--accent);
  color: #ffffff;
}

.message.assistant .bubble {
  background: var(--panel-soft);
  color: var(--ink);
}

.message.error .bubble {
  border: 1px solid #f3d0aa;
  background: #fff4e8;
  color: #7c3f00;
}

.bubble p {
  margin: 0 0 10px;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble pre {
  margin: 12px 0;
  padding: 13px;
  overflow-x: auto;
  border-radius: 8px;
  background: #101815;
  color: #eef8f4;
  white-space: pre;
}

.artifact-toggle {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 56px;
  align-self: center;
  justify-self: center;
  margin-left: -14px;
  margin-right: -14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--accent-strong);
  box-shadow: 0 10px 24px rgba(23, 33, 28, 0.12);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.artifact-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.artifact-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.artifact-header {
  min-height: 76px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.artifact-header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
}

.artifact-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.artifact-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(240px, 38%);
  min-width: 0;
  min-height: 0;
}

.artifact-output-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.result-summary {
  margin: 14px 14px 0;
  padding: 13px;
  border: 1px solid #b7d5d0;
  border-radius: 10px;
  background: #f8fcfb;
}

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

.result-summary-heading h3 {
  margin: 5px 0 0;
  font-size: 15px;
}

.result-summary-state {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.result-summary-state.pass {
  border-color: #9ccbc4;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.result-summary-state.fail {
  border-color: #f3d0aa;
  background: #fff4e8;
  color: #8a3f00;
}

.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.result-summary-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.result-summary-metric span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-summary-metric strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-summary-hint {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.result-summary-download {
  display: inline-block;
  margin-top: 10px;
  text-decoration: none;
}

.design-comparison-panel {
  display: grid;
  gap: 10px;
  margin: 12px 14px 0;
  padding: 13px;
  border: 1px solid #b7d5d0;
  border-radius: 10px;
  background: #f8fcfb;
}

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

.design-comparison-heading h3 {
  margin: 5px 0 0;
  font-size: 15px;
}

.design-comparison-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.design-comparison-count {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.design-comparison-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.design-comparison-notice strong {
  color: var(--ink);
}

.comparison-notice-state {
  font-weight: 800;
}

.comparison-notice-state.pass {
  color: var(--accent-strong);
}

.comparison-notice-state.fail {
  color: #8a3f00;
}

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

.design-comparison-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #b7d5d0;
  border-radius: 8px;
  background: var(--panel);
}

.design-comparison-card.blocked {
  border-color: #e9c9a9;
  background: #fffaf5;
}

.design-comparison-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.design-comparison-card-heading > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.design-comparison-card-heading strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.design-comparison-index {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
}

.comparison-current {
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 800;
}

.comparison-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

.comparison-status.pass {
  color: var(--accent-strong);
}

.comparison-status.fail {
  color: #8a3f00;
}

.comparison-status.unknown {
  color: var(--muted);
}

.design-comparison-compatibility {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.design-comparison-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.design-comparison-metrics > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
}

.design-comparison-metrics span,
.design-comparison-angle-metrics > span {
  color: var(--muted);
  font-size: 9px;
}

.design-comparison-metrics strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-value-fail {
  color: #8a3f00;
}

.design-comparison-angle-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.35;
}

.design-comparison-angle-metrics > span:first-child {
  flex-basis: 100%;
}

.design-comparison-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.design-comparison-card-actions .text-link {
  padding: 5px 7px;
  font-size: 10px;
}

.artifact-body > section {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.artifact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.artifact-empty {
  padding: 13px;
  color: var(--muted);
  font-size: 13px;
}

.artifact-link {
  display: grid;
  gap: 4px;
  max-width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  background: var(--panel-soft);
  text-decoration: none;
  font-size: 12px;
  overflow: hidden;
}

.artifact-type {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
}

.artifact-file {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-status {
  color: var(--muted);
  font-size: 10px;
}

.artifact-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-top: 1px solid var(--line);
  background: #fbfcfb;
}

.file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 8px;
}

.file-header h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.file-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.icon-button.small {
  width: 32px;
  height: 32px;
  font-size: 20px;
}

.folder-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 14px 10px;
}

.folder-tab {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.folder-tab.active,
.folder-tab:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  overflow: auto;
  padding: 0 14px 14px;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
}

.file-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-primary {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.file-display {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.file-open {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  text-decoration: none;
}

.file-open:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.file-semantic {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.file-download {
  color: var(--accent-strong);
  font-size: 10px;
  white-space: nowrap;
}

.file-path {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.file-meta,
.file-empty {
  color: var(--muted);
  font-size: 11px;
}

.file-meta {
  padding-top: 2px;
  white-space: nowrap;
}

.file-empty {
  padding: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell.artifacts-collapsed .workspace {
  grid-template-columns: minmax(0, 1fr) 1px 0;
}

.shell.artifacts-collapsed .artifact-pane {
  display: none;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.continuous-toggle {
  display: inline-flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-self: start;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.continuous-toggle input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.composer.continuous-active .continuous-toggle {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.composer textarea {
  width: 100%;
  min-height: 58px;
  max-height: 160px;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
  line-height: 1.45;
}

.composer textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.composer-actions {
  display: grid;
  gap: 8px;
  align-self: end;
}

.composer button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.composer button.secondary-action {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--accent-strong);
  font-size: 24px;
}

.composer button.secondary-action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.composer button:disabled,
.icon-button:disabled {
  cursor: progress;
  opacity: 0.55;
}

.context-menu {
  position: fixed;
  z-index: 20;
  min-width: 138px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 34px rgba(23, 33, 28, 0.18);
}

.context-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}

.context-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 33, 28, 0.32);
}

.modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(720px, 100%);
  max-height: min(760px, 92dvh);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(23, 33, 28, 0.22);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

.modal-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.modal-field textarea,
.modal-field input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
  line-height: 1.45;
}

.modal-field textarea {
  resize: vertical;
}

.modal-field textarea:focus,
.modal-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-footer button {
  min-width: 94px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.modal-footer button:last-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.modal-footer button.danger {
  border-color: #a12b2b;
  background: #a12b2b;
}

.task-modal {
  width: min(520px, 100%);
}

.task-modal-body {
  display: grid;
  gap: 12px;
}

.modal-error {
  margin: 0;
  color: #a12b2b;
  font-size: 13px;
}

.spectrum-panel {
  display: grid;
  gap: 16px;
}

.spectrum-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.spectrum-summary span,
.modal-note {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.spectrum-summary .spectrum-file-name {
  grid-column: 1 / -1;
  color: var(--text);
  font-weight: 700;
}

.mode-group {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-group label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.modal-note {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 12px;
}

.admin-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  background: var(--bg);
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.admin-topbar h1,
.admin-main h2 {
  margin: 0;
  letter-spacing: 0;
}

.admin-topbar h1 {
  font-size: 19px;
}

.admin-topbar p,
.admin-section-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-main {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
}

.admin-create,
.admin-users,
.admin-usage {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.admin-create {
  padding: 18px;
  overflow: auto;
}

.admin-users {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.admin-usage {
  grid-column: 1 / -1;
  padding-bottom: 12px;
  overflow: hidden;
}

.admin-support-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 8px;
  padding: 0 18px 12px;
}

.admin-support-form input {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
}

.admin-support-form button {
  padding: 8px 10px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.admin-usage-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  padding: 0 18px 4px;
}

.admin-usage-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 11px;
}

.admin-usage-row strong {
  color: var(--ink);
}

.admin-main h2 {
  font-size: 15px;
}

.admin-create-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.admin-create-form label,
.admin-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.admin-create-form span,
.admin-field span {
  color: var(--muted);
  font-size: 11px;
}

.admin-create-form input,
.admin-field input,
.admin-field select {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
  font-size: 13px;
}

.admin-create-form input:focus,
.admin-field input:focus,
.admin-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.admin-create-form button,
.admin-row button {
  padding: 9px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
}

.admin-message {
  min-height: 24px;
  padding: 0 18px 10px;
  color: var(--muted);
  font-size: 12px;
}

.admin-message.error {
  color: #8a3f00;
}

.admin-user-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 0 18px 18px;
}

.admin-row {
  display: grid;
  grid-template-columns:
    minmax(110px, 0.8fr)
    minmax(145px, 1fr)
    minmax(130px, 0.9fr)
    minmax(110px, 0.75fr)
    minmax(145px, 1fr)
    auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.admin-row-meta {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.admin-row input:disabled,
.admin-row select:disabled,
.admin-row button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 28vh) minmax(520px, 72vh);
    height: auto;
    min-height: 100dvh;
  }

  .auth-shell {
    display: block;
    padding: 72px 16px 24px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    gap: 22px;
    width: min(520px, 100%);
  }

  .auth-product-hero {
    gap: 13px;
    padding: 0;
  }

  .auth-product-hero h1 {
    font-size: clamp(30px, 10vw, 44px);
  }

  .auth-product-hero > p {
    font-size: 14px;
  }

  .auth-panel {
    width: 100%;
    padding: 22px;
  }

  .demo-preview-grid {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    height: auto;
    min-height: 100dvh;
  }

  .admin-topbar,
  .admin-main {
    padding: 14px;
  }

  .admin-main {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-support-form {
    grid-template-columns: 1fr;
  }

  .task-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(520px, 1fr) minmax(160px, 28vh);
    overflow: visible;
  }

  .chat-pane {
    width: 100%;
    box-shadow: none;
  }

  .artifact-toggle {
    display: none;
  }

  .artifact-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .artifact-body {
    grid-template-rows: minmax(160px, 1fr) minmax(220px, 1fr);
  }

  .workflow-stepper {
    padding: 10px 14px 9px;
  }

  .workflow-stepper li {
    gap: 3px;
    font-size: 10px;
  }

  .workflow-index {
    width: 17px;
    height: 17px;
  }

  .workspace-empty-state {
    margin: 14px 14px 4px;
    padding: 18px;
  }

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

  .shell.artifacts-collapsed .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(520px, 1fr);
  }
}
