:root {
  --bg: #fbfbf8;
  --sidebar: #f0f0ec;
  --surface: #ffffff;
  --surface-soft: #f7f7f3;
  --line: #e2e3dc;
  --line-strong: #cccec5;
  --text: #191a17;
  --muted: #6b6f66;
  --faint: #9a9f93;
  --blue: #2c7df6;
  --blue-soft: #e8f1ff;
  --green: #18a66a;
  --green-soft: #e7f5ee;
  --amber: #d98b2b;
  --amber-soft: #fff0dd;
  --cyan: #18a8b4;
  --cyan-soft: #e0f8fb;
  --shadow: 0 18px 52px rgba(20, 24, 18, 0.1);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-height: 100vh;
  padding: 18px 20px 20px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.sidebar-top,
.topbar,
.block-head,
.section-head,
.account-bar,
.composer-actions,
.left-controls,
.right-controls {
  display: flex;
  align-items: center;
}

.sidebar-top {
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: #11120f;
  color: #fff;
}

.brand strong,
.account-bar strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.brand span,
.account-bar span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.primary-nav,
.thread-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item,
.thread-item,
.project-root,
.connector-card,
.workflow-card {
  width: 100%;
  border: 0;
  text-align: left;
}

.nav-item,
.project-root {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border-radius: 8px;
  background: transparent;
  color: #383a35;
}

.nav-item {
  padding: 0 4px;
  font-size: 15px;
}

.nav-item svg,
.project-root svg,
.thread-item svg,
.icon-button svg,
.mini-button svg,
.workspace-switch svg,
.status-pill svg,
.tool-button svg,
.send-button svg,
.quick-actions svg,
.text-button svg,
.connector-card svg,
.workflow-visual svg,
.dialog-close svg,
.agent-plan svg,
.feedback-grid svg,
.weekly-note svg,
.console-title svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav-item.active,
.nav-item:hover,
.thread-item.active,
.thread-item:hover {
  background: rgba(25, 26, 23, 0.06);
  color: var(--text);
}

.sidebar-section {
  display: grid;
  gap: 10px;
}

.sidebar-section.compact {
  gap: 8px;
}

.section-head {
  justify-content: space-between;
  gap: 12px;
  color: var(--faint);
  font-size: 13px;
}

.mini-button,
.icon-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.mini-button {
  width: 28px;
  height: 28px;
}

.icon-button {
  width: 34px;
  height: 34px;
}

.icon-button.soft,
.mini-button {
  border-color: transparent;
  background: transparent;
}

.icon-button.plain {
  border-color: transparent;
  background: transparent;
}

.icon-button:hover,
.mini-button:hover,
.tool-button:hover,
.mode-select:hover,
.workspace-switch:hover,
.status-pill:hover,
.text-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.project-root {
  padding: 0;
  font-weight: 650;
}

.thread-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: #41433d;
}

.thread-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-item small {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
}

.account-bar {
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.account-bar > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.avatar {
  width: 34px;
  height: 34px;
  background: #dce9ff;
  color: #1d5fc7;
}

.canvas {
  min-width: 0;
  min-height: 100vh;
  padding: 18px 28px 56px;
  background: var(--bg);
}

.topbar {
  justify-content: space-between;
  min-height: 40px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace-switch,
.status-pill,
.context-chip,
.tool-button,
.mode-select,
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.workspace-switch,
.status-pill {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
}

.workspace-switch {
  color: #373934;
}

.status-pill {
  background: var(--green-soft);
  color: #1b7d51;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d27f;
  box-shadow: 0 0 0 4px rgba(52, 210, 127, 0.16);
}

.hero {
  width: min(100%, 980px);
  margin: 180px auto 0;
  text-align: center;
}

.hero-heading {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.hero-heading p {
  margin: 0;
  color: var(--faint);
  font-size: 13px;
}

.hero-heading h1 {
  margin: 0;
  color: #1e201d;
  font-size: 36px;
  font-weight: 520;
  line-height: 1.18;
}

.context-chip {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: #4d514a;
}

.context-chip svg:first-child {
  color: var(--blue);
}

.composer {
  display: grid;
  gap: 14px;
  min-height: 126px;
  padding: 22px 22px 14px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 10px 36px rgba(30, 32, 29, 0.08);
  text-align: left;
}

.composer:focus-within {
  border-color: rgba(44, 125, 246, 0.38);
  box-shadow: 0 18px 50px rgba(44, 125, 246, 0.12);
}

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

.composer textarea::placeholder {
  color: #b3b7ae;
}

.composer-actions {
  justify-content: space-between;
  gap: 16px;
}

.left-controls,
.right-controls {
  gap: 8px;
  min-width: 0;
}

.tool-button,
.mode-select {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
}

.send-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #9fa2a0;
  color: #fff;
}

.send-button:hover {
  background: #262724;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.quick-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #4e514c;
  white-space: nowrap;
}

.quick-actions button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.quick-actions button:nth-child(1) svg {
  color: var(--blue);
}

.quick-actions button:nth-child(2) svg {
  color: #e86c43;
}

.quick-actions button:nth-child(3) svg {
  color: #7c5cff;
}

.quick-actions button:nth-child(4) svg {
  color: var(--amber);
}

.quick-actions button:nth-child(5) svg {
  color: var(--green);
}

.connectors,
.practice {
  width: min(100%, 1180px);
  margin: 66px auto 0;
}

.block-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.block-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.block-head span {
  color: var(--faint);
  font-size: 13px;
}

.text-button {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 14px;
}

.connector-grid,
.workflow-grid {
  display: grid;
  gap: 14px;
}

.connector-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 760px;
  margin: 0 auto;
}

.connector-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 3px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.connector-card:hover,
.connector-card.selected,
.workflow-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 28px rgba(25, 26, 23, 0.07);
  transform: translateY(-1px);
}

.connector-card.selected {
  outline: 2px solid rgba(44, 125, 246, 0.18);
}

.connector-icon {
  display: grid;
  grid-row: span 2;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
}

.connector-icon.mail {
  background: #fff0e8;
  color: #ef5c2f;
}

.connector-icon.sheet {
  background: var(--green-soft);
  color: var(--green);
}

.connector-icon.vault {
  background: var(--blue-soft);
  color: var(--blue);
}

.connector-card strong {
  min-width: 0;
  font-size: 16px;
}

.connector-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.workflow-grid {
  grid-template-columns: 1.15fr 0.85fr 0.85fr;
}

.workflow-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  align-items: center;
  gap: 18px;
  min-height: 156px;
  padding: 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #1d201c;
}

.workflow-card.featured {
  background: linear-gradient(135deg, #ffe0db 0%, #fff5ec 72%);
  border-color: #f7c9c1;
}

.workflow-card.cyan {
  background: linear-gradient(135deg, var(--cyan-soft), #f7fffd);
  border-color: #b9e9ec;
}

.workflow-card.blue {
  background: linear-gradient(135deg, #e5efff, #f9fbff);
  border-color: #bdd2f8;
}

.workflow-card span {
  color: rgba(29, 32, 28, 0.62);
  font-size: 12px;
  font-weight: 800;
}

.workflow-card strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.25;
}

.workflow-card p {
  margin: 10px 0 0;
  color: rgba(29, 32, 28, 0.72);
  font-size: 14px;
}

.workflow-visual {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.workflow-visual svg {
  width: 38px;
  height: 38px;
}

.workflow-card.featured .workflow-visual {
  color: #ec685c;
}

.workflow-card.cyan .workflow-visual {
  color: var(--cyan);
}

.workflow-card.blue .workflow-visual {
  color: var(--blue);
}

.result-view {
  width: min(100%, 1040px);
  margin: 72px auto 0;
  padding: 28px 0 4px;
  border-top: 1px solid var(--line);
}

.result-toolbar,
.panel-heading,
.supplier-list article,
.evidence-grid > div,
.run-steps li {
  display: flex;
  align-items: center;
}

.result-toolbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow,
.panel-heading span,
.run-id span,
.run-note span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
}

.result-toolbar h2,
.panel-heading h3 {
  margin: 4px 0 0;
  line-height: 1.2;
}

.result-toolbar h2 {
  font-size: 26px;
}

.result-state,
.text-button {
  white-space: nowrap;
}

.text-button svg {
  width: 17px;
  height: 17px;
}

.result-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #9d5e10;
  font-size: 13px;
  font-weight: 750;
}

.result-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.run-summary,
.result-panel,
.evidence-panel,
.task-console {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.run-summary {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.run-id strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.run-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.run-steps li {
  gap: 9px;
  min-height: 34px;
  color: var(--muted);
  font-size: 14px;
}

.run-steps svg {
  width: 18px;
  height: 18px;
}

.run-steps .done svg {
  color: var(--green);
}

.run-steps .active {
  color: var(--text);
  font-weight: 650;
}

.run-steps .active svg {
  color: var(--blue);
}

.run-note {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.run-note p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.result-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.result-panel,
.evidence-panel {
  padding: 18px;
}

.extraction-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.evidence-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.supplier-panel {
  grid-column: 1 / -1;
}

.task-console {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.action-dock {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  max-height: 100vh;
  overflow: auto;
  border-width: 0 0 0 1px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: -12px 0 36px rgba(20, 24, 18, 0.06);
}

.action-dock.is-focused {
  outline: 2px solid rgba(44, 125, 246, 0.28);
  outline-offset: -6px;
}

.console-head span,
.console-title strong {
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.console-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.2;
}

.console-section {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.console-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.console-title svg {
  color: var(--blue);
}

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

.pending-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.pending-list b {
  color: var(--text);
  font-size: 13px;
}

.console-actions {
  display: grid;
  gap: 8px;
}

.console-actions .primary-action,
.console-actions .secondary-action,
.console-link {
  width: 100%;
}

.panel-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-heading h3 {
  font-size: 18px;
}

.table-wrap {
  overflow-x: auto;
}

.rfq-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.rfq-table th,
.rfq-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.rfq-table th {
  color: var(--faint);
  font-size: 12px;
  font-weight: 750;
}

.rfq-table td {
  color: var(--text);
  font-size: 14px;
}

.status,
.supplier-list mark {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.ok,
.supplier-list mark.safe {
  background: var(--green-soft);
  color: #1b7d51;
}

.status.warn,
.supplier-list mark {
  background: var(--amber-soft);
  color: #9d5e10;
}

.supplier-list {
  display: grid;
  gap: 10px;
}

.supplier-list article {
  justify-content: space-between;
  gap: 14px;
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.supplier-list strong,
.evidence-grid strong {
  display: block;
  line-height: 1.25;
}

.supplier-list span,
.evidence-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.supplier-list mark {
  flex: 0 0 auto;
}

.supplier-list mark.base {
  background: var(--blue-soft);
  color: #1d5fc7;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.evidence-grid > div {
  align-items: flex-start;
  gap: 10px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.evidence-grid > div > div {
  min-width: 0;
}

.evidence-grid svg {
  width: 20px;
  height: 20px;
  color: var(--blue);
  flex: 0 0 auto;
}

.feedback-grid {
  display: grid;
  gap: 10px;
}

.feedback-grid article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.feedback-grid svg {
  width: 20px;
  height: 20px;
  color: var(--green);
}

.feedback-grid strong {
  display: block;
  line-height: 1.25;
}

.feedback-grid span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

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

.metric-grid div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.metric-grid strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.metric-grid.compact strong {
  font-size: 22px;
}

.metric-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.weekly-note {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf6;
  color: var(--muted);
}

.weekly-note svg {
  margin-top: 1px;
  color: var(--amber);
}

.weekly-note p {
  margin: 0;
  font-size: 13px;
}

.run-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.run-dialog::backdrop {
  background: rgba(20, 22, 18, 0.22);
}

.run-dialog form {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 26px;
  background: var(--surface);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.dialog-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--green);
  font-size: 13px;
}

.run-dialog h2 {
  margin: 0;
  padding-right: 36px;
  font-size: 24px;
  line-height: 1.2;
}

.run-dialog p {
  margin: 0;
  color: var(--muted);
}

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

.agent-plan div {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 86px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.agent-plan span {
  font-size: 13px;
}

.run-dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 2px 0 0;
  padding: 0;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 8px;
}

.primary-action {
  border: 0;
  background: #1e201d;
  color: #fff;
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 48px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  color: var(--text);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .canvas {
    padding-inline: 24px;
  }

  .hero {
    margin-top: 132px;
  }

  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .result-main {
    grid-template-columns: 1fr;
  }

  .extraction-panel {
    grid-column: auto;
  }

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

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

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

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

  .action-dock {
    position: fixed;
    top: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 20;
    width: min(320px, calc(100vw - 28px));
    min-height: 0;
    max-height: none;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .task-console:not(.action-dock) {
    position: static;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: auto;
    max-height: 360px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .canvas {
    min-height: auto;
    padding: 16px 16px 24px;
  }

  .action-dock {
    position: static;
    width: auto;
    min-height: 0;
    max-height: none;
    margin: 0 16px 28px;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
  }

  .topbar {
    gap: 12px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .hero {
    margin-top: 64px;
  }

  .hero-heading h1 {
    font-size: 30px;
  }

  .composer {
    border-radius: 22px;
    padding: 18px 18px 12px;
  }

  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .left-controls,
  .right-controls {
    justify-content: space-between;
  }

  .connector-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  .sidebar {
    gap: 18px;
    max-height: none;
    overflow: visible;
    padding: 14px;
  }

  .brand span,
  .sidebar-section,
  .account-bar {
    display: none;
  }

  .primary-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    min-height: 42px;
    padding: 0 6px;
  }

  .nav-item span {
    font-size: 13px;
  }

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

  .hero {
    margin-top: 42px;
  }

  .hero-heading h1 {
    font-size: 28px;
  }

  .quick-actions {
    justify-content: flex-start;
  }

  .quick-actions button {
    max-width: 100%;
  }

  .block-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .workflow-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .result-toolbar,
  .supplier-list article {
    align-items: stretch;
    flex-direction: column;
  }

  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .workflow-visual {
    display: none;
  }

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