:root {
  --ink: #18322f;
  --ink-soft: #5d6c67;
  --muted: #8a9790;
  --paper: #f6f5f0;
  --surface: #fffefa;
  --line: #e8e9e1;
  --line-strong: #d9ddd3;
  --green: #103b36;
  --green-2: #1c554d;
  --mint: #dff0e9;
  --coral: #e76855;
  --coral-dark: #cb5545;
  --yellow: #f7d773;
  --yellow-soft: #fff5d9;
  --blue-soft: #e5eff3;
  --blue: #4e7886;
  --red-soft: #f9e5e0;
  --red: #b85a4c;
  --shadow: 0 16px 36px rgba(27, 52, 47, 0.08);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 1080px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(231, 104, 85, 0.26);
  outline-offset: 2px;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

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

.sidebar {
  display: flex;
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  flex-direction: column;
  padding: 28px 16px 20px;
  color: #eef5f0;
  background: var(--green);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9px;
}

.brand-mark span {
  display: block;
  border-radius: 2px;
  background: #f0f5ee;
}

.brand-mark span:nth-child(1) { height: 40%; }
.brand-mark span:nth-child(2) { height: 72%; }
.brand-mark span:nth-child(3) { height: 100%; }

.brand-lockup strong,
.brand-lockup span {
  display: block;
}

.brand-lockup strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-lockup span {
  margin-top: 3px;
  color: rgba(238, 245, 240, 0.58);
  font-size: 11px;
}

.workspace-switcher {
  margin-top: 46px;
}

.eyebrow,
.section-kicker,
.panel-kicker,
.modal-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace-switcher .eyebrow,
.nav-group .eyebrow {
  display: block;
  padding: 0 10px;
  color: rgba(238, 245, 240, 0.44);
}

.workspace-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  padding: 11px 10px;
  color: #eef5f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  text-align: left;
}

.workspace-button > svg,
.account-chip > svg {
  width: 15px;
  margin-left: auto;
  color: rgba(238, 245, 240, 0.52);
}

.workspace-avatar,
.avatar {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--green);
  border-radius: 8px;
  background: #e4c375;
  font-size: 12px;
  font-weight: 800;
}

.workspace-copy strong,
.workspace-copy small {
  display: block;
}

.workspace-copy strong {
  font-size: 12px;
}

.workspace-copy small {
  margin-top: 2px;
  color: rgba(238, 245, 240, 0.54);
  font-size: 10px;
}

.nav-group {
  margin-top: 38px;
}

.nav-group-lower {
  margin-top: 30px;
}

.nav-item {
  display: flex;
  position: relative;
  align-items: center;
  gap: 11px;
  margin-top: 6px;
  padding: 11px 10px;
  color: rgba(238, 245, 240, 0.66);
  border-radius: 8px;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.nav-item svg {
  width: 17px;
  height: 17px;
}

.nav-item:hover,
.nav-item.active {
  color: #f6faf4;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active::before {
  position: absolute;
  left: -16px;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--coral);
  content: "";
}

.nav-item span {
  flex: 1;
  font-size: 12px;
}

.nav-item em {
  min-width: 22px;
  padding: 2px 5px;
  color: #d0ded3;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 10px;
  font-style: normal;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
}

.sync-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 10px;
  color: rgba(238, 245, 240, 0.76);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
}

.sync-pill.is-ready .live-dot {
  background: #73d29f;
  box-shadow: 0 0 0 3px rgba(115, 210, 159, 0.12);
}

.sync-pill.is-warning .live-dot,
.sync-pill .live-dot.is-warning {
  background: #e49b58;
  box-shadow: 0 0 0 3px rgba(228, 155, 88, 0.14);
}

.sync-pill.is-waiting .live-dot,
.sync-pill .live-dot.is-waiting {
  background: #b2bdb5;
  box-shadow: 0 0 0 3px rgba(178, 189, 181, 0.14);
}

.sync-pill small {
  margin-left: auto;
  color: rgba(238, 245, 240, 0.42);
}

.live-dot,
.mode-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #73d29f;
  box-shadow: 0 0 0 3px rgba(115, 210, 159, 0.12);
}

.account-chip {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
  padding: 10px;
  color: #eef5f0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  text-align: left;
}

.account-chip strong,
.account-chip small {
  display: block;
}

.account-chip strong {
  font-size: 12px;
  font-weight: 600;
}

.account-chip small {
  margin-top: 3px;
  color: rgba(238, 245, 240, 0.44);
  font-size: 10px;
}

.main-content {
  grid-column: 2;
  min-width: 0;
  padding: 0 38px 48px;
}

.topbar {
  display: flex;
  height: 76px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.breadcrumb,
.topbar-actions,
.help-button,
.mode-badge {
  display: flex;
  align-items: center;
}

.breadcrumb {
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumb svg {
  width: 14px;
  height: 14px;
  color: #bcc4bb;
}

.breadcrumb strong {
  color: var(--ink);
  font-weight: 600;
}

.topbar-actions {
  gap: 18px;
}

.mode-badge {
  gap: 7px;
  padding: 6px 9px;
  color: #6b765f;
  border: 1px solid #e4e6d6;
  border-radius: 5px;
  background: #f9fbef;
  font-size: 11px;
}

.mode-dot {
  width: 6px;
  height: 6px;
  background: #8aaf65;
  box-shadow: none;
}

.icon-button,
.filter-button {
  display: grid;
  position: relative;
  width: 33px;
  height: 33px;
  place-items: center;
  color: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
}

.icon-button:hover,
.filter-button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.icon-button svg,
.filter-button svg {
  width: 17px;
  height: 17px;
}

.icon-button.compact {
  width: 28px;
  height: 28px;
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border: 1px solid var(--paper);
  border-radius: 50%;
  background: var(--coral);
}

.help-button {
  gap: 6px;
  padding: 6px 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
}

.help-button svg {
  width: 16px;
  height: 16px;
}

.page-intro {
  display: flex;
  min-height: 190px;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 37px 0 26px;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--coral);
}

.section-kicker span {
  display: inline-block;
  width: 23px;
  height: 2px;
  background: var(--coral);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 12px;
  color: var(--green);
  font-size: clamp(31px, 3.1vw, 48px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

h1 em {
  color: var(--coral);
  font-style: normal;
}

.page-intro p {
  max-width: 610px;
  margin-top: 13px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.source-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
  padding: 6px 8px;
  color: #69766d;
  border: 1px solid #e4e8df;
  border-radius: 5px;
  background: rgba(255, 254, 250, 0.64);
  font-size: 10px;
}

.source-status-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8b978d;
}

.source-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b5beb4;
}

.source-status.imported .source-status-dot {
  background: #6da57c;
  box-shadow: 0 0 0 3px rgba(109, 165, 124, 0.13);
}

.source-status strong {
  max-width: 330px;
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-status small {
  max-width: 280px;
  overflow: hidden;
  color: #87958b;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-status .writeback-status {
  max-width: 145px;
  color: #9b8c75;
}

.source-status .writeback-status.is-ready {
  color: #4f8a68;
  font-weight: 650;
}

.source-status button {
  padding: 0 0 0 3px;
  color: var(--coral-dark);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 5px;
}

.secondary-button,
.primary-button,
.inspector-run-button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.secondary-button {
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  background: rgba(255, 254, 250, 0.7);
}

.secondary-button:hover {
  border-color: #aeb9ae;
  background: var(--surface);
}

.secondary-button:disabled {
  color: #b5beb5;
  border-color: #e7ebe4;
  background: #f5f7f2;
  cursor: not-allowed;
  opacity: 0.82;
}

.primary-button,
.inspector-run-button {
  color: #fffaf5;
  background: var(--coral);
  box-shadow: 0 8px 16px rgba(231, 104, 85, 0.17);
}

.primary-button:hover,
.inspector-run-button:hover {
  background: var(--coral-dark);
  box-shadow: 0 10px 20px rgba(231, 104, 85, 0.22);
  transform: translateY(-1px);
}

.primary-button:disabled,
.inspector-run-button:disabled {
  color: #a8b2aa;
  background: #e8ece6;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.primary-button svg,
.secondary-button svg {
  width: 16px;
  height: 16px;
}

.button-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.play-icon svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  stroke-width: 0;
}

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

.metric-card {
  min-height: 125px;
  padding: 17px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.metric-card-primary {
  border-color: #c0d7c8;
  background: #edf6ef;
}

.metric-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 12px;
}

.metric-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: var(--green-2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.7);
}

.metric-icon svg {
  width: 15px;
  height: 15px;
}

.metric-icon.positive {
  color: #397f63;
  background: #edf7e9;
}

.metric-icon.warning {
  color: #a37932;
  background: var(--yellow-soft);
}

.metric-card > strong {
  display: block;
  margin-top: 11px;
  color: var(--green);
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1;
}

.metric-foot {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
}

.trend-up {
  margin-right: 4px;
  color: #3b8a6d;
  font-weight: 700;
}

.work-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 22px;
  margin-top: 31px;
  align-items: start;
}

.content-column {
  min-width: 0;
}

.section-heading,
.tabs-and-search,
.label-row,
.preview-head,
.preview-number,
.preview-foot,
.table-footer,
.inspector-header,
.rule-callout-top,
.modal-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-heading h2 {
  color: var(--green);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.section-heading span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.heading-actions {
  display: flex;
  gap: 5px;
}

.tabs-and-search {
  gap: 16px;
  margin-top: 22px;
  border-bottom: 1px solid var(--line);
}

.tabs {
  display: flex;
  min-width: 0;
  gap: 22px;
}

.tab {
  position: relative;
  padding: 0 0 12px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
}

.tab span {
  margin-left: 3px;
  color: #aeb7b0;
  font-size: 10px;
}

.tab.active {
  color: var(--green);
  font-weight: 700;
}

.tab.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--coral);
  content: "";
}

.search-box {
  display: flex;
  min-width: 183px;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  padding: 7px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.search-box svg {
  width: 15px;
  height: 15px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.search-box input::placeholder {
  color: #b2bbb3;
}

.table-wrap {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(27, 52, 47, 0.035);
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.product-table th,
.product-table td {
  padding: 13px 10px;
  border-bottom: 1px solid #eff0ea;
  overflow: hidden;
  text-align: left;
  vertical-align: middle;
}

.product-table th {
  color: #8f9a92;
  background: #fbfbf7;
  font-size: 10px;
  font-weight: 700;
}

.product-table td {
  color: var(--ink-soft);
  font-size: 11px;
}

.product-table th:first-child,
.product-table td:first-child {
  padding-left: 14px;
}

.product-table th:nth-child(1) { width: 34px; }
.product-table th:nth-child(2) { width: 29%; }
.product-table th:nth-child(3) { width: 15%; }
.product-table th:nth-child(4) { width: 19%; }
.product-table th:nth-child(5) { width: 12%; }
.product-table th:nth-child(6) { width: 16%; }
.product-table th:nth-child(7) { width: 10%; }

.product-table tbody tr {
  transition: background 150ms ease;
}

.product-table tbody tr:hover,
.product-table tbody tr.selected {
  background: #fcfdf9;
}

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

.empty-table-row td {
  padding: 0;
  border-bottom: 0;
  text-align: center;
}

.empty-table-state {
  display: grid;
  min-height: 178px;
  place-content: center;
  gap: 7px;
  padding: 24px;
  color: var(--muted);
}

.empty-table-state strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.empty-table-state span {
  font-size: 11px;
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--coral);
  cursor: pointer;
}

.product-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.product-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.product-thumb {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  color: #43615d;
  background: #e9efe8;
  font-size: 13px;
  font-weight: 750;
}

.product-thumb.peach { color: #9c5d4f; background: #fae5d7; }
.product-thumb.blue { color: #4f7581; background: #dcecf1; }
.product-thumb.yellow { color: #977c39; background: #f6eccb; }
.product-thumb.purple { color: #756284; background: #ebe5f0; }

.product-meta strong,
.product-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-meta strong {
  max-width: 100%;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
}

.product-meta small {
  max-width: 100%;
  margin-top: 3px;
  color: #9ca69d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.money {
  color: var(--ink);
  font-weight: 650;
}

.price-compare {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.price-compare.is-warning {
  color: #b06f2f;
  font-weight: 650;
}

.commission-compare strong,
.commission-compare small {
  display: block;
}

.commission-compare strong {
  color: var(--ink);
  font-size: 11px;
}

.commission-compare small {
  margin-top: 3px;
  color: #9ca69d;
  font-size: 9px;
}

.commission-compare.higher strong,
.commission-compare.higher small {
  color: #3a8767;
}

.commission-compare.lower strong,
.commission-compare.lower small {
  color: var(--red);
}

.fee {
  color: #9c762d;
  font-weight: 650;
}

.status-badge,
.result-badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.status-cell {
  min-width: 0;
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.status-detail {
  display: block;
  max-width: 190px;
  margin-top: 4px;
  overflow: hidden;
  color: #9b7b70;
  font-size: 8px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge::before,
.result-badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-badge.pending {
  color: #887d59;
  background: var(--yellow-soft);
}

.status-badge.done {
  color: #418366;
  background: #e5f3e9;
}

.status-badge.review {
  color: var(--red);
  background: var(--red-soft);
}

.status-badge.confirmation {
  color: #8c6a25;
  background: #fff0c7;
}

.status-badge.price-warning {
  color: #9b6726;
  background: #fff0c7;
}

.status-badge.running {
  color: var(--blue);
  background: var(--blue-soft);
}

.link-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-size: 10px;
  text-decoration: none;
}

.link-cell:hover {
  color: var(--coral-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-cell svg {
  width: 12px;
  height: 12px;
}

.muted-link {
  color: #b6beb7;
  font-size: 10px;
}

.table-footer {
  padding: 12px 14px;
  color: #9ca69d;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination[hidden] {
  display: none;
}

.page-button,
.page-number {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #8c9991;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  font-size: 10px;
}

.page-button svg {
  width: 13px;
  height: 13px;
}

.page-button:not(:disabled):hover,
.page-number:hover,
.page-number.active {
  color: var(--green);
  border-color: var(--line);
  background: #fafcf7;
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.inspector {
  position: sticky;
  top: 20px;
  padding: 18px;
  border: 1px solid #dfe5db;
  border-radius: 10px;
  background: #fdfef9;
  box-shadow: var(--shadow);
}

.inspector.closed {
  display: none;
}

.inspector-header {
  align-items: flex-start;
}

.panel-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #4e8d6e;
}

.panel-kicker .live-dot {
  width: 6px;
  height: 6px;
  box-shadow: none;
}

.inspector-header h2 {
  margin-top: 8px;
  color: var(--green);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.rule-callout {
  margin-top: 19px;
  padding: 13px;
  border: 1px solid #e4e9dc;
  border-radius: 8px;
  background: #f4f8eb;
}

.rule-callout-top {
  color: #63715f;
  font-size: 10px;
  font-weight: 700;
}

.rule-state {
  padding: 4px 6px;
  color: #498060;
  border-radius: 4px;
  background: #e4f2df;
  font-size: 9px;
}

.rule-callout p {
  margin-top: 10px;
  color: #5c6d60;
  font-size: 11px;
  line-height: 1.6;
}

.rule-callout p strong {
  color: var(--green);
  font-size: 14px;
}

.rule-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 11px;
}

.rule-tag {
  padding: 4px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
}

.rule-tag.equal { color: #527d5f; background: #e0efe1; }
.rule-tag.higher { color: #8c6d2f; background: #f9edc7; }
.rule-tag.lower { color: #a75e50; background: #f7e2dc; }
.rule-tag.confirmation { color: #8c6d2f; background: #f9edc7; }

.form-block {
  margin-top: 20px;
}

.form-block > label,
.label-row label {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.label-row span {
  color: #a0aaa0;
  font-size: 10px;
}

.select-wrap {
  position: relative;
  margin-top: 8px;
}

.select-wrap select {
  width: 100%;
  height: 36px;
  padding: 0 33px 0 10px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  background: var(--surface);
  font-size: 11px;
  appearance: none;
}

.select-wrap > svg {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.activity-id-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.activity-id-row > label {
  color: #7a897e;
  font-size: 10px;
  font-weight: 650;
}

.activity-id-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.activity-id-controls input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  background: var(--surface);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.activity-id-controls input:focus {
  border-color: #89a795;
  box-shadow: 0 0 0 3px rgba(94, 137, 111, 0.12);
}

.activity-id-controls .icon-button {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  color: #5f8f70;
  border: 1px solid #d5e1d4;
  background: #f3f8ef;
}

.activity-id-controls .icon-button:hover {
  color: #fff;
  border-color: #6f9a7c;
  background: #6f9a7c;
}

.activity-id-controls .icon-button svg {
  width: 14px;
  height: 14px;
}

.activity-default-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.activity-default-row span {
  min-width: 0;
  overflow: hidden;
  color: #87958b;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  flex: 0 0 auto;
  padding: 0;
  color: var(--coral-dark);
  background: transparent;
  font-size: 9px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--coral);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:disabled {
  color: #9fb0a2;
  cursor: default;
  text-decoration: none;
}

.activity-helper {
  margin-top: 7px;
  color: #a0aaa1;
  font-size: 9px;
  line-height: 1.5;
}

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

.workflow-steps li {
  display: grid;
  position: relative;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  align-items: start;
  min-height: 50px;
}

.workflow-steps li:not(:last-child)::before {
  position: absolute;
  top: 21px;
  left: 10px;
  width: 1px;
  height: 33px;
  background: #e0e6dd;
  content: "";
}

.workflow-steps li > span {
  display: grid;
  z-index: 1;
  width: 21px;
  height: 21px;
  place-items: center;
  color: #89968c;
  border: 1px solid #dde4da;
  border-radius: 50%;
  background: #fdfef9;
  font-size: 9px;
  font-weight: 700;
}

.workflow-steps li.step-ready > span {
  color: #fff;
  border-color: #79a481;
  background: #79a481;
}

.workflow-steps li strong,
.workflow-steps li small {
  display: block;
}

.workflow-steps li strong {
  color: #52625a;
  font-size: 10px;
  font-weight: 650;
}

.workflow-steps li small {
  margin-top: 4px;
  color: #a1aaa2;
  font-size: 9px;
}

.workflow-steps li i {
  margin-top: 2px;
  color: #b0bab0;
  font-size: 9px;
  font-style: normal;
}

.workflow-steps li.step-ready i {
  color: #66a076;
}

.execution-preview {
  margin-top: 8px;
  padding: 13px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.preview-head,
.preview-foot {
  color: #9da79f;
  font-size: 9px;
}

.preview-head strong {
  color: #65746b;
  font-weight: 600;
}

.preview-number {
  justify-content: flex-start;
  gap: 7px;
  margin-top: 12px;
}

.preview-number strong {
  color: var(--green);
  font-size: 25px;
  letter-spacing: -0.04em;
}

.preview-number span {
  color: #738179;
  font-size: 10px;
}

.preview-number b {
  margin-left: auto;
  color: #5f9d70;
  font-size: 10px;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  margin-top: 9px;
  border-radius: 5px;
  background: #e8eee6;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #6da57c;
}

.preview-foot {
  margin-top: 8px;
}

.inspector-run-button {
  width: 100%;
  margin-top: 18px;
}

.inspector-run-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke-width: 0;
}

.safe-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: #9aa69c;
  font-size: 9px;
}

.safe-note svg {
  width: 13px;
  height: 13px;
  color: #77a47e;
}

.logs-section {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.logs-heading {
  align-items: flex-end;
}

.logs-heading h2 {
  margin-top: 8px;
  color: var(--green);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.logs-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.compact-action {
  min-height: 33px;
  padding: 0 10px;
  font-size: 10px;
}

.compact-action svg {
  width: 14px;
  height: 14px;
}

.logs-toolbar {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: #fbfcf8;
}

.log-summary {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 150px;
  margin-right: auto;
  color: var(--muted);
  font-size: 10px;
}

.log-summary strong {
  color: var(--green);
  font-size: 16px;
  font-weight: 650;
}

.log-summary i {
  width: 1px;
  height: 13px;
  margin: 0 5px;
  background: var(--line-strong);
}

.log-select-wrap,
.log-search-box {
  display: flex;
  position: relative;
  height: 32px;
  align-items: center;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.log-select-wrap {
  min-width: 166px;
}

.log-select-wrap select {
  width: 100%;
  height: 100%;
  padding: 0 28px 0 9px;
  color: var(--ink-soft);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 10px;
  appearance: none;
}

.log-select-wrap svg {
  position: absolute;
  right: 8px;
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.log-search-box {
  width: 220px;
  gap: 6px;
  padding: 0 9px;
}

.log-search-box svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.log-search-box input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 10px;
}

.log-search-box input::placeholder {
  color: #aeb8af;
}

.logs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--surface);
}

.logs-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  table-layout: fixed;
}

.logs-table th,
.logs-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #eff1eb;
  overflow: hidden;
  text-align: left;
  vertical-align: middle;
}

.logs-table th {
  color: #8f9a92;
  background: #fbfbf7;
  font-size: 9px;
  font-weight: 700;
}

.logs-table td {
  color: var(--ink-soft);
  font-size: 10px;
}

.logs-table th:nth-child(1) { width: 115px; }
.logs-table th:nth-child(2) { width: 24%; }
.logs-table th:nth-child(3) { width: 74px; }
.logs-table th:nth-child(4) { width: 122px; }
.logs-table th:nth-child(5) { width: 70px; }
.logs-table th:nth-child(6) { width: 48px; }
.logs-table th:nth-child(7) { width: 220px; }
.logs-table th:nth-child(8) { width: 38px; }

.logs-table tbody tr.log-row {
  cursor: pointer;
  transition: background 150ms ease;
}

.logs-table tbody tr.log-row:hover,
.logs-table tbody tr.log-row.is-expanded {
  background: #fcfdf9;
}

.logs-table td time,
.logs-table td > small,
.log-product small {
  display: block;
  color: #9aa59c;
  font-size: 9px;
  line-height: 1.45;
}

.logs-table td time {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.log-product {
  min-width: 0;
}

.log-product strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-product small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-status {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.log-status.success { color: #4e8662; background: #e5f2e6; }
.log-status.failed { color: #aa5a4d; background: var(--red-soft); }
.log-status.review,
.log-status.contact { color: #92702f; background: var(--yellow-soft); }
.log-status.paused,
.log-status.running { color: #537988; background: var(--blue-soft); }
.log-status.queued { color: #77847b; background: #eef1ec; }

.log-stage,
.log-result {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-stage {
  color: var(--ink-soft);
}

.log-result {
  color: var(--ink);
  font-weight: 600;
}

.log-expand-column,
.log-expand {
  text-align: center !important;
}

.log-expand {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  transition: transform 150ms ease, color 150ms ease, background 150ms ease;
}

.log-expand:hover {
  color: var(--green);
  background: #edf4ed;
}

.log-expand svg {
  width: 14px;
  height: 14px;
}

.log-row.is-expanded .log-expand {
  color: var(--coral-dark);
  transform: rotate(90deg);
}

.log-detail-row > td {
  padding: 0;
  border-bottom: 1px solid var(--line-strong);
  background: #f8faf5;
}

.log-detail-panel {
  padding: 16px 18px 18px;
  border-top: 1px solid #e8ece3;
}

.log-detail-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(240px, 1.5fr) minmax(220px, 1.3fr);
  gap: 10px;
}

.log-detail-grid > div {
  min-width: 0;
  padding-right: 12px;
  border-right: 1px solid #e3e9df;
}

.log-detail-grid > div:last-child {
  border-right: 0;
}

.log-detail-grid span,
.log-link-line span {
  display: block;
  color: #94a097;
  font-size: 9px;
}

.log-detail-grid strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
}

.log-detail-grid .log-reason {
  color: #9c5c4f;
}

.log-detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  gap: 20px;
  margin-top: 16px;
}

.log-detail-columns section {
  min-width: 0;
}

.log-detail-columns h3 {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.log-trace {
  max-height: 230px;
  overflow-y: auto;
  margin: 0;
  padding: 0 5px 0 0;
  list-style: none;
}

.log-trace li {
  display: grid;
  grid-template-columns: 67px 10px minmax(0, 1fr);
  gap: 7px;
  min-height: 39px;
  align-items: start;
  color: var(--ink-soft);
}

.log-trace time {
  padding-top: 1px;
  color: #9ca79f;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.log-trace-dot {
  position: relative;
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border: 2px solid #79a687;
  border-radius: 50%;
  background: #f8faf5;
}

.log-trace li:not(:last-child) .log-trace-dot::after {
  position: absolute;
  top: 6px;
  left: 1px;
  width: 1px;
  height: 34px;
  background: #d7e3d8;
  content: "";
}

.log-trace strong {
  display: block;
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
}

.log-trace p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.log-trace small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #9da89f;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-json {
  max-height: 230px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  color: #52645d;
  border: 1px solid #e2e9df;
  border-radius: 5px;
  background: #f2f6ef;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log-detail-muted {
  padding: 12px;
  color: #9ba69d;
  border: 1px dashed #dce3da;
  border-radius: 5px;
  font-size: 10px;
}

.log-link-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid #e3e9df;
}

.log-link-line span {
  flex: 0 0 auto;
}

.log-link-line a {
  min-width: 0;
  overflow: hidden;
  color: #4d8170;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-link-line small {
  flex: 0 0 auto;
  color: #9ba79d;
  font-size: 9px;
}

.logs-empty {
  display: grid;
  min-height: 180px;
  place-content: center;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.logs-empty[hidden] {
  display: none;
}

.logs-empty-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #6d9a7b;
  border-radius: 8px;
  background: #eaf3e8;
}

.logs-empty-icon svg {
  width: 17px;
  height: 17px;
}

.logs-empty strong {
  color: var(--ink);
  font-size: 12px;
}

.logs-empty > span:last-child {
  font-size: 10px;
}

.logs-footer {
  padding: 9px 2px 0;
  color: #9ca69e;
  font-size: 9px;
}

.import-overlay {
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 25;
  place-items: center;
  padding: 20px;
  background: rgba(16, 59, 54, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.import-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.import-modal {
  width: min(650px, 100%);
  padding: 27px 29px 23px;
  border: 1px solid rgba(223, 229, 219, 0.9);
  border-radius: 12px;
  background: #fffefa;
  box-shadow: 0 24px 70px rgba(16, 59, 54, 0.24);
}

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

.import-modal-header h2 {
  margin-top: 8px;
  color: var(--green);
  font-size: 23px;
  letter-spacing: -0.04em;
}

.import-modal-header p {
  max-width: 470px;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.import-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8f2;
}

.import-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  color: #8a968e;
  border-radius: 5px;
  background: transparent;
  font-size: 11px;
  font-weight: 650;
}

.import-tab svg {
  width: 15px;
  height: 15px;
}

.import-tab.active {
  color: var(--green);
  background: #fffefa;
  box-shadow: 0 2px 7px rgba(27, 52, 47, 0.08);
}

.import-panel {
  display: none;
  min-height: 205px;
  padding-top: 21px;
}

.import-panel.active {
  display: block;
}

.dropzone {
  display: flex;
  width: 100%;
  min-height: 145px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 17px;
  color: var(--ink);
  border: 1px dashed #b7c9bc;
  border-radius: 9px;
  background: #f7fbf3;
  text-align: center;
}

.dropzone:hover {
  border-color: #82a891;
  background: #f2faef;
}

.dropzone.dragging {
  border-color: var(--coral);
  background: #fff3ed;
}

.dropzone-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #5c9a6c;
  border-radius: 50%;
  background: #e0f1df;
}

.dropzone-icon svg {
  width: 17px;
  height: 17px;
}

.dropzone strong {
  margin-top: 10px;
  font-size: 12px;
}

.dropzone small,
.dropzone-hint {
  margin-top: 5px;
  color: #8c9a90;
  font-size: 10px;
}

.dropzone-hint {
  color: #5e9c6a;
  font-weight: 650;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #e6eae1;
  border-radius: 7px;
  background: #fbfcf8;
}

.file-preview.empty {
  color: #9ca79e;
}

.file-preview-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  color: #6b9872;
  border-radius: 5px;
  background: #e6f2e5;
}

.file-preview-icon svg {
  width: 14px;
  height: 14px;
}

.file-preview > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.file-preview strong,
.file-preview small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview strong {
  color: var(--ink);
  font-size: 10px;
}

.file-preview small {
  margin-top: 3px;
  color: #9ca79e;
  font-size: 9px;
}

.file-state {
  color: #5d9a6a;
  font-size: 9px;
  font-weight: 700;
}

.import-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  color: #7c866f;
  border: 1px solid #eee6c8;
  border-radius: 6px;
  background: #fffaf0;
  font-size: 10px;
  line-height: 1.55;
}

.import-notice svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #bd9150;
}

.import-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.import-modal-footer > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.import-modal-footer .secondary-button,
.import-modal-footer .primary-button {
  min-height: 36px;
  padding-right: 12px;
  padding-left: 12px;
}

.export-overlay {
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 26;
  place-items: center;
  padding: 20px;
  background: rgba(16, 59, 54, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.export-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.export-modal {
  width: min(560px, 100%);
  padding: 25px 27px 21px;
  border: 1px solid rgba(223, 229, 219, 0.9);
  border-radius: 10px;
  background: #fffefa;
  box-shadow: 0 24px 70px rgba(16, 59, 54, 0.24);
}

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

.export-modal-header h2 {
  margin-top: 7px;
  color: var(--green);
  font-size: 21px;
  letter-spacing: -0.03em;
}

.export-modal-header p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

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

.export-field-option {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid #e1e8dc;
  border-radius: 7px;
  background: #f8fbf5;
  cursor: pointer;
}

.export-field-option:has(input:checked) {
  border-color: #b8d2bc;
  background: #eef7ee;
}

.export-field-option input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  accent-color: #5c956b;
  flex: 0 0 auto;
}

.export-field-option span {
  min-width: 0;
}

.export-field-option strong,
.export-field-option small {
  display: block;
}

.export-field-option strong {
  color: var(--ink);
  font-size: 11px;
}

.export-field-option small {
  margin-top: 4px;
  color: #8d9a90;
  font-size: 9px;
  line-height: 1.35;
}

.export-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.export-modal-footer > span {
  color: #87948a;
  font-size: 10px;
}

.export-modal-footer > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-modal-footer .secondary-button,
.export-modal-footer .primary-button {
  min-height: 35px;
  padding-right: 12px;
  padding-left: 12px;
}

.extension-download-button {
  color: var(--green);
  font-weight: 700;
}

.extension-download-button:hover {
  color: var(--coral-dark);
}

.extension-overlay {
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 27;
  place-items: center;
  padding: 20px;
  background: rgba(16, 59, 54, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.extension-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.extension-modal {
  width: min(650px, 100%);
  padding: 27px 29px 23px;
  border: 1px solid rgba(223, 229, 219, 0.9);
  border-radius: 12px;
  background: #fffefa;
  box-shadow: 0 24px 70px rgba(16, 59, 54, 0.24);
}

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

.extension-modal-header h2 {
  margin-top: 8px;
  color: var(--green);
  font-size: 23px;
  letter-spacing: -0.04em;
}

.extension-modal-header p {
  max-width: 510px;
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.extension-download-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 13px;
  border: 1px solid #dce8dc;
  border-radius: 8px;
  background: #f4f9f1;
}

.extension-download-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  color: #4f8d65;
  border-radius: 8px;
  background: #e0f0df;
}

.extension-download-icon svg {
  width: 20px;
  height: 20px;
}

.extension-download-copy {
  min-width: 0;
  flex: 1;
}

.extension-download-copy strong,
.extension-download-copy span {
  display: block;
}

.extension-download-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.extension-download-copy span {
  margin-top: 4px;
  color: #809085;
  font-size: 10px;
}

.extension-download-link {
  flex: 0 0 auto;
  min-height: 36px;
  padding-right: 12px;
  padding-left: 12px;
  color: #fffaf5;
  text-decoration: none;
}

.extension-download-link:hover {
  color: #fffaf5;
}

.extension-install-list {
  display: grid;
  gap: 10px;
  margin: 21px 0 0;
  padding: 0;
  list-style: none;
}

.extension-install-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.extension-install-list li > span {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  color: #4c7c5c;
  border-radius: 50%;
  background: #e7f2e4;
  font-size: 10px;
  font-weight: 800;
}

.extension-install-list strong,
.extension-install-list small {
  display: block;
}

.extension-install-list strong {
  color: var(--ink);
  font-size: 11px;
}

.extension-install-list small {
  margin-top: 3px;
  color: #87968b;
  font-size: 10px;
  line-height: 1.5;
}

.extension-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 19px;
  padding: 10px 11px;
  color: #7c866f;
  border: 1px solid #eee6c8;
  border-radius: 6px;
  background: #fffaf0;
  font-size: 10px;
  line-height: 1.55;
}

.extension-notice svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #bd9150;
}

.import-count {
  color: #9aa59b;
  font-size: 10px;
}

.toast {
  display: flex;
  position: fixed;
  right: 26px;
  bottom: 24px;
  z-index: 10;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  color: var(--ink);
  border: 1px solid #dce8dc;
  border-radius: 7px;
  background: #f8fff7;
  box-shadow: 0 12px 30px rgba(27, 52, 47, 0.12);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.toast-icon {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: #69a276;
}

.toast-icon svg {
  width: 12px;
  height: 12px;
}

.run-overlay {
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 20;
  place-items: center;
  padding: 20px;
  background: rgba(16, 59, 54, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.run-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.run-modal {
  width: min(420px, 100%);
  padding: 29px 30px 25px;
  border-radius: 12px;
  background: #fffefa;
  box-shadow: 0 24px 70px rgba(16, 59, 54, 0.22);
  text-align: center;
}

.run-modal-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 15px;
  place-items: center;
  color: var(--coral);
  border: 1px solid #f4c3b9;
  border-radius: 50%;
  background: #fff1ec;
  animation: pulse 1.4s ease-in-out infinite;
}

.run-modal-icon svg {
  width: 21px;
  height: 21px;
}

.modal-kicker {
  color: var(--coral);
}

.run-modal h2 {
  margin-top: 8px;
  color: var(--green);
  font-size: 22px;
  letter-spacing: -0.03em;
}

.run-modal p {
  margin-top: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.modal-progress {
  height: 7px;
  overflow: hidden;
  margin-top: 22px;
  border-radius: 7px;
  background: #ecefe7;
}

.modal-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 250ms ease;
}

.modal-status-row {
  margin-top: 10px;
  color: #9aa49c;
  font-size: 10px;
}

.modal-status-row strong {
  color: var(--green);
  font-size: 11px;
}

.modal-cancel {
  padding: 7px 10px;
  color: #87938a;
  background: transparent;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.run-modal-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 23px;
}

.run-modal-actions .modal-cancel {
  margin-top: 0;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  color: var(--green);
  border: 1px solid #cbd7cf;
  border-radius: 6px;
  background: #f7faf5;
  font-size: 11px;
}

.modal-close:hover {
  border-color: var(--green);
  background: #edf4ed;
}

.modal-close svg {
  width: 13px;
  height: 13px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@media (max-width: 1240px) {
  .main-content {
    padding-right: 24px;
    padding-left: 24px;
  }

  .work-area {
    grid-template-columns: minmax(0, 1fr) 288px;
    gap: 16px;
  }

  .tabs {
    gap: 15px;
  }

  .product-table th,
  .product-table td {
    padding-right: 7px;
    padding-left: 7px;
  }
}

@media (max-width: 980px) {
  body {
    min-width: 0;
    overflow-x: hidden;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
    padding: 16px 18px;
  }

  .workspace-switcher,
  .nav-group,
  .sidebar-footer {
    display: none;
  }

  .main-content {
    grid-column: auto;
    margin-left: 0;
    padding: 0 18px 34px;
    overflow-x: hidden;
  }

  .topbar {
    height: 61px;
  }

  .page-intro {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding-top: 28px;
  }

  .page-intro > div:first-child {
    width: 100%;
    min-width: 0;
  }

  .intro-actions {
    width: 100%;
    padding-bottom: 0;
  }

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

  .work-area {
    grid-template-columns: 1fr;
  }

  .inspector {
    position: static;
  }

  .logs-toolbar {
    flex-wrap: wrap;
  }

  .log-summary {
    width: 100%;
    margin-right: 0;
  }

  .log-search-box {
    flex: 1 1 180px;
  }
}

@media (max-width: 620px) {
  .topbar-actions .help-button,
  .mode-badge {
    display: none;
  }

  .topbar-actions .extension-download-button {
    display: flex;
    width: auto;
    margin-left: auto;
    padding: 6px 0;
  }

  h1 {
    font-size: 34px;
  }

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

  .source-status {
    display: flex;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    max-width: 100%;
  }

  .source-status-label,
  .source-status strong,
  .source-status small {
    min-width: 0;
  }

  .source-status-label {
    flex: 0 1 auto;
  }

  .source-status strong {
    flex: 0 1 150px;
    max-width: 150px;
  }

  .source-status small {
    flex: 1 1 80px;
  }

  .source-status button {
    flex: 0 0 auto;
  }

  .secondary-button,
  .primary-button {
    width: 100%;
  }

  .tabs-and-search {
    display: block;
    overflow: hidden;
  }

  .tabs {
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .logs-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .logs-actions {
    width: 100%;
  }

  .logs-actions .compact-action {
    flex: 1;
  }

  .logs-toolbar {
    align-items: stretch;
  }

  .log-select-wrap,
  .log-search-box {
    width: 100%;
    min-width: 0;
  }

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

  .log-detail-grid > div {
    padding: 0 0 8px;
    border-right: 0;
    border-bottom: 1px solid #e3e9df;
  }

  .log-detail-grid > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .log-link-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .search-box {
    margin-top: 11px;
  }

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

  .product-table {
    min-width: 730px;
  }

  .logs-table-wrap {
    contain: paint;
  }

  .table-footer {
    min-width: 730px;
  }

  .import-modal {
    max-height: calc(100vh - 30px);
    overflow-y: auto;
    padding: 22px 18px 18px;
  }

  .import-tabs {
    grid-template-columns: 1fr;
  }

  .import-tab {
    justify-content: flex-start;
    padding: 0 11px;
  }

  .import-modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .import-modal-footer > div {
    width: 100%;
  }

  .import-modal-footer .secondary-button,
  .import-modal-footer .primary-button {
    flex: 1;
  }

  .export-modal {
    max-height: calc(100vh - 30px);
    overflow-y: auto;
    padding: 21px 18px 18px;
  }

  .export-field-grid {
    grid-template-columns: 1fr;
  }

  .export-modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .export-modal-footer > div {
    width: 100%;
  }

  .export-modal-footer .secondary-button,
  .export-modal-footer .primary-button {
    flex: 1;
  }

  .extension-modal {
    max-height: calc(100vh - 30px);
    overflow-y: auto;
    padding: 22px 18px 18px;
  }

  .extension-download-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .extension-download-copy {
    padding-top: 2px;
  }

  .extension-download-link {
    width: 100%;
    margin-left: 52px;
  }
}
