:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --border: #d6dbe1;
  --text: #1f2933;
  --muted: #65717f;
  --accent: #12645a;
  --accent-dark: #0b4c44;
  --danger: #a53333;
  --warning: #8a5b00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 14px;
}

a {
  color: var(--accent);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar nav a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.topbar nav a:hover {
  text-decoration: underline;
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.container.backyard-container {
  width: 100%;
  max-width: none;
  padding: 20px 24px;
}

.section {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

h3 {
  margin-top: 20px;
  font-size: 15px;
}

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

.wide {
  grid-column: 1 / -1;
}

.upload-form {
  display: grid;
  gap: 16px;
  max-width: 720px;
}

.preparation-notice {
  display: grid;
  gap: 4px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #9fc9c2;
  border-radius: 6px;
  background: #f2faf8;
}

.preparation-notice p {
  margin: 0;
  font-weight: 700;
}

.file-prep-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.file-prep-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.file-prep-card.editable {
  border-color: #9fc9c2;
  background: #fbfdfc;
}

.file-prep-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
}

input[data-ime-ascii] {
  ime-mode: inactive;
}

input[data-password-ascii] {
  ime-mode: disabled;
}

textarea {
  resize: vertical;
}

input[readonly] {
  background: #f1f4f6;
}

.municipality-picker {
  position: relative;
}

.search-results {
  position: absolute;
  z-index: 10;
  top: 64px;
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.12);
}

.search-result {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font-weight: 500;
  text-align: left;
}

.search-result:hover,
.search-result:focus {
  background: #eef6f4;
  outline: none;
}

.search-result-code {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

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

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

.inline-form {
  display: inline-grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  margin: 2px 4px 2px 0;
  vertical-align: middle;
}

.stack-form,
.approval-form {
  display: grid;
  gap: 10px;
}

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

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  width: auto;
  min-height: 0;
}

.attachment-dropzone {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed #8aa7a1;
  border-radius: 6px;
  background: #f7fbfa;
  cursor: pointer;
}

.attachment-dropzone.dragover {
  border-color: var(--accent);
  background: #eef6f4;
}

.attachment-dropzone input[type="file"] {
  width: 100%;
  min-height: 36px;
  padding: 6px 0;
  border: 0;
  background: transparent;
}

.attachment-dropzone span {
  color: var(--text);
  font-weight: 700;
}

.attachment-dropzone small {
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.setup-panel {
  max-width: 640px;
  margin: 40px auto;
}

.mfa-setup {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #9fc9c2;
  border-radius: 6px;
  background: #f2faf8;
}

.mfa-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 216px;
  height: 216px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.backyard-nav-section {
  grid-column: 1 / -1;
  margin: 10px 8px 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button.danger,
.button.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.button.secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button.secondary,
button.secondary {
  background: #fff;
  color: var(--accent);
}

.button.compact {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.status,
.required,
.optional {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e7f1ef;
  color: var(--accent-dark);
  font-size: 12px;
}

.required {
  background: #f7e4e4;
  color: var(--danger);
}

.optional {
  background: #edf0f3;
  color: var(--muted);
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #fff;
}

.message.error {
  border-color: #deb0b0;
  color: var(--danger);
}

.message.success {
  border-color: #9fc9c2;
  color: var(--accent-dark);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.path {
  max-width: 260px;
  overflow-wrap: anywhere;
}

.hash {
  max-width: 220px;
  overflow-wrap: anywhere;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

.issues {
  margin: 0;
  padding-left: 20px;
  color: var(--danger);
}

.issues.warning {
  color: var(--warning);
}

.next-action,
.blocked-action {
  padding: 10px 12px;
  border-radius: 4px;
  background: #e7f1ef;
  color: var(--accent-dark);
  font-weight: 700;
}

.blocked-action {
  background: #f7e4e4;
  color: var(--danger);
}

.inline-action {
  margin: 12px 0 18px;
}

.action-panel {
  display: grid;
  gap: 16px;
  margin: 16px 0 18px;
  padding: 16px;
  border: 1px solid #9fc9c2;
  border-radius: 6px;
  background: #f2faf8;
}

.action-panel.blocked {
  border-color: #deb0b0;
  background: #fff7f7;
}

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

.action-panel h3 {
  margin: 0 0 6px;
}

.action-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.action-panel-message.important {
  display: inline-block;
  margin-top: 2px;
  padding: 8px 10px;
  border-left: 4px solid #b45309;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
  line-height: 1.65;
}

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

.action-buttons .inline-action {
  margin: 0;
}

.primary-outputs {
  display: grid;
  gap: 10px;
}

.primary-outputs h3 {
  margin: 0;
}

.primary-output-table {
  border: 1px solid var(--border);
}

.output-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: #edf0f3;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

.job-step-cell {
  display: grid;
  gap: 4px;
  min-width: 112px;
}

.job-status-badge {
  white-space: nowrap;
}

.job-note-list {
  max-width: 260px;
  min-width: 160px;
}

.job-note-preview {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
}

.job-progress-cell {
  display: grid;
  gap: 6px;
  min-width: 210px;
}

.job-progress-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.job-progress-dots li {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.job-progress-dots li.done {
  border-color: #9fc9c2;
  background: #edf7f4;
  color: var(--accent-dark);
}

.job-progress-dots li.current {
  border-color: var(--accent);
  background: #dff1ec;
  color: var(--accent-dark);
  box-shadow: 0 0 0 2px #b9ddd5;
}

.job-progress-label {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ebisumart-guide {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #c9d7e2;
  border-radius: 6px;
  background: #fbfdff;
}

.ebisumart-guide-head h3,
.ebisumart-guide-head p {
  margin: 0;
}

.ebisumart-guide-head p {
  margin-top: 4px;
  color: var(--muted);
}

.ebisumart-guide-sections {
  display: grid;
  gap: 12px;
}

.ebisumart-guide-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.ebisumart-guide-section-head {
  display: grid;
  gap: 3px;
}

.ebisumart-guide-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.ebisumart-guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ebisumart-guide-steps li {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.guide-image-button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f1f4f6;
}

.guide-image-button img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
}

.guide-step-no {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.ebisumart-guide-steps small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.guide-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.guide-dialog::backdrop {
  background: rgba(31, 41, 51, 0.55);
}

.guide-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.guide-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 110px);
  object-fit: contain;
}

.step2-result {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}

.step2-summary,
.match-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.step2-summary h3,
.step2-summary p,
.match-panel h3 {
  margin: 0;
}

.step2-summary p {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}

.match-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.match-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.match-ng {
  border-color: #deb0b0;
  background: #fffafa;
}

.blocking-errors {
  display: grid;
  gap: 10px;
  margin: 16px 0 18px;
  padding: 14px;
  border: 1px solid #deb0b0;
  border-radius: 6px;
  background: #fffafa;
}

.blocking-errors-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.blocking-errors-head h3 {
  margin: 0;
}

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

.blocking-error-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #deb0b0;
  border-radius: 6px;
  background: #fff;
}

.blocking-error-card span {
  color: var(--muted);
  font-size: 12px;
}

.ng-card-list {
  display: grid;
  gap: 12px;
}

.ng-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #deb0b0;
  border-radius: 6px;
  background: #fff;
}

.ng-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ng-message {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid var(--danger);
  background: #fff7f7;
  line-height: 1.6;
}

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

.ng-status {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafb;
}

.ng-status.exists {
  border-color: #9fc9c2;
  background: #f2faf8;
}

.ng-status.missing {
  border-color: #deb0b0;
  background: #fff7f7;
}

.ng-status span,
.ng-detail-row {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ng-detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

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

.match-card-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.match-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
  }

  .match-card:nth-child(even) {
    background: #f7fbf8;
    border-color: #cfe0d6;
  }

  .match-card:nth-child(odd) {
    background: #fff;
  }

.match-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.match-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.match-vendor,
.match-meta,
.match-reason {
  color: var(--muted);
  font-size: 12px;
}

.match-reason {
  overflow-wrap: anywhere;
}

.match-name {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.field-source-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafb;
}

.field-source-grid span {
    color: var(--muted);
    font-size: 11px;
    overflow-wrap: anywhere;
  }

  .step2-field-summary {
    margin: 0 0 12px;
  }

  .step2-field-summary div {
    background: #f3f6f8;
  }

.match-images {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.match-images img,
.image-missing {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f1f4f6;
  object-fit: cover;
}

.image-missing {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.product-adjustment-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d9e4e1;
  border-radius: 6px;
  background: #fbfdfc;
}

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

.product-adjustment-grid label {
  min-width: 0;
}

.product-adjustment-grid textarea {
  min-height: 76px;
  line-height: 1.45;
}

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

.variation-adjustment-panel {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #c9d7e2;
  border-radius: 6px;
  background: #f8fbfd;
}

.variation-adjustment-head,
.variation-adjustment-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.variation-adjustment-head h3 {
  margin: 0 0 6px;
}

.variation-adjustment-head p {
  margin: 0;
  color: var(--muted);
}

.variation-adjustment-form,
.variation-adjustment-list {
  display: grid;
  gap: 10px;
}

.variation-adjustment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.variation-adjustment-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.variation-adjustment-meta span {
  display: grid;
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

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

.variation-edit-grid {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
}

.variation-name-field {
  min-width: 0;
}

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

.variation-table input[type="number"] {
  width: 110px;
}

.variation-table input[type="text"] {
  min-width: 160px;
}

.variation-image-cell {
  min-width: 150px;
}

.variation-image-cell img,
.variation-thumb-row img {
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f1f4f6;
  object-fit: cover;
}

.variation-image-cell span,
.variation-thumb-row span {
  display: block;
  max-width: 220px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.variation-thumb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.variation-thumb-row.missing {
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: 4px;
}

.char-count {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.char-count.over-limit {
  color: var(--danger);
  font-weight: 700;
}

.image-selection-form {
  display: grid;
  gap: 8px;
}

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

.image-selection-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf0f3;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.image-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}

.image-option {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.image-option.selected {
  border-color: var(--accent);
  background: #f2faf8;
}

.image-option input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.image-option img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f1f4f6;
  object-fit: cover;
}

.image-option-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.image-option-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.details-panel {
  margin-top: 18px;
  border-top: 1px solid var(--border);
}

.details-panel summary {
  padding: 12px 0 0;
  color: var(--accent-dark);
  font-weight: 700;
  cursor: pointer;
}

.export-action {
  display: flex;
  max-width: 760px;
  gap: 10px;
  flex-wrap: wrap;
}

.export-action select {
  flex: 1;
  min-width: 220px;
}

.field-reference-table td {
  min-width: 120px;
}

.backyard-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.backyard-sidebar {
  position: sticky;
  top: 64px;
  min-height: 0;
  padding: 10px;
  border-radius: 6px;
  background: #223247;
  color: #fff;
}

.backyard-nav {
  display: grid;
  gap: 3px;
}

.backyard-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 4px;
  color: #e8eef5;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
}

.backyard-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.backyard-nav a.active {
  background: #f2b705;
  color: #1f2328;
  font-weight: 700;
}

.nav-alert-badge {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.backyard-main {
  min-width: 0;
}

.backyard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.backyard-header h1 {
  margin: 0;
}

.backyard-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.backyard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.backyard-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.backyard-metric-grid.compact {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.backyard-metric,
.backyard-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.backyard-metric {
  min-height: 94px;
  padding: 14px;
}

.backyard-metric-grid.compact .backyard-metric {
  min-height: 72px;
  padding: 10px 12px;
}

.backyard-metric .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.backyard-metric .value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

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

.backyard-metric .sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.backyard-panel {
  margin-bottom: 16px;
  overflow: hidden;
}

.backyard-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfd;
}

.backyard-panel-header h2 {
  margin: 0;
  font-size: 16px;
}

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

.backyard-filter-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) repeat(3, minmax(150px, 220px)) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.municipality-filter-bar {
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(140px, 190px)) auto auto;
  padding: 8px 12px;
}

.sales-filter-bar {
  grid-template-columns: minmax(260px, 1.4fr) repeat(6, minmax(120px, 1fr)) auto auto;
}

.backyard-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.compact-filter summary {
  cursor: pointer;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.inline-upload-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-upload-form input[type="file"] {
  max-width: 220px;
  font-size: 12px;
}

.trend-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  font-weight: 800;
}

.trend-icon.up {
  color: #17663a;
}

.trend-icon.down {
  color: #8a1f1f;
}

.trend-icon.flat {
  color: #64748b;
}

.backyard-inline-warning {
  margin: 10px 14px;
  color: #8a1f1f;
  font-weight: 700;
}

.backyard-filter-bar input,
.backyard-filter-bar select,
.backyard-filter-bar button {
  min-height: 34px;
}

.backyard-table-wrap table {
  min-width: 1120px;
}

.sales-board-table {
  min-width: 1480px;
}

.sales-board-table .sticky-col {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.sales-board-table th.sticky-col {
  z-index: 3;
  background: #fbfcfd;
}

.sales-board-table .rank-col {
  left: 0;
  width: 64px;
  min-width: 64px;
}

.sales-board-table .municipality-col {
  left: 64px;
  width: 260px;
  min-width: 260px;
  box-shadow: 1px 0 0 var(--border);
}

.sales-board-table .row-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.sales-board-table .row-actions .button {
  padding: 5px 8px;
  min-height: 28px;
  font-size: 12px;
}

.backyard-table-wrap th,
.backyard-table-wrap td {
  padding: 9px 8px;
  font-size: 13px;
  white-space: nowrap;
}

.backyard-table-wrap td {
  vertical-align: middle;
}

.backyard-table-wrap td.long-text {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-help-intro p {
  margin: 0;
  padding: 14px;
  line-height: 1.7;
}

.role-help-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.role-help-cards > div {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8faf9;
}

.role-help-cards span,
.role-help-list {
  color: var(--muted);
  line-height: 1.7;
}

.role-help-list {
  margin: 0;
  padding: 14px 28px 18px;
}

.backyard-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.backyard-chip.orange {
  background: #fff0c2;
  color: #7a4c00;
}

.backyard-chip.green {
  background: #dff4e7;
  color: #17663a;
}

.backyard-chip.gray {
  background: #e8edf3;
  color: #465362;
}

.backyard-chip.red {
  background: #fde2e2;
  color: #8a1f1f;
}

.backyard-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.backyard-form-grid.single {
  grid-template-columns: 1fr;
}

.backyard-form-grid .wide {
  grid-column: 1 / -1;
}

.backyard-form-grid .full-span {
  grid-column: 1 / -1;
}

.backyard-form-grid .form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.backyard-form-grid .form-guidance,
.backyard-form-grid .form-note {
  color: var(--muted);
  font-size: 13px;
}

.backyard-form-grid .form-guidance {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.backyard-form-grid .form-note {
  margin: 0;
}

.backyard-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.backyard-action-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.backyard-action-body p {
  margin: 0;
  color: var(--muted);
}

.backyard-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  padding: 14px;
}

.backyard-summary-grid div {
  display: grid;
  gap: 6px;
}

.backyard-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.backyard-summary-grid strong {
  font-size: 15px;
}

.backyard-history-list {
  display: grid;
  gap: 3px;
  margin-bottom: 6px;
  min-width: 220px;
  font-size: 12px;
}

.backyard-history-list strong {
  font-size: 12px;
  color: var(--text);
}

.backyard-history-list span {
  color: var(--muted);
  white-space: nowrap;
}

.knowledge-table .knowledge-table-text {
  max-width: 360px;
  white-space: normal;
}

.knowledge-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.knowledge-meta div {
  display: grid;
  gap: 5px;
}

.knowledge-meta span,
.knowledge-faq-head span {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-summary,
.knowledge-body,
.knowledge-file-note,
.knowledge-empty {
  padding: 14px;
}

.knowledge-summary {
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.knowledge-body {
  white-space: pre-wrap;
  line-height: 1.75;
}

.knowledge-body.compact {
  padding: 8px 0 0;
}

.knowledge-faq-list {
  display: grid;
  gap: 0;
}

.knowledge-faq-item {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.knowledge-faq-item:last-child {
  border-bottom: 0;
}

.knowledge-faq-head h3 {
  margin: 4px 0 0;
  font-size: 16px;
}

.knowledge-faq-edit {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  background: #fbfcfd;
}

.backyard-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.backyard-estimate-preview {
  margin: 14px;
  min-height: 260px;
  padding: 22px;
  border: 1px solid var(--border);
  background: #fff;
}

.backyard-estimate-preview h3 {
  margin-top: 0;
  text-align: center;
  font-size: 20px;
}

.backyard-progress-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  list-style: none;
}

.backyard-progress-list li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
}

.backyard-progress-list div {
  height: 10px;
  border-radius: 999px;
  background: #edf1f5;
  overflow: hidden;
}

.backyard-progress-list i {
  display: block;
  height: 100%;
  background: var(--accent);
}

@media (max-width: 900px) {
  .ng-status-grid,
  .field-source-grid,
  .file-prep-grid,
  .product-adjustment-grid,
  .variation-adjustment-row,
  .variation-adjustment-meta,
  .variation-edit-grid,
  .backyard-metric-grid,
  .backyard-form-grid,
  .backyard-filter-bar,
  .backyard-two-column,
  .backyard-summary-grid {
    grid-template-columns: 1fr;
  }

  .workflow-summary-grid,
  .workflow-two-column {
    grid-template-columns: 1fr;
  }

  .backyard-shell {
    grid-template-columns: 1fr;
  }

  .backyard-sidebar {
    position: static;
    min-height: 0;
  }

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

.note {
  white-space: pre-wrap;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f8fafb;
}

.workflow-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
}

.workflow-bell.active {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.workflow-bell.active.overdue {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff1f2;
}

.workflow-bell span {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  padding: 1px 5px;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  border-radius: 999px;
  background: #dc2626;
}

.workflow-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.workflow-summary-grid > div {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.workflow-summary-grid span,
.workflow-node span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.workflow-stepper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 14px;
}

.workflow-step {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.workflow-step.current {
  color: #075985;
  border-color: #7dd3fc;
  background: #e0f2fe;
  font-weight: 700;
}

.workflow-branch-map {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.workflow-trunk,
.workflow-branch-nodes {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(116px, 150px);
  gap: 12px;
  min-width: max-content;
}

.workflow-branch-split {
  position: relative;
  width: 18px;
  height: 18px;
  margin-left: 70px;
  border-left: 2px solid #9ca3af;
}

.workflow-branch-split::after {
  position: absolute;
  left: -6px;
  bottom: -5px;
  color: #6b7280;
  content: "▼";
  font-size: 12px;
  line-height: 1;
}

.workflow-branches {
  display: grid;
  gap: 8px;
}

.workflow-branch-row {
  display: grid;
  grid-template-columns: minmax(128px, 170px) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  min-width: max-content;
}

.workflow-branch-label {
  display: grid;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}

.workflow-merge-line {
  position: relative;
  width: 18px;
  height: 18px;
  margin-left: 70px;
  border-left: 2px solid #9ca3af;
}

.workflow-merge-line::after {
  position: absolute;
  left: -6px;
  bottom: -5px;
  color: #6b7280;
  content: "▼";
  font-size: 12px;
  line-height: 1;
}

.workflow-post-merge {
  display: grid;
  grid-template-columns: minmax(128px, 170px) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  min-width: max-content;
}

.workflow-svg-map {
  margin: 14px 0;
  overflow-x: auto;
  padding-bottom: 6px;
}

.workflow-svg {
  display: block;
  min-width: 980px;
  height: auto;
}

.workflow-svg-edge {
  fill: none;
  stroke: #94a3b8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  marker-end: url("#workflow-svg-arrow");
}

.workflow-svg-edge-label {
  fill: #374151;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
  stroke-linejoin: round;
  font-size: 11px;
  font-weight: 700;
}

#workflow-svg-arrow path {
  fill: #94a3b8;
}

.workflow-svg-lane-label {
  fill: #374151;
  font-size: 12px;
  font-weight: 700;
}

.workflow-svg-node {
  --workflow-role-accent: #94a3b8;
  --workflow-role-bg: #fff;
  --workflow-role-chip-bg: #e5e7eb;
  --workflow-role-chip-text: #374151;
  color: inherit;
}

.workflow-svg-node-rect {
  fill: var(--workflow-role-bg);
  stroke: #cbd5e1;
  stroke-width: 1;
}

.workflow-svg-node-diamond {
  stroke-width: 1.2;
}

.workflow-svg-node-accent {
  fill: var(--workflow-role-accent);
}

.workflow-svg-index {
  fill: var(--workflow-role-chip-text);
  font-size: 10px;
  font-weight: 700;
}

.workflow-svg-title {
  fill: #111827;
  font-size: 11px;
  font-weight: 700;
}

.workflow-svg-role {
  fill: #4b5563;
  font-size: 10px;
}

.workflow-svg-node.role-sales {
  --workflow-role-accent: #2563eb;
  --workflow-role-bg: #eff6ff;
  --workflow-role-chip-bg: #dbeafe;
  --workflow-role-chip-text: #1e40af;
}

.workflow-svg-node.role-contract {
  --workflow-role-accent: #7c3aed;
  --workflow-role-bg: #f5f3ff;
  --workflow-role-chip-bg: #ede9fe;
  --workflow-role-chip-text: #5b21b6;
}

.workflow-svg-node.role-operation {
  --workflow-role-accent: #059669;
  --workflow-role-bg: #ecfdf5;
  --workflow-role-chip-bg: #d1fae5;
  --workflow-role-chip-text: #065f46;
}

.workflow-svg-node.completed .workflow-svg-node-rect {
  fill: #f0fdf4;
  stroke: #86efac;
}

.workflow-svg-node.active .workflow-svg-node-rect {
  fill: #f0f9ff;
  stroke: #7dd3fc;
}

.workflow-svg-node.selected .workflow-svg-node-rect {
  fill: #e0f2fe;
  stroke: #0284c7;
  stroke-width: 2;
}

.workflow-svg-node.overdue .workflow-svg-node-rect {
  fill: #fff1f2;
  stroke: #fca5a5;
}

.workflow-svg a {
  color: inherit;
  text-decoration: none;
}

.workflow-bpmn-map {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.workflow-bpmn-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fafb;
}

.workflow-bpmn-toolbar span,
.workflow-bpmn-message {
  color: var(--muted);
  font-size: 12px;
}

.workflow-bpmn-canvas {
  width: 100%;
  height: 720px;
  min-height: 560px;
  overflow: hidden;
}

.workflow-bpmn-canvas .djs-container {
  cursor: grab;
}

.workflow-bpmn-canvas .djs-label text,
.workflow-bpmn-canvas .djs-element text {
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.25;
}

.workflow-bpmn-canvas .djs-label {
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
}

.workflow-bpmn-canvas .djs-connection .djs-visual > path {
  stroke: #64748b !important;
  stroke-width: 2.2px !important;
}

.workflow-bpmn-canvas .workflow-bpmn-hidden-task-icon {
  display: none;
}

.workflow-bpmn-canvas .workflow-bpmn-role-badge {
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0;
  paint-order: stroke;
  pointer-events: none;
  stroke: #fff;
  stroke-linejoin: round;
  stroke-width: 3px;
}

.workflow-bpmn-canvas .workflow-bpmn-role-badge-sales {
  fill: #1e40af;
}

.workflow-bpmn-canvas .workflow-bpmn-role-badge-contract {
  fill: #5b21b6;
}

.workflow-bpmn-canvas .workflow-bpmn-role-badge-operation {
  fill: #065f46;
}

.workflow-bpmn-canvas .djs-element.workflow-bpmn-role-sales .djs-visual > :first-child {
  fill: #eff6ff !important;
  stroke: #2563eb !important;
}

.workflow-bpmn-canvas .djs-element.workflow-bpmn-role-contract .djs-visual > :first-child {
  fill: #f5f3ff !important;
  stroke: #7c3aed !important;
}

.workflow-bpmn-canvas .djs-element.workflow-bpmn-role-operation .djs-visual > :first-child {
  fill: #ecfdf5 !important;
  stroke: #059669 !important;
}

.workflow-bpmn-canvas .djs-element.workflow-bpmn-selected .djs-visual > :first-child {
  stroke: #1677a8 !important;
  stroke-width: 4px !important;
}

.workflow-bpmn-canvas .djs-element:hover .djs-visual > :first-child {
  stroke: #2d6a4f !important;
}

.workflow-bpmn-message {
  padding: 0 12px 12px;
}

.bpmn-layout-editor {
  display: grid;
  gap: 10px;
}

.bpmn-layout-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafb;
}

.bpmn-layout-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bpmn-layout-canvas {
  width: 100%;
  height: 760px;
  min-height: 620px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.bpmn-layout-errors {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #deb0b0;
  border-radius: 6px;
  background: #fff7f7;
  color: var(--danger);
  font-weight: 700;
}

.workflow-task-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.workflow-task-card {
  display: block;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.workflow-task-card.current {
  border-color: #7dd3fc;
  background: #e0f2fe;
}

.workflow-task-card strong,
.workflow-task-card span {
  display: block;
}

.workflow-task-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.workflow-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.workflow-work-area,
.workflow-status-area {
  min-width: 0;
}

.workflow-checklist {
  margin: 0 0 16px;
  padding-left: 20px;
}

.sales-response-source {
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
}

.workflow-return-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.workflow-status-list {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0 0 18px;
}

.workflow-status-list dt {
  color: var(--muted);
}

.workflow-status-list dd {
  margin: 0;
  font-weight: 700;
}

.workflow-status-subtext {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

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

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

.workflow-swimlane {
  display: grid;
  grid-template-columns: minmax(150px, 190px) 1fr;
  gap: 12px;
  align-items: stretch;
}

.workflow-swimlane-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
}

.workflow-swimlane-title span {
  color: var(--muted);
  font-size: 12px;
}

.workflow-swimlane-steps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 220px);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.workflow-node {
  position: relative;
  --workflow-role-accent: #94a3b8;
  --workflow-role-bg: #fff;
  --workflow-role-chip-bg: #e5e7eb;
  --workflow-role-chip-text: #374151;
  display: block;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--workflow-role-accent);
  border-radius: 6px;
  background: var(--workflow-role-bg);
  color: inherit;
  text-decoration: none;
}

.workflow-node.role-sales {
  --workflow-role-accent: #2563eb;
  --workflow-role-bg: #eff6ff;
  --workflow-role-chip-bg: #dbeafe;
  --workflow-role-chip-text: #1e40af;
}

.workflow-node.role-contract {
  --workflow-role-accent: #7c3aed;
  --workflow-role-bg: #f5f3ff;
  --workflow-role-chip-bg: #ede9fe;
  --workflow-role-chip-text: #5b21b6;
}

.workflow-node.role-operation {
  --workflow-role-accent: #059669;
  --workflow-role-bg: #ecfdf5;
  --workflow-role-chip-bg: #d1fae5;
  --workflow-role-chip-text: #065f46;
}

.workflow-node.compact {
  min-height: 52px;
  padding: 7px 8px;
  overflow-wrap: anywhere;
}

.workflow-node small {
  display: inline-grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  margin-bottom: 3px;
  border-radius: 999px;
  background: var(--workflow-role-chip-bg);
  color: var(--workflow-role-chip-text);
  font-size: 10px;
  font-weight: 700;
}

.workflow-node.compact strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.workflow-node.compact span {
  font-size: 10px;
  line-height: 1.3;
}

.workflow-trunk .workflow-node:not(:last-child)::after,
.workflow-branch-nodes .workflow-node:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -11px;
  z-index: 1;
  color: #6b7280;
  content: "→";
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
}

.workflow-node.completed {
  border-color: #86efac;
  border-left-color: var(--workflow-role-accent);
  background: linear-gradient(0deg, rgb(240 253 244 / 72%), rgb(240 253 244 / 72%)), var(--workflow-role-bg);
}

.workflow-node.active {
  border-color: #7dd3fc;
  border-left-color: var(--workflow-role-accent);
  background: linear-gradient(0deg, rgb(240 249 255 / 72%), rgb(240 249 255 / 72%)), var(--workflow-role-bg);
}

.workflow-node.waiting {
  background: var(--workflow-role-bg);
}

.workflow-node.selected {
  border-color: #0284c7;
  border-left-color: var(--workflow-role-accent);
  background: linear-gradient(0deg, rgb(240 249 255 / 78%), rgb(240 249 255 / 78%)), var(--workflow-role-bg);
}

.workflow-node.overdue {
  border-color: #fca5a5;
  border-left-color: var(--workflow-role-accent);
  background: linear-gradient(0deg, rgb(255 241 242 / 78%), rgb(255 241 242 / 78%)), var(--workflow-role-bg);
}

.workflow-unread-row,
.workflow-overdue-row {
  background: #fff7ed;
}

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

@media (max-width: 760px) {
  .container {
    padding: 14px;
  }

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

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

  .backyard-header {
    flex-direction: column;
  }

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

  .workflow-summary-grid,
  .workflow-two-column {
    grid-template-columns: 1fr;
  }

  .backyard-nav {
    grid-template-columns: 1fr;
  }

  .action-panel-header {
    flex-direction: column;
  }

  .action-buttons {
    justify-content: flex-start;
  }

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

  table {
    display: block;
    overflow-x: auto;
  }
}
