@font-face {
  font-family: "YS Geo";
  src: url("/static/assets/fonts/ys-geo-thin.ttf") format("truetype");
  font-style: normal;
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("/static/assets/fonts/ys-geo-light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("/static/assets/fonts/ys-geo-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("/static/assets/fonts/ys-geo-medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("/static/assets/fonts/ys-geo-medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("/static/assets/fonts/ys-geo-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("/static/assets/fonts/ys-geo-heavy.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "YS Geo";
  src: url("/static/assets/fonts/ys-geo-black.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/assets/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/assets/fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --font-sans: "YS Geo", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --bg: #f4f5f6;
  --panel: #ffffff;
  --panel-strong: #f1f2f4;
  --border: #dfe1e4;
  --text: #1c1a1c;
  --muted: #74777d;
  --accent: #1683f8;
  --accent-strong: #006bd6;
  --accent-soft: #e2f0ff;
  --brand-red: #e60000;
  --accent-warm: #e60000;
  --sand: #dbd0c3;
  --dark-gray: #2c282c;
  --black: #1c1a1c;
  --success: #267a64;
  --warning: #9b6400;
  --error: #d82b23;
  --shadow: 0 14px 36px rgba(28, 26, 28, 0.12);
  --shadow-soft: 0 2px 8px rgba(28, 26, 28, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --line: 1px solid var(--border);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
}

html[data-theme="dark"] {
  background: #1c1a1c;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-synthesis: none;
  color: var(--text);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-color: var(--border);
  background: #fff;
  color: var(--text);
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea):focus {
  outline: none;
  border-color: var(--accent);
}

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

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(28, 26, 28, 0.98);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(28, 26, 28, 0.16);
  backdrop-filter: blur(10px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.header-brand-logo {
  display: block;
  width: 130px;
  height: auto;
}

.brand-divider {
  width: 1px;
  height: 22px;
  background: currentColor;
  opacity: 0.28;
}

.product-name {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

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

.user-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  white-space: nowrap;
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 4px 8px 4px 5px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #fff;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.profile-trigger:hover,
.profile-trigger:focus-visible {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.current-user-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.current-user-copy strong {
  max-width: 150px;
  overflow: hidden;
  color: #fff;
  font-size: 0.82rem;
  text-overflow: ellipsis;
}

.current-user-copy small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.7rem;
}

.nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-btn.active {
  background: #3e3b3f;
  color: #fff;
}

.nav-btn.active::after {
  content: none;
}

/* Layout */
main {
  width: min(1240px, calc(100% - 32px));
  margin: 20px auto 40px;
}

body.auth-locked > header,
body.auth-locked > .workspace-context,
body.auth-locked > main:not(#authView) {
  display: none !important;
}

body:not(.auth-locked) > #authView {
  display: none;
}

main.auth-shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 40px;
  overflow: hidden;
  background:
    radial-gradient(circle at 83% 52%, rgba(230, 0, 0, 0.24), transparent 20%),
    linear-gradient(108deg, rgba(28, 26, 28, 0.98) 0%, rgba(44, 40, 44, 0.95) 48%, rgba(28, 26, 28, 0.84) 100%);
}

main.auth-shell::before {
  position: absolute;
  z-index: -1;
  right: -5vw;
  bottom: -16vh;
  width: min(68vw, 980px);
  height: min(68vw, 980px);
  background: url("/static/assets/brand/arb-car-sand.svg") center / contain no-repeat;
  content: "";
  opacity: 0.24;
  transform: rotate(-4deg);
  filter: drop-shadow(0 30px 80px rgba(0, 0, 0, 0.42));
}

.auth-panel {
  width: min(100%, 420px);
  padding: 34px;
  border: 0;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.3);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  color: var(--black);
  line-height: 1;
}

.auth-brand-logo {
  display: block;
  width: 158px;
  height: auto;
}

.auth-panel h1,
.auth-panel h2 {
  margin-bottom: 20px;
  font-size: 1.45rem;
}

.auth-panel label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.auth-panel .btn-primary {
  width: 100%;
}

.password-input {
  position: relative;
  display: block;
  width: 100%;
}

.password-input input {
  width: 100%;
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: inline-grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.password-toggle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.password-eye-slash {
  display: none;
}

.password-toggle[aria-pressed="true"] .password-eye-slash {
  display: block;
}

.form-error {
  min-height: 20px;
  margin: 5px 0 10px;
  color: var(--error);
  font-size: 0.84rem;
}

.form-success {
  min-height: 20px;
  margin: 5px 0 10px;
  color: var(--success);
  font-size: 0.84rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(28, 26, 28, 0.62);
}

#passwordModal {
  z-index: 110;
}

.modal-panel {
  max-width: 420px;
}

.profile-panel {
  width: min(820px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px;
  border: var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(28, 26, 28, 0.3);
}

.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.profile-head h2 {
  margin: 3px 0 0;
  font-size: 1.6rem;
}

.profile-kicker {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel-strong);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.profile-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
}

.profile-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
  min-height: 310px;
  padding: 28px 20px;
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 95% 10%, rgba(230, 0, 0, 0.28), transparent 38%),
    linear-gradient(155deg, var(--dark-gray), var(--black));
  text-align: center;
}

.profile-summary strong {
  max-width: 100%;
  margin-top: 16px;
  overflow-wrap: anywhere;
  font-size: 1.08rem;
}

.profile-summary > span:not(.avatar):not(.role-chip) {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
}

.profile-save,
.profile-logout {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-weight: 500;
}

.profile-save:hover,
.profile-logout:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
}

.profile-save {
  margin-top: auto;
}

.profile-save:disabled {
  cursor: wait;
  opacity: 0.6;
}

.profile-logout {
  margin-top: 10px;
}

.role-chip {
  margin-top: 12px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.09);
  font-size: 0.72rem;
  font-weight: 700;
}

.profile-stats {
  display: grid;
  width: 100%;
  margin: 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-stats > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.profile-stats dt {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.68rem;
  line-height: 1.35;
}

.profile-stats dd {
  margin: 0;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}

.profile-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.profile-fields label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-fields label:nth-child(2),
.profile-email-field {
  grid-column: 1 / -1;
}

.profile-email-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.profile-email-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.profile-password-action {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
}

.profile-password-action:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.14);
}

.avatar-picker {
  min-width: 0;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.avatar-picker legend {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 750;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(54px, 1fr));
  gap: 8px;
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 7px 3px 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.avatar-option small {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.66rem;
  text-overflow: ellipsis;
}

.avatar-option:hover {
  background: var(--panel-strong);
}

.avatar-option.selected {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 6px 14px rgba(28, 26, 28, 0.16);
  font-size: 1.05rem;
  font-weight: 900;
}

.avatar-small { width: 34px; height: 34px; font-size: 0.82rem; }
.avatar-large { width: 92px; height: 92px; font-size: 2rem; }
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

#view-upload,
#view-feeds,
#view-colors {
  display: block;
}

.card,
.feeds-table,
.workflow-header {
  border: var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

/* Steps */
.workflow-header {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  padding: 18px 22px;
  margin-bottom: 16px;
}

.workflow-kicker,
.section-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.workflow-title h1 {
  font-size: 1.28rem;
  line-height: 1.2;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
}

.step {
  position: relative;
  min-width: 0;
  padding-right: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 16px;
  right: 8px;
  left: 42px;
  height: 2px;
  background: var(--border);
}

.step-marker {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.step-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-right: 6px;
  background: var(--panel);
}

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

.step-copy strong {
  color: inherit;
  font-size: 0.84rem;
}

.step-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.step.active {
  color: var(--accent-strong);
}

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

.step.done {
  color: var(--text);
}

.step.done .step-marker {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 0;
}

.step.done .step-marker::after {
  content: "✓";
  font-size: 0.86rem;
}

.step.done:not(:last-child)::after {
  background: var(--accent);
}

/* Cards */
.card {
  padding: 22px;
  margin-bottom: 16px;
}

.profile-strip label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.profile-strip {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(480px, 1.3fr);
  gap: 20px;
  align-items: end;
  margin: 18px 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.profile-actions-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 12px;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 6px;
}

.inline-control .btn-del {
  width: 42px;
  min-width: 42px;
}

.profile-strip strong {
  display: block;
  margin-bottom: 5px;
}

.action-status {
  margin-right: auto;
  align-self: center;
}

.btn-table {
  padding: 7px 10px;
  margin-right: 6px;
  white-space: nowrap;
}

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

.audit-details {
  max-width: 480px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.audit-table td:nth-child(4) {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.user-admin {
  margin-top: 24px;
  padding-top: 24px;
  border-top: var(--line);
}

.section-head {
  margin-bottom: 16px;
}

.user-create {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(180px, 1fr) 140px auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 4px;
}

.user-create label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

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

.user-row-actions {
  display: flex;
  gap: 6px;
}

.workspace-context {
  width: min(1240px, calc(100% - 32px));
  margin: 20px auto 0;
  overflow: visible;
  border: var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.workspace-context-main {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 40px;
  align-items: end;
  gap: 20px;
  padding: 16px 18px;
}

.workspace-identity {
  align-self: center;
}

.workspace-kicker,
.modal-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.workspace-identity h2 {
  margin-top: 5px;
  font-size: 1rem;
  line-height: 1.2;
}

.context-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(155, 100, 0, 0.12);
}

.context-status-dot.is-ready {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(38, 122, 100, 0.12);
}

.context-selectors {
  display: grid;
  grid-template-columns:
    minmax(190px, 0.9fr) 18px
    minmax(230px, 1.15fr) 18px
    minmax(138px, 0.55fr);
  align-items: end;
  gap: 10px;
}

.context-control {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.context-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 6px;
}

.context-combobox {
  position: relative;
  display: block;
  min-width: 0;
}

.native-context-select {
  display: none;
}

.context-select-trigger {
  display: block;
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 34px 0 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.context-select-trigger::-webkit-search-cancel-button {
  display: none;
}

.context-select-trigger:hover {
  border-color: #bfc2c6;
  background: #fafbfc;
}

.context-select-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.18);
}

.context-select-trigger:focus-visible {
  outline: none;
}

.context-select-trigger:disabled {
  color: #918b8f;
  background: var(--panel-strong);
  cursor: not-allowed;
}

.context-select-chevron {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 14px;
  width: 8px;
  height: 8px;
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transition: transform 0.15s ease;
}

.context-select-trigger[aria-expanded="true"] + .context-select-chevron {
  transform: translateY(-35%) rotate(225deg);
}

.context-select-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  display: block;
  min-width: 260px;
  padding: 6px;
  border: var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(28, 26, 28, 0.18);
}

.context-select-search {
  display: block;
  padding: 2px 2px 7px;
}

.context-select-search input {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 0.82rem;
}

.context-select-options {
  display: grid;
  max-height: 260px;
  gap: 2px;
  overflow-y: auto;
}

.context-options-label {
  padding: 7px 10px 4px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.context-select-option {
  display: grid;
  width: 100%;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.context-select-option:hover {
  background: var(--panel-strong);
}

.context-select-option.selected {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.context-option-check {
  visibility: hidden;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.context-select-option.selected .context-option-check {
  visibility: visible;
}

.context-create-option .context-option-check {
  visibility: visible;
  color: var(--accent);
  font-size: 1rem;
}

.context-create-option {
  margin-top: 2px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 7px 7px;
}

.context-create-option:hover,
.context-create-option:focus-visible {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.context-option-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.context-option-copy strong {
  overflow: hidden;
  font-size: 0.83rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-option-copy small {
  color: var(--muted);
  font-size: 0.68rem;
}

.context-select-no-results {
  padding: 18px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.context-more-results {
  padding: 9px 10px 6px;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
}

.context-select-no-results.is-error {
  color: var(--error);
  background: #fff5f4;
}

.context-cme-combobox {
  position: relative;
  display: block;
  min-width: 0;
}

.context-cme-combobox > input {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text);
  background: #fff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.context-cme-combobox > input:hover {
  border-color: #bfc2c6;
  background: #fafbfc;
}

.context-cme-combobox > input:focus,
.context-cme-combobox > input.has-value {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.14);
}

.context-cme-popover {
  right: 0;
  left: auto;
  width: min(520px, calc(100vw - 36px));
}

.cme-search-option {
  grid-template-columns: 24px minmax(0, 1fr);
}

.cme-search-option .context-option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cme-id-mark {
  visibility: visible;
  color: var(--accent);
  font-family: var(--font-mono);
}

.field-help {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.35;
}

.context-add {
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #e4e6e9;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.context-add:hover {
  background: #d8dade;
}

.context-add:disabled {
  border-color: var(--border);
  color: #aaa3a8;
  background: var(--panel-strong);
  cursor: not-allowed;
}

.context-arrow {
  align-self: center;
  color: var(--sand);
  font-size: 1.15rem;
}

.workspace-menu {
  position: relative;
  align-self: end;
}

.workspace-menu > summary {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #e4e6e9;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.workspace-menu > summary::-webkit-details-marker,
.recent-feeds-details > summary::-webkit-details-marker {
  display: none;
}

.workspace-menu[open] > summary {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.18);
}

.workspace-menu > summary:focus-visible,
.context-add:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 50%;
  max-width: 220px;
  padding: 7px 9px;
  transform: translate(-50%, -3px);
  border-radius: 7px;
  color: #fff;
  background: #2f2d30;
  box-shadow: 0 8px 20px rgba(28, 26, 28, 0.18);
  content: attr(data-tooltip);
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  white-space: nowrap;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  transform: translate(-50%, 0);
  opacity: 1;
}

.workspace-menu > summary[data-tooltip]::after {
  right: 0;
  left: auto;
  transform: translate(0, -3px);
}

.workspace-menu > summary[data-tooltip]:hover::after,
.workspace-menu > summary[data-tooltip]:focus-visible::after {
  transform: none;
}

.workspace-menu[open] > summary::after {
  display: none;
}

.workspace-menu-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  width: 190px;
  padding: 6px;
  border: var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.workspace-menu-popover button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.workspace-menu-popover button:hover {
  background: var(--panel-strong);
}

.workspace-menu-popover .menu-danger {
  color: var(--error);
}

.workspace-status-row {
  padding: 9px 18px;
  border-top: 1px solid var(--border);
  color: var(--warning);
  background: var(--panel-strong);
  font-size: 0.78rem;
}

.workspace-status-row .is-ready {
  color: var(--success);
}

.dealership-overview {
  border-top: 1px solid var(--border);
}

.overview-head {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  padding: 13px 18px;
}

.overview-head h3 {
  font-size: 0.95rem;
  margin-bottom: 3px;
}

.overview-metrics {
  display: flex;
  align-items: stretch;
}

.metric {
  min-width: 76px;
  padding: 0 16px;
  border-left: 1px solid var(--border);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
  line-height: 1;
}

.metric-good strong { color: var(--success); }
.metric-warn strong { color: var(--warning); }
.metric-alert strong { color: var(--error); }

.overview-history {
  white-space: nowrap;
}

.recent-feeds-details {
  border-top: 1px solid var(--border);
}

.recent-feeds-details > summary {
  padding: 9px 18px;
  color: var(--muted);
  background: #fdfbf9;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  list-style: none;
}

.recent-feeds-details > summary::after {
  margin-left: 6px;
  content: "↓";
}

.recent-feeds-details[open] > summary::after {
  content: "↑";
}

.recent-feeds {
  display: grid;
  gap: 8px;
  padding: 10px 18px 14px;
  background: #fdfbf9;
}

.recent-feed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.85rem;
}

.recent-feed-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.review-count {
  color: var(--error);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.workspace-modal .modal-kicker {
  margin-bottom: 8px;
  color: var(--accent);
}

.workspace-modal h2 {
  margin-bottom: 8px;
}

.workspace-modal .modal-description {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.workspace-modal .actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.workspace-modal .btn-primary,
.workspace-modal .btn-secondary {
  width: auto;
}

.feeds-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 10px 0 12px;
}

.feeds-scope {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feeds-scope .btn-secondary.active {
  background: var(--accent-soft);
  border-color: rgba(22, 131, 248, 0.38);
  color: var(--accent-strong);
}

.actions.compact {
  justify-content: flex-start;
  margin-top: 10px;
}

.card h2,
.feeds-header h2 {
  font-size: 1.1rem;
  line-height: 1.25;
  margin-bottom: 8px;
  color: var(--text);
}

.card > .hint:first-of-type {
  margin-bottom: 14px;
}

/* Upload */
.upload-card {
  padding: 0;
  overflow: hidden;
}

.upload-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--border);
}

.upload-head h2 {
  margin-bottom: 5px;
  font-size: 1.35rem;
}

.upload-state-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.upload-state-badge.is-ready {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.upload-state-badge.is-loading {
  background: #fff2d8;
  color: var(--warning);
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
}

.upload-main {
  min-height: 390px;
  padding: 26px;
}

.upload-main.has-file {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.upload-sidebar {
  padding: 4px 24px;
  border-left: 1px solid var(--border);
  background: #fafbfc;
}

.upload-side-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.upload-side-section:last-child {
  border-bottom: none;
}

.upload-side-label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.context-summary-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  margin-top: 9px;
  font-size: 0.86rem;
}

.context-summary-row > span {
  color: var(--muted);
}

.context-summary-row strong {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-summary-warning,
.upload-error {
  margin-top: 12px;
  color: var(--error);
  font-size: 0.82rem;
}

.update-mode-fieldset {
  min-width: 0;
  border: 0;
}

.update-mode-fieldset legend {
  width: 100%;
  padding: 20px 0 0;
}

.update-mode-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
}

.update-mode-option + .update-mode-option {
  margin-top: 8px;
}

.update-mode-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.update-mode-option.disabled {
  color: var(--muted);
  background: var(--panel-strong);
  cursor: not-allowed;
}

.update-mode-option input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.update-mode-option strong,
.update-mode-option small {
  display: block;
}

.update-mode-option strong {
  font-size: 0.84rem;
  line-height: 1.2;
}

.update-mode-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.28;
}

.mode-check {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.mode-soon {
  padding: 3px 6px;
  border-radius: 6px;
  background: #e4e6e9;
  font-size: 0.64rem;
  font-weight: 600;
}

.upload-mode-native {
  display: none;
}

.upload-requirements ul {
  display: grid;
  gap: 8px;
  list-style: none;
}

.upload-requirements li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.8rem;
}

.upload-requirements li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

.dropzone {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #bfc2c6;
  border-radius: var(--radius);
  padding: 34px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  background: #fafbfc;
}

.dropzone:hover,
.dropzone.drag-over,
.dropzone:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.drop-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.dropzone p {
  margin: 7px 0 17px;
  color: var(--muted);
  font-size: 0.86rem;
}

.dropzone-action,
.file-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 0;
  border-radius: var(--radius-sm);
  background: #e4e6e9;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.selected-file {
  min-height: 116px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.file-type-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.selected-file-copy {
  min-width: 0;
}

.selected-file-copy strong,
.selected-file-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.file-action {
  border: 1px solid rgba(22, 131, 248, 0.28);
  background: #fff;
  cursor: pointer;
}

.file-remove {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.45rem;
}

.file-action:hover,
.file-remove:hover {
  background: rgba(255, 255, 255, 0.72);
}

.upload-photo-source {
  min-width: 0;
  margin-top: 18px;
  padding: 0;
  border: 0;
}

.upload-photo-source legend {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
}

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

.upload-photo-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.upload-photo-catalog-hint {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.upload-photo-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.upload-photo-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-photo-option input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.upload-photo-option:focus-within {
  outline: 2px solid rgba(31, 122, 255, 0.28);
  outline-offset: 2px;
}

.upload-photo-option strong,
.upload-photo-option small {
  display: block;
}

.upload-photo-option strong {
  font-size: 0.84rem;
  line-height: 1.25;
}

.upload-photo-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.upload-photobank-link {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.upload-photobank-link > span {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
}

.upload-photobank-link input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
}

.upload-photobank-link small {
  color: var(--muted);
  font-size: 0.72rem;
}

.upload-photo-recommendation {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(22, 131, 248, 0.34);
  border-radius: var(--radius-sm);
  background: rgba(22, 131, 248, 0.07);
}

.upload-photo-recommendation-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 1rem;
}

.upload-photo-recommendation strong,
.upload-photo-recommendation p,
.upload-photo-recommendation small {
  display: block;
}

.upload-photo-recommendation strong {
  margin-top: 3px;
  font-size: 0.88rem;
}

.upload-photo-recommendation p,
.upload-photo-recommendation small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.45;
}

.upload-photo-recommendation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.upload-photo-recommendation-actions button {
  min-height: 38px;
}

@media (max-width: 680px) {
  .upload-photo-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .upload-photo-recommendation {
    grid-template-columns: 1fr;
  }

  .upload-photo-recommendation-actions {
    display: grid;
  }
}

/* Progress */
.progress-wrap {
  margin-top: 16px;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9eef5;
  border: 1px solid #dce4ee;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.35s ease;
}

#upload-status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.upload-actions {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 14px 26px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.upload-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.upload-actions .btn-primary {
  min-width: 224px;
}

.btn-primary:disabled {
  border-color: #d8dade;
  background: #d8dade;
  color: #8c8f94;
  cursor: not-allowed;
  transform: none;
}

/* Mapping */
.mapping-card {
  padding: 0;
  overflow: visible;
}

.mapping-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--border);
}

.mapping-head h2 {
  margin-bottom: 5px;
  font-size: 1.35rem;
}

.mapping-state-badge {
  flex: 0 0 auto;
  max-width: 270px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
}

.mapping-state-badge.is-ready {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.mapping-state-badge.is-warning {
  background: #fff2d8;
  color: var(--warning);
}

.mapping-file-bar {
  display: grid;
  grid-template-columns: 44px minmax(180px, 1fr) minmax(520px, 1.7fr);
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.mapping-file-bar .file-type-icon {
  width: 44px;
  height: 44px;
}

.mapping-file-copy {
  min-width: 0;
}

.mapping-file-copy strong,
.mapping-file-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-file-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}

.mapping-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.mapping-summary > div {
  padding: 2px 16px;
  border-left: 1px solid var(--border);
}

.mapping-summary span,
.mapping-summary strong {
  display: block;
}

.mapping-summary span {
  color: var(--muted);
  font-size: 0.7rem;
}

.mapping-summary strong {
  margin-top: 3px;
  font-size: 1rem;
}

.price-decision-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  margin: 18px 26px 0;
  padding: 16px;
  border: 1px solid #efc36f;
  border-radius: 14px;
  background: #fff9ec;
}

.price-decision-card.is-resolved {
  border-color: #aadbbf;
  background: #f2fbf6;
}

.source-table-decision-icon {
  font-size: 1.25rem;
}

.source-table-option {
  min-width: 220px;
}

.price-decision-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff0cc;
  color: #9a6100;
  font-size: 1.1rem;
  font-weight: 750;
}

.price-decision-card.is-resolved .price-decision-icon {
  background: #dcf4e6;
  color: #267347;
}

.price-decision-copy > strong {
  display: block;
  font-size: 0.92rem;
}

.price-decision-copy > p {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.price-decision-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.price-decision-option {
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid #d9c89f;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.price-decision-option:hover,
.price-decision-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.price-decision-option strong,
.price-decision-option span {
  display: block;
}

.price-decision-option span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.import-question-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  margin: 18px 26px 0;
  padding: 16px;
  border: 1px solid #efc36f;
  border-radius: 14px;
  background: #fff9ec;
}

.import-question-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff0cc;
  color: #9a6100;
  font-size: 1rem;
  font-weight: 750;
}

.import-question-card strong {
  display: block;
  font-size: 0.92rem;
}

.import-question-card p {
  margin: 4px 0 11px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.missing-data-fields,
.automatic-import-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.missing-data-fields span,
.automatic-import-facts span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 600;
}

.mapping-diagnostics {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.mapping-diagnostics > summary {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 26px;
  background: #fafbfc;
  cursor: pointer;
  list-style: none;
}

.mapping-diagnostics > summary::-webkit-details-marker {
  display: none;
}

.mapping-diagnostics > summary strong,
.mapping-diagnostics > summary small {
  display: block;
}

.mapping-diagnostics > summary strong {
  font-size: 0.88rem;
}

.mapping-diagnostics > summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.mapping-diagnostics-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 650;
}

.mapping-diagnostics[open] .mapping-diagnostics-action .context-chevron {
  transform: rotate(225deg);
}

.mapping-diagnostics:not([open]) + .mapping-note-card {
  margin-top: 20px;
}

.mapping-profile-bar {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(600px, 1.25fr);
  align-items: end;
  gap: 24px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--border);
}

.mapping-profile-status {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.mapping-profile-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 1.1rem;
  font-weight: 700;
}

.mapping-profile-status strong,
.mapping-profile-status span {
  display: block;
}

.mapping-profile-status strong {
  font-size: 0.86rem;
}

.mapping-profile-status div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.mapping-profile-controls {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(210px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.mapping-control-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.mapping-profile-select {
  position: relative;
  display: block;
  min-width: 0;
}

.mapping-profile-native,
.mapping-native-select {
  display: none;
}

.mapping-profile-trigger,
.mapping-select-trigger {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  outline: none;
  text-align: left;
}

.mapping-profile-trigger > span:first-child,
.mapping-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-profile-trigger:hover,
.mapping-select-trigger:hover {
  border-color: #bfc2c6;
  background: #fafbfc;
}

.mapping-profile-trigger[aria-expanded="true"],
.mapping-select-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.18);
}

.mapping-profile-trigger:focus-visible,
.mapping-select-trigger:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.18);
}

.mapping-profile-popover,
.mapping-select-popover {
  position: absolute;
  z-index: 18;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mapping-profile-popover {
  max-height: 260px;
  overflow-y: auto;
}

.mapping-profile-option,
.mapping-select-option {
  width: 100%;
  display: block;
  padding: 10px 12px;
  border: 0;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.mapping-profile-option:hover,
.mapping-select-option:hover {
  background: var(--panel-strong);
}

.mapping-profile-option.selected,
.mapping-select-option.selected {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.mapping-profile-delete {
  min-height: 42px;
  white-space: nowrap;
}

.mapping-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.mapping-toolbar > p {
  color: var(--muted);
  font-size: 0.76rem;
}

.mapping-filters {
  display: inline-flex;
  gap: 6px;
}

.mapping-filter {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
}

.mapping-filter span {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.68rem;
}

.mapping-filter.active {
  border-color: rgba(22, 131, 248, 0.38);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.mapping-filter.active span {
  background: #fff;
  color: var(--accent-strong);
}

.mapping-groups {
  display: grid;
  gap: 16px;
  padding: 22px 26px 26px;
}

.mapping-group {
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.mapping-group-head {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

summary.mapping-group-head {
  border-bottom: 0;
  cursor: pointer;
  list-style: none;
}

summary.mapping-group-head::-webkit-details-marker {
  display: none;
}

.mapping-optional-group[open] > summary {
  border-bottom: 1px solid var(--border);
}

.mapping-group-head h3 {
  font-size: 0.96rem;
}

.mapping-group-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.mapping-group-head > span {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.mapping-group-head > span b {
  font: inherit;
}

.mapping-optional-group[open] .mapping-group-head .context-chevron {
  transform: rotate(225deg);
}

.mapping-field-list {
  display: grid;
}

.mapping-field-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 108px 170px minmax(240px, 0.95fr);
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px 16px;
  border-bottom: 1px solid #edf0f2;
}

.mapping-field-row:last-child {
  border-bottom: 0;
}

.mapping-field-row.mapping-needs-attention {
  background: #fffaf0;
}

.mapping-field-row.is-matched .required-badge {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.mapping-target {
  min-width: 0;
}

.mapping-target strong,
.mapping-field-code {
  display: block;
}

.mapping-target strong {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-field-code {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.mapping-field-result {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.mapping-field-result-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b7bbc0;
}

.mapping-field-row.is-matched .mapping-field-result-dot {
  background: var(--accent);
}

.mapping-field-row.mapping-needs-attention .mapping-field-result-dot {
  background: var(--warning);
}

.mapping-field-result-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-combobox {
  position: relative;
  min-width: 0;
}

.mapping-select-popover {
  min-width: 300px;
}

.mapping-option-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.mapping-option-search {
  min-height: 38px !important;
}

.mapping-select-options {
  max-height: 286px;
  overflow-y: auto;
  padding: 6px;
}

.mapping-select-option {
  border-radius: 8px;
}

.mapping-select-option span,
.mapping-select-option small {
  display: block;
}

.mapping-select-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
}

.mapping-options-empty,
.mapping-empty-filter {
  display: block;
  padding: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.mapping-field-row.filter-hidden,
.mapping-group.filter-hidden {
  display: none;
}

.mapping-note-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr);
  gap: 24px;
  align-items: start;
  margin: 18px 26px 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f7f8fa;
}

.mapping-note-copy > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mapping-note-copy label {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.mapping-note-copy span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e9ecf0;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 600;
}

.mapping-note-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.mapping-note-input {
  position: relative;
}

.mapping-note-input textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 11px 14px 24px;
  border: 1px solid #d8dce1;
  border-radius: 11px;
  outline: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.45;
}

.mapping-note-input textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 131, 248, 0.12);
}

.mapping-note-input > span {
  position: absolute;
  right: 11px;
  bottom: 8px;
  color: var(--muted);
  font-size: 0.58rem;
  pointer-events: none;
}

.mapping-actions {
  position: sticky;
  z-index: 6;
  bottom: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 26px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(250, 251, 252, 0.96);
  box-shadow: 0 -8px 20px rgba(28, 26, 28, 0.05);
  backdrop-filter: blur(10px);
}

.mapping-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.mapping-actions .btn-primary {
  min-width: 220px;
}

.mapping-wrap {
  margin: 10px 0 4px;
  overflow-x: auto;
}

.mapping-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.mapping-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--panel-strong);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.mapping-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #eee9e4;
  vertical-align: middle;
}

.mapping-table tr:nth-child(even) td {
  background: #fdfbf9;
}

.mapping-table select,
.form-grid input,
.url-box input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mapping-table select:focus,
.form-grid input:focus,
.url-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.18);
}

.required-badge,
.optional-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.required-badge {
  background: #fff1f0;
  color: var(--error);
}

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

/* Settings */
.settings-card {
  padding: 0;
  overflow: visible;
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--border);
}

.settings-head h2 {
  margin-bottom: 5px;
  font-size: 1.35rem;
}

.settings-state-badge {
  flex: 0 0 auto;
  max-width: 240px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
}

.settings-state-badge.is-ready {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.settings-state-badge.is-warning {
  background: #fff2d8;
  color: var(--warning);
}

.settings-context-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px 26px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.settings-context-bar > div {
  min-width: 0;
  padding: 0 18px;
  border-left: 1px solid var(--border);
}

.settings-context-bar > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.settings-context-bar span,
.settings-context-bar strong {
  display: block;
}

.settings-context-bar span {
  color: var(--muted);
  font-size: 0.7rem;
}

.settings-context-bar strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automatic-import-summary {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 18px 26px 0;
  padding: 16px;
  border: 1px solid #a8d9bd;
  border-radius: 14px;
  background: #f2fbf6;
}

.automatic-import-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #dcf4e6;
  color: #267347;
  font-size: 1.05rem;
  font-weight: 800;
}

.automatic-import-summary strong {
  display: block;
  font-size: 0.92rem;
}

.automatic-import-summary p {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.automatic-import-facts span {
  border: 1px solid #cae9d7;
  color: #285e40;
}

.automatic-import-summary .btn-secondary {
  white-space: nowrap;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.75fr);
}

.settings-main {
  display: grid;
  gap: 16px;
  padding: 24px 26px 28px;
}

.settings-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.settings-section-head > div,
.settings-side-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.settings-section-number {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
}

.settings-section-head h3,
.settings-side-head h3,
.settings-defaults h3 {
  font-size: 0.94rem;
}

.settings-section-head p,
.settings-side-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.field-required,
.field-optional {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}

.field-required {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.field-optional {
  background: var(--panel-strong);
  color: var(--muted);
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px;
}

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

.settings-field-grid .settings-field + .settings-field {
  border-left: 1px solid var(--border);
}

.settings-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}

.settings-label-row small {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 500;
}

.settings-label-row small.is-inherited {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.settings-field > small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.settings-field input:not([type="hidden"]) {
  min-height: 44px;
}

.settings-hours-field {
  border-top: 1px solid var(--border);
}

.hours-control {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 18px minmax(120px, 1fr);
  align-items: end;
  gap: 8px;
  max-width: 390px;
}

.hours-control label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hours-control label span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.hours-control input {
  font-family: var(--font-mono);
  text-align: center;
}

.hours-separator {
  padding-bottom: 13px;
  color: var(--muted);
  text-align: center;
}

.settings-sidebar {
  padding: 4px 24px;
  border-left: 1px solid var(--border);
  background: #fafbfc;
}

.settings-side-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.settings-side-section:last-child {
  border-bottom: 0;
}

.settings-mode-fieldset {
  margin-top: 16px;
  border: 0;
}

.settings-mode-fieldset legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.settings-defaults-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 10px;
  background: #e4e6e9;
  color: var(--text);
  font-size: 1.05rem;
}

.settings-defaults p,
.settings-next p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.settings-defaults .btn-secondary {
  width: 100%;
  margin-top: 14px;
}

#dealershipSettingsStatus {
  display: block;
  min-height: 18px;
  margin-top: 8px;
  color: var(--success);
  font-size: 0.72rem;
  text-align: center;
}

.settings-next > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.settings-next strong {
  font-size: 0.86rem;
}

.settings-error {
  margin: 0 26px 14px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 43, 35, 0.25);
  border-radius: 10px;
  background: #fff1f0;
  color: var(--error);
  font-size: 0.8rem;
}

.settings-actions,
.review-stage-actions {
  position: sticky;
  z-index: 6;
  bottom: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 26px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  background: rgba(250, 251, 252, 0.96);
  box-shadow: 0 -8px 20px rgba(28, 26, 28, 0.05);
  backdrop-filter: blur(10px);
}

.settings-actions > span,
.review-stage-actions > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.settings-actions .btn-primary,
.review-stage-actions .btn-primary {
  min-width: 210px;
}

.settings-field input.field-error {
  border-color: var(--error);
  background: #fff7f6;
  box-shadow: 0 0 0 2px rgba(216, 43, 35, 0.08);
}

.review-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
}

.review-stage-head h2 {
  font-size: 1.2rem;
}

.review-stage-body {
  padding: 22px 26px 26px;
}

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 12px 0 0;
}

.dictionary-add {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) auto;
  align-items: end;
  gap: 12px;
  margin: 16px 0 10px;
}

.dictionary-add label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.dictionary-add input,
.dictionary-add select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

.dictionary-table td:last-child {
  width: 44px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

/* Actions */
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary,
.btn-copy,
.btn-del,
.btn-danger {
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  border: 1px solid var(--black);
  background: var(--black);
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  background: var(--dark-gray);
  border-color: var(--dark-gray);
  transform: translateY(-1px);
}

.btn-secondary {
  border: 1px solid transparent;
  background: #e4e6e9;
  color: var(--text);
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  background: #d8dade;
  border-color: transparent;
  color: var(--text);
  transform: translateY(-1px);
}

.btn-copy {
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  width: 42px;
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-copy:hover {
  background: var(--accent-soft);
}

.btn-del {
  border: 1px solid transparent;
  background: transparent;
  color: var(--error);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-del:hover {
  background: #fff1f0;
  border-color: #f9c5c0;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--error);
  background: var(--error);
  color: #fff;
  font-weight: 600;
}

.btn-danger:hover {
  border-color: #bd251f;
  background: #bd251f;
  transform: translateY(-1px);
}

.btn-danger:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

/* Step 4 */
.result-card {
  overflow: hidden;
  padding: 0;
  background: #f4f5f6;
}

.result-state {
  min-height: 560px;
}

.result-state-head {
  padding: 28px 30px 22px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.result-state-head h2 {
  margin-top: 4px;
  font-size: 1.35rem;
}

.result-state-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.processing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  max-width: 760px;
  min-height: 470px;
  margin: 0 auto;
  padding: 46px 24px 8px;
}

.processing-visual {
  position: relative;
  width: 100%;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

@property --progress {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.processing-ring {
  position: relative;
  z-index: 2;
  width: 196px;
  height: 196px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(22, 131, 248, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(22, 131, 248, 0.13), transparent 49%),
    rgba(255, 255, 255, 0.78);
  box-shadow:
    0 24px 64px rgba(28, 26, 28, 0.13),
    0 0 48px rgba(22, 131, 248, 0.09),
    inset 0 0 38px rgba(22, 131, 248, 0.06);
  transition: --progress 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.processing-ring::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(
    from -90deg,
    #8fc5ff 0,
    var(--accent) calc(var(--progress, 0) * 1%),
    #dce8f5 0
  );
  filter: drop-shadow(0 0 7px rgba(22, 131, 248, 0.34));
  z-index: 0;
}

.processing-ring::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background:
    linear-gradient(rgba(22, 131, 248, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 131, 248, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.98) 0 52%, rgba(244,249,255,0.95) 100%);
  background-size: 18px 18px, 18px 18px, auto;
  z-index: 1;
}

.processing-energy-ring,
.processing-hud-ticks,
.processing-hud-axis,
.processing-data-stream {
  position: absolute;
  pointer-events: none;
}

.processing-energy-ring {
  z-index: 3;
  border-radius: 50%;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
}

.energy-ring-one {
  inset: -19px;
  background: conic-gradient(
    from 12deg,
    transparent 0 8%,
    rgba(143, 197, 255, 0.88) 8% 10%,
    transparent 10% 27%,
    rgba(111, 94, 255, 0.7) 27% 29%,
    transparent 29% 57%,
    rgba(22, 131, 248, 0.76) 57% 61%,
    transparent 61% 88%,
    rgba(143, 197, 255, 0.6) 88% 90%,
    transparent 90%
  );
  filter: drop-shadow(0 0 5px rgba(22, 131, 248, 0.44));
  animation: processing-energy-spin 6.5s linear infinite;
}

.energy-ring-two {
  inset: 11px;
  background: conic-gradient(
    from 80deg,
    transparent 0 20%,
    rgba(22, 131, 248, 0.5) 20% 23%,
    transparent 23% 47%,
    rgba(111, 94, 255, 0.58) 47% 52%,
    transparent 52% 78%,
    rgba(143, 197, 255, 0.46) 78% 81%,
    transparent 81%
  );
  animation: processing-energy-spin 4.8s linear infinite reverse;
}

.processing-hud-ticks {
  z-index: 2;
  inset: -28px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from -1deg,
    rgba(22, 131, 248, 0.32) 0deg 0.7deg,
    transparent 0.7deg 6deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: processing-ticks-spin 24s linear infinite;
}

.processing-hud-axis {
  z-index: 2;
  opacity: 0.32;
  background: linear-gradient(90deg, transparent, rgba(22, 131, 248, 0.64), transparent);
}

.axis-horizontal {
  top: 50%;
  left: -38px;
  width: calc(100% + 76px);
  height: 1px;
}

.axis-vertical {
  top: -38px;
  left: 50%;
  width: 1px;
  height: calc(100% + 76px);
  background: linear-gradient(transparent, rgba(22, 131, 248, 0.64), transparent);
}

.processing-hud-label {
  position: absolute;
  z-index: 8;
  padding: 3px 6px;
  border: 1px solid rgba(22, 131, 248, 0.23);
  border-radius: 4px;
  background: rgba(238, 246, 255, 0.88);
  color: #1768bb;
  font-family: var(--font-mono);
  font-size: 0.46rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(22, 131, 248, 0.1);
}

.hud-label-stage {
  top: -39px;
  left: 50%;
  transform: translateX(-50%);
}

.hud-label-code {
  right: -34px;
  bottom: 10px;
  color: #664de1;
  border-color: rgba(111, 94, 255, 0.28);
}

.processing-core {
  position: relative;
  z-index: 5;
  width: 94px;
  height: 94px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 27px;
  background: #1c1a1c;
  box-shadow:
    0 18px 38px rgba(28, 26, 28, 0.24),
    0 0 0 8px rgba(28, 26, 28, 0.045),
    0 0 30px rgba(22, 131, 248, 0.12);
  animation: processing-core-breathe 3.2s ease-in-out infinite;
}

.processing-core::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(143, 197, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 197, 255, 0.055) 1px, transparent 1px);
  background-size: 12px 12px;
  mask-image: radial-gradient(circle, #000 25%, transparent 78%);
}

.processing-core-corners {
  position: absolute;
  z-index: 5;
  inset: 7px;
  background:
    linear-gradient(#8fc5ff, #8fc5ff) left top / 12px 1px no-repeat,
    linear-gradient(#8fc5ff, #8fc5ff) left top / 1px 12px no-repeat,
    linear-gradient(#8fc5ff, #8fc5ff) right top / 12px 1px no-repeat,
    linear-gradient(#8fc5ff, #8fc5ff) right top / 1px 12px no-repeat,
    linear-gradient(#8fc5ff, #8fc5ff) left bottom / 12px 1px no-repeat,
    linear-gradient(#8fc5ff, #8fc5ff) left bottom / 1px 12px no-repeat,
    linear-gradient(#8fc5ff, #8fc5ff) right bottom / 12px 1px no-repeat,
    linear-gradient(#8fc5ff, #8fc5ff) right bottom / 1px 12px no-repeat;
  opacity: 0.5;
  animation: processing-corners 1.8s ease-in-out infinite;
}

.processing-brand-mark {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 20px;
  z-index: 2;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.14));
}

.processing-scan-line {
  position: absolute;
  z-index: 4;
  left: 9px;
  right: 9px;
  top: 10px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, #8fc5ff 18% 82%, transparent);
  box-shadow:
    0 0 8px rgba(143, 197, 255, 0.9),
    0 8px 18px rgba(22, 131, 248, 0.28);
  animation: processing-scan 2.15s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.processing-core-glint {
  position: absolute;
  z-index: 3;
  inset: -36% 44%;
  width: 18px;
  transform: rotate(26deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.24), transparent);
  animation: processing-glint 3.4s ease-in-out infinite;
}

.processing-data-stream {
  z-index: 7;
  inset: 0;
}

.processing-data-stream i {
  position: absolute;
  width: 2px;
  height: 9px;
  border-radius: 99px;
  background: linear-gradient(#a5d4ff, transparent);
  box-shadow: 0 0 7px rgba(22, 131, 248, 0.75);
  opacity: 0;
  animation: processing-data-fall 2.4s linear infinite;
}

.processing-data-stream i:nth-child(1) { top: 33px; left: 57px; }
.processing-data-stream i:nth-child(2) { top: 45px; right: 48px; animation-delay: -0.7s; }
.processing-data-stream i:nth-child(3) { bottom: 42px; left: 42px; animation-delay: -1.3s; }
.processing-data-stream i:nth-child(4) { right: 62px; bottom: 35px; animation-delay: -1.9s; }

.processing-orbit {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  border: 1px solid rgba(22, 131, 248, 0.24);
  border-radius: 50%;
}

.processing-orbit i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8fc5ff;
  box-shadow: 0 0 9px rgba(22, 131, 248, 0.9);
}

.processing-orbit-one {
  inset: 18px -20px;
  transform: rotate(-18deg);
  animation: processing-orbit-one 8s linear infinite;
}

.processing-orbit-one i {
  top: 18px;
  right: 18px;
}

.processing-orbit-two {
  inset: -21px 22px;
  border-color: rgba(22, 131, 248, 0.16);
  transform: rotate(62deg);
  animation: processing-orbit-two 11s linear infinite reverse;
}

.processing-orbit-two i {
  bottom: 12px;
  left: 27px;
  width: 4px;
  height: 4px;
}

.processing-progress-beacon {
  position: absolute;
  z-index: 6;
  top: calc(50% - 5px);
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #1683f8;
  box-shadow:
    0 0 0 4px rgba(22, 131, 248, 0.15),
    0 0 14px rgba(22, 131, 248, 0.75);
  transform: rotate(calc(var(--progress, 0) * 3.6deg)) translateY(-101px);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.processing-spark {
  position: absolute;
  z-index: 6;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(22, 131, 248, 0.75);
  animation: processing-spark 2.6s ease-in-out infinite;
}

.spark-one { top: 28px; left: 34px; }
.spark-two { right: 25px; bottom: 50px; animation-delay: -0.9s; }
.spark-three { bottom: 31px; left: 57px; animation-delay: -1.7s; }

.processing-ring[data-stage="generating"] .processing-scan-line {
  background: linear-gradient(90deg, transparent, #6ee7a0 18% 82%, transparent);
  box-shadow: 0 0 10px rgba(38, 169, 93, 0.82);
  animation-duration: 1.25s;
}

.processing-ring[data-stage="generating"] .processing-orbit i {
  background: #50d087;
  box-shadow: 0 0 10px rgba(38, 169, 93, 0.8);
}

.processing-ring[data-stage="generating"] .processing-energy-ring {
  filter: hue-rotate(82deg) drop-shadow(0 0 6px rgba(38, 169, 93, 0.45));
}

.processing-ring[data-stage="generating"] .processing-hud-label {
  color: #18804c;
  border-color: rgba(38, 169, 93, 0.28);
  background: rgba(233, 250, 240, 0.9);
}

.processing-ring.is-complete .processing-core {
  box-shadow:
    0 18px 38px rgba(28, 26, 28, 0.24),
    0 0 0 13px rgba(38, 169, 93, 0.12),
    0 0 42px rgba(38, 169, 93, 0.34);
}

.processing-ring.is-complete .processing-progress-beacon {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(38, 169, 93, 0.18), 0 0 18px rgba(38, 169, 93, 0.8);
}

.processing-percent {
  position: relative;
  z-index: 3;
  margin-top: 31px;
  font-family: var(--font-mono);
  font-size: 1.45rem;
  line-height: 1;
}

.processing-counter {
  position: relative;
  z-index: 3;
  max-width: 260px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
  text-align: center;
}

.processing-pulse {
  position: absolute;
  z-index: -1;
  width: 244px;
  height: 244px;
  border: 1px solid rgba(22, 131, 248, 0.2);
  border-radius: 50%;
  animation: result-pulse 2.2s ease-out infinite;
}

.pulse-two {
  animation-delay: 1.1s;
}

@keyframes result-pulse {
  0% { opacity: 0.8; transform: scale(0.72); }
  100% { opacity: 0; transform: scale(1.35); }
}

@keyframes processing-core-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

@keyframes processing-scan {
  0%, 8% { opacity: 0; transform: translateY(0); }
  18% { opacity: 1; }
  82% { opacity: 1; }
  92%, 100% { opacity: 0; transform: translateY(72px); }
}

@keyframes processing-glint {
  0%, 48% { transform: translateX(-75px) rotate(26deg); opacity: 0; }
  58% { opacity: 1; }
  74%, 100% { transform: translateX(75px) rotate(26deg); opacity: 0; }
}

@keyframes processing-orbit-one {
  to { transform: rotate(342deg); }
}

@keyframes processing-orbit-two {
  to { transform: rotate(422deg); }
}

@keyframes processing-spark {
  0%, 100% { opacity: 0.2; transform: scale(0.65); }
  50% { opacity: 1; transform: scale(1.65); }
}

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

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

@keyframes processing-corners {
  0%, 100% { opacity: 0.32; filter: brightness(1); }
  50% { opacity: 0.82; filter: brightness(1.4); }
}

@keyframes processing-data-fall {
  0% { opacity: 0; transform: translateY(-7px); }
  30% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(17px); }
}

@media (prefers-reduced-motion: reduce) {
  .processing-ring,
  .processing-progress-beacon,
  .processing-progress-track > span {
    transition-duration: 0.01ms;
  }

  .processing-core,
  .processing-scan-line,
  .processing-core-glint,
  .processing-core-corners,
  .processing-energy-ring,
  .processing-hud-ticks,
  .processing-data-stream i,
  .processing-orbit,
  .processing-spark,
  .processing-pulse,
  .processing-fact-strip.is-changing {
    animation: none;
  }

  .processing-scan-line {
    top: 50%;
    opacity: 0.55;
  }

  .processing-spark {
    opacity: 0.65;
  }

}

/* Feed creation progress: the official Auto.ru Business car fills from the
 * bottom up with the brand red. The wheel areas are cut out of the red asset,
 * so they stay transparent throughout the operation. */
.processing-car {
  position: relative;
  z-index: 3;
  width: min(320px, 82vw);
  aspect-ratio: 390 / 200;
}

.processing-car-art {
  position: absolute;
  inset: 0;
  display: block;
  transform-origin: 50% 100%;
}

.processing-car-art img,
.processing-car-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.processing-car-art img {
  display: block;
  object-fit: contain;
}

.processing-car-ghost {
  opacity: 0.24;
}

.processing-car-fill {
  overflow: hidden;
  clip-path: inset(var(--car-fill-top, 100%) 0 0 0);
  transition: clip-path 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.processing-car.is-complete .processing-car-art {
  animation: processing-car-celebrate 0.72s cubic-bezier(0.22, 0.82, 0.24, 1) both;
}

@keyframes processing-car-celebrate {
  0%, 100% { transform: translateY(0) rotate(0); }
  32% { transform: translateY(-14px) rotate(-0.8deg); }
  56% { transform: translateY(2px) rotate(0.45deg); }
  74% { transform: translateY(-5px) rotate(-0.25deg); }
}

@media (prefers-reduced-motion: reduce) {
  .processing-car-fill {
    transition-duration: 0.01ms;
  }

  .processing-car.is-complete .processing-car-art {
    animation: none;
  }
}

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

.processing-content-hidden,
#processing-state > .result-state-head {
  display: none;
}

.result-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
}

.result-context-grid > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 15px;
  border-right: 1px solid var(--border);
}

.result-context-grid > span:last-child {
  border-right: 0;
}

.result-context-grid small {
  color: var(--muted);
  font-size: 0.63rem;
}

.result-context-grid strong {
  overflow: hidden;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.processing-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 22px;
  list-style: none;
}

.processing-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  min-height: 68px;
  color: var(--muted);
}

.processing-steps li::after {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 0;
  left: 14px;
  width: 1px;
  background: #d5d8dc;
}

.processing-steps li:last-child::after {
  display: none;
}

.processing-steps li > span {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d5d8dc;
  border-radius: 50%;
  background: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.processing-steps li.is-done > span {
  border-color: #a8ddbf;
  background: #e7f7ed;
  color: var(--success);
}

.processing-steps li.is-active > span {
  border: 6px solid #cfe4fb;
  background: var(--accent);
  color: transparent;
  box-shadow: inset 0 0 0 3px #fff;
}

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

.processing-steps strong {
  margin-top: 1px;
  color: var(--text);
  font-size: 0.78rem;
}

.processing-steps small {
  margin-top: 4px;
  font-size: 0.66rem;
  line-height: 1.35;
}

.processing-progress-card {
  display: grid;
  gap: 10px;
  margin-top: 2px;
  padding: 14px 16px;
  border: 1px solid #d8e6f5;
  border-radius: 12px;
  background: #f8fbff;
}

.processing-progress-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.processing-progress-card strong {
  font-size: 0.72rem;
}

.processing-progress-card span {
  color: var(--muted);
  font-size: 0.64rem;
  text-align: right;
}

.processing-progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #dce7f2;
}

.processing-progress-track > span {
  display: block;
  width: 3%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}

.processing-stop-actions {
  width: min(520px, calc(100% - 48px));
  margin: 0 auto 26px;
  text-align: center;
}

.processing-stop-button {
  color: #a23b31;
}

.processing-stop-confirm {
  margin-top: 10px;
  padding: 14px 16px;
  border: 1px solid #efc4bf;
  border-radius: 12px;
  background: #fff7f5;
  text-align: left;
}

.processing-stop-confirm strong {
  font-size: 0.74rem;
}

.processing-stop-confirm p {
  margin-top: 5px;
  color: #6f514d;
  font-size: 0.65rem;
  line-height: 1.45;
}

.processing-stop-confirm > div {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.result-stopped-card {
  border-color: #efd8a9;
  background: #fffaf0;
}

.result-stopped-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  color: #9a6514;
  background: #ffedc7;
  font-size: 0.8rem;
}

.stopped-progress-summary {
  display: grid;
  gap: 4px;
  margin: 18px 0;
  padding: 14px;
  border-radius: 12px;
  background: #fff;
}

.stopped-progress-summary strong {
  font-family: var(--font-mono);
  font-size: 1.2rem;
}

.stopped-progress-summary span {
  color: var(--muted);
  font-size: 0.68rem;
}

.processing-fact-strip {
  width: calc(100% - 108px);
  max-width: 972px;
  min-height: 2.8em;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  margin: -4px auto 18px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.processing-fact-info {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  margin-top: 1px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}

.processing-fact-strip.is-changing {
  animation: processing-fact-reveal 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes processing-fact-reveal {
  from { opacity: 0; transform: translateY(7px); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.processing-note {
  padding: 14px 30px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

@media (max-width: 860px) {
  .processing-layout {
    min-height: 410px;
    padding: 28px 24px 6px;
  }

  .processing-visual {
    min-height: 390px;
  }

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

  .result-context-grid > span {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .result-context-grid > span:last-child {
    border-bottom: 0;
  }

  .processing-fact-strip {
    width: calc(100% - 48px);
    margin-top: 6px;
  }
}

@media (max-width: 560px) {
  .processing-layout {
    min-height: 310px;
    padding: 14px 16px 0;
  }

  .processing-visual {
    min-height: 300px;
  }

  .processing-car {
    width: min(274px, 82vw);
  }

  .processing-progress-beacon {
    transform: rotate(calc(var(--progress, 0) * 3.6deg)) translateY(-89px);
  }

  .processing-orbit-one {
    inset: 15px -16px;
  }

  .processing-orbit-two {
    inset: -17px 19px;
  }

  .processing-pulse {
    width: 216px;
    height: 216px;
  }

  .processing-core {
    width: 86px;
    height: 86px;
    border-radius: 24px;
  }

  .processing-brand-mark {
    width: 66px;
    height: 66px;
  }

  .processing-fact-strip {
    width: calc(100% - 32px);
    min-height: 3.9em;
    font-size: 0.76rem;
  }

  .processing-progress-card > div:first-child {
    display: grid;
    gap: 4px;
  }

  .processing-progress-card span {
    text-align: left;
  }

  .processing-stop-confirm > div {
    display: grid;
  }
}

/* Centered five-stage deck. Active content stays in normal flow so long reviews are never clipped. */
body[data-active-view="upload"] #view-upload {
  width: min(1120px, calc(100% - 32px));
  margin-top: 22px;
}

#view-upload > .workflow-header,
#view-upload > [data-filter-menu="upload"],
.feed-flow-legacy-result {
  display: none !important;
}

.feed-flow-shell {
  --feed-flow-radius: 14px;
  width: 100%;
}

.feed-flow-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 18px;
  padding: 0 4px;
}

.feed-flow-intro h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.feed-flow-intro p {
  max-width: 660px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.feed-flow-progress {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  font-size: 0.7rem;
  font-weight: 650;
}

.feed-flow-deck {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-flow-item {
  position: relative;
  min-width: 0;
  margin-inline: 0;
  transition: margin 220ms ease, opacity 180ms ease, transform 220ms ease;
}

.feed-flow-item.is-complete {
  z-index: 2;
  margin-right: var(--stack-inset, 0);
  margin-bottom: -17px;
  margin-left: var(--stack-inset, 0);
  opacity: 0.9;
  transform: translateY(-1px);
}

.feed-flow-item.is-active {
  z-index: 5;
}

.feed-flow-item.is-future,
.feed-flow-item.is-reached-future {
  opacity: 0.62;
}

.feed-flow-item.is-reached-future {
  opacity: 0.74;
}

.feed-flow-card {
  position: relative;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--feed-flow-radius);
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(28, 26, 28, 0.045);
  transition: border-color 180ms ease, box-shadow 220ms ease, background 180ms ease;
}

.feed-flow-item.is-active .feed-flow-card {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  box-shadow: 0 18px 46px rgba(28, 26, 28, 0.09), 0 0 0 1px rgba(22, 131, 248, 0.035);
}

.feed-flow-item.is-complete .feed-flow-card {
  background: color-mix(in srgb, var(--panel) 94%, var(--panel-strong));
  box-shadow: 0 7px 18px rgba(28, 26, 28, 0.045);
}

.feed-stage-toggle {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 13px;
  padding: 12px 18px;
  border: 0;
  border-radius: var(--feed-flow-radius);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.feed-stage-toggle:disabled {
  cursor: default;
}

.feed-stage-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.feed-stage-marker {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel);
  font-size: 0.76rem;
  font-weight: 750;
}

.feed-flow-item.is-active .feed-stage-marker {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 5px 14px rgba(22, 131, 248, 0.22);
}

.feed-flow-item.is-complete .feed-stage-marker {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.feed-flow-item.is-complete .feed-stage-marker::before {
  content: "✓";
}

.feed-flow-item.is-complete .feed-stage-marker {
  font-size: 0;
}

.feed-flow-item.is-complete .feed-stage-marker::before {
  font-size: 0.8rem;
}

.feed-stage-copy {
  min-width: 0;
}

.feed-stage-copy strong,
.feed-stage-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-stage-copy strong {
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.25;
}

.feed-stage-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.35;
}

.feed-flow-item.is-complete .feed-stage-copy small {
  opacity: 0.76;
  filter: blur(0.35px);
}

.feed-stage-status {
  max-width: 220px;
  overflow: hidden;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-strong);
  font-size: 0.66rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-flow-item.is-active .feed-stage-status {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.feed-flow-item.is-complete .feed-stage-status {
  color: var(--success);
  background: #eef9f2;
}

.feed-stage-chevron {
  width: 8px;
  height: 8px;
  justify-self: end;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--muted);
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.feed-flow-item.is-active .feed-stage-chevron {
  color: var(--accent-strong);
  transform: rotate(225deg) translate(-2px, -2px);
}

.feed-stage-body {
  min-width: 0;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--feed-flow-radius) var(--feed-flow-radius);
  background: var(--panel);
}

.feed-stage-body[hidden],
.feed-stage-navigation[hidden] {
  display: none !important;
}

.feed-stage-body > .card {
  margin: 0;
  border: 0;
  border-radius: 0 0 var(--feed-flow-radius) var(--feed-flow-radius);
  box-shadow: none;
}

.feed-stage-body > .result-state {
  overflow: hidden;
  border-radius: 0 0 var(--feed-flow-radius) var(--feed-flow-radius);
  background: #f4f5f6;
}

.feed-stage-placeholder {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  margin: 20px;
  padding: 18px;
  border: 1px solid #cbe4d5;
  border-radius: 12px;
  background: #f3faf6;
}

.feed-stage-placeholder > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  font-weight: 750;
}

.feed-stage-placeholder strong {
  font-size: 0.82rem;
}

.feed-stage-placeholder p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.feed-stage-navigation {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--feed-flow-radius) var(--feed-flow-radius);
  background: #fafbfc;
}

.feed-stage-navigation-hint {
  min-width: 0;
  margin-right: auto;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.feed-stage-navigation .btn-primary,
.feed-stage-navigation .btn-secondary {
  width: auto;
  min-width: 116px;
}

.feed-flow-shell .workspace-context {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0 0 var(--feed-flow-radius) var(--feed-flow-radius);
  background: transparent;
  box-shadow: none;
}

body[data-active-view="upload"] .feed-flow-shell .workspace-context-main {
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 12px;
  padding: 18px;
}

.feed-flow-shell .context-flow-heading,
.feed-flow-shell .toolbar-create-feed,
.feed-flow-shell .section-filter-host {
  display: none !important;
}

.feed-flow-shell .context-selectors {
  min-width: 0;
}

.feed-flow-shell .upload-head,
.feed-flow-shell .mapping-head,
.feed-flow-shell .settings-head,
.feed-flow-shell :is(.upload-actions, .mapping-actions, .settings-actions, .review-stage-actions),
.feed-flow-shell #backToSettings,
.feed-flow-shell #error-state .result-error-actions {
  display: none !important;
}

.feed-flow-shell .upload-layout {
  border-top: 0;
}

.feed-flow-shell .upload-context-gate {
  margin: 18px;
}

.feed-flow-shell #processing-state,
.feed-flow-shell #stopped-state,
.feed-flow-shell #error-state,
.feed-flow-shell #ready-state {
  min-height: 0;
}

body[data-theme="dark"]:not(.auth-locked) .feed-flow-card,
body[data-theme="dark"]:not(.auth-locked) .feed-stage-body {
  border-color: var(--workflow-border);
  color: var(--text);
  background: var(--workflow-surface);
}

body[data-theme="dark"]:not(.auth-locked) .feed-flow-item.is-active .feed-flow-card {
  border-color: rgba(143, 197, 255, 0.38);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(143, 197, 255, 0.04);
}

body[data-theme="dark"]:not(.auth-locked) .feed-stage-navigation {
  border-color: var(--workflow-border);
  background: var(--workflow-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) .feed-stage-status {
  background: var(--workflow-surface-raised);
}

body[data-theme="dark"]:not(.auth-locked) .feed-flow-item.is-complete .feed-stage-status,
body[data-theme="dark"]:not(.auth-locked) .feed-stage-placeholder {
  border-color: var(--workflow-success-border);
  color: var(--text);
  background: var(--workflow-success-bg);
}

@media (max-width: 860px) {
  body[data-active-view="upload"] #view-upload {
    width: min(100% - 20px, 1120px);
    margin-top: 14px;
  }

  .feed-flow-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 14px;
  }

  .feed-flow-deck {
    gap: 8px;
  }

  .feed-flow-item.is-complete {
    margin: 0;
    opacity: 0.88;
    transform: none;
  }

  .feed-stage-toggle {
    grid-template-columns: 36px minmax(0, 1fr) 16px;
    min-height: 64px;
    padding: 11px 13px;
  }

  .feed-stage-status {
    grid-column: 2;
    width: fit-content;
    max-width: 100%;
    margin-top: -5px;
  }

  .feed-stage-chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  body[data-active-view="upload"] .feed-flow-shell .workspace-context-main {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .feed-flow-shell .workspace-menu {
    justify-self: end;
  }

  .feed-stage-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 12px 13px;
  }

  .feed-stage-navigation-hint {
    grid-column: 1 / -1;
    margin: 0 0 3px;
  }

  .feed-stage-navigation .btn-primary,
  .feed-stage-navigation .btn-secondary {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .feed-flow-intro h1 {
    font-size: 1.5rem;
  }

  .feed-flow-intro p {
    font-size: 0.72rem;
  }

  .feed-stage-copy small {
    white-space: normal;
  }

  .feed-stage-placeholder {
    grid-template-columns: 34px minmax(0, 1fr);
    margin: 12px;
    padding: 13px;
  }

  .feed-stage-placeholder > span {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feed-flow-item,
  .feed-flow-card,
  .feed-stage-chevron {
    transition: none;
  }

  .feed-flow-item.is-complete .feed-stage-copy small {
    filter: none;
  }
}

.result-success-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 22px 28px;
  border-bottom: 1px solid #b9dfc9;
  background: #f2fbf5;
}

.result-success-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
}

.result-success-head h2 {
  margin: 2px 0 3px;
  font-size: 1.25rem;
}

.result-success-head p {
  color: #587064;
  font-size: 0.75rem;
}

.result-status-badge {
  padding: 7px 11px;
  border-radius: 9px;
  background: #dcefe4;
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 700;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 18px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 28px;
}

.result-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-summary-card,
.result-link-card,
.result-sidebar {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
}

.result-summary-card {
  padding: 18px;
}

.result-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.result-summary-head h3 {
  margin-top: 3px;
  font-size: 0.95rem;
}

.result-summary-head > span {
  color: var(--muted);
  font-size: 0.67rem;
}

.result-context-success {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fafbfc;
}

.result-context-success > span {
  padding: 12px 13px;
}

.result-review-note {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #fff5dc;
  color: #8a5b00;
  font-size: 0.7rem;
}

.result-link-card {
  padding: 18px;
}

.result-link-card h3 {
  margin: 3px 0 4px;
  font-size: 0.9rem;
}

.result-link-card > div:first-child p {
  color: var(--muted);
  font-size: 0.7rem;
}

.url-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
}

.url-box input {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d5d8dc;
  border-radius: 10px;
  background: #fafbfc;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.url-box .btn-copy {
  width: auto;
  min-width: 130px;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid #c9ccd0;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-weight: 600;
}

.copy-status {
  min-height: 18px;
  display: block;
  margin-top: 5px;
  color: var(--success);
  font-size: 0.66rem;
}

.result-file-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.result-file-actions .btn-primary,
.result-file-actions .btn-secondary {
  min-width: 150px;
}

.result-sidebar {
  overflow: hidden;
}

.result-sidebar section {
  padding: 17px;
  border-bottom: 1px solid var(--border);
}

.result-sidebar section:last-child {
  border-bottom: 0;
}

.result-sidebar-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.68rem;
  font-weight: 700;
}

.result-sidebar h3 {
  font-size: 0.77rem;
}

.result-sidebar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.result-sidebar-help {
  background: #fafbfc;
}

.result-sidebar-help strong {
  font-size: 0.72rem;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 28px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.result-actions .btn-primary,
.result-actions .btn-secondary {
  min-width: 190px;
}

#error-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 54px 28px;
}

.result-error-card {
  width: min(620px, 100%);
  padding: 30px;
  border: 1px solid #efc0bb;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 20px 50px rgba(28, 26, 28, 0.08);
}

.result-error-icon {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #fff0ef;
  color: var(--error);
  font-size: 1.35rem;
  font-weight: 700;
}

.result-error-card h2 {
  margin: 4px 0 7px;
  font-size: 1.2rem;
}

.result-error-card > p {
  color: var(--error);
  font-size: 0.75rem;
  line-height: 1.45;
}

.result-error-help {
  margin: 20px 0;
  padding: 13px 14px;
  border-radius: 11px;
  background: #f2f3f5;
  text-align: left;
}

.result-error-help strong {
  font-size: 0.74rem;
}

.result-error-help p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
}

.result-error-actions {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.result-error-actions .btn-primary,
.result-error-actions .btn-secondary {
  min-width: 180px;
}

/* Feeds */
.feeds-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.feeds-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  font-size: 0.92rem;
}

.feeds-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--panel-strong);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.feeds-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eee9e4;
  vertical-align: middle;
}

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

.feeds-table tr:hover td {
  background: #fdfbf9;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 16px !important;
}

.status-badge {
  min-width: 96px;
  padding-inline: 10px;
}

.status-ready {
  background: #e8f7ee;
  color: var(--success);
}

.status-processing {
  background: #fff7db;
  color: var(--warning);
}

.status-error {
  background: #fff1f0;
  color: var(--error);
}

.status-pending {
  background: #eef2f7;
  color: var(--muted);
}

.feed-url-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-url-cell a {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-decoration: none;
}

.feed-url-cell a:hover {
  text-decoration: underline;
}

/* Stage 4.1 — feed history */
.feeds-view {
  max-width: 1440px;
}

.feeds-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 2px 2px 0;
}

.feeds-page-head h1 {
  margin: 3px 0 5px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.feeds-page-head p {
  color: var(--muted);
  font-size: 0.78rem;
}

.feeds-page-actions {
  display: flex;
  gap: 8px;
}

.feeds-page-actions .btn-primary,
.feeds-page-actions .btn-secondary {
  min-width: 135px;
}

.feeds-list-card {
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 26, 28, 0.04);
}

.feeds-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 13px;
}

.feeds-list-head h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 4px;
  font-size: 1rem;
}

.info-hint {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid #737982;
  border-radius: 50%;
  background: transparent;
  color: #737982;
  cursor: default;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.info-hint.is-small {
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-width: 1.5px;
  font-size: 10px;
  vertical-align: -2px;
}

.info-hint:hover,
.info-hint:focus-visible {
  border-color: #31343a;
  color: #31343a;
  outline: 0;
}

.info-tooltip {
  position: fixed;
  z-index: 1800;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 9px;
  background: #27282b;
  box-shadow: 0 10px 28px rgba(28, 26, 28, 0.24);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
  pointer-events: none;
}

.feeds-bulk-bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #f1f7ff;
}

.feeds-bulk-bar > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.feeds-bulk-bar strong {
  font-size: 0.76rem;
}

.feeds-bulk-bar span {
  color: var(--muted);
  font-size: 0.65rem;
}

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

.feeds-bulk-actions .btn-secondary,
.feeds-bulk-actions .btn-danger {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.65rem;
}

.feeds-clear-selection {
  padding: 7px 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.65rem;
}

.feeds-list-head .hint {
  font-size: 0.7rem;
}

.feeds-lifecycle-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: #eef0f2;
}

.feeds-lifecycle-tabs button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5e646d;
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 550;
}

.feeds-lifecycle-tabs button:hover {
  color: var(--text);
}

.feeds-lifecycle-tabs button.is-active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(28, 26, 28, 0.12);
  color: var(--text);
}

.feeds-lifecycle-tabs strong {
  min-width: 20px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #dfe2e6;
  font-size: 0.58rem;
  text-align: center;
}

.feeds-lifecycle-tabs button.is-active strong {
  background: #eaf4ff;
  color: #1378e7;
}

.feeds-scope {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: #eef0f2;
}

.feeds-scope-tab {
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.69rem;
  font-weight: 600;
}

.feeds-scope-tab:hover {
  color: var(--text);
}

.feeds-scope-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(28, 26, 28, 0.1);
}

.feeds-list-card .feeds-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.feeds-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feed-filter-chip {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #d7d9dc;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 500;
}

.feed-filter-chip:hover {
  border-color: #b8bcc1;
}

.feed-filter-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.feeds-search {
  width: min(310px, 34%);
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #d7d9dc;
  border-radius: 10px;
  background: #fff;
}

.feeds-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.1);
}

.feeds-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.feeds-search input {
  min-height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.72rem;
}

.feeds-table-wrap {
  min-height: 260px;
}

.feeds-product-table {
  table-layout: fixed;
  font-size: 0.75rem;
}

.feeds-product-table th {
  padding: 11px 14px;
  background: #fff;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 500;
}

.feeds-product-table th:nth-child(1) { width: 4%; }
.feeds-product-table th:nth-child(2) { width: 23%; }
.feeds-product-table th:nth-child(3) { width: 20%; }
.feeds-product-table th:nth-child(4) { width: 18%; }
.feeds-product-table th:nth-child(5) { width: 9%; }
.feeds-product-table th:nth-child(6) { width: 14%; }
.feeds-product-table th:nth-child(7) { width: 12%; }

.feed-select-column {
  padding-right: 4px !important;
  text-align: center !important;
}

.feed-select-column input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.feeds-product-table td {
  height: 78px;
  padding: 12px 14px;
  border-bottom-color: var(--border);
}

.feeds-product-table tbody tr {
  position: relative;
}

.feeds-product-table tbody tr:hover td {
  background: #fafbfc;
}

.feeds-product-table tbody tr.is-selected td {
  background: #f1f7ff;
}

.feed-name-cell,
.feed-status-cell,
.feed-row-actions {
  display: flex;
  align-items: center;
}

.feed-name-cell {
  min-width: 0;
  gap: 10px;
}

.feed-file-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #eef0f2;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.59rem;
  font-weight: 700;
}

.feed-name-cell > div,
.feed-org-cell,
.feed-date-cell {
  min-width: 0;
}

.feed-name-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
}

.feed-name-title strong {
  min-width: 0;
}

.feed-note-indicator {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: #1683f8;
  cursor: help;
}

.feed-note-indicator:hover,
.feed-note-indicator:focus-visible {
  background: #eaf4ff;
  outline: 0;
}

.feed-note-indicator svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.feed-lifecycle-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 0.53rem;
  font-weight: 650;
  white-space: nowrap;
}

.feed-lifecycle-badge.is-connected {
  background: #e4f7eb;
  color: #18733a;
}

.feed-lifecycle-badge.is-archived {
  background: #eef0f2;
  color: #646a73;
}

.feed-lifecycle-badge.is-trash {
  background: #fff0f0;
  color: #b42318;
}

.feed-date-cell small.is-danger {
  color: #b42318;
}

.feed-note-tooltip {
  position: fixed;
  z-index: 1400;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  background: #211f22;
  box-shadow: 0 10px 28px rgba(28, 26, 28, 0.22);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.45;
  white-space: pre-wrap;
  pointer-events: none;
}

.feeds-product-table tbody tr[data-feed-row] {
  cursor: pointer;
}

.feeds-product-table tbody tr[data-feed-row]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.feed-detail-view {
  display: block;
  padding-bottom: 28px;
}

.feed-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 20px;
  align-items: end;
  margin-bottom: 14px;
}

.feed-detail-back {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.feed-detail-back:hover {
  color: var(--text);
}

.feed-detail-title {
  min-width: 0;
}

.feed-detail-title h1 {
  max-width: 980px;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.65rem, 2.25vw, 2.05rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-detail-meta-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 7px;
}

.feed-detail-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.feed-detail-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef0f2;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
}

.feed-detail-status.is-ready {
  background: #e7f7ed;
  color: #247b4b;
}

.feed-detail-status.is-progress {
  background: #e8f3ff;
  color: #116fc7;
}

.feed-detail-status.is-attention {
  background: #ffeded;
  color: #c52e2e;
}

.feed-detail-head-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.feed-detail-head-actions a {
  text-decoration: none;
}

.feed-detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.feed-detail-metrics article,
.feed-detail-card,
.feed-detail-next-step {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.feed-detail-metrics article {
  min-height: 94px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 15px 18px;
}

.feed-detail-metrics span,
.feed-detail-metrics small {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
}

.feed-detail-metrics strong {
  display: block;
  margin: 6px 0 3px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.15;
}

.feed-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 10px;
}

.feed-detail-card {
  padding: 20px;
}

.feed-detail-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: auto;
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  position: static;
}

.feed-detail-card h2,
.feed-detail-next-step h2 {
  margin: 0;
  font-size: 1.05rem;
}

.feed-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--border);
}

.feed-detail-facts > div {
  min-width: 0;
  padding: 12px 8px 12px 0;
  border-bottom: 1px solid var(--border);
}

.feed-detail-facts dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.64rem;
}

.feed-detail-facts dd {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-detail-note-card > p {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.feed-detail-note-card textarea {
  width: 100%;
  min-height: 126px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid #d8dce1;
  border-radius: 14px;
  outline: 0;
  background: #f8f9fa;
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.5;
}

.feed-detail-note-card textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 131, 248, 0.12);
}

.feed-detail-note-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.feed-detail-note-card footer > span,
.feed-detail-save-status {
  color: var(--muted);
  font-size: 0.62rem;
}

.feed-detail-save-status.is-saved {
  color: var(--success);
}

.feed-detail-next-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 10px;
  padding: 18px 20px;
  background: #f5f8fc;
}

.feed-detail-next-step p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.feed-detail-next-step .btn-primary {
  flex: 0 0 auto;
}

.feed-name-cell strong,
.feed-name-cell small,
.feed-org-cell strong,
.feed-org-cell small,
.feed-date-cell strong,
.feed-date-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-name-cell strong,
.feed-org-cell strong,
.feed-date-cell strong {
  font-size: 0.72rem;
}

.feed-name-cell small,
.feed-org-cell small,
.feed-date-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 400;
}

.feed-name-cell small {
  font-family: var(--font-mono);
}

.feed-status-cell {
  gap: 9px;
}

.feed-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9da2a8;
  box-shadow: 0 0 0 4px #eef0f2;
}

.feed-status-dot.is-ready {
  background: var(--success);
  box-shadow: 0 0 0 4px #e7f7ed;
}

.feed-status-dot.is-progress {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.feed-status-dot.is-attention {
  background: var(--error);
  box-shadow: 0 0 0 4px #fff0ef;
}

.feed-status-cell strong,
.feed-status-cell small {
  display: block;
}

.feed-status-cell strong {
  font-size: 0.7rem;
}

.feed-status-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.59rem;
}

.feed-review-note {
  display: inline-flex;
  margin-top: 4px;
  padding: 3px 5px;
  border-radius: 5px;
  background: #fff5dc;
  color: #8a5b00;
  font-size: 0.57rem;
  font-weight: 600;
}

.feed-car-count {
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: #eef0f2;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
}

.feed-row-actions {
  position: relative;
  justify-content: flex-end;
  gap: 7px;
}

.feed-primary-action {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.65rem;
  white-space: nowrap;
}

.feed-actions {
  position: relative;
}

.feed-actions-trigger {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7d9dc;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
}

.feed-actions-trigger:hover,
.feed-actions.is-open .feed-actions-trigger {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.feed-actions-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  padding: 6px;
  border: 1px solid #d7d9dc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(28, 26, 28, 0.18);
}

.feed-actions-popover a,
.feed-actions-popover button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}

.feed-actions-popover a:hover,
.feed-actions-popover button:hover {
  background: #eef0f2;
}

.feed-actions-popover .feed-action-danger {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  color: var(--error);
}

.feed-lifecycle-panel {
  width: min(590px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(28, 26, 28, 0.24);
}

.feed-lifecycle-panel h2 {
  margin: 7px 0 8px;
  font-size: 1.24rem;
}

.feed-lifecycle-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.feed-lifecycle-warning {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #ffc9c6;
  border-radius: 12px;
  background: #fff5f4;
}

.feed-lifecycle-warning > strong {
  color: #a61b1b;
  font-size: 0.78rem;
}

.feed-lifecycle-warning p {
  margin: 5px 0 10px;
  color: #6d3030;
  font-size: 0.7rem;
  line-height: 1.45;
}

.feed-lifecycle-warning ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-lifecycle-warning li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 7px;
  border-top: 1px solid #f1d7d4;
  font-size: 0.67rem;
}

.feed-lifecycle-warning li span {
  color: #7b6260;
  text-align: right;
}

.feed-lifecycle-retention {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: #f2f3f5;
}

.feed-lifecycle-retention p {
  margin: 0;
  color: #545962;
  font-size: 0.69rem;
  line-height: 1.45;
}

.feed-lifecycle-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.feed-lifecycle-actions button {
  min-height: 40px;
  width: auto;
}

.feeds-loading,
.feeds-empty-state {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
}

.feeds-loading span {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border: 3px solid #dde1e5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: result-spin 0.9s linear infinite;
}

.feeds-loading strong,
.feeds-empty-state strong {
  font-size: 0.78rem;
}

.feeds-empty-state > span {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 11px;
  background: #eef0f2;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.feeds-empty-state.is-error > span {
  background: #fff0ef;
  color: var(--error);
}

.feeds-empty-state p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 0.68rem;
}

.feeds-list-footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
  background: #fafbfc;
  color: var(--muted);
  font-size: 0.64rem;
}

.feeds-list-footer > span:last-child {
  margin-left: auto;
}

.feeds-list-footer strong {
  color: var(--text);
}

.feeds-action-status {
  color: var(--success);
  font-weight: 600;
}

/* Stage 4.2 — company color dictionary */
.colors-view {
  max-width: 1440px;
}

.colors-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 2px 2px 0;
}

.colors-page-head h1 {
  margin: 3px 0 5px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.colors-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-help-trigger {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: help;
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 600;
}

.color-help-trigger:hover,
.color-help-trigger:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.color-help-trigger > span {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  font-size: 0.58rem;
}

.colors-page-head p {
  color: var(--muted);
  font-size: 0.78rem;
}

.colors-page-actions {
  display: flex;
  gap: 8px;
}

.colors-page-actions .btn-primary,
.colors-page-actions .btn-secondary {
  min-width: 152px;
}

.color-learning-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.color-learning-heading,
.color-learning-mode,
.color-import-review {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.color-learning-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
}

.color-learning-heading h2 {
  margin-top: 5px;
  font-size: 1rem;
}

.color-learning-mode {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px 12px;
  padding: 16px;
}

.color-learning-mode .btn-primary,
.color-learning-mode .btn-secondary {
  grid-column: 2;
  width: fit-content;
}

.color-learning-number {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.color-learning-mode strong {
  display: block;
  font-size: 0.78rem;
}

.color-learning-mode p {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.45;
}

.color-import-review {
  margin-bottom: 14px;
  padding: 18px;
  border-color: rgba(22, 131, 248, 0.34);
}

.color-import-review-head,
.color-import-review > footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.color-import-review-head h2 {
  margin: 4px 0;
  font-size: 1rem;
}

.color-import-review-head p,
.color-import-review > footer p {
  color: var(--muted);
  font-size: 0.66rem;
}

.color-import-queue-tabs {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.color-import-queue-tabs button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
}

.color-import-queue-tabs button strong {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef0f2;
  color: var(--text);
  text-align: center;
}

.color-import-queue-tabs button.is-active {
  border-color: rgba(22, 131, 248, 0.48);
  background: #edf6ff;
  color: #0a62b8;
}

.color-import-queue-tabs button:disabled {
  opacity: 0.48;
  cursor: default;
}

.color-import-review-list {
  display: grid;
  gap: 6px;
  margin: 14px 0;
}

.color-import-queue-empty {
  display: grid;
  gap: 4px;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.color-import-queue-empty strong {
  color: var(--text);
  font-size: 0.74rem;
}

.color-import-queue-empty span {
  font-size: 0.64rem;
}

.color-import-review-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 24px minmax(220px, 0.9fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
}

.color-import-source strong,
.color-import-source small,
.color-import-review-row label > span {
  display: block;
}

.color-import-source strong {
  font-size: 0.72rem;
}

.color-import-source small,
.color-import-review-row label > span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.59rem;
}

.color-import-review-row select {
  width: 100%;
  min-height: 36px;
  border-color: #cfd2d6;
  font-size: 0.68rem;
}

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

.color-import-confidence {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.59rem;
  font-weight: 650;
  white-space: nowrap;
}

.color-import-confidence.is-high {
  background: #e7f7ed;
  color: var(--success);
}

.color-import-confidence.is-medium {
  background: #fff3d6;
  color: #8a5a00;
}

.color-import-confidence.is-low {
  background: #fff0ef;
  color: var(--error);
}

.color-import-review > footer {
  align-items: center;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.color-editor-card {
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(520px, 1.5fr);
  gap: 18px 24px;
  margin-bottom: 14px;
  padding: 20px;
  border: 1px solid rgba(22, 131, 248, 0.34);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 26, 28, 0.04);
}

.color-editor-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.color-editor-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 1rem;
  font-weight: 700;
}

.color-editor-intro h2 {
  margin: 2px 0 5px;
  font-size: 1rem;
}

.color-editor-intro p {
  max-width: 290px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.4;
}

.color-editor-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr);
  gap: 12px;
}

.color-editor-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-editor-field > span {
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 600;
}

.color-editor-field > small {
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.35;
}

.color-editor-field input {
  min-height: 44px;
  border-color: #cfd2d6;
  font-size: 0.73rem;
}

.color-editor-field input[readonly] {
  background: #f3f4f5;
  color: var(--muted);
}

.color-canonical-select {
  position: relative;
  min-width: 0;
}

.native-color-select {
  display: none;
}

.color-canonical-trigger {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid #cfd2d6;
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.73rem;
  text-align: left;
}

.color-canonical-trigger:hover,
.color-canonical-select.is-open .color-canonical-trigger {
  border-color: var(--accent);
}

.color-canonical-trigger.has-value {
  border-color: rgba(22, 131, 248, 0.48);
  color: var(--text);
}

.color-canonical-value {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.color-canonical-value > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-canonical-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1rem;
  transition: transform 0.15s ease;
}

.color-canonical-select.is-open .color-canonical-chevron {
  transform: rotate(180deg);
}

.color-swatch {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  background: var(--color-swatch, #d7d9dc);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.color-swatch.is-empty {
  border-style: dashed;
  background: linear-gradient(135deg, #fff 45%, #d7d9dc 46%, #d7d9dc 54%, #fff 55%);
}

.color-canonical-popover {
  position: absolute;
  z-index: 55;
  top: calc(100% + 6px);
  right: 0;
  width: max(100%, 360px);
  padding: 7px;
  border: 1px solid #d7d9dc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(28, 26, 28, 0.18);
}

.color-canonical-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
}

.color-canonical-option {
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.69rem;
  text-align: left;
}

.color-canonical-option:hover,
.color-canonical-option.is-selected {
  background: #eef0f2;
}

.color-option-check {
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
}

.color-editor-error {
  grid-column: 2;
  padding: 9px 11px;
  border-radius: 9px;
  background: #fff1f0;
  color: var(--error);
  font-size: 0.67rem;
}

.color-editor-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.color-editor-actions .btn-primary {
  min-width: 164px;
}

.colors-list-card {
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 26, 28, 0.04);
}

.colors-list-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px 13px;
}

.colors-list-head h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.colors-list-head .hint {
  font-size: 0.7rem;
}

.colors-company-badge {
  max-width: 340px;
  overflow: hidden;
  padding: 7px 10px;
  border-radius: 9px;
  background: #eef0f2;
  color: var(--text);
  font-size: 0.67rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.colors-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.colors-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-filter-chip {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #d7d9dc;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.67rem;
  font-weight: 500;
}

.color-filter-chip:hover {
  border-color: #b8bcc1;
}

.color-filter-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.colors-search {
  width: min(310px, 32%);
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #d7d9dc;
  border-radius: 10px;
  background: #fff;
}

.colors-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.1);
}

.colors-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.colors-search input {
  min-height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.72rem;
}

.colors-table-wrap {
  min-height: 280px;
}

.colors-product-table {
  table-layout: fixed;
  font-size: 0.74rem;
}

.colors-product-table th {
  padding: 11px 14px;
  background: #fff;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 500;
}

.colors-product-table th:nth-child(1) { width: 23%; }
.colors-product-table th:nth-child(2) { width: 25%; }
.colors-product-table th:nth-child(3) { width: 15%; }
.colors-product-table th:nth-child(4) { width: 19%; }
.colors-product-table th:nth-child(5) { width: 18%; }

.colors-product-table td {
  height: 76px;
  padding: 12px 14px;
  border-bottom-color: var(--border);
}

.colors-product-table tbody tr:hover td {
  background: #fafbfc;
}

.color-raw-cell,
.color-canonical-cell,
.color-row-actions {
  display: flex;
  align-items: center;
}

.color-history-event,
.color-history-actor,
.color-history-date {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-history-event-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.color-history-event.is-import .color-history-event-icon {
  background: #f0eafd;
  color: #6941c6;
}

.color-history-event.is-confirmation .color-history-event-icon {
  background: #e7f7ed;
  color: var(--success);
}

.color-history-event.is-deleted .color-history-event-icon {
  background: #fff0ef;
  color: var(--error);
}

.color-history-event strong,
.color-history-event small,
.color-history-subject strong,
.color-history-subject small,
.color-history-actor strong,
.color-history-actor small,
.color-history-date strong,
.color-history-date small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-history-event strong,
.color-history-subject strong,
.color-history-actor strong,
.color-history-date strong {
  font-size: 0.71rem;
}

.color-history-event small,
.color-history-subject small,
.color-history-actor small,
.color-history-date small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.61rem;
}

.color-history-method {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #eef0f2;
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 600;
}

.color-history-method.is-import {
  background: #f0eafd;
  color: #6941c6;
}

.color-history-method.is-confirmation {
  background: #e7f7ed;
  color: var(--success);
}

.color-history-method.is-deleted {
  background: #fff0ef;
  color: var(--error);
}

.color-history-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #eef0f2;
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 700;
}

.color-history-date-filter {
  width: auto;
  min-width: 142px;
  gap: 7px;
}

.color-history-date-filter > span,
.color-history-actor-kicker {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
}

.color-history-date-filter input {
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.color-history-actor-filter {
  width: min(200px, 100%);
  min-width: 190px;
}

.color-history-actor-filter > summary {
  width: 100%;
  outline: 0;
}

.color-history-actor-filter > summary:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.12);
}

.color-history-actor-filter > summary strong {
  min-width: 0;
  flex: 1;
}

.color-history-actor-filter > summary .feed-filter-chevron {
  margin-left: auto;
}

.color-history-actor-popover {
  max-height: min(360px, calc(100vh - 140px));
  overflow-y: auto;
}

.color-history-actor-options label {
  align-items: flex-start;
  padding: 9px 10px;
}

.color-history-actor-options label.is-selected {
  background: var(--accent-soft);
}

.color-history-actor-options label > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.color-history-actor-options strong,
.color-history-actor-options small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-history-actor-options strong {
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 600;
}

.color-history-actor-options small {
  color: var(--muted);
  font-size: 0.6rem;
}

body[data-active-view="colors"] #colorsFilterFields {
  align-content: center;
  align-items: center;
}

body[data-active-view="colors"] .section-filter-bar {
  align-items: flex-start;
}

body[data-active-view="colors"] #colorsFilterFields > .section-filter-control:first-child {
  width: 250px;
  min-width: 180px;
  flex: 0 1 250px;
}

body[data-active-view="colors"] #colorsFilterFields .section-filter-chip-group {
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

body[data-active-view="colors"] #colorsFilterFields .color-history-date-filter {
  width: 142px;
  min-width: 142px;
  flex: 0 0 142px;
}

body[data-active-view="colors"] #colorsFilterFields .color-history-actor-filter {
  width: 200px;
  min-width: 190px;
  flex: 0 0 200px;
}

@media (min-width: 1200px) {
  body[data-active-view="colors"] #colorsFilterFields {
    display: grid;
    flex: 0 1 auto;
    grid-template-columns: 250px max-content 142px 142px;
    gap: 8px;
  }

  body[data-active-view="colors"] #colorsFilterFields > .section-filter-control:first-child,
  body[data-active-view="colors"] #colorsFilterFields .color-history-date-filter {
    width: 100%;
    min-width: 0;
  }

  body[data-active-view="colors"] #colorsFilterFields .color-history-actor-filter {
    grid-column: 1 / span 2;
  }
}

@media (min-width: 1500px) {
  body[data-active-view="colors"] #colorsFilterFields {
    grid-template-columns: 250px max-content 142px 142px 200px;
  }

  body[data-active-view="colors"] #colorsFilterFields .color-history-actor-filter {
    grid-column: auto;
  }
}

.color-raw-cell {
  min-width: 0;
  gap: 10px;
}

.color-raw-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #eef0f2;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
}

.color-raw-cell > div {
  min-width: 0;
}

.color-raw-cell strong,
.color-raw-cell small,
.color-updated-cell strong,
.color-updated-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-raw-cell strong,
.color-updated-cell strong {
  font-size: 0.71rem;
}

.color-raw-cell small,
.color-updated-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 400;
}

.color-canonical-cell {
  gap: 9px;
}

.color-table-swatch {
  width: 24px;
  height: 24px;
}

.color-canonical-cell strong {
  font-size: 0.71rem;
}

.color-source-badge {
  display: inline-flex;
  padding: 6px 8px;
  border-radius: 8px;
  background: #eef0f2;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 600;
  line-height: 1.2;
}

.color-source-badge.is-manual {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.color-source-badge.is-learned {
  background: #e7f7ed;
  color: var(--success);
}

.color-source-badge.is-review {
  background: #fff3d6;
  color: #8a5a00;
}

.color-source-badge.is-import {
  background: #efe9ff;
  color: #6741b8;
}

.color-use-cell {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.color-use-cell strong {
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.color-use-cell small {
  color: var(--muted);
  font-size: 0.58rem;
}

.color-row-actions {
  position: relative;
  justify-content: flex-end;
  gap: 7px;
}

.color-edit-action {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.64rem;
}

.color-actions {
  position: relative;
}

.color-actions-trigger {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7d9dc;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
}

.color-actions-trigger:hover,
.color-actions.is-open .color-actions-trigger {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.color-actions-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  right: 0;
  width: 205px;
  padding: 6px;
  border: 1px solid #d7d9dc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(28, 26, 28, 0.18);
}

.color-actions-popover button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 500;
  text-align: left;
}

.color-actions-popover button:hover {
  background: #eef0f2;
}

.color-actions-popover .color-action-danger {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  color: var(--error);
}

.colors-loading,
.colors-empty-state {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
}

.colors-loading span {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border: 3px solid #dde1e5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: result-spin 0.9s linear infinite;
}

.colors-loading strong,
.colors-empty-state strong {
  font-size: 0.78rem;
}

.colors-empty-state > span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 11px;
  background: #eef0f2;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.colors-empty-state p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 0.68rem;
}

.colors-empty-state .btn-secondary {
  min-height: 34px;
  font-size: 0.65rem;
}

.colors-list-footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
  background: #fafbfc;
  color: var(--muted);
  font-size: 0.64rem;
}

.colors-list-footer > span:last-child {
  margin-left: auto;
}

.colors-list-footer strong {
  color: var(--text);
}

.colors-action-status {
  color: var(--success);
  font-weight: 600;
}

.colors-action-status.is-error {
  color: var(--error);
}

.color-delete-panel {
  width: min(440px, 100%);
  padding: 28px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 24px 70px rgba(28, 26, 28, 0.28);
}

.color-delete-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 13px;
  border-radius: 50%;
  background: #fff0ef;
  color: var(--error);
  font-size: 1.2rem;
  font-weight: 700;
}

.color-delete-panel h2 {
  margin: 4px 0 8px;
  font-size: 1.15rem;
}

.color-delete-panel p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.color-delete-panel p strong {
  color: var(--text);
}

.color-delete-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.color-delete-actions .btn-secondary,
.color-delete-actions .btn-danger {
  min-width: 150px;
}

/* Stage 4.3 — audit and administration */
.audit-view {
  max-width: 1440px;
}

.audit-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 2px 2px 0;
}

.audit-page-head h1 {
  margin: 3px 0 5px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.audit-page-head p {
  color: var(--muted);
  font-size: 0.78rem;
}

.audit-page-actions .btn-secondary {
  min-width: 130px;
}

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

.audit-summary-card {
  min-width: 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.audit-summary-card:hover {
  border-color: #c3c6ca;
  transform: translateY(-1px);
}

.audit-summary-card.is-active {
  border-color: rgba(22, 131, 248, 0.5);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.audit-summary-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #eef0f2;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
}

.audit-summary-card.is-feeds .audit-summary-icon {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.audit-summary-card.is-access .audit-summary-icon {
  background: #eee9f8;
  color: #665093;
}

.audit-summary-card.is-attention .audit-summary-icon {
  background: #fff0ef;
  color: var(--error);
}

.audit-summary-card small,
.audit-summary-card strong {
  display: block;
}

.audit-summary-card small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.audit-summary-card strong {
  margin-top: 5px;
  font-size: 1.35rem;
  line-height: 1;
}

.audit-operations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.audit-operation-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.audit-operation-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #eef0f2;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.audit-operation-icon.is-backup {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.audit-operation-icon.is-cleanup {
  background: #fff6de;
  color: var(--warning);
}

.audit-operation-card h2 {
  margin: 2px 0 4px;
  font-size: 0.8rem;
}

.audit-operation-card p {
  max-width: 420px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.35;
}

.audit-operation-card .btn-secondary {
  min-width: 132px;
  padding: 9px 12px;
  font-size: 0.66rem;
}

.audit-list-card,
.user-admin {
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 26, 28, 0.04);
}

.audit-list-head,
.users-list-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px 13px;
}

.audit-list-head h2,
.users-list-head h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.audit-list-head .hint,
.users-list-head .hint {
  font-size: 0.7rem;
}

.audit-loaded-badge {
  padding: 7px 10px;
  border-radius: 9px;
  background: #eef0f2;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 600;
  white-space: nowrap;
}

.audit-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.audit-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.audit-filter-chip {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #d7d9dc;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 500;
}

.audit-filter-chip:hover {
  border-color: #b8bcc1;
}

.audit-filter-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.audit-search {
  width: min(310px, 28%);
  min-width: 235px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #d7d9dc;
  border-radius: 10px;
  background: #fff;
}

.audit-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.1);
}

.audit-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.audit-search input {
  min-height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.7rem;
}

.audit-table-wrap {
  min-height: 300px;
}

.audit-product-table {
  table-layout: fixed;
  font-size: 0.72rem;
}

.audit-product-table th {
  padding: 11px 14px;
  background: #fff;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 500;
}

.audit-product-table th:nth-child(1) { width: 12%; }
.audit-product-table th:nth-child(2) { width: 17%; }
.audit-product-table th:nth-child(3) { width: 23%; }
.audit-product-table th:nth-child(4) { width: 17%; }
.audit-product-table th:nth-child(5) { width: 31%; }

.audit-product-table td {
  height: 76px;
  padding: 12px 14px;
  border-bottom-color: var(--border);
  vertical-align: middle;
}

.audit-product-table tbody tr:hover td {
  background: #fafbfc;
}

.audit-time-cell strong,
.audit-time-cell small,
.audit-object-cell strong,
.audit-object-cell small,
.user-created-cell strong,
.user-created-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-time-cell strong,
.audit-object-cell strong,
.user-created-cell strong {
  font-size: 0.68rem;
}

.audit-time-cell small,
.audit-object-cell small,
.user-created-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 400;
}

.audit-actor-cell,
.audit-event-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.audit-actor-cell > span {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #2c292c;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
}

.audit-actor-cell > div,
.audit-event-cell > div {
  min-width: 0;
}

.audit-actor-cell strong,
.audit-actor-cell small,
.audit-event-cell strong,
.audit-event-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-actor-cell strong,
.audit-event-cell strong {
  font-size: 0.68rem;
}

.audit-actor-cell small,
.audit-event-cell small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.58rem;
}

.audit-event-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #eef0f2;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.53rem;
  font-weight: 700;
}

.audit-event-icon.is-feeds {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.audit-event-icon.is-access {
  background: #eee9f8;
  color: #665093;
}

.audit-event-icon.is-system {
  background: #fff6de;
  color: var(--warning);
}

.audit-event-icon.is-attention {
  background: #fff0ef;
  color: var(--error);
}

.audit-event-icon.is-data {
  background: #e7f7ed;
  color: var(--success);
}

.audit-detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.audit-detail-list span {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.audit-detail-list small {
  color: var(--muted);
  font-size: 0.55rem;
}

.audit-detail-list strong {
  max-width: 150px;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-loading,
.audit-empty-state {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
}

.audit-loading span {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border: 3px solid #dde1e5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: result-spin 0.9s linear infinite;
}

.audit-loading strong,
.audit-empty-state strong {
  font-size: 0.78rem;
}

.audit-empty-state > span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 11px;
  background: #eef0f2;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.audit-empty-state p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 0.68rem;
}

.audit-empty-state .btn-secondary {
  min-height: 34px;
  font-size: 0.65rem;
}

.audit-list-footer,
.users-list-footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
  background: #fafbfc;
  color: var(--muted);
  font-size: 0.64rem;
}

.audit-list-footer > span:last-child,
.users-list-footer > span:last-child {
  margin-left: auto;
}

.audit-list-footer strong {
  color: var(--text);
}

.audit-action-status,
.users-action-status {
  color: var(--success);
  font-weight: 600;
}

.audit-action-status.is-error,
.users-action-status.is-error {
  color: var(--error);
}

.user-admin {
  margin-top: 14px;
  padding: 0;
  border-top: 1px solid var(--border);
}

.users-list-head .btn-primary {
  min-width: 176px;
}

.users-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  padding: 0 20px 14px;
  background: #fff;
}

.users-summary > span {
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: #fafbfc;
}

.users-summary > span:first-child {
  border-radius: 11px 0 0 11px;
}

.users-summary > span:last-child {
  border-radius: 0 11px 11px 0;
}

.users-summary small {
  color: var(--muted);
  font-size: 0.61rem;
}

.users-summary strong {
  margin-top: 4px;
  font-size: 1rem;
}

.user-editor-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px 24px;
  margin: 0 20px 14px;
  padding: 18px;
  border: 1px solid rgba(22, 131, 248, 0.34);
  border-radius: 14px;
  background: #fff;
}

.user-editor-modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  margin: 0;
  padding: 24px;
  border-color: var(--border);
  box-shadow: 0 24px 70px rgba(28, 26, 28, 0.24);
}

.user-editor-modal-card .user-role-fieldset {
  grid-column: 1 / -1;
}

.user-editor-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.user-editor-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
}

.user-editor-head h3 {
  margin: 2px 0 4px;
  font-size: 0.86rem;
}

.user-editor-head p {
  color: var(--muted);
  font-size: 0.63rem;
  line-height: 1.4;
}

.user-editor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 11px;
}

.user-editor-fields label,
.user-role-fieldset,
.user-password-panel label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 0;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 600;
}

.user-editor-fields input,
.user-password-panel input {
  min-height: 42px;
  border-color: #cfd2d6;
  font-size: 0.71rem;
}

.user-role-fieldset legend {
  margin-bottom: 6px;
  font-size: 0.68rem;
}

.native-user-role {
  display: none;
}

.user-role-segments {
  min-height: 42px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #eef0f2;
}

.user-role-segments button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 600;
}

.user-role-segments button.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 4px rgba(28, 26, 28, 0.12);
}

.user-editor-error {
  grid-column: 2;
  padding: 9px 11px;
  border-radius: 9px;
  background: #fff1f0;
  color: var(--error);
  font-size: 0.66rem;
}

.user-editor-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.user-editor-actions .btn-primary {
  min-width: 170px;
}

.users-table-wrap {
  min-height: 160px;
  border-top: 1px solid var(--border);
}

.users-product-table {
  table-layout: fixed;
  font-size: 0.72rem;
}

.users-product-table th {
  padding: 11px 14px;
  background: #fff;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 500;
}

.users-product-table th:nth-child(1) { width: 37%; }
.users-product-table th:nth-child(2) { width: 16%; }
.users-product-table th:nth-child(3) { width: 14%; }
.users-product-table th:nth-child(4) { width: 18%; }
.users-product-table th:nth-child(5) { width: 15%; }

.users-product-table td {
  height: 76px;
  padding: 12px 14px;
  border-bottom-color: var(--border);
}

.users-product-table tbody tr:hover td {
  background: #fafbfc;
}

.user-identity-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-identity-cell > div {
  min-width: 0;
}

.user-identity-cell strong,
.user-identity-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-identity-cell strong {
  font-size: 0.7rem;
}

.user-identity-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 400;
}

.user-self-badge {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.52rem;
  vertical-align: middle;
}

.user-role-badge,
.user-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #eef0f2;
  color: var(--text);
  font-size: 0.61rem;
  font-weight: 600;
}

.user-role-badge.is-admin {
  background: #eee9f8;
  color: #665093;
}

.user-role-badge.is-supervisor {
  background: #e8f3ff;
  color: #116fc7;
}

.user-status-badge > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.user-status-badge.is-active {
  background: #e7f7ed;
  color: var(--success);
}

.user-status-badge.is-active > span {
  background: var(--success);
}

.user-status-badge.is-inactive {
  color: var(--muted);
}

.user-status-badge.is-inactive > span {
  background: #969ba1;
}

.user-row-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.user-current-note {
  color: var(--muted);
  font-size: 0.59rem;
}

.user-actions-trigger {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7d9dc;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
}

.user-actions-trigger:hover,
.user-row-actions.is-open .user-actions-trigger {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.user-actions-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  right: 0;
  width: 230px;
  padding: 6px;
  border: 1px solid #d7d9dc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(28, 26, 28, 0.18);
}

.user-actions-popover button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.67rem;
  font-weight: 500;
  text-align: left;
}

.user-actions-popover button:hover {
  background: #eef0f2;
}

.user-actions-popover .user-action-danger,
.user-actions-popover .user-action-success {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
}

.user-actions-popover .user-action-danger {
  color: var(--error);
}

.user-actions-popover .user-action-success {
  color: var(--success);
}

.operation-confirm-panel {
  width: min(470px, 100%);
  padding: 28px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 24px 70px rgba(28, 26, 28, 0.28);
}

.operation-confirm-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 13px;
  border-radius: 50%;
  background: #fff6de;
  color: var(--warning);
  font-size: 1.1rem;
  font-weight: 700;
}

.operation-confirm-icon.is-access {
  background: #eee9f8;
  color: #665093;
}

.operation-confirm-panel h2 {
  margin: 4px 0 8px;
  font-size: 1.15rem;
}

.operation-confirm-panel > p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.operation-confirm-panel > p strong {
  color: var(--text);
}

.operation-confirm-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 18px;
  padding: 12px;
  border-radius: 10px;
  background: #fff6de;
  color: #7d5400;
  text-align: left;
}

.operation-confirm-note strong {
  font-size: 0.68rem;
}

.operation-confirm-note span {
  font-size: 0.63rem;
}

.operation-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.operation-confirm-actions .btn-secondary,
.operation-confirm-actions .btn-danger,
.operation-confirm-actions .btn-primary {
  min-width: 160px;
}

@media (max-width: 520px) {
  .operation-confirm-panel {
    padding: 22px;
  }

  .operation-confirm-actions {
    flex-direction: column;
  }

  .operation-confirm-actions .btn-secondary,
  .operation-confirm-actions .btn-danger,
  .operation-confirm-actions .btn-primary {
    width: 100%;
    min-width: 0;
  }
}

.user-password-panel {
  text-align: left;
}

.user-password-panel .operation-confirm-icon,
.user-password-panel > .section-kicker,
.user-password-panel h2,
.user-password-panel > p {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.user-password-panel label {
  margin-top: 18px;
}

.user-password-panel .user-editor-error {
  margin-top: 8px;
}

/* Stage 4.4 — authentication and personal account */
main.auth-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  grid-template-columns: minmax(480px, 1.08fr) minmax(480px, 0.92fr);
  place-items: stretch;
  padding: 0;
  overflow: hidden;
  background: var(--page);
}

main.auth-shell::before {
  content: none;
}

.auth-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  padding: 38px 48px 34px;
  color: #fff;
  background:
    radial-gradient(circle at 78% 24%, rgba(22, 131, 248, 0.25), transparent 30%),
    linear-gradient(145deg, #1c1a1c 0%, #292629 58%, #151415 100%);
}

.auth-visual::after {
  position: absolute;
  z-index: -1;
  right: -160px;
  bottom: -250px;
  width: 720px;
  height: 720px;
  background: url("/static/assets/brand/arb-car-sand.svg") center / contain no-repeat;
  content: "";
  opacity: 0.23;
  transform: rotate(-6deg);
}

.auth-visual-logo {
  display: block;
  width: 164px;
  height: auto;
}

.auth-visual-copy {
  width: min(100%, 760px);
  margin: auto 0;
  padding: 72px 0;
}

.auth-visual-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3rem, 4.7vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.auth-visual-copy h1 span {
  display: block;
}

.auth-visual-copy h1 span + span {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
}

.auth-visual-copy > p {
  max-width: 620px;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: clamp(1.05rem, 1.35vw, 1.35rem);
  line-height: 1.35;
}

.auth-password-rule {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.auth-password-rule > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
}

.auth-password-rule p {
  margin: 0;
}

.auth-password-rule strong,
.auth-password-rule small {
  display: block;
}

.auth-panel {
  align-self: center;
  justify-self: center;
  width: min(560px, calc(100% - 64px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 30px 34px 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(28, 26, 28, 0.12);
}

.auth-brand {
  margin-bottom: 34px;
}

.auth-form-head {
  margin-bottom: 22px;
}

.auth-form-head .section-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

.auth-form-head h2 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.auth-form-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.auth-form > label,
.auth-setup-grid label {
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
}

.auth-form > label + label {
  margin-top: 14px;
}

.auth-form-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

.auth-form-links .auth-text-button {
  margin: 0;
}

.auth-form input {
  height: 44px;
  border-color: #d3d5d8;
  border-radius: 9px;
  background: #fff;
}

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

.auth-setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.auth-setup-grid label:first-child,
.auth-setup-grid label:nth-child(2) {
  grid-column: span 1;
}

.auth-setup-grid label:nth-child(3) {
  grid-column: 1 / -1;
}

.auth-password-rule {
  margin-top: 16px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #f0f1f2;
}

.auth-password-rule > span {
  color: var(--muted);
  background: #fff;
}

.auth-password-rule strong {
  color: var(--text);
  font-size: 0.75rem;
}

.auth-password-rule small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.auth-form .form-error {
  min-height: 0;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: #b42318;
  background: #fff0ef;
}

.auth-submit {
  height: 44px;
  margin-top: 14px;
  border-radius: 9px;
}

.auth-text-button {
  width: fit-content;
  margin: 12px auto 0;
  padding: 4px;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
}

.auth-text-button:hover,
.auth-text-button:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.sidebar-notification-badge {
  position: absolute;
  top: 5px;
  right: 3px;
  z-index: 2;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid #1c1a1c;
  border-radius: 999px;
  color: #fff;
  background: #e60000;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
}

.profile-panel {
  position: relative;
  isolation: isolate;
  width: min(960px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 92% 5%, rgba(230, 0, 0, 0.34), transparent 34%),
    radial-gradient(circle at 18% 82%, rgba(219, 208, 195, 0.1), transparent 32%),
    linear-gradient(145deg, #3b2024 0%, #272326 38%, #1c1a1c 100%);
  box-shadow: 0 30px 90px rgba(14, 12, 13, 0.48);
}

.profile-panel::before {
  position: absolute;
  right: 20px;
  bottom: 46px;
  z-index: 0;
  width: min(520px, 58%);
  aspect-ratio: 390 / 200;
  background: url("/static/assets/brand/arb-car-sand.svg") center / contain no-repeat;
  content: "";
  opacity: 0.09;
  pointer-events: none;
}

.profile-head {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(28, 26, 28, 0.24);
  backdrop-filter: blur(12px);
}

.profile-head .section-kicker {
  color: var(--sand);
}

.profile-head h2 {
  margin: 3px 0 4px;
  color: #fff;
  font-size: 1.45rem;
}

.profile-panel .modal-close {
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.08);
}

.profile-panel .modal-close:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.profile-layout {
  position: relative;
  z-index: 1;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - 144px);
  min-height: 0;
  max-height: calc(100vh - 144px);
}

.profile-summary {
  align-self: stretch;
  min-height: 0;
  padding: 28px 22px 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: rgba(28, 26, 28, 0.14);
  backdrop-filter: blur(8px);
}

.profile-form {
  overflow-y: auto;
  padding: 18px 22px 0;
}

.profile-section {
  margin-bottom: 12px;
  padding: 4px 0 20px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.profile-section + .profile-section {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.profile-section-head > div {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
}

.profile-section-head > div > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.09);
  font-size: 0.66rem;
  font-weight: 800;
}

.profile-section-head h3,
.profile-admin-tools h3 {
  margin: 0;
  font-size: 0.88rem;
}

.profile-admin-tools p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
}

.profile-fields {
  margin-top: 16px;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.profile-fields label {
  color: rgba(255, 255, 255, 0.72);
}

.profile-fields label:nth-child(2) {
  grid-column: auto;
}

.profile-email-field {
  grid-column: 1 / -1;
}

.profile-fields input {
  height: 42px;
  border-radius: 8px;
}

.profile-fields input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.profile-fields input:disabled {
  color: var(--muted);
  background: #f0f1f2;
}

.avatar-picker {
  margin-top: 15px;
}

.avatar-grid {
  grid-template-columns: repeat(5, minmax(58px, 1fr));
}

.avatar-option {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.avatar-option:hover {
  background: transparent;
}

.avatar-option.selected {
  color: #006bd6;
  background: transparent;
  box-shadow: none;
}

.avatar-option:hover .avatar {
  box-shadow:
    0 0 0 2px rgba(22, 131, 248, 0.34),
    0 6px 14px rgba(28, 26, 28, 0.16);
}

.avatar-option.selected .avatar,
.avatar-option:focus-visible .avatar {
  box-shadow:
    0 0 0 3px var(--accent),
    0 6px 14px rgba(28, 26, 28, 0.18);
}

.avatar-option:focus-visible {
  outline: 0;
}

.profile-admin-tools {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.profile-admin-tools-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
}

.profile-admin-tools .btn-secondary {
  min-width: 174px;
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.profile-admin-tools .btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.16);
}

.password-change-icon,
.logout-confirm-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
  background: #e4e6e9;
  font-size: 0.78rem;
  font-weight: 800;
}

.profile-message {
  min-height: 0;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
}

.profile-message.form-error {
  background: #fff0ef;
}

.profile-message.form-success {
  background: #edf8f0;
}

.password-change-panel,
.logout-confirm-panel {
  width: min(440px, 100%);
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(28, 26, 28, 0.24);
}

.password-change-panel > .section-kicker,
.logout-confirm-panel > .section-kicker {
  display: block;
  margin-top: 18px;
  color: var(--muted);
}

.password-change-panel h2,
.logout-confirm-panel h2 {
  margin: 6px 0 7px;
  font-size: 1.35rem;
}

.password-change-panel > p,
.logout-confirm-panel > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.password-change-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 13px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
}

.password-change-panel input {
  height: 42px;
  border-radius: 8px;
}

.password-change-panel .form-error {
  min-height: 0;
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff0ef;
}

.password-change-actions,
.logout-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.password-change-actions button,
.logout-confirm-actions button {
  min-width: 120px;
}

/* Utilities */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hidden {
  display: none !important;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.warning-banner {
  margin: 12px 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid #f5c26b;
  background: #fff8e6;
  color: #8a5b00;
  font-size: 0.88rem;
  line-height: 1.45;
}

.validation-panel {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
}

.validation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

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

.validation-head .subheading {
  margin: 0 0 5px;
}

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

.validation-table input {
  width: 100%;
  min-width: 150px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #fff;
}

.issue-blocking {
  color: var(--error);
  font-weight: 700;
}

.issue-review {
  color: var(--warning);
  font-weight: 700;
}

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

.generation-blocker {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(180, 35, 24, 0.34);
  border-radius: var(--radius-sm);
  background: #fff1f0;
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}

.needs-attention {
  outline: 3px solid rgba(180, 35, 24, 0.2);
  outline-offset: 2px;
}

select.field-error {
  border-color: var(--error);
  background: #fff7f6;
}

.subheading {
  margin: 18px 0 8px;
  font-size: 0.98rem;
  line-height: 1.25;
  color: var(--text);
}

/* Step 3.4 — vehicle review */
#reviewStage {
  background: #f4f5f6;
}

.review-stage-head {
  scroll-margin-top: 72px;
  background: #fff;
}

.review-stage-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.review-context-bar {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(240px, 1.4fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.review-context-bar > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 26px;
  border-right: 1px solid var(--border);
}

.review-context-bar > span:last-child {
  border-right: 0;
}

.review-context-bar small {
  color: var(--muted);
  font-size: 0.65rem;
}

.review-context-bar strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-stage-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 26px 32px;
}

.validation-panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.review-outcome {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid #f0c4bf;
  border-radius: 18px 18px 0 0;
  background: #fff;
}

.review-outcome.is-ready {
  border-color: #a9dcc0;
}

.review-outcome.is-review {
  border-color: #efd39a;
}

.review-outcome.is-loading {
  border-color: var(--border);
}

.review-outcome-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff1f0;
  color: var(--error);
  font-size: 1.25rem;
  font-weight: 700;
}

.review-outcome.is-ready .review-outcome-icon {
  background: #e7f7ed;
  color: var(--success);
}

.review-outcome.is-review .review-outcome-icon {
  background: #fff6de;
  color: #9b6500;
}

.review-outcome.is-loading .review-outcome-icon {
  background: #eef0f2;
  color: var(--muted);
}

.review-outcome h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.review-outcome .hint {
  line-height: 1.4;
}

.review-outcome .btn-secondary {
  min-width: 158px;
  gap: 7px;
}

.review-progress {
  height: 4px;
  overflow: hidden;
  background: #e7e9ec;
}

.review-progress span {
  height: 100%;
  display: block;
  width: 0;
  background: var(--success);
  transition: width 0.25s ease;
}

.validation-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: var(--border);
}

.validation-metrics .metric {
  min-width: 0;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding: 15px 18px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.validation-metrics .metric:hover,
.validation-metrics .metric.is-active {
  background: #f1f6fd;
  box-shadow: inset 0 -3px 0 var(--accent);
}

.validation-metrics .metric span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.validation-metrics .metric strong {
  font-size: 1.45rem;
  line-height: 1;
}

.review-issues-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
}

.review-issues-head h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.review-issues-head > div > span {
  color: var(--muted);
  font-size: 0.72rem;
}

.validation-actions {
  align-items: center;
}

.btn-quiet {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
}

.btn-quiet:hover {
  color: var(--text);
}

.review-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0;
}

.review-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-filter-chip {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #d7d9dc;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
}

.review-filter-chip:hover {
  border-color: #b9bdc1;
}

.review-filter-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.review-search {
  width: min(280px, 34%);
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #d7d9dc;
  border-radius: 10px;
  background: #fff;
}

.review-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.1);
}

.review-search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.review-search input {
  min-height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.76rem;
}

.validation-issue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.validation-global-issues {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.validation-global-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #d7d9dc;
  border-left: 4px solid #7f858c;
  border-radius: 14px;
  background: #fff;
}

.validation-global-card.is-error {
  border-left-color: var(--error);
  background: #fffafa;
}

.validation-global-card.is-review {
  border-left-color: #e1a321;
  background: #fffdf7;
}

.validation-global-card small,
.validation-global-card strong {
  display: block;
}

.validation-global-card small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.64rem;
}

.validation-global-card strong {
  font-size: 0.78rem;
}

.validation-global-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.validation-global-action {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 700px) {
  .validation-global-card {
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
  }

  .validation-global-action {
    grid-column: 2;
    justify-content: stretch;
  }

  .validation-global-action .btn-table {
    width: 100%;
  }
}

.vehicle-review-card {
  overflow: visible;
  border: 1px solid var(--border);
  border-left: 4px solid #c6c9cd;
  border-radius: 14px;
  background: #fff;
}

.vehicle-review-card.is-error {
  border-left-color: var(--error);
}

.vehicle-review-card.is-review {
  border-left-color: #e1a321;
}

.vehicle-review-card.is-warning {
  border-left-color: #7f858c;
}

.vehicle-review-card.is-ready {
  border-left-color: var(--success);
}

.vehicle-review-head {
  position: static;
  height: auto;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  background: #fff;
  color: var(--text);
  box-shadow: none;
}

.vehicle-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.vehicle-row-number {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #eef0f2;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.vehicle-title div {
  min-width: 0;
}

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

.vehicle-title strong {
  font-size: 0.85rem;
}

.vehicle-title small {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.review-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 8px;
  background: #eef0f2;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 600;
  white-space: nowrap;
}

.review-status-pill.is-error {
  background: #fff0ef;
  color: var(--error);
}

.review-status-pill.is-review {
  background: #fff5dc;
  color: #8a5b00;
}

.review-status-pill.is-warning {
  background: #eef0f2;
  color: #5d6268;
}

.review-status-pill.is-ready {
  background: #e7f7ed;
  color: var(--success);
}

.vehicle-review-badges {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.vin-source-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 8px;
  color: #1267a8;
  background: #eaf4fc;
  font-size: 0.64rem;
  font-weight: 600;
  white-space: nowrap;
}

.vin-source-pill.not_found,
.vin-source-pill.not_configured,
.vin-source-pill.unauthorized,
.vin-source-pill.unavailable,
.vin-source-pill.rate_limited,
.vin-source-pill.invalid_response {
  color: #5d6268;
  background: #eef0f2;
}

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

.vin-conflict-actions .btn-table {
  max-width: 100%;
  white-space: normal;
  text-align: left;
}

.vehicle-issue-list {
  border-top: 1px solid var(--border);
}

.vehicle-issue {
  display: grid;
  grid-template-columns: 24px minmax(220px, 0.9fr) minmax(280px, 1.1fr);
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.vehicle-issue:last-child {
  border-bottom: 0;
}

.vehicle-issue-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef0f2;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.vehicle-issue-icon.is-error {
  background: #fff0ef;
  color: var(--error);
}

.vehicle-issue-icon.is-review {
  background: #fff5dc;
  color: #8a5b00;
}

.vehicle-issue-copy strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.74rem;
}

.vehicle-issue-copy p,
.vehicle-ready-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.field-decision-evidence {
  display: block;
  margin-top: 5px;
  color: #747a82;
  font-size: 0.64rem;
  line-height: 1.35;
}

.result-acceptance-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}

.result-acceptance-card h3,
.result-acceptance-card p {
  margin: 0;
}

.result-acceptance-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.acceptance-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.acceptance-choice button {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
}

.acceptance-choice button.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.acceptance-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.68rem;
}

.acceptance-field input,
.acceptance-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  resize: vertical;
}

.acceptance-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.7rem;
}

.vehicle-issue-action {
  min-width: 0;
}

.review-inline-editor {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
}

.review-inline-editor span {
  color: var(--muted);
  font-size: 0.65rem;
}

.review-inline-editor input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d7d9dc;
  border-radius: 9px;
  background: #fff;
  font-size: 0.74rem;
}

.review-inline-editor input:focus {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.1);
}

.review-inline-link {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
}

.review-help-text {
  color: var(--muted);
  font-size: 0.7rem;
}

.vehicle-ready-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

.vehicle-ready-note > span {
  color: var(--success);
  font-weight: 700;
}

.vehicle-ready-note strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.74rem;
}

.review-empty {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  border: 1px dashed #cfd2d6;
  border-radius: 14px;
  background: rgba(255,255,255,0.6);
  text-align: center;
}

.review-empty > span {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: 50%;
  background: #e7f7ed;
  color: var(--success);
  font-weight: 700;
}

.review-empty strong {
  font-size: 0.8rem;
}

.review-empty p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.review-resolution-panel {
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.resolution-panel-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.resolution-panel-head h3 {
  margin: 2px 0 3px;
  font-size: 0.9rem;
}

.resolution-panel-head p {
  color: var(--muted);
  font-size: 0.7rem;
}

.resolution-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: #e9eef5;
  color: var(--accent-strong);
  font-size: 1.1rem;
  font-weight: 700;
}

.resolution-icon-color {
  background: linear-gradient(135deg, #eb5757, #f2c94c 34%, #27ae60 66%, #2f80ed);
  color: #fff;
}

.resolution-counter {
  padding: 6px 9px;
  border-radius: 8px;
  background: #eef0f2;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.resolution-list {
  position: relative;
}

.resolution-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px minmax(260px, 0.9fr);
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.resolution-row:last-child {
  border-bottom: 0;
}

.resolution-source {
  display: flex;
  align-items: center;
  gap: 11px;
}

.color-source-swatch {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid #d6d8dc;
  border-radius: 50%;
  background: linear-gradient(135deg, #dde0e4 50%, #b9bec4 50%);
}

.resolution-source strong,
.resolution-source small {
  display: block;
}

.resolution-source strong {
  font-size: 0.78rem;
}

.resolution-source small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
}

.review-select {
  position: relative;
  min-width: 0;
}

.review-select-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid #cfd2d6;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.73rem;
  text-align: left;
}

.review-select-trigger:hover,
.review-select.is-open .review-select-trigger {
  border-color: var(--accent);
}

.review-select-trigger.has-value {
  border-color: rgba(22, 131, 248, 0.48);
  background: var(--accent-soft);
}

.review-select-chevron {
  color: var(--muted);
  font-size: 1rem;
}

.review-select-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  width: max(100%, 280px);
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #d7d9dc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(24, 23, 25, 0.16);
}

.review-select-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  text-align: left;
}

.review-select-option:hover,
.review-select-option.is-selected {
  background: #eef0f2;
}

.review-option-check {
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
}

.color-dot {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 50%;
  background: linear-gradient(135deg, #f2f3f5 50%, #92979e 50%);
}

.review-select-empty {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

.catalog-resolution-row {
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.3fr) auto;
}

.catalog-vehicle small,
.catalog-vehicle strong,
.catalog-vehicle span {
  display: block;
}

.catalog-vehicle small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.63rem;
}

.catalog-vehicle strong {
  font-size: 0.78rem;
}

.catalog-vehicle span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.67rem;
}

.review-catalog-option {
  min-height: 54px;
}

.review-catalog-option > span {
  min-width: 0;
}

.review-catalog-option strong,
.review-catalog-option small {
  display: block;
}

.review-catalog-option strong {
  font-size: 0.72rem;
}

.review-catalog-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.63rem;
}

.review-stage-actions {
  background: rgba(255, 255, 255, 0.96);
}

.review-stage-actions .btn-secondary {
  min-width: 110px;
}

.review-stage-actions .btn-primary:disabled {
  border-color: #d8dade;
  background: #d8dade;
  color: #8a8e93;
  cursor: not-allowed;
  transform: none;
}

#colorReviewInlineError,
#generationBlocker {
  margin: 12px 18px;
}

@media (max-width: 860px) {
  main.auth-shell {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    grid-template-columns: 1fr;
    place-items: stretch;
    padding: 0;
  }

  .auth-visual {
    min-height: 280px;
    padding: 24px;
  }

  .auth-visual::after {
    right: -90px;
    bottom: -180px;
    width: 420px;
    height: 420px;
    opacity: 0.16;
  }

  .auth-visual-logo {
    width: 142px;
  }

  .auth-visual-copy {
    margin: auto 0 0;
    padding: 48px 0 6px;
  }

  .auth-visual-copy h1 {
    font-size: clamp(2.15rem, 10vw, 3rem);
    line-height: 0.96;
  }

  .auth-visual-copy h1 span + span {
    margin-top: 5px;
  }

  .auth-visual-copy > p {
    margin-top: 18px;
    font-size: 0.95rem;
  }

  .auth-panel {
    align-self: stretch;
    width: 100%;
    max-height: none;
    padding: 30px 20px 40px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-form-links {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  header {
    height: auto;
    min-height: 64px;
    padding: 14px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }

  nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .user-controls {
    margin-left: auto;
  }

  .current-user-copy small {
    display: none;
  }

  #profileModal {
    place-items: start center;
    overflow-y: auto;
  }

  #profileModal .profile-panel {
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  #profileModal .profile-panel::before {
    right: 5%;
    bottom: 12%;
    width: 90%;
    opacity: 0.07;
  }

  #profileModal .profile-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }

  #profileModal .profile-form {
    overflow-y: visible;
  }

  #createUserModal {
    place-items: start center;
    overflow-y: auto;
    padding: 12px;
  }

  .user-editor-modal-card {
    width: 100%;
    max-height: none;
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .user-editor-modal-card .user-editor-fields {
    grid-template-columns: 1fr;
  }

  .user-editor-modal-card .user-editor-error {
    grid-column: 1;
  }

  .profile-summary {
    min-height: 0;
    padding: 22px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  main {
    width: min(100% - 20px, 1240px);
    margin-top: 12px;
  }

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

  .steps {
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

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

  .upload-sidebar {
    border-top: 1px solid var(--border);
    border-left: none;
  }

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

  .dictionary-add {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .workspace-grid,
  .overview-metrics,
  .validation-metrics {
    grid-template-columns: 1fr;
  }

  .validation-head {
    flex-direction: column;
  }

  .validation-actions {
    width: 100%;
    flex-direction: column;
  }

  .profile-strip {
    grid-template-columns: 1fr;
  }

  .profile-actions-grid {
    grid-template-columns: 1fr;
  }

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

  .feeds-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .overview-head {
    flex-direction: column;
  }

  .recent-feed {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .actions,
  .feeds-header,
  .url-box {
    flex-direction: column;
    align-items: stretch;
  }

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

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

  .btn-copy,
  .btn-del {
    width: 100%;
  }

  .operations-actions {
    flex-direction: column;
  }

  .feed-url-cell {
    max-width: 200px;
  }
}

@media (max-width: 560px) {
  .current-user-copy {
    display: none;
  }

  .profile-trigger {
    padding-right: 5px;
  }

  .profile-fields {
    grid-template-columns: 1fr;
  }

  .profile-fields label:nth-child(2) {
    grid-column: auto;
  }

  .avatar-grid {
    grid-template-columns: repeat(3, minmax(58px, 1fr));
  }

  .profile-email-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-admin-tools {
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: start;
  }

  .profile-admin-tools .btn-secondary {
    grid-column: 1 / -1;
    width: 100%;
  }

  .user-editor-actions {
    flex-direction: column-reverse;
  }

  .user-editor-actions .btn-primary,
  .user-editor-actions .btn-quiet {
    width: 100%;
  }

}

/* Stage 5.1 — Auto.ru Business sidebar shell */
body {
  --app-sidebar-width: 184px;
  --product-page-gutter: 18px;
  --product-control-height: 32px;
  --product-surface-radius: 14px;
}

body:not(.auth-locked) {
  padding-left: var(--app-sidebar-width);
  transition: padding-left 0.18s ease;
}

body.sidebar-collapsed {
  --app-sidebar-width: 60px;
}

body.auth-locked {
  padding-left: 0;
}

body.auth-locked > .app-sidebar {
  display: none !important;
}

.app-sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: grid;
  width: var(--app-sidebar-width);
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: visible;
  color: #fff;
  background: #1c1a1c;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: none;
  transition: width 0.18s ease;
}

.app-sidebar > header {
  position: static;
  z-index: auto;
  display: flex;
  width: auto;
  height: auto;
  min-height: 49px;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 8px 8px;
  border: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.app-sidebar .logo {
  display: flex;
  width: 100%;
  gap: 4px;
  align-items: center;
  justify-content: flex-start;
}

.app-sidebar .header-brand-logo {
  width: 84px;
  flex: 0 0 auto;
}

.sidebar-brand-divider {
  width: 1px;
  height: 17px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.28);
}

.sidebar-service-name {
  min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.58rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-app-icon {
  display: none;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.app-sidebar .profile-trigger {
  display: grid;
  width: calc(100% - 12px);
  min-height: 48px;
  grid-template-columns: 28px minmax(0, 1fr) 12px;
  gap: 6px;
  align-items: center;
  margin: 0 5px 8px;
  padding: 5px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: transparent;
}

.app-sidebar .profile-trigger:hover,
.app-sidebar .profile-trigger:focus-visible {
  border-color: transparent;
  background: #2d2a2d;
}

.app-sidebar .profile-trigger:focus-visible,
.app-sidebar .nav-btn:focus-visible,
.sidebar-collapse:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.app-sidebar .profile-trigger .avatar-small {
  width: 28px;
  height: 28px;
}

.app-sidebar .current-user-copy strong {
  max-width: 96px;
  font-size: 0.72rem;
  font-weight: 400;
}

.app-sidebar .current-user-copy small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.6rem;
}

.sidebar-chevron {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.44);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-nav {
  display: block;
  min-height: 0;
  padding: 6px 5px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  scrollbar-color: #4a474a transparent;
  scrollbar-width: thin;
}

.sidebar-group {
  display: grid;
  gap: 2px;
  padding: 12px 0 6px;
}

.sidebar-group + .sidebar-group {
  border-top: 0;
}

.sidebar-group-head {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  padding: 0 2px 0 5px;
}

.sidebar-group-label {
  padding: 0;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.6rem;
  font-weight: 500;
}

.sidebar-nav-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 31px;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
  transition: background 0.12s ease;
}

.sidebar-nav-row:hover {
  background: #2d2a2d;
}

.sidebar-nav-row.is-active {
  background: #414042;
}

.sidebar-role-access-hint {
  position: absolute;
  top: 50%;
  right: 7px;
  z-index: 2;
  display: none;
  max-width: 122px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  background: #343134;
  font-size: 0.55rem;
  line-height: 1.2;
  text-align: right;
  transform: translateY(-50%);
  pointer-events: none;
}

.sidebar-nav-row.is-role-locked {
  cursor: not-allowed;
}

.sidebar-nav-row.is-role-locked .nav-btn,
.sidebar-nav-row.is-role-locked .sidebar-item-action {
  color: rgba(255, 255, 255, 0.34);
  cursor: not-allowed;
}

.sidebar-nav-row.is-role-locked .nav-btn > span {
  opacity: 0.48;
  filter: blur(0.75px);
}

.sidebar-nav-row.is-role-locked:hover .sidebar-role-access-hint,
.sidebar-nav-row.is-role-locked:focus-within .sidebar-role-access-hint {
  display: block;
}

.sidebar-nav-row.is-role-locked:hover {
  background: #262326;
}

.app-sidebar .nav-btn {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 34px;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 7px;
  border: 0;
  border-radius: 8px 0 0 8px;
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
  text-align: left;
}

.app-sidebar .nav-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-sidebar .nav-btn > span {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar .nav-btn:hover {
  color: #fff;
  background: transparent;
}

.app-sidebar .nav-btn.active {
  color: #fff;
  background: transparent;
}

.app-sidebar .nav-btn.active::before {
  content: none;
}

.sidebar-item-action {
  display: grid;
  width: 31px;
  min-height: 34px;
  place-items: center;
  border: 0;
  border-radius: 0 8px 8px 0;
  color: rgba(255, 255, 255, 0.52);
  background: transparent;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}

.sidebar-item-action:hover {
  color: #fff;
  background: #565356;
}

.sidebar-item-action:focus-visible {
  color: #fff;
  background: #565356;
  outline: 2px solid #fff;
  outline-offset: -3px;
}

.sidebar-item-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-item-action.is-arrow svg {
  width: 12px;
  height: 12px;
}

.app-sidebar:not(.sidebar-collapsed) [data-tooltip]::after,
body:not(.sidebar-collapsed) .app-sidebar [data-tooltip]::after {
  display: none;
}

.sidebar-footer {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #1c1a1c;
}

.sidebar-collapse {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-height: 34px;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 6px 7px;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.sidebar-collapse:hover {
  color: #fff;
  background: #2d2a2d;
}

.sidebar-collapse svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 0.18s ease;
}

.sidebar-collapse span {
  font-size: 0.72rem;
}

body.sidebar-collapsed .app-sidebar > header {
  justify-content: center;
  padding-inline: 8px;
}

body.sidebar-collapsed .app-sidebar .logo {
  justify-content: center;
}

body.sidebar-collapsed .app-sidebar .header-brand-logo {
  display: none;
}

body.sidebar-collapsed .app-sidebar .sidebar-app-icon {
  display: block;
}

body.sidebar-collapsed .sidebar-brand-divider,
body.sidebar-collapsed .sidebar-service-name {
  display: none;
}

body.sidebar-collapsed .app-sidebar .profile-trigger {
  display: grid;
  width: 48px;
  grid-template-columns: 30px;
  justify-content: center;
  margin-inline: 6px;
  padding: 8px;
}

body.sidebar-collapsed .app-sidebar .current-user-copy,
body.sidebar-collapsed .sidebar-chevron,
body.sidebar-collapsed .sidebar-group-head,
body.sidebar-collapsed .app-sidebar .nav-btn > span,
body.sidebar-collapsed .sidebar-collapse > span {
  display: none;
}

body.sidebar-collapsed .sidebar-item-action {
  display: none;
}

body.sidebar-collapsed .sidebar-role-access-hint {
  display: none !important;
}

body.sidebar-collapsed .sidebar-footer {
  overflow: visible;
}

body.sidebar-collapsed .sidebar-nav-row {
  display: block;
}

body.sidebar-collapsed .sidebar-nav {
  padding-inline: 6px;
  overflow: visible;
}

body.sidebar-collapsed .sidebar-group {
  padding-block: 6px;
}

body.sidebar-collapsed .app-sidebar .nav-btn,
body.sidebar-collapsed .sidebar-collapse {
  grid-template-columns: 22px;
  justify-content: center;
  padding-inline: 8px;
}

body.sidebar-collapsed .sidebar-collapse svg {
  transform: rotate(180deg);
}

body.sidebar-collapsed .app-sidebar [data-tooltip]::after {
  top: 50%;
  left: calc(100% + 8px);
  display: block;
  transform: translate(3px, -50%);
}

body.sidebar-collapsed .app-sidebar [data-tooltip]:hover::after,
body.sidebar-collapsed .app-sidebar [data-tooltip]:focus-visible::after {
  transform: translate(0, -50%);
}

body:not(.auth-locked) > .workspace-context,
body:not(.auth-locked) > main:not(#authView) {
  width: calc(100% - (var(--product-page-gutter) * 2));
  max-width: none;
}

body:not(.auth-locked) > .workspace-context {
  margin-top: 16px;
}

/* Shared Auto.ru Business filter menu */
.section-filter-menu {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 26, 28, 0.04);
}

.section-filter-menu:has(.feed-filter-menu[open]) {
  position: relative;
  z-index: 120;
  overflow: visible;
}

.section-filter-menu:has(.feed-filter-menu[open]) .section-filter-bar {
  position: relative;
  z-index: 121;
}

.feed-filter-menu[open] {
  z-index: 122;
}

.dealers-list-card.section-filter-menu {
  margin-bottom: 0;
}

.section-filter-notice {
  min-height: 64px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.section-filter-notice-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid #f0a100;
  border-radius: 50%;
  color: #d98e00;
  font-size: 0.65rem;
  font-weight: 700;
}

.section-filter-notice > div > strong,
.section-filter-notice > div > small {
  display: block;
}

.section-filter-notice > div > strong {
  font-size: 0.75rem;
  font-weight: 500;
}

.section-filter-notice > div > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.63rem;
}

.section-filter-total {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--muted);
  font-size: 0.64rem;
  white-space: nowrap;
}

.section-filter-total strong {
  color: var(--text);
  font-size: 0.7rem;
}

.section-filter-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 18px;
  background: #fafbfc;
}

.section-filter-primary {
  min-height: 38px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
}

.section-filter-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.section-filter-primary svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.filter-active-count {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 0.58rem;
  line-height: 1;
}

.section-filter-fields {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 8px;
}

.section-filter-control {
  width: min(290px, 100%);
  min-width: 210px;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #cfd3d7;
  border-radius: 9px;
  background: #fff;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.section-filter-control:focus-within,
.section-filter-control.has-value {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(22, 131, 248, 0.08);
}

.section-filter-control svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.section-filter-control input {
  min-width: 0;
  min-height: 36px;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.66rem;
}

.section-filter-control input::placeholder {
  color: #858a90;
}

.section-filter-chip-group {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 8px;
}

.section-filter-chip {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #cfd3d7;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 500;
}

.section-filter-chip:hover {
  border-color: #aeb4ba;
}

.section-filter-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.section-filter-placeholder {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px dashed #cfd3d7;
  border-radius: 9px;
  background: #fff;
  color: #8a8f95;
  cursor: not-allowed;
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 500;
}

.feeds-filter-fields {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  overflow: visible;
}

.feeds-filter-fields .section-filter-control {
  width: min(360px, 100%);
  min-width: 0;
}

.feeds-filter-row-break {
  width: 100%;
  height: 0;
}

.feeds-search-filter {
  flex: 0 1 360px;
}

.feed-filter-menu {
  position: relative;
  flex: 0 0 auto;
}

.feed-filter-menu > summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid #cfd3d7;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 0.64rem;
  font-weight: 500;
  list-style: none;
  white-space: nowrap;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.feed-filter-menu > summary::-webkit-details-marker {
  display: none;
}

.feed-filter-menu > summary:hover,
.feed-filter-menu[open] > summary {
  border-color: #aeb4ba;
}

.feed-filter-menu.has-value > summary,
.feed-filter-menu[open].has-value > summary {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(22, 131, 248, 0.08);
}

.feed-filter-menu > summary strong {
  max-width: 190px;
  overflow: hidden;
  color: inherit;
  font-size: inherit;
  font-weight: 500;
  text-overflow: ellipsis;
}

.feed-filter-clear {
  width: 15px;
  height: 15px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #899097;
  font-size: 0.8rem;
  line-height: 1;
}

.feed-filter-menu.has-value .feed-filter-clear {
  display: inline-flex;
}

.feed-filter-clear:hover {
  background: rgba(22, 131, 248, 0.12);
  color: var(--accent-strong);
}

.feed-filter-chevron {
  width: 7px;
  height: 7px;
  margin: -3px 1px 0 3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.12s ease;
}

.feed-filter-menu[open] .feed-filter-chevron {
  margin-top: 3px;
  transform: rotate(225deg);
}

.feed-filter-popover {
  position: absolute;
  z-index: 90;
  top: calc(100% + 5px);
  left: 0;
  width: 280px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(28, 26, 28, 0.16);
}

.feed-filter-field {
  display: grid;
  gap: 6px;
}

.feed-filter-field > span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 500;
}

.feed-filter-field select,
.feed-filter-field input,
.feed-vehicle-columns input {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #cfd3d7;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.66rem;
}

.feed-filter-field select:focus,
.feed-filter-field input:focus,
.feed-vehicle-columns input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.1);
}

.feed-filter-suggestions {
  display: grid;
  gap: 2px;
  max-height: 268px;
  margin: 8px -4px -4px;
  overflow-y: auto;
}

.feed-filter-suggestions button {
  width: 100%;
  min-height: 48px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.feed-filter-suggestions button:hover,
.feed-filter-suggestions button.is-selected {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.feed-filter-suggestions button strong,
.feed-filter-suggestions button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-filter-suggestions button strong {
  font-size: 0.68rem;
  font-weight: 500;
}

.feed-filter-suggestions button small {
  color: var(--muted);
  font-size: 0.58rem;
}

.feed-filter-suggestions .feed-filter-empty {
  margin: 0;
  padding: 8px 10px;
}

.feed-filter-more {
  margin: 0;
  padding: 7px 10px 5px;
  color: var(--muted);
  font-size: 0.58rem;
}

.feed-date-popover {
  width: 310px;
}

.feed-date-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.feed-date-inputs > .feed-filter-field:only-child {
  grid-column: 1 / -1;
}

.feed-choice-list {
  display: grid;
  gap: 2px;
}

.feed-choice-list label {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.66rem;
}

.feed-choice-list label:hover {
  background: #f1f3f5;
}

.feed-choice-list input {
  accent-color: var(--accent);
}

.feed-filter-menu-wide .feed-filter-popover {
  width: min(640px, calc(100vw - 48px));
}

.feed-vehicle-popover {
  padding: 0;
  overflow: hidden;
}

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

.feed-vehicle-columns > div {
  min-width: 0;
  border-right: 1px solid var(--border);
}

.feed-vehicle-columns > div:last-child {
  border-right: 0;
  background: #f7f8f9;
}

.feed-vehicle-columns input {
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}

.feed-vehicle-options {
  height: 290px;
  overflow-y: auto;
  padding: 7px 0;
}

.feed-vehicle-group-label {
  display: block;
  padding: 2px 12px 7px;
  color: var(--muted);
  font-size: 0.6rem;
}

.feed-vehicle-options button {
  width: 100%;
  min-height: 36px;
  display: block;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  text-align: left;
}

.feed-vehicle-options button:hover,
.feed-vehicle-options button.is-selected {
  background: #e9ebee;
}

.feed-filter-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 0.64rem;
}

.feed-filter-popover-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.feed-filter-popover-actions button {
  min-height: 48px;
  border: 0;
  border-right: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
}

.feed-filter-popover-actions button:last-child {
  border-right: 0;
}

.feed-filter-popover-actions button:hover {
  background: #f1f3f5;
}

.section-filter-reset {
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: #e9ebee;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 500;
  white-space: nowrap;
}

.section-filter-reset:hover {
  background: #dde0e4;
}

.feed-filter-drawer-open {
  overflow: hidden;
}

.feed-filter-drawer-layer {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: flex;
  justify-content: flex-end;
}

.feed-filter-drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(28, 26, 28, 0.22);
  cursor: default;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.feed-filter-drawer {
  position: relative;
  width: min(440px, 100vw);
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: 22px 24px 0;
  background: #fff;
  box-shadow: -18px 0 44px rgba(28, 26, 28, 0.16);
  transform: translateX(100%);
  transition: transform 0.18s ease;
}

.feed-filter-drawer-layer.is-open .feed-filter-drawer-backdrop {
  opacity: 1;
}

.feed-filter-drawer-layer.is-open .feed-filter-drawer {
  transform: translateX(0);
}

.feed-filter-drawer > header {
  position: static;
  z-index: auto;
  height: auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--text);
  box-shadow: none;
  backdrop-filter: none;
}

.feed-filter-drawer > header h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.feed-filter-drawer > header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.75rem;
}

.feed-filter-drawer-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #f1f2f4;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 1.25rem;
  line-height: 1;
}

.feed-filter-drawer-close:hover {
  background: #e4e6e9;
}

.feed-filter-drawer-search {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  padding: 0 13px;
  border: 1px solid #aeb4ba;
  border-radius: 11px;
  background: #f7f8f9;
}

.feed-filter-drawer-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 131, 248, 0.1);
}

.feed-filter-drawer-search svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.feed-filter-drawer-search input {
  min-width: 0;
  min-height: 44px;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.76rem;
}

.feed-filter-drawer-list {
  min-height: 0;
  overflow-y: auto;
  margin: 0 -8px;
  padding: 0 8px 20px;
}

.feed-filter-drawer-list section + section {
  margin-top: 20px;
}

.feed-filter-drawer-list h3 {
  margin: 0 0 8px;
  font-size: 0.77rem;
}

.feed-filter-drawer-option {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 3px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
}

.feed-filter-drawer-option:hover {
  background: #f1f2f4;
}

.feed-filter-drawer-option input {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  accent-color: #2c2a2c;
}

.feed-filter-drawer-option span,
.feed-filter-drawer-option strong,
.feed-filter-drawer-option small {
  min-width: 0;
  display: block;
}

.feed-filter-drawer-option strong {
  font-size: 0.72rem;
  font-weight: 500;
}

.feed-filter-drawer-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.6rem;
}

.feed-filter-drawer-empty {
  padding: 34px 14px;
  text-align: center;
}

.feed-filter-drawer-empty strong {
  font-size: 0.76rem;
}

.feed-filter-drawer-empty p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.66rem;
}

.feed-filter-drawer > footer {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 -24px;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.feed-filter-drawer > footer span {
  color: var(--muted);
  font-size: 0.64rem;
}

.feed-filter-drawer > footer .btn-primary {
  width: auto;
  min-width: 110px;
}

/* Unified context and filters toolbar */
.unified-toolbar {
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(28, 26, 28, 0.05);
}

.unified-toolbar .workspace-context-main {
  grid-template-columns: minmax(700px, 1fr) auto 38px;
  align-items: end;
  gap: 12px;
  padding: 13px 18px;
}

.unified-toolbar .context-control {
  gap: 5px;
  font-size: 0.65rem;
}

.unified-toolbar .context-select-trigger,
.unified-toolbar .context-cme-combobox > input,
.unified-toolbar .context-add,
.unified-toolbar .workspace-menu > summary {
  height: 38px;
  min-height: 38px;
}

.unified-toolbar .context-control-row {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.unified-toolbar .context-add {
  width: 38px;
  min-width: 38px;
}

.toolbar-create-feed {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--text);
  border-radius: 9px;
  background: var(--text);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.toolbar-create-feed:hover,
.toolbar-create-feed:focus-visible {
  border-color: #373337;
  background: #373337;
}

.toolbar-create-feed svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.section-filter-host {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
}

.workspace-context:has(.feed-filter-menu[open]),
.section-filter-host:has(.feed-filter-menu[open]) {
  position: relative;
  z-index: 130;
  overflow: visible;
}

.section-filter-host .section-filter-menu {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.section-filter-host .section-filter-notice {
  min-height: 46px;
  padding: 8px 18px;
}

.section-filter-host .section-filter-notice-icon {
  width: 22px;
  height: 22px;
}

.section-filter-host .section-filter-bar {
  padding: 10px 18px;
}

.section-filter-host .section-filter-primary,
.section-filter-host .section-filter-control,
.section-filter-host .section-filter-chip,
.section-filter-host .section-filter-placeholder {
  min-height: 36px;
}

.section-filter-host .section-filter-control input {
  min-height: 34px;
}

body[data-active-view="feeds"] > .workspace-context .workspace-context-main,
body[data-active-view="dealers"] > .workspace-context .workspace-context-main,
body[data-active-view="colors"] > .workspace-context .workspace-context-main,
body[data-active-view="audit"] > .workspace-context .workspace-context-main {
  display: none;
}

body[data-active-view="feeds"] > .workspace-context .section-filter-host,
body[data-active-view="dealers"] > .workspace-context .section-filter-host,
body[data-active-view="colors"] > .workspace-context .section-filter-host,
body[data-active-view="audit"] > .workspace-context .section-filter-host {
  overflow: visible;
  border-top: 0;
  border-radius: 16px;
}

body[data-active-view="feeds"] > .workspace-context .section-filter-menu,
body[data-active-view="dealers"] > .workspace-context .section-filter-menu,
body[data-active-view="colors"] > .workspace-context .section-filter-menu,
body[data-active-view="audit"] > .workspace-context .section-filter-menu {
  overflow: visible;
  border-radius: 16px;
}

body[data-active-view="feeds"] > .workspace-context .section-filter-bar,
body[data-active-view="dealers"] > .workspace-context .section-filter-bar,
body[data-active-view="colors"] > .workspace-context .section-filter-bar,
body[data-active-view="audit"] > .workspace-context .section-filter-bar {
  border-radius: 16px;
}

body[data-active-view="dealers"] > .workspace-context .section-filter-notice,
body[data-active-view="colors"] > .workspace-context .section-filter-notice {
  display: none;
}

.color-company-filter {
  min-width: 124px;
}

.color-company-filter > summary strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feeds-filter-fields > .feed-filter-menu:nth-of-type(n + 7) > .feed-filter-popover {
  right: 0;
  left: auto;
}

body[data-active-view="feeds"] .feeds-view .dealership-overview {
  display: none !important;
}

/* Stage 5.2 — dealers directory */
.dealers-view {
  max-width: 1440px;
}

.dealers-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 2px 2px 0;
}

.dealers-page-head h1 {
  margin: 3px 0 5px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.dealers-page-head p {
  color: var(--muted);
  font-size: 0.78rem;
}

.dealers-page-head .btn-secondary {
  min-width: 118px;
}

.dealers-list-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 26, 28, 0.04);
}

.dealers-alert {
  min-height: 64px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.dealers-alert-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid #f0a100;
  border-radius: 50%;
  color: #d98e00;
  font-size: 0.65rem;
  font-weight: 700;
}

.dealers-alert strong,
.dealers-alert small {
  display: block;
}

.dealers-alert > div > strong {
  font-size: 0.75rem;
  font-weight: 500;
}

.dealers-alert > div > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.63rem;
}

.dealers-total-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--muted);
  font-size: 0.64rem;
}

.dealers-total-pill strong {
  color: var(--text);
  font-size: 0.7rem;
}

.dealers-filter-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.dealers-all-filters {
  min-height: 38px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
}

.dealers-all-filters:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.dealers-all-filters svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dealers-filter-fields {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 8px;
}

.dealer-filter-control {
  min-width: 180px;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #cfd3d7;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.dealer-filter-control:focus-within,
.dealer-filter-control.has-value {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(22, 131, 248, 0.08);
}

.dealer-filter-control > span {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 0.63rem;
  font-weight: 500;
}

.dealer-filter-control svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.dealer-filter-control input {
  min-width: 0;
  min-height: 36px;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.66rem;
}

.dealer-filter-control input::placeholder {
  color: #858a90;
}

.dealer-name-filter {
  min-width: 210px;
}

.dealer-date-filter {
  min-width: 220px;
}

.dealer-date-filter input {
  min-width: 104px;
}

.dealers-reset-filters {
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  background: #eef0f2;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 500;
}

.dealers-reset-filters:hover {
  background: #e2e4e7;
}

.dealers-table-wrap {
  min-height: 310px;
  overflow-x: auto;
}

.dealers-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.72rem;
}

.dealers-table th {
  height: 44px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
  text-align: left;
}

.dealers-table th:nth-child(1) { width: 25%; }
.dealers-table th:nth-child(2) { width: 13%; }
.dealers-table th:nth-child(3) { width: 10%; }
.dealers-table th:nth-child(4) { width: 20%; }
.dealers-table th:nth-child(5) { width: 20%; }
.dealers-table th:nth-child(6) { width: 12%; }

.dealers-table td {
  height: 76px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.dealers-table tbody tr:hover td {
  background: #fafbfc;
}

.dealers-table tbody tr[data-dealer-row] {
  cursor: pointer;
}

.dealers-table tbody tr[data-dealer-row]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.dealer-name-cell,
.dealer-creator-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dealer-name-cell > div,
.dealer-creator-cell > div {
  min-width: 0;
}

.dealer-building-icon {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: #2c292c;
  color: #fff;
}

.dealer-building-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.dealer-name-cell strong,
.dealer-name-cell small,
.dealer-latest-feed strong,
.dealer-latest-feed small,
.dealer-creator-cell strong,
.dealer-creator-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dealer-name-cell strong,
.dealer-latest-feed strong,
.dealer-creator-cell strong {
  font-size: 0.69rem;
  font-weight: 500;
}

.dealer-name-cell small,
.dealer-latest-feed small,
.dealer-creator-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.59rem;
}

.dealer-cme-id {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dealer-feed-count strong,
.dealer-feed-count small {
  display: block;
}

.dealer-status-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.dealer-status-summary span {
  font-size: 0.58rem;
  font-weight: 600;
  white-space: nowrap;
}

.dealer-status-summary .is-ready {
  color: var(--success);
}

.dealer-status-summary .is-progress {
  color: var(--accent-strong);
}

.dealer-status-summary .is-attention {
  color: var(--error);
}

.dealer-status-summary .is-archived,
.dealer-flow-card-stats .is-archived {
  color: var(--muted);
}

.dealer-feed-count strong {
  font-size: 0.88rem;
}

.dealer-feed-count small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.57rem;
}

.dealer-creator-cell > span {
  width: 28px;
  height: 28px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #eef0f2;
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 700;
}

.dealer-open-feeds {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #d7d9dc;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.62rem;
  font-weight: 500;
  white-space: nowrap;
}

.dealer-open-feeds:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.dealers-loading,
.dealers-empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

.dealers-loading > span {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border: 3px solid #dde1e5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: result-spin 0.9s linear infinite;
}

.dealers-loading strong,
.dealers-empty-state strong {
  font-size: 0.76rem;
}

.dealers-empty-state > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 11px;
  background: #eef0f2;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.dealers-empty-state.is-error > span {
  background: #fff0ef;
  color: var(--error);
}

.dealers-empty-state p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 0.66rem;
}

.dealers-list-footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  color: var(--muted);
  font-size: 0.63rem;
}

.dealers-list-footer strong {
  color: var(--text);
}

.dealer-detail-view {
  display: block;
  padding-bottom: 28px;
}

.dealer-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 24px;
  align-items: end;
  margin-bottom: 14px;
}

.dealer-detail-head .feed-detail-back {
  grid-column: 1 / -1;
}

.dealer-detail-head h1 {
  margin: 2px 0 5px;
  font-size: 1.75rem;
  line-height: 1.12;
}

.dealer-detail-head p {
  color: var(--muted);
  font-size: 0.74rem;
}

.dealer-detail-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dealer-detail-metrics span {
  min-height: 46px;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  font-size: 0.64rem;
}

.dealer-detail-metrics strong {
  color: var(--text);
  font-size: 1rem;
}

.dealer-flow {
  display: grid;
  grid-template-columns: 310px 24px 360px 24px 440px;
  justify-content: start;
  align-items: stretch;
  min-height: 460px;
  padding: 10px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #eef0f2;
  box-shadow: var(--shadow-soft);
}

.dealer-flow.is-level-1 {
  grid-template-columns: 310px;
}

.dealer-flow.is-level-2 {
  grid-template-columns: 310px 24px 360px;
}

.dealer-flow.is-level-1 .dealer-flow-arrow,
.dealer-flow.is-level-1 .dealer-flow-dealerships,
.dealer-flow.is-level-1 .dealer-flow-feeds,
.dealer-flow.is-level-2 .dealer-flow-arrow-to-feeds,
.dealer-flow.is-level-2 .dealer-flow-feeds {
  display: none;
}

.dealer-flow.is-level-2 .dealer-flow-dealerships,
.dealer-flow.is-level-3 .dealer-flow-dealerships,
.dealer-flow.is-level-3 .dealer-flow-feeds {
  animation: dealer-flow-reveal 0.16s ease-out;
}

@keyframes dealer-flow-reveal {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.dealer-flow-column {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.dealer-flow-column-head {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.dealer-flow-column-head > span {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: #e8f3ff;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
}

.dealer-flow-column-head strong,
.dealer-flow-column-head small {
  display: block;
}

.dealer-flow-column-head strong {
  font-size: 0.75rem;
}

.dealer-flow-column-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.59rem;
}

.dealer-flow-arrow {
  display: grid;
  place-items: center;
  color: #a1a6ac;
  font-size: 1.15rem;
}

.dealer-flow-company-card {
  width: calc(100% - 16px);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 8px;
  padding: 9px 10px;
  border: 1px solid #b9d8fa;
  border-radius: 10px;
  background: #f1f7fe;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.dealer-flow-company-card > div {
  flex: 1;
  min-width: 0;
}

.dealer-flow-company-card .dealer-building-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.dealer-flow-company-card .dealer-building-icon svg {
  width: 16px;
  height: 16px;
}

.dealer-flow-company-card:hover,
.dealer-flow-company-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dealer-flow-company-card strong,
.dealer-flow-company-card small {
  display: block;
}

.dealer-flow-company-card strong {
  font-size: 0.76rem;
}

.dealer-flow-company-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.59rem;
}

.dealer-flow-company-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.62rem;
}

.dealer-flow-company-card b {
  color: var(--text);
}

.dealer-flow-toggle {
  align-self: center;
  color: var(--accent-strong);
  font-size: 0.57rem;
  font-weight: 600;
  white-space: nowrap;
}

.dealer-flow-list {
  max-height: 406px;
  overflow-y: auto;
  padding: 7px;
}

.dealer-flow-card {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  gap: 8px;
  align-items: center;
  margin-bottom: 5px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.dealer-flow-card:hover {
  border-color: #b6cbe2;
  background: #fafcff;
}

.dealer-flow-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(22, 131, 248, 0.08);
}

.dealer-flow-card-main {
  min-width: 0;
}

.dealer-flow-card-main strong,
.dealer-flow-card-main small,
.dealer-flow-card-main em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dealer-flow-card-main strong {
  font-size: 0.69rem;
  white-space: nowrap;
}

.dealer-flow-card-main small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.58rem;
  white-space: nowrap;
}

.dealer-flow-card-main em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.57rem;
  font-style: normal;
  line-height: 1.35;
}

.dealer-flow-note {
  max-width: 100%;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 3px 6px;
  overflow: hidden;
  border-radius: 6px;
  background: #eaf4ff;
  color: #116fc7;
  font-size: 0.55rem;
  line-height: 1.2;
}

.dealer-flow-note svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dealer-flow-note > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dealer-flow-card-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--muted);
  font-size: 0.57rem;
}

.dealer-flow-card-stats b {
  color: var(--text);
  font-size: 0.75rem;
}

.dealer-flow-card-stats i {
  margin-top: 2px;
  font-size: 0.54rem;
  font-style: normal;
  white-space: nowrap;
}

.dealer-flow-card-stats .is-ready {
  color: var(--success);
}

.dealer-flow-card-stats .is-progress {
  color: var(--accent-strong);
}

.dealer-flow-card-stats .is-attention {
  color: var(--error);
}

.dealer-flow-feed-card {
  grid-template-columns: 10px minmax(0, 1fr) auto 18px;
}

.dealer-flow-feed-card .feed-status-dot {
  width: 8px;
  height: 8px;
}

.dealer-flow-feed-meta {
  text-align: right;
}

.dealer-flow-feed-meta b,
.dealer-flow-feed-meta small {
  display: block;
}

.dealer-flow-feed-meta b {
  font-size: 0.78rem;
}

.dealer-flow-feed-meta small {
  color: var(--muted);
  font-size: 0.54rem;
}

.dealer-flow-chevron {
  color: #9ba0a6;
  font-size: 0.85rem;
}

.dealer-flow-empty {
  padding: 30px 16px;
  color: var(--muted);
  font-size: 0.66rem;
  text-align: center;
}

.dealer-flow-safety-note {
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.45;
}

/* Stage 5.3 — scale calibration against Auto.ru Business desktop references */
body:not(.auth-locked) > main:not(#authView) {
  margin-top: 18px;
  margin-bottom: 32px;
}

.feeds-view,
.colors-view,
.audit-view,
.dealers-view {
  max-width: none;
}

.feeds-page-head,
.colors-page-head,
.audit-page-head,
.dealers-page-head {
  margin-bottom: 14px;
}

.feeds-page-head h1,
.colors-page-head h1,
.audit-page-head h1,
.dealers-page-head h1 {
  font-size: 1.75rem;
  line-height: 1.12;
}

.feeds-page-head p,
.colors-page-head p,
.audit-page-head p,
.dealers-page-head p {
  font-size: 0.76rem;
}

.feeds-page-actions .btn-primary,
.feeds-page-actions .btn-secondary,
.colors-page-actions .btn-primary,
.colors-page-actions .btn-secondary,
.audit-page-actions .btn-secondary,
.dealers-page-head .btn-secondary {
  min-width: 112px;
}

body:not(.auth-locked) .btn-primary,
body:not(.auth-locked) .btn-secondary,
body:not(.auth-locked) .btn-danger {
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.15;
}

.workspace-context,
.unified-toolbar,
.section-filter-menu,
.feeds-list-card,
.colors-list-card,
.audit-list-card,
.dealers-list-card {
  border-radius: var(--product-surface-radius);
}

.section-filter-bar,
.dealers-filter-bar {
  gap: 6px;
  padding: 9px 14px;
}

.section-filter-primary,
.section-filter-control,
.section-filter-chip,
.section-filter-placeholder,
.dealers-all-filters,
.dealer-filter-control,
.dealers-reset-filters,
.feed-filter-menu > summary {
  min-height: var(--product-control-height);
  border-radius: 8px;
  font-size: 0.68rem;
}

.section-filter-primary,
.dealers-all-filters {
  padding: 6px 10px;
}

.section-filter-primary svg,
.dealers-all-filters svg {
  width: 16px;
  height: 16px;
}

.section-filter-chip,
.section-filter-placeholder,
.feed-filter-menu > summary,
.dealers-reset-filters {
  padding: 6px 9px;
}

.section-filter-control,
.dealer-filter-control {
  padding-right: 9px;
  padding-left: 9px;
}

.section-filter-control input,
.dealer-filter-control input {
  min-height: 30px;
  font-size: 0.68rem;
}

.section-filter-host .section-filter-bar {
  padding: 9px 14px;
}

.section-filter-host .section-filter-primary,
.section-filter-host .section-filter-control,
.section-filter-host .section-filter-chip,
.section-filter-host .section-filter-placeholder {
  min-height: var(--product-control-height);
}

.section-filter-host .section-filter-control input {
  min-height: 30px;
}

.feeds-filter-fields {
  gap: 6px;
}

.feeds-filter-fields .section-filter-control {
  width: min(280px, 100%);
}

.feeds-search-filter {
  flex-basis: 280px;
}

.audit-summary {
  gap: 8px;
  margin-bottom: 12px;
}

.audit-summary-card {
  min-height: 80px;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 12px;
}

.audit-summary-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.audit-summary-card strong {
  margin-top: 4px;
  font-size: 1.25rem;
}

.feeds-list-head {
  padding: 16px 18px 12px;
}

.feeds-product-table {
  font-size: 0.72rem;
}

.feeds-product-table th {
  padding: 10px 12px;
  font-size: 0.66rem;
}

.feeds-product-table td {
  height: 68px;
  padding: 10px 12px;
}

.feed-file-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.feed-primary-action {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.68rem;
}

.dealers-table th {
  height: 40px;
  padding: 9px 12px;
  font-size: 0.64rem;
}

.dealers-table td {
  height: 68px;
  padding: 10px 12px;
}

.feeds-list-footer,
.colors-list-footer,
.audit-list-footer,
.dealers-list-footer {
  min-height: 44px;
  padding: 9px 18px;
}

@media (max-width: 1180px) {
  .unified-toolbar .workspace-context-main {
    grid-template-columns: minmax(0, 1fr) auto 38px;
  }

  .context-selectors {
    grid-template-columns: minmax(190px, 0.9fr) 18px minmax(230px, 1.1fr);
  }

  .cme-context-arrow {
    display: none;
  }

  .context-cme-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  html,
  body {
    overflow-x: hidden;
  }

  .unified-toolbar .workspace-context-main {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .feeds-filter-bar {
    flex-direction: column;
  }

  .feeds-filter-bar .section-filter-primary,
  .feeds-filter-fields {
    width: 100%;
  }

  .feed-filter-menu {
    max-width: 100%;
  }

  .section-filter-reset {
    width: 100%;
  }

  .context-selectors {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .context-arrow {
    display: none;
  }

  .context-cme-control {
    grid-column: auto;
  }

  .toolbar-create-feed {
    width: 100%;
    justify-content: center;
  }

  .context-cme-popover {
    right: auto;
    left: 0;
  }

  .workflow-header,
  .steps {
    min-width: 0;
    max-width: 100%;
  }

  .steps {
    width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .section-filter-host .section-filter-notice {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .section-filter-host .section-filter-total {
    grid-column: 2;
    justify-self: start;
  }

  .feed-filter-menu,
  .feed-filter-menu > summary,
  .feeds-search-filter {
    width: 100%;
  }

  #uploadPlatformMenu {
    width: 100%;
    min-width: 0;
  }

  .feed-filter-menu > summary {
    justify-content: flex-start;
  }

  .feed-filter-menu > summary .feed-filter-chevron {
    margin-left: auto;
  }

  .feed-filter-popover,
  .feed-filter-menu-wide .feed-filter-popover {
    position: static;
    width: 100%;
    margin-top: 5px;
    box-shadow: 0 8px 20px rgba(28, 26, 28, 0.1);
  }

  .feed-vehicle-columns {
    grid-template-columns: 1fr;
  }

  .feed-vehicle-columns > div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .feed-vehicle-options {
    height: 210px;
  }

  .feed-filter-drawer {
    width: 100%;
    padding-right: 18px;
    padding-left: 18px;
  }

  .feed-filter-drawer > footer {
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .feeds-page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .feeds-page-actions,
  .feeds-page-actions .btn-primary,
  .feeds-page-actions .btn-secondary {
    width: 100%;
  }

  .feeds-list-head {
    align-items: stretch;
    flex-direction: column;
    padding-right: 16px;
    padding-left: 16px;
  }

  .feeds-lifecycle-tabs {
    width: 100%;
  }

  .feeds-lifecycle-tabs button {
    flex: 1 1 0;
    justify-content: center;
    padding-right: 7px;
    padding-left: 7px;
  }

  .feeds-bulk-bar {
    position: sticky;
    z-index: 30;
    bottom: 8px;
    align-items: stretch;
    flex-direction: column;
    margin: 0 8px;
    border: 1px solid #cfe1f7;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(28, 26, 28, 0.16);
  }

  .feeds-bulk-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feeds-clear-selection {
    grid-column: 1 / -1;
  }

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

  .feed-lifecycle-actions button {
    width: 100%;
  }

  .feeds-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .feeds-product-table {
    display: table;
    width: 880px;
    max-width: none;
    overflow: visible;
  }
}

/* Stage 7 — focused two-path knowledge learning journey */
.knowledge-view {
  max-width: 1280px;
  margin: 0 auto;
}

.knowledge-page-head {
  margin-bottom: 12px;
}

.knowledge-page-head h1 {
  margin-top: 0;
}

.knowledge-platform-hero {
  min-height: 116px;
  grid-template-columns: 58px minmax(0, 1fr) minmax(210px, 260px);
  gap: 16px;
  padding: 18px 20px;
}

.knowledge-platform-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  font-size: 1.5rem;
}

.knowledge-platform-title h2 {
  margin: 5px 0 3px;
  font-size: 1.2rem;
}

.knowledge-platform-title p {
  font-size: 0.71rem;
}

.knowledge-readiness {
  padding: 14px 15px;
}

.knowledge-readiness > span {
  color: #51555c;
  font-size: 0.66rem;
  font-weight: 600;
}

.knowledge-readiness > strong {
  margin-top: 4px;
  font-size: 0.82rem;
}

.knowledge-readiness-track {
  height: 5px;
  margin-top: 9px;
}

.knowledge-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 12px;
  margin-top: 12px;
}

.knowledge-upload-card,
.knowledge-evidence-card {
  padding: 20px;
}

.knowledge-upload-card > header,
.knowledge-evidence-card > header {
  padding-bottom: 14px;
}

.knowledge-upload-card h3,
.knowledge-evidence-card h3 {
  margin-top: 3px;
  font-size: 1rem;
}

.knowledge-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #f0f1f3;
}

.knowledge-mode-switch button {
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  color: #5d6066;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: left;
}

.knowledge-mode-switch button small {
  color: #898c92;
  font-size: 0.58rem;
  font-weight: 400;
}

.knowledge-mode-switch button.is-active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 2px 8px rgba(28, 26, 28, 0.09);
}

.knowledge-mode-switch button.is-active small {
  color: var(--accent);
}

.knowledge-paired-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  margin-top: 14px;
}

.knowledge-paired-flow.is-target-only {
  grid-template-columns: 1fr;
}

.knowledge-paired-flow.is-target-only .knowledge-flow-arrow,
.knowledge-paired-flow.is-target-only #knowledgeSourceDropzone {
  display: none;
}

.knowledge-file-slot {
  display: grid;
  min-height: 86px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1.5px dashed #bbc9d8;
  border-radius: 12px;
  background: #f9fbfd;
  cursor: pointer;
  transition: 0.15s ease;
}

.knowledge-file-slot:hover,
.knowledge-file-slot.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.knowledge-file-slot.has-file {
  border-style: solid;
  border-color: #82cbb3;
  background: #f4fbf8;
}

.knowledge-file-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: #195f9d;
  background: #dcecff;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
}

.knowledge-file-slot.has-file .knowledge-file-number {
  color: #17624f;
  background: #daf3e9;
}

.knowledge-file-slot strong {
  display: block;
  font-size: 0.7rem;
}

.knowledge-file-slot p {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.6rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-file-action {
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 600;
}

.knowledge-flow-arrow {
  color: #9ba0a6;
  font-size: 1rem;
  text-align: center;
}

.knowledge-target-only-note {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #5f6268;
  background: #fff7df;
  font-size: 0.62rem;
  line-height: 1.4;
}

.knowledge-target-only-note > span {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: #815400;
  background: #ffe9a9;
  font-weight: 700;
}

.knowledge-acceptance {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr);
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.knowledge-case-confirmations {
  display: grid;
  gap: 7px;
}

.knowledge-case-confirmations label {
  display: flex;
  min-height: 24px;
  gap: 8px;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 600;
}

.knowledge-case-confirmations label.is-disabled {
  display: none;
}

.knowledge-acceptance input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.knowledge-acceptance-note {
  display: grid;
  gap: 5px;
}

.knowledge-acceptance-note > span {
  font-size: 0.61rem;
  font-weight: 600;
}

.knowledge-acceptance-note small {
  color: var(--muted);
  font-weight: 400;
}

.knowledge-acceptance-note input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  font-size: 0.64rem;
}

.knowledge-upload-actions {
  margin-top: 14px;
}

.knowledge-safety-note {
  margin-top: 12px;
}

.knowledge-evidence-list {
  gap: 6px;
  margin-top: 0;
}

.knowledge-evidence-item {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px;
}

.knowledge-evidence-item.is-blocked > span {
  color: #aa241e;
  background: #fde4e2;
}

.knowledge-evidence-item p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.knowledge-samples-card {
  margin-top: 12px;
}

.knowledge-samples-card > header {
  justify-content: space-between;
  padding: 15px 18px 11px;
}

.knowledge-samples-card h3 span {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  margin-left: 5px;
  border-radius: 999px;
  color: #5f6268;
  background: #eef0f2;
  font-size: 0.6rem;
}

.knowledge-sample-row {
  grid-template-columns: 44px minmax(0, 1fr) minmax(155px, auto);
}

.knowledge-sample-format.is-paired {
  color: #17624f;
  background: #daf3e9;
}

.knowledge-sample-row p strong {
  display: inline;
  color: #17624f;
  font-size: inherit;
}

.knowledge-technical-details {
  margin-top: 12px;
}

.knowledge-technical-details > summary {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.knowledge-technical-details > summary::-webkit-details-marker {
  display: none;
}

.knowledge-technical-details > summary strong,
.knowledge-technical-details > summary span {
  display: block;
}

.knowledge-technical-details > summary strong {
  font-size: 0.72rem;
}

.knowledge-technical-details > summary div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.61rem;
}

.knowledge-details-chevron {
  color: var(--muted);
  font-size: 1rem;
  transition: transform 0.15s ease;
}

.knowledge-technical-details[open] .knowledge-details-chevron {
  transform: rotate(180deg);
}

.knowledge-technical-content {
  border-top: 1px solid var(--border);
}

@media (max-width: 1000px) {
  .knowledge-platform-hero {
    grid-template-columns: 58px minmax(0, 1fr);
  }

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

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

@media (max-width: 700px) {
  .knowledge-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .knowledge-page-head .btn-primary {
    width: 100%;
  }

  .knowledge-mode-switch,
  .knowledge-paired-flow,
  .knowledge-acceptance,
  .knowledge-evidence-list {
    grid-template-columns: 1fr;
  }

  .knowledge-flow-arrow {
    transform: rotate(90deg);
  }

  .knowledge-file-slot {
    min-height: 78px;
  }

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

  .knowledge-upload-actions .btn-primary {
    width: 100%;
  }

  .knowledge-sample-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .knowledge-sample-meta {
    grid-column: 2;
    text-align: left;
  }

  .knowledge-rules-head {
    align-items: stretch;
    flex-direction: column;
  }

  .knowledge-downloads {
    width: 100%;
  }

  .knowledge-downloads a {
    flex: 1;
    justify-content: center;
  }
}

/* Stage 6 — controlled multi-platform knowledge base */
.sidebar-knowledge-menu {
  width: 100%;
  min-width: 0;
  border-radius: 8px;
}

.sidebar-knowledge-row {
  align-items: stretch;
}

.sidebar-knowledge-menu > summary {
  display: grid;
  min-height: 34px;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 7px;
  border-radius: 8px 0 0 8px;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  list-style: none;
  font-size: 0.72rem;
}

.sidebar-knowledge-menu > summary::-webkit-details-marker {
  display: none;
}

.sidebar-knowledge-menu > summary:hover,
.sidebar-knowledge-menu[open] > summary,
.sidebar-knowledge-menu.is-active > summary {
  color: #fff;
  background: transparent;
}

.sidebar-knowledge-menu > summary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.sidebar-knowledge-menu > summary > svg:first-child {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-knowledge-row.is-open,
.sidebar-knowledge-row:has(.sidebar-knowledge-menu.is-active) {
  background: #414042;
}

.sidebar-knowledge-toggle svg {
  transition: transform 0.16s ease;
}

.sidebar-knowledge-row.is-open .sidebar-knowledge-toggle svg {
  transform: rotate(180deg);
}

.sidebar-knowledge-panel {
  position: fixed;
  z-index: 38;
  top: 0;
  bottom: 0;
  left: var(--app-sidebar-width);
  display: grid;
  width: min(312px, calc(100vw - var(--app-sidebar-width) - 18px));
  min-width: 280px;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 18px 20px 22px 24px;
  overflow: hidden;
  border: 0;
  border-radius: 0 0 34px;
  color: #fff;
  background: #1c1a1c;
  box-shadow: 20px 0 46px rgba(0, 0, 0, 0.24);
  transform-origin: left center;
  animation: knowledge-panel-in 0.16s ease-out;
}

@keyframes knowledge-panel-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-knowledge-panel-header {
  display: block;
  padding: 0;
  color: #fff;
  background: transparent;
}

.sidebar-knowledge-panel-header strong {
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.sidebar-knowledge-search {
  display: grid;
  min-height: 44px;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  background: #414043;
}

.sidebar-knowledge-search svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-linecap: round;
  stroke-width: 2;
}

.sidebar-knowledge-search input {
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  font-size: 0.76rem;
  outline: none;
  box-shadow: none;
}

.sidebar-knowledge-search input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-knowledge-search:focus-within {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.sidebar-knowledge-items {
  display: block;
  min-height: 0;
  margin: 0 -8px 0 -14px;
  padding: 0 8px 0 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #565356 transparent;
  scrollbar-width: thin;
}

.sidebar-knowledge-group {
  display: grid;
  gap: 1px;
  padding: 0 0 14px;
}

.sidebar-knowledge-group h3 {
  margin: 0;
  padding: 0 12px 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.58rem;
  font-weight: 500;
}

.sidebar-knowledge-item {
  display: grid;
  width: 100%;
  min-height: 38px;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 5px 12px;
  border: 0;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.92);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.sidebar-knowledge-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-knowledge-item.is-selected {
  color: #fff;
  background: #454346;
}

.sidebar-knowledge-item > span:last-child {
  min-width: 0;
}

.sidebar-knowledge-item strong,
.sidebar-knowledge-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-knowledge-item strong {
  font-size: 0.72rem;
  font-weight: 400;
}

.sidebar-knowledge-item small {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.57rem;
}

.knowledge-nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #777377;
}

.knowledge-nav-dot.is-ready { background: #58c8a2; }
.knowledge-nav-dot.is-learning { background: #f0bd52; }
.knowledge-nav-dot.is-research { background: #777377; }

.sidebar-knowledge-loading,
.sidebar-knowledge-empty {
  display: block;
  padding: 18px 14px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.76rem;
}

body.sidebar-collapsed .sidebar-knowledge-menu > summary {
  grid-template-columns: 22px;
  justify-content: center;
  padding-inline: 8px;
}

body.sidebar-collapsed .sidebar-knowledge-menu > summary > span,
body.sidebar-collapsed .sidebar-knowledge-toggle {
  display: none;
}

body.sidebar-collapsed .sidebar-knowledge-menu[open] .sidebar-knowledge-panel {
  left: var(--app-sidebar-width);
  display: grid;
}

body.sidebar-collapsed .sidebar-knowledge-menu[open] > summary::after {
  display: none;
}

@media (max-width: 860px) {
  .sidebar-knowledge-panel {
    width: calc(100vw - var(--app-sidebar-width));
    min-width: 0;
    gap: 13px;
    padding: 16px 14px 20px;
    border-radius: 0 0 24px;
  }

  .sidebar-knowledge-panel-header strong {
    font-size: 1rem;
  }

  .sidebar-knowledge-search {
    min-height: 42px;
    grid-template-columns: 21px minmax(0, 1fr);
    gap: 9px;
    padding: 0 13px;
    border-radius: 12px;
  }

  .sidebar-knowledge-search svg {
    width: 21px;
    height: 21px;
  }

  .sidebar-knowledge-search input {
    min-height: 42px;
    font-size: 0.74rem;
  }

  .sidebar-knowledge-items {
    margin-inline: -4px;
    padding-inline: 4px;
  }

  .sidebar-knowledge-group h3 {
    padding-inline: 12px;
  }

  .sidebar-knowledge-item {
    padding-inline: 12px;
  }
}

.platform-filter-menu {
  min-width: 210px;
}

#uploadPlatformMenu {
  width: 205px;
  min-width: 205px;
}

#uploadPlatformOptions {
  width: 100%;
  min-width: 0;
}

#uploadPlatformMenu > summary .feed-filter-chevron {
  margin-left: auto;
}

.platform-choice-popover {
  width: min(390px, calc(100vw - 36px));
  max-height: 360px;
  padding: 6px;
  overflow-y: auto;
}

.platform-choice {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.platform-choice:hover,
.platform-choice.is-selected {
  background: var(--accent-soft);
}

.platform-choice-copy,
.platform-choice-copy strong,
.platform-choice-copy small {
  display: block;
  min-width: 0;
}

.platform-choice-copy strong {
  overflow: hidden;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-choice-copy small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-choice-state {
  color: var(--success);
  font-weight: 700;
  text-align: center;
}

.platform-choice-empty {
  display: block;
  padding: 16px 12px;
  color: var(--muted);
  font-size: 0.66rem;
  text-align: center;
}

.dealer-platform-filter {
  min-width: 150px;
}

body[data-active-view="knowledge"] > .workspace-context {
  display: none;
}

body[data-active-view="photobank"] > .workspace-context {
  display: none;
}

.knowledge-view {
  max-width: none;
}

.knowledge-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 2px;
}

.knowledge-page-head h1 {
  margin: 3px 0 5px;
  font-size: 1.75rem;
  line-height: 1.12;
}

.knowledge-page-head p {
  color: var(--muted);
  font-size: 0.76rem;
}

.knowledge-platform-hero {
  display: grid;
  min-height: 156px;
  grid-template-columns: 76px minmax(0, 1fr) minmax(180px, 260px);
  gap: 20px;
  align-items: center;
  padding: 24px;
  border: 1px solid #d7e5f4;
  border-radius: 18px;
  background:
    radial-gradient(circle at 86% 20%, rgba(22, 131, 248, 0.12), transparent 32%),
    linear-gradient(135deg, #fafdff 0%, #f0f7ff 100%);
  box-shadow: 0 8px 24px rgba(28, 26, 28, 0.04);
}

.knowledge-platform-mark {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 20px;
  color: #fff;
  background: #1c1a1c;
  box-shadow: 0 12px 24px rgba(28, 26, 28, 0.16);
  font-size: 2rem;
  font-weight: 700;
}

.knowledge-platform-title h2 {
  margin: 7px 0 5px;
  font-size: 1.45rem;
}

.knowledge-platform-title p {
  max-width: 760px;
  color: #5f6268;
  font-size: 0.78rem;
  line-height: 1.5;
}

.knowledge-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
}

.knowledge-source-link {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 600;
  text-decoration: none;
}

.knowledge-status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
}

.knowledge-status-pill.is-ready { color: #17624f; background: #daf3e9; }
.knowledge-status-pill.is-learning { color: #815400; background: #fff0c8; }
.knowledge-status-pill.is-research { color: #60636a; background: #e9ebee; }
.knowledge-status-pill.is-loading { color: #195f9d; background: var(--accent-soft); }
.knowledge-status-pill.is-error { color: #aa241e; background: #fde4e2; }

.knowledge-readiness {
  padding: 18px;
  border: 1px solid rgba(22, 131, 248, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.knowledge-readiness span,
.knowledge-readiness strong {
  display: block;
}

.knowledge-readiness span {
  color: var(--muted);
  font-size: 0.64rem;
}

.knowledge-readiness strong {
  margin-top: 5px;
  font-size: 1.55rem;
}

.knowledge-readiness-track {
  height: 7px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce4ed;
}

.knowledge-readiness-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1683f8, #58c8a2);
  transition: width 0.35s ease;
}

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

.knowledge-metrics article {
  display: flex;
  min-height: 78px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.knowledge-metric-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: #17624f;
  background: #daf3e9;
  font-size: 0.68rem;
  font-weight: 700;
}

.knowledge-metric-icon.is-samples { color: #195f9d; background: var(--accent-soft); }
.knowledge-metric-icon.is-generation { color: #6f4a00; background: #fff0c8; }
.knowledge-metrics small,
.knowledge-metrics strong { display: block; }
.knowledge-metrics small { color: var(--muted); font-size: 0.62rem; }
.knowledge-metrics strong { margin-top: 4px; font-size: 1rem; }

.knowledge-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 12px;
}

.knowledge-upload-card,
.knowledge-evidence-card,
.knowledge-rules-card,
.knowledge-samples-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 26, 28, 0.035);
}

.knowledge-upload-card,
.knowledge-evidence-card {
  padding: 18px;
}

.knowledge-upload-card > header,
.knowledge-evidence-card > header,
.knowledge-rules-head,
.knowledge-samples-card > header {
  position: static;
  z-index: auto;
  display: flex;
  width: auto;
  height: auto;
  min-height: 0;
  gap: 11px;
  align-items: flex-start;
  border: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.knowledge-card-step {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #195f9d;
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
}

.knowledge-upload-card h3,
.knowledge-evidence-card h3,
.knowledge-rules-card h3,
.knowledge-samples-card h3 {
  font-size: 0.9rem;
}

.knowledge-upload-card header p,
.knowledge-evidence-card header p,
.knowledge-rules-card header p,
.knowledge-samples-card header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.4;
}

.knowledge-dropzone {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 7px;
  margin-top: 16px;
  padding: 20px;
  border: 1.5px dashed #b9cce0;
  border-radius: 13px;
  background: #f8fbff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.knowledge-dropzone:hover,
.knowledge-dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.knowledge-dropzone svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.knowledge-dropzone strong { font-size: 0.76rem; }
.knowledge-dropzone span { color: var(--muted); font-size: 0.62rem; }

.knowledge-upload-actions {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
}

.knowledge-upload-actions > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-upload-actions > span.is-error { color: var(--error); }
.knowledge-upload-actions > span.is-success { color: #17624f; }

.knowledge-safety-note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-top: 10px;
  padding: 11px;
  border-radius: 10px;
  color: #5b6068;
  background: #f3f4f6;
  font-size: 0.62rem;
  line-height: 1.45;
}

.knowledge-safety-note > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #195f9d;
  background: #dcecff;
  font-weight: 700;
}

.knowledge-evidence-list {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.knowledge-evidence-title {
  display: flex;
  gap: 6px;
  align-items: center;
}

.knowledge-evidence-title .info-hint {
  margin-left: 0;
}

.knowledge-evidence-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.knowledge-evidence-item > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  font-size: 0.66rem;
  font-weight: 700;
}

.knowledge-evidence-item.is-confirmed > span { color: #17624f; background: #daf3e9; }
.knowledge-evidence-item.is-pending > span { color: #195f9d; background: #dcecff; }
.knowledge-evidence-item.is-missing > span { color: #815400; background: #fff0c8; }
.knowledge-evidence-item strong { font-size: 0.68rem; }
.knowledge-evidence-item p { margin-top: 3px; color: var(--muted); font-size: 0.6rem; line-height: 1.35; }

.knowledge-evidence-info {
  align-self: center;
  margin: 0;
}

.knowledge-rules-card,
.knowledge-samples-card {
  margin-top: 12px;
  overflow: hidden;
}

.knowledge-rules-head {
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.knowledge-rules-head > div:first-child {
  display: flex;
  gap: 11px;
}

.knowledge-downloads {
  display: flex;
  gap: 6px;
}

.knowledge-downloads a {
  display: inline-flex;
  min-height: 32px;
  gap: 7px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font-size: 0.66rem;
  font-weight: 600;
  text-decoration: none;
}

.knowledge-downloads a:hover { border-color: #aeb2b8; background: #f5f6f7; }

.knowledge-rules-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
}

.knowledge-code-wrap {
  min-width: 0;
  background: #1f1d20;
}

.knowledge-code-head {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.58);
  font-family: var(--font-mono);
  font-size: 0.6rem;
}

.knowledge-code-head button {
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  cursor: pointer;
  font-size: 0.58rem;
}

.knowledge-code-wrap pre {
  max-height: 430px;
  overflow: auto;
  padding: 18px;
  color: #d8e9fb;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.62;
  white-space: pre-wrap;
}

.knowledge-rules-table-wrap {
  min-width: 0;
  overflow-x: auto;
}

.knowledge-rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.66rem;
}

.knowledge-rules-table th {
  padding: 11px 12px;
  color: var(--muted);
  background: #f7f8f9;
  font-size: 0.6rem;
  font-weight: 600;
  text-align: left;
}

.knowledge-rules-table td {
  padding: 12px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.knowledge-rules-table td:first-child { width: 54%; }
.knowledge-rules-table strong,
.knowledge-rules-table small { display: block; }
.knowledge-rules-table small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.knowledge-rule-status { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: #f0f1f3; }

.knowledge-samples-card > header {
  padding: 17px 18px 12px;
}

.knowledge-samples-list {
  display: grid;
  border-top: 1px solid var(--border);
}

.knowledge-sample-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(160px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.knowledge-sample-row:last-child { border-bottom: 0; }
.knowledge-sample-format { display: grid; width: 42px; height: 34px; place-items: center; border-radius: 9px; color: #195f9d; background: var(--accent-soft); font-family: var(--font-mono); font-size: 0.58rem; font-weight: 700; }
.knowledge-sample-row strong { font-size: 0.7rem; }
.knowledge-sample-row p { margin-top: 3px; color: var(--muted); font-size: 0.6rem; }
.knowledge-sample-meta { color: #815400; font-size: 0.62rem; text-align: right; }
.knowledge-sample-meta small { display: block; margin-top: 3px; color: var(--muted); }
.knowledge-samples-empty { display: flex; gap: 12px; align-items: center; padding: 22px 18px; color: var(--muted); }
.knowledge-samples-empty > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #f0f1f3; }
.knowledge-samples-empty strong { color: var(--text); font-size: 0.72rem; }
.knowledge-samples-empty p { margin-top: 3px; font-size: 0.62rem; }

@media (max-width: 1000px) {
  .knowledge-platform-hero {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .knowledge-platform-mark {
    width: 64px;
    height: 64px;
  }

  .knowledge-readiness {
    grid-column: 1 / -1;
  }

  .knowledge-grid,
  .knowledge-rules-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .knowledge-page-head,
  .knowledge-rules-head {
    align-items: stretch;
    flex-direction: column;
  }

  .knowledge-page-head .btn-primary {
    width: 100%;
  }

  .knowledge-platform-hero {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 13px;
    padding: 17px;
  }

  .knowledge-platform-mark {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    font-size: 1.35rem;
  }

  .knowledge-platform-title h2 {
    font-size: 1.1rem;
  }

  .knowledge-metrics {
    grid-template-columns: 1fr;
  }

  .knowledge-upload-card,
  .knowledge-evidence-card {
    padding: 14px;
  }

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

  .knowledge-upload-actions .btn-primary,
  .knowledge-downloads {
    width: 100%;
  }

  .knowledge-downloads a {
    flex: 1;
    justify-content: center;
  }

  .knowledge-sample-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .knowledge-sample-meta {
    grid-column: 2;
    text-align: left;
  }

  .platform-filter-menu,
  .dealer-platform-filter {
    width: 100%;
  }
}

/* Stage 7 final calibration: keep the focused journey above legacy knowledge styles. */
.knowledge-view {
  max-width: 1280px;
  margin: 0 auto;
}

.knowledge-page-head {
  margin-bottom: 12px;
}

.knowledge-platform-hero {
  min-height: 116px;
  grid-template-columns: 58px minmax(0, 1fr) minmax(210px, 260px);
  gap: 16px;
  padding: 18px 20px;
}

.knowledge-platform-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  font-size: 1.5rem;
}

.knowledge-platform-title h2 {
  margin: 5px 0 3px;
  font-size: 1.2rem;
}

.knowledge-platform-title p {
  font-size: 0.71rem;
}

.knowledge-readiness {
  padding: 14px 15px;
}

.knowledge-readiness > strong {
  margin-top: 4px;
  font-size: 0.82rem;
}

.knowledge-readiness-track {
  height: 5px;
  margin-top: 9px;
}

.knowledge-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 12px;
  margin-top: 12px;
}

.knowledge-upload-card,
.knowledge-evidence-card {
  padding: 20px;
}

.knowledge-upload-card > header,
.knowledge-evidence-card > header {
  padding-bottom: 14px;
}

.knowledge-upload-card h3,
.knowledge-evidence-card h3 {
  margin-top: 3px;
  font-size: 1rem;
}

.knowledge-evidence-list {
  gap: 6px;
  margin-top: 0;
}

.knowledge-evidence-item {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px;
}

@media (max-width: 1000px) {
  .knowledge-platform-hero {
    grid-template-columns: 58px minmax(0, 1fr);
  }

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

@media (max-width: 700px) {
  .knowledge-mode-switch,
  .knowledge-paired-flow,
  .knowledge-acceptance,
  .knowledge-evidence-list {
    grid-template-columns: 1fr;
  }

  .mapping-note-card {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-inline: 14px;
    padding: 14px;
  }

  .feed-detail-head,
  .feed-detail-grid,
  .feed-detail-metrics {
    grid-template-columns: 1fr;
  }

  .feed-detail-head-actions,
  .feed-detail-next-step {
    align-items: stretch;
    flex-direction: column;
  }

  .feed-detail-head-actions > *,
  .feed-detail-next-step .btn-primary {
    width: 100%;
    text-align: center;
  }

  .feed-detail-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .feed-detail-title h1 {
    white-space: normal;
  }

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

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

  .dealer-detail-metrics {
    flex-wrap: wrap;
  }

  .dealer-flow {
    grid-template-columns: 280px 24px 330px 24px 400px;
    overflow-x: auto;
  }

  .dealer-flow.is-level-1 {
    grid-template-columns: 280px;
  }

  .dealer-flow.is-level-2 {
    grid-template-columns: 280px 24px 330px;
  }
}

/* Users directory — follows the compact Auto.ru Business account pattern. */
body[data-active-view="users"] > .workspace-context {
  display: none;
}

body:not(.auth-locked) > main#view-users.users-view {
  width: min(980px, calc(100% - 32px));
  max-width: 980px;
  margin-right: auto;
  margin-left: var(--product-page-gutter);
  margin-top: 28px;
}

.users-page {
  overflow: visible;
  padding: 28px 36px 0;
  border: 1px solid #eceef0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(28, 26, 28, 0.04);
}

.users-page-head {
  position: relative;
  z-index: 30;
  width: auto;
  height: auto;
  min-height: 72px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 0 0 18px;
  border-bottom: 1px solid #e5e7e9;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.users-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.users-title-row h1 {
  color: var(--text);
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.users-help {
  position: relative;
}

.users-help summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 1px solid #2c282c;
  border-radius: 9px;
  background: #fff;
  color: #2c282c;
  cursor: pointer;
  font-size: 0.68rem;
  list-style: none;
}

.users-help summary::-webkit-details-marker {
  display: none;
}

.users-help summary > span {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #2c282c;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 0.64rem;
  font-weight: 700;
}

.users-help > div {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  padding: 13px;
  border: 1px solid #dfe1e4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(28, 26, 28, 0.2);
}

.users-help > div strong {
  font-size: 0.72rem;
}

.users-help > div p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.63rem;
  line-height: 1.45;
}

.users-add-button {
  min-height: 42px;
  padding: 9px 20px;
  border: 0;
  border-radius: 12px;
  background: #2c282c;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
}

.users-add-button:hover,
.users-add-button:focus-visible {
  background: #403b40;
}

.users-filters {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(240px, 1.25fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr) auto;
  gap: 10px;
  padding: 18px 0 12px;
}

.users-filters label,
.users-search {
  min-width: 0;
}

.users-filters select,
.users-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #bfc3c8;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.68rem;
}

.users-filters select {
  padding: 0 38px 0 13px;
}

.users-search {
  position: relative;
  display: block;
}

.users-search svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #969ba1;
  stroke-linecap: round;
  stroke-width: 1.8;
  transform: translateY(-50%);
}

.users-search input {
  padding: 0 12px 0 38px;
}

.users-reset-filters {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #bfc3c8;
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.64rem;
}

.users-directory {
  min-height: 240px;
}

.users-directory-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 18px;
  padding: 12px 0 14px;
}

.users-directory-main {
  min-width: 0;
}

.users-directory-main > strong,
.users-directory-main > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-directory-main > strong {
  font-size: 0.86rem;
  font-weight: 600;
}

.users-directory-main > span {
  margin-top: 3px;
  color: #777b81;
  font-size: 0.65rem;
}

.users-directory-meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(40px, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.users-directory-meta > strong {
  font-size: 0.69rem;
  font-weight: 500;
}

.users-directory-meta > strong.is-admin {
  color: var(--accent-strong);
  font-weight: 600;
}

.users-directory-meta > span {
  height: 1px;
  border-top: 1px dotted #c9ccd0;
}

.users-directory-meta > small {
  color: #424954;
  font-size: 0.63rem;
  font-weight: 600;
}

.users-directory-meta > small.is-inactive {
  color: #8a8e94;
}

.users-directory-meta > small.is-pending,
.users-directory-meta > small.is-expired {
  color: #b42318;
}

.user-approval-button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #e60000;
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 700;
}

.user-approval-button:hover,
.user-approval-button:focus-visible {
  background: #c90000;
}

.users-directory-item + .users-directory-item {
  border-top: 0;
}

.users-directory-item .user-actions-trigger {
  width: 34px;
  height: 30px;
  border-color: transparent;
  font-size: 0.82rem;
}

.users-directory-item .user-actions-trigger:hover,
.users-directory-item .user-row-actions.is-open .user-actions-trigger {
  border-color: transparent;
  background: #eef0f2;
}

.users-directory-item .user-actions-popover {
  top: 36px;
}

.users-directory-loading,
.users-directory-empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.users-directory-loading span {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  border: 3px solid #dde1e5;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: result-spin 0.9s linear infinite;
}

.users-directory-empty strong {
  color: var(--text);
  font-size: 0.9rem;
}

.users-directory-empty p {
  margin-top: 6px;
  font-size: 0.72rem;
}

.users-page-footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 -36px;
  padding: 10px 36px;
  border-top: 1px solid #e5e7e9;
  border-radius: 0 0 24px 24px;
  background: #fafbfc;
  color: var(--muted);
  font-size: 0.62rem;
}

.users-page-footer > span:last-child {
  margin-left: auto;
}

@media (max-width: 860px) {
  body:not(.auth-locked) > main#view-users.users-view {
    width: min(100% - 20px, 1240px);
    max-width: none;
    margin-right: auto;
    margin-left: 10px;
    margin-top: 12px;
  }

  .users-page {
    padding: 20px 16px 0;
    border-radius: 18px;
  }

  .users-page-head {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .users-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .users-add-button {
    width: 100%;
  }

  .users-filters {
    grid-template-columns: 1fr;
  }

  .users-directory-item {
    padding-block: 12px;
  }

  .users-directory-meta {
    grid-template-columns: auto minmax(20px, 1fr);
  }

  .users-directory-meta > small {
    grid-column: 1 / -1;
  }

  .users-page-footer {
    align-items: flex-start;
    flex-direction: column;
    margin-inline: -16px;
    padding: 10px 16px;
  }

  .users-page-footer > span:last-child {
    margin-left: 0;
  }
}

/* Keep mapping decisions readable and actionable on a phone-sized viewport. */
@media (max-width: 860px) {
  .mapping-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 18px 14px 16px;
  }

  .mapping-state-badge {
    max-width: 100%;
    align-self: flex-start;
    white-space: normal;
  }

  .mapping-file-bar {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 14px;
  }

  .price-decision-card,
  .import-question-card {
    margin-inline: 14px;
  }

  .mapping-diagnostics > summary {
    align-items: flex-start;
    padding: 14px;
  }

  .mapping-summary {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    border-top: 1px solid var(--border);
  }

  .mapping-summary > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-left: 0;
    border-bottom: 1px solid #edf0f2;
  }

  .mapping-summary > div:last-child {
    border-bottom: 0;
  }

  .mapping-summary strong {
    margin-top: 0;
  }

  .mapping-profile-bar {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 14px;
  }

  .mapping-profile-controls {
    grid-template-columns: 1fr;
  }

  .mapping-profile-delete {
    width: 100%;
  }

  .automatic-import-summary {
    grid-template-columns: 44px minmax(0, 1fr);
    margin: 14px;
  }

  .automatic-import-summary .btn-secondary {
    grid-column: 1 / -1;
    width: 100%;
  }

  .mapping-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 14px;
  }

  .mapping-filters {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .mapping-groups {
    padding: 14px;
  }

  .mapping-group-head {
    min-height: 0;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
  }

  .mapping-group-head > span {
    max-width: 48%;
    white-space: normal;
  }

  .mapping-field-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    min-height: 0;
    padding: 12px;
  }

  .mapping-target {
    grid-column: 1;
  }

  .mapping-field-row > .required-badge,
  .mapping-field-row > .optional-badge {
    grid-column: 2;
    justify-self: end;
  }

  .mapping-field-result,
  .mapping-combobox {
    grid-column: 1 / -1;
  }

  .mapping-field-result-text {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .mapping-select-popover {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .mapping-filters {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .mapping-filter {
    width: 100%;
    justify-content: space-between;
  }
}

/* Personal workspace themes */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 15px;
  border: 0;
}

.theme-option {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.theme-option:hover {
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.theme-option.selected {
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px var(--accent);
}

.theme-option:has(input:focus-visible) {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.theme-option:has(input:disabled) {
  cursor: wait;
  opacity: 0.72;
}

.theme-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-preview {
  position: relative;
  display: block;
  height: 88px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-preview::before {
  position: absolute;
  inset: 10px 18px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  content: "";
}

.theme-preview-light {
  background:
    radial-gradient(circle at 82% 18%, rgba(22, 131, 248, 0.12), transparent 30%),
    linear-gradient(145deg, #fff, #e9ebee);
}

.theme-preview-light::before {
  background-image: url("/static/assets/brand/arb-car-black.svg");
  opacity: 0.72;
}

.theme-preview-dark {
  background:
    radial-gradient(circle at 88% 12%, rgba(230, 0, 0, 0.32), transparent 34%),
    linear-gradient(145deg, #3b2024, #1c1a1c);
}

.theme-preview-dark::before {
  background-image: url("/static/assets/brand/arb-car-sand.svg");
  opacity: 0.56;
}

.theme-option-footer {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.045);
}

.theme-option-footer strong {
  font-size: 0.76rem;
}

.theme-option-check {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: transparent;
  font-size: 0.62rem;
}

.theme-option.selected .theme-option-check {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.theme-save-status {
  display: block;
  min-height: 18px;
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.65rem;
  text-align: right;
}

.theme-save-status.is-saving {
  color: #8fc5ff;
}

.theme-save-status.is-success {
  color: #8fd4ad;
}

.theme-save-status.is-error {
  color: #ff9b95;
}

body[data-theme="dark"]:not(.auth-locked) {
  --bg: #201e20;
  --panel: #2a272a;
  --panel-strong: #343034;
  --border: rgba(255, 255, 255, 0.12);
  --text: #f5f2ef;
  --muted: #aaa6aa;
  --accent-strong: #8fc5ff;
  --accent-soft: rgba(22, 131, 248, 0.18);
  --success: #7ed5b8;
  --warning: #f4c777;
  --error: #ff8e87;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 5px 18px rgba(0, 0, 0, 0.2);
  color-scheme: dark;
  background:
    radial-gradient(circle at 92% 5%, rgba(230, 0, 0, 0.24), transparent 34%),
    radial-gradient(circle at 18% 82%, rgba(219, 208, 195, 0.08), transparent 32%),
    linear-gradient(145deg, #3b2024 0%, #272326 38%, #1c1a1c 100%);
  background-attachment: fixed;
}

body[data-theme="dark"]:not(.auth-locked)::before {
  position: fixed;
  z-index: 3;
  right: 2%;
  bottom: 3%;
  width: min(780px, 66vw);
  aspect-ratio: 390 / 200;
  background: url("/static/assets/brand/arb-car-sand.svg") center / contain no-repeat;
  content: "";
  opacity: 0.036;
  pointer-events: none;
}

body[data-theme="dark"]:not(.auth-locked) > .workspace-context,
body[data-theme="dark"]:not(.auth-locked) .workflow-header,
body[data-theme="dark"]:not(.auth-locked) .card,
body[data-theme="dark"]:not(.auth-locked) .section-filter-menu,
body[data-theme="dark"]:not(.auth-locked) .color-learning-heading,
body[data-theme="dark"]:not(.auth-locked) .color-learning-mode,
body[data-theme="dark"]:not(.auth-locked) .color-import-review,
body[data-theme="dark"]:not(.auth-locked) .feeds-list-card,
body[data-theme="dark"]:not(.auth-locked) .colors-list-card,
body[data-theme="dark"]:not(.auth-locked) .audit-summary-card,
body[data-theme="dark"]:not(.auth-locked) .audit-list-card,
body[data-theme="dark"]:not(.auth-locked) .dealers-list-card,
body[data-theme="dark"]:not(.auth-locked) .users-page,
body[data-theme="dark"]:not(.auth-locked) .user-admin {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(42, 39, 42, 0.94);
  box-shadow: var(--shadow-soft);
}

body[data-theme="dark"]:not(.auth-locked) .color-import-review-row,
body[data-theme="dark"]:not(.auth-locked) .color-import-queue-empty,
body[data-theme="dark"]:not(.auth-locked) .color-import-queue-tabs button {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

body[data-theme="dark"]:not(.auth-locked) .color-import-queue-tabs button strong {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"]:not(.auth-locked) .color-import-queue-tabs button.is-active {
  border-color: rgba(143, 197, 255, 0.48);
  color: #b9dcff;
  background: rgba(22, 131, 248, 0.16);
}

body[data-theme="dark"]:not(.auth-locked) .section-filter-notice,
body[data-theme="dark"]:not(.auth-locked) .section-filter-bar,
body[data-theme="dark"]:not(.auth-locked) .dealers-alert,
body[data-theme="dark"]:not(.auth-locked) .upload-actions,
body[data-theme="dark"]:not(.auth-locked) .upload-sidebar,
body[data-theme="dark"]:not(.auth-locked) .dropzone,
body[data-theme="dark"]:not(.auth-locked) .users-help summary,
body[data-theme="dark"]:not(.auth-locked) .users-help > div {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

body[data-theme="dark"]:not(.auth-locked) .color-help-trigger {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"]:not(.auth-locked) input,
body[data-theme="dark"]:not(.auth-locked) select,
body[data-theme="dark"]:not(.auth-locked) textarea,
body[data-theme="dark"]:not(.auth-locked) .context-select-trigger,
body[data-theme="dark"]:not(.auth-locked) .section-filter-control,
body[data-theme="dark"]:not(.auth-locked) .dealer-filter-control,
body[data-theme="dark"]:not(.auth-locked) .feed-filter-menu > summary,
body[data-theme="dark"]:not(.auth-locked) .context-select-popover,
body[data-theme="dark"]:not(.auth-locked) .workspace-menu-popover {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
  background-color: #312e31;
}

body[data-theme="dark"]:not(.auth-locked) input:disabled,
body[data-theme="dark"]:not(.auth-locked) select:disabled,
body[data-theme="dark"]:not(.auth-locked) textarea:disabled {
  color: #9d999d;
  background: #373437;
}

body[data-theme="dark"]:not(.auth-locked) .btn-secondary,
body[data-theme="dark"]:not(.auth-locked) .btn-quiet,
body[data-theme="dark"]:not(.auth-locked) .dropzone-action,
body[data-theme="dark"]:not(.auth-locked) .file-action,
body[data-theme="dark"]:not(.auth-locked) .context-add,
body[data-theme="dark"]:not(.auth-locked) .workspace-menu > summary {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"]:not(.auth-locked) .btn-primary,
body[data-theme="dark"]:not(.auth-locked) .toolbar-create-feed {
  border-color: #f5f2ef;
  color: #1c1a1c;
  background: #f5f2ef;
}

body[data-theme="dark"]:not(.auth-locked) .btn-primary:hover,
body[data-theme="dark"]:not(.auth-locked) .toolbar-create-feed:hover {
  border-color: var(--sand);
  background: var(--sand);
}

body[data-theme="dark"]:not(.auth-locked) .btn-primary:disabled {
  border-color: rgba(255, 255, 255, 0.12);
  color: #b9b5b9;
  background: rgba(255, 255, 255, 0.09);
}

body[data-theme="dark"]:not(.auth-locked) input::placeholder,
body[data-theme="dark"]:not(.auth-locked) textarea::placeholder {
  color: #aaa6aa;
  opacity: 1;
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .mapping-group,
  .settings-section,
  .result-state-head,
  .result-context-grid,
  .result-summary-card,
  .result-link-card,
  .result-sidebar,
  .result-actions,
  .result-error-card,
  .feed-detail-metrics article,
  .feed-detail-card,
  .feed-detail-next-step,
  .feed-lifecycle-panel,
  .colors-picker-panel,
  .color-delete-panel,
  .audit-operation-card,
  .dealer-flow-column,
  .knowledge-metric,
  .knowledge-upload-card,
  .knowledge-evidence-card,
  .knowledge-rules-card,
  .knowledge-samples-card,
  .review-stage-head,
  .review-outcome,
  .review-resolution-panel,
  .validation-global-card,
  .vehicle-review-card,
  .vehicle-review-head,
  .result-acceptance-card
) {
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
  background: rgba(42, 39, 42, 0.96);
}

/* Knowledge base: keep every text/background pair readable in dark theme. */
body[data-theme="dark"]:not(.auth-locked) .knowledge-platform-hero {
  border-color: rgba(143, 197, 255, 0.22);
  color: var(--text);
  background:
    radial-gradient(circle at 86% 20%, rgba(22, 131, 248, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(52, 48, 52, 0.98), rgba(42, 39, 42, 0.98));
  box-shadow: var(--shadow-soft);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-platform-title h2,
body[data-theme="dark"]:not(.auth-locked) .knowledge-readiness strong,
body[data-theme="dark"]:not(.auth-locked) .knowledge-file-slot strong,
body[data-theme="dark"]:not(.auth-locked) .knowledge-evidence-item strong,
body[data-theme="dark"]:not(.auth-locked) .knowledge-sample-row strong {
  color: var(--text);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-platform-title p,
body[data-theme="dark"]:not(.auth-locked) .knowledge-readiness span,
body[data-theme="dark"]:not(.auth-locked) .knowledge-file-slot p,
body[data-theme="dark"]:not(.auth-locked) .knowledge-evidence-item p,
body[data-theme="dark"]:not(.auth-locked) .knowledge-sample-row p,
body[data-theme="dark"]:not(.auth-locked) .knowledge-sample-meta small {
  color: #c2bec2;
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-readiness {
  border-color: rgba(143, 197, 255, 0.2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-readiness-track {
  background: rgba(255, 255, 255, 0.13);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-mode-switch {
  background: rgba(255, 255, 255, 0.07);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-mode-switch button {
  color: #c5c1c5;
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-mode-switch button small {
  color: #aaa6aa;
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-mode-switch button.is-active {
  color: #fff;
  background: rgba(143, 197, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(143, 197, 255, 0.34);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-mode-switch button.is-active small {
  color: #8fc5ff;
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-file-slot {
  border-color: rgba(143, 197, 255, 0.42);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-file-slot:hover,
body[data-theme="dark"]:not(.auth-locked) .knowledge-file-slot.is-dragover {
  border-color: #8fc5ff;
  background: rgba(22, 131, 248, 0.14);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-file-slot.has-file {
  border-color: rgba(126, 213, 184, 0.64);
  background: rgba(126, 213, 184, 0.1);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-file-number {
  color: #8fc5ff;
  background: rgba(22, 131, 248, 0.2);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-file-slot.has-file .knowledge-file-number {
  color: #9ce3cb;
  background: rgba(126, 213, 184, 0.16);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-file-action,
body[data-theme="dark"]:not(.auth-locked) .knowledge-source-link {
  color: #8fc5ff;
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-flow-arrow {
  color: #c2bec2;
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-target-only-note {
  color: #e7d7ad;
  background: rgba(244, 199, 119, 0.12);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-acceptance {
  border-color: rgba(255, 255, 255, 0.11);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-acceptance-note > span,
body[data-theme="dark"]:not(.auth-locked) .knowledge-case-confirmations label {
  color: var(--text);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-safety-note {
  color: #d1cdd1;
  background: rgba(255, 255, 255, 0.055);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-evidence-item {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.025);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-samples-card h3 span,
body[data-theme="dark"]:not(.auth-locked) .knowledge-rule-status,
body[data-theme="dark"]:not(.auth-locked) .knowledge-samples-empty > span {
  color: #d2ced2;
  background: rgba(255, 255, 255, 0.09);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-sample-meta {
  color: #f4c777;
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-downloads a {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-downloads a:hover {
  border-color: rgba(143, 197, 255, 0.7);
  color: #fff;
  background: rgba(22, 131, 248, 0.16);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-rules-table th {
  color: #bdb9bd;
  background: rgba(255, 255, 255, 0.045);
}

body[data-theme="dark"]:not(.auth-locked) .knowledge-technical-details > summary {
  color: var(--text);
}

body[data-theme="dark"]:not(.auth-locked) #knowledgeCreateFeed:disabled {
  border-color: rgba(255, 255, 255, 0.16);
  color: #c6c2c6;
  background: rgba(255, 255, 255, 0.09);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-actions-popover,
  .color-actions-popover,
  .user-actions-popover,
  .mapping-profile-popover,
  .mapping-select-popover,
  .feed-filter-popover,
  .feed-filter-drawer,
  .feed-filter-drawer > header,
  .feed-filter-drawer > footer
) {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
  background: #312e31;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-actions-popover a,
  .feed-actions-popover button,
  .color-actions-popover button,
  .user-actions-popover button,
  .mapping-profile-option,
  .mapping-select-option,
  .platform-choice
) {
  color: var(--text);
  background: transparent;
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-actions-popover a,
  .feed-actions-popover button,
  .color-actions-popover button,
  .user-actions-popover button,
  .mapping-profile-option,
  .mapping-select-option,
  .platform-choice
):hover {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-actions-trigger,
  .color-actions-trigger,
  .user-actions-trigger,
  .dealer-open-feeds
) {
  border-color: rgba(255, 255, 255, 0.16);
  color: #f5f2ef;
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-actions-trigger,
  .color-actions-trigger,
  .user-actions-trigger,
  .dealer-open-feeds
):hover {
  border-color: rgba(143, 197, 255, 0.72);
  color: #fff;
  background: rgba(22, 131, 248, 0.2);
}

body[data-theme="dark"]:not(.auth-locked) .users-directory-item .user-actions-trigger:hover,
body[data-theme="dark"]:not(.auth-locked) .users-directory-item .user-row-actions.is-open .user-actions-trigger {
  border-color: rgba(143, 197, 255, 0.72);
  background: rgba(22, 131, 248, 0.2);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .users-directory-main > span,
  .users-directory-meta > small,
  .users-page-footer,
  .user-current-note
) {
  color: #b9b5b9;
}

body[data-theme="dark"]:not(.auth-locked) .users-directory-meta > span {
  border-color: rgba(255, 255, 255, 0.22);
}

body[data-theme="dark"]:not(.auth-locked) .sidebar-knowledge-search {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: #3a373a;
}

body[data-theme="dark"]:not(.auth-locked) .sidebar-knowledge-search input {
  border: 0;
  color: #fff;
  background: transparent;
}

body[data-theme="dark"]:not(.auth-locked) .sidebar-knowledge-search input::placeholder {
  color: rgba(255, 255, 255, 0.68);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feeds-list-card .feeds-toolbar,
  .colors-toolbar,
  .audit-toolbar,
  .dealers-filter-bar
) {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feeds-scope,
  .feed-filter-chip,
  .feeds-search,
  .color-filter-chip,
  .colors-search,
  .audit-filter-chip,
  .audit-search,
  .dealers-reset-filters
) {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text);
  background: rgba(255, 255, 255, 0.065);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-filter-chip,
  .color-filter-chip,
  .audit-filter-chip
).is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-scope-tab {
  color: var(--muted);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-scope-tab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .colors-empty-state > span,
  .mode-soon,
  .feed-file-icon,
  .feed-car-count,
  .feed-detail-status,
  .colors-company-badge,
  .color-raw-icon,
  .color-source-badge,
  .audit-summary-icon,
  .audit-operation-icon,
  .audit-loaded-badge,
  .audit-event-icon,
  .dealer-creator-cell > span,
  .user-role-badge,
  .resolution-counter,
  .review-status-pill,
  .vehicle-issue-icon
) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

body[data-theme="dark"]:not(.auth-locked) .info-hint {
  border-color: #9da3ac;
  color: #b8bdc5;
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .color-source-badge.is-learned,
  .feed-lifecycle-badge.is-connected,
  .review-status-pill.is-ready
) {
  color: var(--success);
  background: rgba(126, 213, 184, 0.14);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-lifecycle-badge.is-trash,
  .review-status-pill.is-error,
  .vehicle-issue-icon.is-error
) {
  color: var(--error);
  background: rgba(255, 142, 135, 0.14);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feed-review-note,
  .review-status-pill.is-review,
  .vehicle-issue-icon.is-review,
  .result-review-note
) {
  color: var(--warning);
  background: rgba(244, 199, 119, 0.14);
}

body[data-theme="dark"]:not(.auth-locked) .feed-lifecycle-badge.is-archived {
  color: #c4c0c4;
  background: rgba(255, 255, 255, 0.09);
}

body[data-theme="dark"]:not(.auth-locked) .feed-status-dot {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.09);
}

body[data-theme="dark"]:not(.auth-locked) .feed-status-dot.is-ready {
  box-shadow: 0 0 0 4px rgba(126, 213, 184, 0.14);
}

body[data-theme="dark"]:not(.auth-locked) .feed-status-dot.is-progress {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

body[data-theme="dark"]:not(.auth-locked) .feed-status-dot.is-attention {
  box-shadow: 0 0 0 4px rgba(255, 142, 135, 0.16);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .feeds-product-table,
  .colors-product-table,
  .audit-product-table,
  .dealers-table
) tbody tr.is-selected td {
  background: rgba(22, 131, 248, 0.13);
}

body[data-theme="dark"]:not(.auth-locked) table,
body[data-theme="dark"]:not(.auth-locked) thead,
body[data-theme="dark"]:not(.auth-locked) th,
body[data-theme="dark"]:not(.auth-locked) td {
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
  background-color: transparent;
}

body[data-theme="dark"]:not(.auth-locked) th {
  color: var(--muted);
  background-color: rgba(255, 255, 255, 0.035);
}

body[data-theme="dark"]:not(.auth-locked) tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"]:not(.auth-locked) .users-page-head {
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs {
  background: rgba(255, 255, 255, 0.07);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs button {
  color: var(--muted);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs button.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.24);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs strong {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-lifecycle-tabs button.is-active strong {
  color: #8fc5ff;
  background: rgba(22, 131, 248, 0.18);
}

body[data-theme="dark"]:not(.auth-locked) .feeds-list-footer,
body[data-theme="dark"]:not(.auth-locked) .colors-list-footer,
body[data-theme="dark"]:not(.auth-locked) .audit-list-footer,
body[data-theme="dark"]:not(.auth-locked) .dealers-list-footer,
body[data-theme="dark"]:not(.auth-locked) .users-page-footer {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
}

body[data-theme="dark"]:not(.auth-locked) .users-help summary > span {
  color: #1c1a1c;
  background: #f5f2ef;
}

body[data-theme="dark"]:not(.auth-locked) .profile-panel {
  color-scheme: light;
}

body[data-theme="dark"]:not(.auth-locked) .profile-fields input {
  border-color: #dfe1e4;
  color: #1c1a1c;
  background: #fff;
}

body[data-theme="dark"]:not(.auth-locked) .profile-fields input:disabled {
  color: #74777d;
  background: #f0f1f2;
}

body[data-theme="dark"]:not(.auth-locked) .profile-panel .avatar-option.selected {
  color: #8fc5ff;
}

@media (max-width: 560px) {
  .theme-picker {
    grid-template-columns: 1fr;
  }
}

/* ── Photo bank ──────────────────────────────────────────────────────────── */
.photobank-view {
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 34px 54px;
}

.photobank-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.photobank-page-head h1 {
  margin: 3px 0 6px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.photobank-page-head p {
  color: var(--muted);
}

.photobank-state {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  font-size: 0.72rem;
  font-weight: 700;
}

.photobank-state.is-configured {
  border-color: rgba(38, 122, 100, 0.24);
  color: var(--success);
  background: rgba(38, 122, 100, 0.08);
}

.photobank-state.is-warning {
  border-color: rgba(155, 100, 0, 0.28);
  color: var(--warning);
  background: rgba(155, 100, 0, 0.08);
}

.photobank-intro {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid #bddcff;
  border-radius: 14px;
  background: var(--accent-soft);
}

.photobank-intro-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--accent);
}

.photobank-intro-icon svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.photobank-intro strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.94rem;
}

.photobank-intro p {
  max-width: 860px;
  color: #47647f;
  font-size: 0.78rem;
  line-height: 1.45;
}

.photobank-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.photobank-card,
.photobank-guide {
  border: var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.photobank-form {
  padding: 22px;
}

.photobank-form > header,
.photobank-guide > section {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
}

.photobank-form > header {
  margin-bottom: 18px;
}

.photobank-step {
  display: grid;
  width: 34px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font: 700 0.68rem var(--font-mono);
}

.photobank-form h2,
.photobank-guide h2 {
  font-size: 1rem;
}

.photobank-form header p,
.photobank-guide section > div > p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.photobank-type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-strong);
}

.photobank-type-switch button {
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.photobank-type-switch button.is-active {
  border-color: var(--border);
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(28, 26, 28, 0.08);
}

.photobank-type-switch strong,
.photobank-type-switch small {
  display: block;
}

.photobank-type-switch strong {
  font-size: 0.79rem;
}

.photobank-type-switch small {
  margin-top: 3px;
  font-size: 0.66rem;
}

.photobank-field {
  display: block;
  margin-top: 14px;
}

.photobank-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

.photobank-field input,
.photobank-field select {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
}

.photobank-field small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.photobank-mode-fields {
  padding: 2px 2px 0;
}

.photobank-detection {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-strong);
}

.photobank-detection > span {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.photobank-detection p,
.photobank-detection strong,
.photobank-detection small {
  display: block;
}

.photobank-detection strong {
  font-size: 0.72rem;
}

.photobank-detection small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.4;
}

.photobank-detection.is-ready {
  border-color: rgba(38, 122, 100, 0.24);
  background: rgba(38, 122, 100, 0.06);
}

.photobank-detection.is-ready > span {
  background: var(--success);
}

.photobank-detection.is-planned,
.photobank-detection.is-warning {
  border-color: rgba(155, 100, 0, 0.24);
  background: rgba(155, 100, 0, 0.06);
}

.photobank-detection.is-planned > span,
.photobank-detection.is-warning > span {
  background: var(--warning);
}

.photobank-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.photobank-contract-note {
  display: grid;
  gap: 3px;
  margin-top: 14px;
  padding: 11px 12px;
  border-left: 3px solid var(--warning);
  border-radius: 8px;
  color: var(--text);
  background: rgba(155, 100, 0, 0.07);
}

.photobank-contract-note strong {
  font-size: 0.7rem;
}

.photobank-contract-note span {
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.4;
}

.photobank-advanced {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-strong);
}

.photobank-advanced > summary,
.photobank-coverage > summary {
  position: relative;
  padding: 11px 34px 11px 13px;
  list-style: none;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
}

.photobank-advanced > summary::-webkit-details-marker,
.photobank-coverage > summary::-webkit-details-marker {
  display: none;
}

.photobank-advanced > summary::after,
.photobank-coverage > summary::after {
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--muted);
  content: "+";
  font-size: 1rem;
  font-weight: 400;
  transform: translateY(-50%);
}

.photobank-advanced[open] > summary::after,
.photobank-coverage[open] > summary::after {
  content: "−";
}

.photobank-advanced-body {
  padding: 0 13px 13px;
  border-top: 1px solid var(--border);
}

.photobank-enabled {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-strong);
  cursor: pointer;
}

.photobank-enabled input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.photobank-enabled strong,
.photobank-enabled small {
  display: block;
}

.photobank-enabled strong {
  font-size: 0.75rem;
}

.photobank-enabled small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.35;
}

.photobank-message {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--success);
  background: rgba(38, 122, 100, 0.08);
  font-size: 0.72rem;
}

.photobank-message.is-error {
  color: var(--error);
  background: rgba(216, 43, 35, 0.08);
}

.photobank-form > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.photobank-form > footer > span {
  color: var(--muted);
  font-size: 0.68rem;
}

.photobank-guide {
  overflow: hidden;
}

.photobank-guide > section {
  padding: 22px;
}

.photobank-guide ol {
  display: grid;
  gap: 13px;
  margin-top: 17px;
  list-style: none;
  counter-reset: photobank-guide;
}

.photobank-guide li {
  position: relative;
  padding-left: 30px;
  counter-increment: photobank-guide;
}

.photobank-guide li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  content: counter(photobank-guide);
  font: 700 0.62rem var(--font-mono);
}

.photobank-guide li strong,
.photobank-guide li small {
  display: block;
}

.photobank-guide li strong {
  font-size: 0.73rem;
}

.photobank-guide li small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.photobank-safety,
.photobank-next,
.photobank-current,
.photobank-coverage {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.photobank-current > span,
.photobank-current > strong,
.photobank-current > p {
  display: block;
}

.photobank-current > span {
  color: var(--accent);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.photobank-current > strong {
  margin-top: 5px;
  font-size: 0.78rem;
}

.photobank-current > p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.photobank-coverage {
  padding: 0;
}

.photobank-coverage > summary {
  padding: 14px 40px 14px 20px;
}

.photobank-coverage ul {
  display: grid;
  gap: 11px;
  padding: 0 20px 16px;
  list-style: none;
}

.photobank-coverage li strong,
.photobank-coverage li span {
  display: block;
}

.photobank-coverage li strong {
  font-size: 0.7rem;
}

.photobank-coverage li span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.4;
}

.photobank-safety {
  background: rgba(38, 122, 100, 0.06);
}

.photobank-safety strong,
.photobank-next > span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 700;
}

.photobank-safety strong {
  color: var(--success);
}

.photobank-safety p,
.photobank-next p {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.photobank-next > span {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.photobank-next > strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.78rem;
}

body[data-theme="dark"]:not(.auth-locked) .photobank-intro {
  border-color: rgba(22, 131, 248, 0.35);
  background: rgba(22, 131, 248, 0.12);
}

body[data-theme="dark"]:not(.auth-locked) .photobank-intro p {
  color: var(--muted);
}

body[data-theme="dark"]:not(.auth-locked) :is(
  .photobank-detection,
  .photobank-advanced,
  .photobank-advanced-body,
  .photobank-coverage
) {
  border-color: rgba(255, 255, 255, 0.14);
}

@media (max-width: 920px) {
  .photobank-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .photobank-view {
    padding: 22px 16px 40px;
  }

  .photobank-page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .photobank-type-switch,
  .photobank-fields-row {
    grid-template-columns: 1fr;
  }

  .photobank-form {
    padding: 17px;
  }

  .photobank-form > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .photobank-form > footer .btn-primary {
    width: 100%;
  }
}

/* Photo bank: one target, one source, one result. */
.photobank-view {
  max-width: 860px;
  padding: 38px 34px 64px;
}

.photobank-page-head {
  display: block;
  margin-bottom: 20px;
}

.photobank-page-head h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.photobank-form {
  display: grid;
  gap: 24px;
  padding: 28px;
}

.photobank-form-section {
  display: grid;
  gap: 18px;
}

.photobank-form-section h2 {
  font-size: 0.95rem;
}

.photobank-type-switch {
  margin: 0;
  padding: 4px;
}

.photobank-type-switch button {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.photobank-mode-fields {
  display: grid;
  gap: 16px;
  padding: 0;
}

.photobank-entity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(130px, 0.58fr);
  gap: 12px;
  align-items: end;
}

.photobank-entity-grid.is-company-only {
  grid-template-columns: minmax(0, 1fr);
}

.photobank-entity-grid.is-company-only .photobank-field {
  max-width: 100%;
}

.photobank-combobox {
  margin: 0 !important;
}

.photobank-combobox .context-select-trigger,
.photobank-combobox.context-cme-combobox input {
  min-height: 46px;
  padding-right: 36px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.photobank-combobox .context-select-popover {
  z-index: 150;
  min-width: 100%;
}

.photobank-platform-combobox .context-select-options {
  max-height: 310px;
}

.photobank-form,
.photobank-form-section,
.photobank-mode-fields {
  overflow: visible;
}

.photobank-mode-fields.hidden {
  display: none;
}

.photobank-autoru-fields {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-strong);
}

.photobank-autoru-fields > div:first-child strong,
.photobank-autoru-fields > div:first-child p {
  display: block;
}

.photobank-autoru-fields > div:first-child strong {
  font-size: 0.82rem;
}

.photobank-autoru-fields > div:first-child p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.photobank-mode-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.photobank-mode-control button {
  min-height: 40px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: 700 0.68rem var(--font-body);
}

.photobank-mode-control button.is-active {
  border-color: var(--border);
  color: var(--text);
  background: var(--panel-strong);
}

.photobank-detection.hidden {
  display: none;
}

.photobank-field {
  margin: 0;
}

.photobank-field > span {
  margin-bottom: 7px;
}

.photobank-field > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.photobank-field input,
.photobank-field select {
  min-height: 46px;
  border-radius: 10px;
}

.photobank-result {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-strong);
}

.photobank-result-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel);
  font-size: 1rem;
  font-weight: 800;
}

.photobank-result strong,
.photobank-result p {
  display: block;
}

.photobank-result strong {
  font-size: 0.78rem;
}

.photobank-result p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.4;
}

.photobank-result.is-ready {
  border-color: rgba(38, 122, 100, 0.28);
  background: rgba(38, 122, 100, 0.07);
}

.photobank-result.is-ready .photobank-result-icon {
  color: #fff;
  background: var(--success);
}

.photobank-result.is-warning {
  border-color: rgba(155, 100, 0, 0.28);
  background: rgba(155, 100, 0, 0.07);
}

.photobank-result.is-warning .photobank-result-icon {
  color: #fff;
  background: var(--warning);
}

.photobank-result.is-error {
  border-color: rgba(216, 43, 35, 0.25);
  background: rgba(216, 43, 35, 0.07);
}

.photobank-result.is-error .photobank-result-icon {
  color: #fff;
  background: var(--error);
}

.photobank-message {
  margin: -12px 0 0;
}

.photobank-form > footer {
  margin: 0;
  padding-top: 20px;
}

@media (max-width: 640px) {
  .photobank-view {
    padding: 24px 16px 40px;
  }

  .photobank-form {
    gap: 20px;
    padding: 20px;
  }

  .photobank-fields-row,
  .photobank-entity-grid {
    grid-template-columns: 1fr;
  }

  .photobank-mode-control {
    grid-template-columns: 1fr;
  }

  .photobank-mode-control button {
    min-height: 38px;
    text-align: left;
  }
}

/* Feed workflow: complete dark theme for every creation and review state. */
body[data-theme="dark"]:not(.auth-locked) {
  --workflow-surface: #2a272a;
  --workflow-surface-soft: #312e31;
  --workflow-surface-raised: #393539;
  --workflow-border: rgba(255, 255, 255, 0.14);
  --workflow-warning-bg: rgba(155, 100, 0, 0.18);
  --workflow-warning-border: rgba(244, 199, 119, 0.45);
  --workflow-warning-text: #ffd58a;
  --workflow-success-bg: rgba(38, 122, 100, 0.2);
  --workflow-success-border: rgba(126, 213, 184, 0.42);
  --workflow-error-bg: rgba(216, 43, 35, 0.18);
  --workflow-error-border: rgba(255, 142, 135, 0.42);
  isolation: isolate;
}

body[data-theme="dark"]:not(.auth-locked)::before {
  z-index: -1;
  opacity: 0.022;
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .upload-sidebar,
  .upload-actions,
  .mapping-file-bar,
  .mapping-diagnostics > summary,
  .mapping-toolbar,
  .mapping-group-head,
  .mapping-note-card,
  .mapping-actions,
  .settings-context-bar,
  .settings-section-head,
  .settings-sidebar,
  .settings-actions,
  .review-stage-actions,
  .review-context-bar,
  .processing-note,
  .result-actions
) {
  border-color: var(--workflow-border);
  color: var(--text);
  background: var(--workflow-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .dropzone,
  .update-mode-option,
  .file-type-icon,
  .price-decision-option,
  .missing-data-fields span,
  .automatic-import-facts span,
  .mapping-profile-trigger,
  .mapping-select-trigger,
  .mapping-profile-popover,
  .mapping-select-popover,
  .mapping-profile-option,
  .mapping-select-option,
  .mapping-filter,
  .mapping-group,
  .settings-section,
  .review-outcome,
  .validation-metrics .metric,
  .review-filter-chip,
  .review-search,
  .validation-global-card,
  .vehicle-review-card,
  .vehicle-review-head,
  .result-acceptance-card,
  .acceptance-choice button,
  .review-inline-editor input,
  .review-resolution-panel,
  .review-select-trigger,
  .result-state-head,
  .result-context-grid,
  .result-summary-card,
  .result-link-card,
  .result-sidebar,
  .result-error-card
) {
  border-color: var(--workflow-border);
  color: var(--text);
  background: var(--workflow-surface);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .dropzone-action,
  .file-action,
  .mode-soon,
  .settings-defaults-icon,
  .mapping-filter span,
  .mapping-group-head > span,
  .mapping-note-copy span,
  .review-outcome-icon,
  .vehicle-row-number,
  .review-status-pill,
  .vin-source-pill,
  .vehicle-issue-icon,
  .resolution-icon,
  .resolution-counter,
  .result-error-help
) {
  border-color: var(--workflow-border);
  color: var(--text);
  background: var(--workflow-surface-raised);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .dropzone:hover,
  .dropzone.drag-over,
  .dropzone:focus-visible,
  .update-mode-option.selected,
  .mapping-profile-option.selected,
  .mapping-select-option.selected,
  .mapping-filter.active,
  .review-filter-chip.is-active,
  .acceptance-choice button.is-selected,
  .review-select-trigger.has-value
) {
  border-color: rgba(143, 197, 255, 0.52);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .mapping-profile-trigger:hover,
  .mapping-select-trigger:hover,
  .mapping-profile-option:hover,
  .mapping-select-option:hover,
  .mapping-filter:hover,
  .review-filter-chip:hover,
  .acceptance-choice button:hover,
  .review-select-trigger:hover
) {
  border-color: rgba(255, 255, 255, 0.24);
  background: var(--workflow-surface-raised);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .file-type-icon {
  color: var(--accent-strong);
  background: rgba(143, 197, 255, 0.12);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .file-action:hover,
body[data-theme="dark"]:not(.auth-locked) #view-upload .file-remove:hover {
  background: rgba(255, 255, 255, 0.11);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .progress-bar {
  border-color: var(--workflow-border);
  background: var(--workflow-surface-raised);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .upload-state-badge.is-loading,
  .mapping-state-badge.is-warning,
  .settings-state-badge.is-warning
) {
  color: var(--workflow-warning-text);
  background: var(--workflow-warning-bg);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .price-decision-card,
  .import-question-card
) {
  border-color: var(--workflow-warning-border);
  color: var(--text);
  background: var(--workflow-warning-bg);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .price-decision-icon,
  .import-question-icon,
  .review-outcome.is-review .review-outcome-icon,
  .review-status-pill.is-review,
  .vehicle-issue-icon.is-review
) {
  color: var(--workflow-warning-text);
  background: rgba(244, 199, 119, 0.15);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .price-decision-card.is-resolved,
  .automatic-import-summary,
  .review-outcome.is-ready,
  .result-success-head,
  .result-stopped-card
) {
  border-color: var(--workflow-success-border);
  color: var(--text);
  background: var(--workflow-success-bg);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .price-decision-card.is-resolved .price-decision-icon,
  .automatic-import-icon,
  .review-outcome.is-ready .review-outcome-icon,
  .review-status-pill.is-ready,
  .vehicle-ready-note > span,
  .review-empty > span,
  .result-status-badge
) {
  color: var(--success);
  background: rgba(126, 213, 184, 0.14);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .automatic-import-facts span {
  border-color: var(--workflow-success-border);
  color: var(--success);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .mapping-field-row,
  .mapping-table td
) {
  border-color: var(--workflow-border);
  background: transparent;
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .mapping-field-row.mapping-needs-attention,
  .mapping-table tr:nth-child(even) td
) {
  background: rgba(244, 199, 119, 0.07);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .mapping-filter.active span {
  color: var(--accent-strong);
  background: rgba(143, 197, 255, 0.12);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .required-badge {
  color: var(--error);
  background: var(--workflow-error-bg);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .optional-badge {
  color: var(--muted);
  background: var(--workflow-surface-raised);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .mapping-note-input textarea,
  .mapping-table select,
  .form-grid input,
  .url-box input,
  .review-acceptance-notes,
  .review-inline-editor input
) {
  border-color: var(--workflow-border);
  color: var(--text);
  background: var(--workflow-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .settings-error,
  .settings-field input.field-error,
  select.field-error,
  .validation-global-card.is-error,
  .review-outcome.is-error,
  .review-status-pill.is-error,
  .vehicle-issue-icon.is-error,
  .generation-blocker,
  .result-error-icon
) {
  border-color: var(--workflow-error-border);
  color: var(--error);
  background: var(--workflow-error-bg);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .warning-banner {
  border-color: var(--workflow-warning-border);
  color: var(--workflow-warning-text);
  background: var(--workflow-warning-bg);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .validation-table input {
  border-color: var(--workflow-border);
  color: var(--text);
  background: var(--workflow-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .field-decision-evidence {
  color: var(--muted);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload #reviewStage {
  color: var(--text);
  background: var(--workflow-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .validation-metrics {
  background: var(--workflow-border);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .review-progress {
  background: var(--workflow-surface-raised);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .validation-metrics .metric:hover,
body[data-theme="dark"]:not(.auth-locked) #view-upload .validation-metrics .metric.is-active {
  background: rgba(143, 197, 255, 0.12);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .validation-global-card.is-review,
  .review-status-pill.is-review
) {
  border-left-color: var(--workflow-warning-text);
  background: var(--workflow-warning-bg);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .review-status-pill.is-warning,
  .vin-source-pill.rate_limited,
  .vin-source-pill.invalid_response
) {
  color: var(--muted);
  background: var(--workflow-surface-raised);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .vin-source-pill {
  color: var(--accent-strong);
  background: rgba(143, 197, 255, 0.12);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .review-empty {
  border-color: var(--workflow-border);
  background: rgba(255, 255, 255, 0.025);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .result-card {
  color: var(--text);
  background: var(--workflow-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-car-ghost {
  opacity: 0.28;
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-ring {
  border-color: rgba(143, 197, 255, 0.28);
  background:
    radial-gradient(circle at 50% 48%, rgba(22, 131, 248, 0.15), transparent 49%),
    rgba(31, 36, 43, 0.82);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.34),
    0 0 54px rgba(22, 131, 248, 0.1),
    inset 0 0 38px rgba(22, 131, 248, 0.07);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-ring::before {
  background: conic-gradient(
    var(--accent) calc(var(--progress, 0) * 1%),
    var(--workflow-surface-raised) 0
  );
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-ring::after {
  background:
    linear-gradient(rgba(143, 197, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 197, 255, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, #22262d 0 52%, #1c2026 100%);
  background-size: 18px 18px, 18px 18px, auto;
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-hud-label {
  border-color: rgba(143, 197, 255, 0.24);
  color: #9dceff;
  background: rgba(20, 26, 34, 0.88);
  box-shadow: 0 0 15px rgba(22, 131, 248, 0.16);
  backdrop-filter: blur(5px);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .hud-label-code {
  border-color: rgba(143, 122, 255, 0.32);
  color: #b7a8ff;
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-ring[data-stage="generating"] .processing-hud-label {
  border-color: rgba(80, 208, 135, 0.3);
  color: #75e8a7;
  background: rgba(18, 36, 27, 0.9);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-fact-strip {
  color: var(--text);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-steps li::after {
  background: var(--workflow-border);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-steps li > span {
  border-color: var(--workflow-border);
  background: var(--workflow-surface);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-steps li.is-done > span {
  border-color: var(--workflow-success-border);
  color: var(--success);
  background: var(--workflow-success-bg);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-steps li.is-active > span {
  border-color: rgba(143, 197, 255, 0.26);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--workflow-surface);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .processing-progress-card,
  .processing-stop-confirm,
  .stopped-progress-summary
) {
  border-color: var(--workflow-border);
  color: var(--text);
  background: var(--workflow-surface);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-progress-track {
  background: var(--workflow-surface-raised);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-stop-confirm {
  border-color: var(--workflow-error-border);
  background: var(--workflow-error-bg);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .processing-stop-confirm p {
  color: #d5c3c0;
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .result-success-head p {
  color: var(--muted);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload :is(
  .result-context-success,
  .result-sidebar-help,
  .result-error-help
) {
  background: var(--workflow-surface-soft);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .result-review-note {
  color: var(--workflow-warning-text);
  background: var(--workflow-warning-bg);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .url-box .btn-copy {
  border-color: var(--workflow-border);
  color: var(--text);
  background: var(--workflow-surface-raised);
}

body[data-theme="dark"]:not(.auth-locked) #view-upload .btn-primary:disabled {
  border-color: var(--workflow-border);
  color: #aaa6aa;
  background: var(--workflow-surface-raised);
}

@media (max-width: 700px) {
  #view-upload .workflow-header {
    padding: 18px 16px;
  }

  #view-upload .settings-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 18px 16px;
  }

  #view-upload .settings-state-badge {
    max-width: 100%;
    align-self: flex-start;
    white-space: normal;
  }

  #view-upload .settings-context-bar {
    grid-template-columns: 1fr;
    padding: 0;
  }

  #view-upload .settings-context-bar > div {
    padding: 10px 16px;
    border-left: 0;
    border-bottom: 1px solid var(--workflow-border, var(--border));
  }

  #view-upload .settings-context-bar > div:first-child {
    padding-left: 16px;
  }

  #view-upload .settings-context-bar > div:last-child {
    border-bottom: 0;
  }

  #view-upload .settings-main {
    padding: 16px 12px 20px;
  }

  #view-upload .settings-section-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  #view-upload .review-stage-head {
    align-items: stretch;
    flex-direction: column;
    padding: 18px 16px;
  }

  #view-upload .review-stage-head h2 {
    max-width: 18ch;
    font-size: 1.25rem;
  }

  #view-upload .review-stage-head .btn-secondary {
    width: 100%;
  }

  #view-upload .review-context-bar {
    grid-template-columns: 1fr;
  }

  #view-upload .review-context-bar > span {
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--workflow-border, var(--border));
  }

  #view-upload .review-context-bar > span:last-child {
    border-bottom: 0;
  }

  #view-upload .review-stage-body {
    gap: 12px;
    padding: 14px 12px 24px;
  }

  #view-upload .review-outcome {
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 14px 12px;
  }

  #view-upload .review-outcome-icon {
    width: 34px;
    height: 34px;
  }

  #view-upload .review-outcome .btn-secondary {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

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

  #view-upload .validation-metrics .metric {
    min-height: 72px;
    padding: 12px;
  }

  #view-upload .review-issues-head,
  #view-upload .review-toolbar,
  #view-upload .vehicle-review-head {
    align-items: stretch;
    flex-direction: column;
  }

  #view-upload .review-issues-head {
    margin-top: 14px;
  }

  #view-upload .review-search {
    width: 100%;
    min-width: 0;
  }

  #view-upload .vehicle-review-badges {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  #view-upload .vehicle-issue {
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
  }

  #view-upload .vehicle-issue > :last-child {
    grid-column: 2;
    min-width: 0;
  }

  #view-upload .review-stage-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Five-step feed creation: the organization toolbar is the guarded first step. */
body[data-active-view="upload"] .unified-toolbar .workspace-context-main {
  grid-template-columns: 174px minmax(620px, 1fr) auto 38px;
}

.context-flow-heading {
  display: none;
  min-width: 0;
  align-self: center;
}

body[data-active-view="upload"] .context-flow-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.context-flow-heading > span {
  color: var(--accent-strong);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.context-flow-heading > strong {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.2;
}

.context-flow-heading > small {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.3;
}

.context-flow-heading.is-complete > span::after {
  content: " · подтверждено";
  color: var(--success);
}

body[data-active-view="upload"] > .workspace-context {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 8px 28px rgba(22, 122, 255, 0.1);
}

.toolbar-create-feed.is-confirmed {
  border-color: var(--accent);
  background: var(--accent);
}

.upload-context-gate {
  min-height: 122px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
}

.upload-context-gate-marker {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.upload-context-gate strong,
.upload-context-gate p {
  display: block;
}

.upload-context-gate p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.upload-context-gate button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--panel);
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
}

.upload-card.is-context-locked .upload-layout,
.upload-card.is-context-locked .upload-actions {
  display: none;
}

.upload-card.is-context-locked .upload-head {
  padding-bottom: 0;
  border-bottom: 0;
}

@media (max-width: 1180px) {
  body[data-active-view="upload"] .unified-toolbar .workspace-context-main {
    grid-template-columns: minmax(0, 1fr) auto 38px;
  }

  body[data-active-view="upload"] .context-flow-heading {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: baseline;
    gap: 8px;
  }
}

@media (max-width: 860px) {
  body[data-active-view="upload"] .unified-toolbar .workspace-context-main {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-active-view="upload"] .context-flow-heading {
    grid-column: auto;
    display: flex;
  }

  .upload-context-gate {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .upload-context-gate button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .workflow-header {
    align-items: stretch;
  }

  .steps {
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    padding-bottom: 4px;
  }

  .upload-context-gate {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .upload-context-gate button {
    grid-column: auto;
    width: 100%;
  }
}

/* The deck owns the upload context layout; keep this after the legacy guarded-step rules. */
body[data-active-view="upload"] .feed-flow-shell .unified-toolbar .workspace-context-main {
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 12px;
  padding: 18px;
}

@media (max-width: 860px) {
  body[data-active-view="upload"] .feed-flow-shell .unified-toolbar .workspace-context-main {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }
}

/* Administrative knowledge screens stay usable on narrow workspaces. */
@media (max-width: 700px) {
  body[data-active-view="colors"] .section-filter-bar,
  .colors-page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  body[data-active-view="colors"] :is(
    .section-filter-primary,
    .section-filter-fields,
    .section-filter-control,
    .section-filter-chip-group,
    .color-history-actor-filter
  ) {
    width: 100%;
    min-width: 0;
  }

  body[data-active-view="colors"] #colorsFilterFields .section-filter-chip-group {
    flex-wrap: wrap;
  }

  body[data-active-view="colors"] #colorsFilterFields .color-history-actor-filter {
    width: 100%;
    min-width: 0;
    flex-basis: 100%;
  }

  .colors-page-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .colors-page-actions .btn-primary,
  .colors-page-actions .btn-secondary {
    width: 100%;
    min-width: 0;
  }

  .colors-title-line {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .color-learning-modes {
    grid-template-columns: minmax(0, 1fr);
  }

  .color-import-review-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .color-import-arrow {
    display: none;
  }

  .color-import-confidence {
    width: fit-content;
  }

  .color-import-review-head,
  .color-import-review > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .color-import-review > footer .btn-primary {
    width: 100%;
  }

  .color-editor-card,
  .color-editor-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .color-editor-card {
    padding: 16px;
  }

  .color-editor-error {
    grid-column: auto;
  }

  .color-canonical-popover {
    right: auto;
    left: 0;
    width: 100%;
    min-width: 0;
  }

  .color-canonical-options {
    grid-template-columns: 1fr;
  }

  .color-editor-actions {
    flex-direction: column-reverse;
  }

  .color-editor-actions > button {
    width: 100%;
    min-width: 0;
  }

  .colors-list-head,
  .colors-list-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .colors-company-badge {
    max-width: 100%;
    align-self: flex-start;
  }

  .colors-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .colors-product-table {
    display: table;
    width: 760px;
    max-width: none;
    overflow: visible;
  }

  .colors-product-table .colors-empty-state,
  .colors-product-table .colors-loading {
    position: sticky;
    left: 12px;
    width: min(250px, calc(100vw - 128px));
    margin: 0;
    padding-inline: 12px;
  }

  .colors-list-footer > span:last-child {
    margin-left: 0;
  }
}

/* Journal uses the same Auto.ru Business filter system as the other directories. */
.audit-filter-bar,
.audit-filter-fields {
  overflow: visible;
}

.audit-filter-fields {
  align-items: flex-start;
}

.audit-section-filters .feed-filter-popover {
  width: 300px;
}

.audit-section-filters [data-audit-filter-menu="event"] .feed-filter-popover {
  width: 340px;
}

.audit-section-filters [data-audit-filter-menu="actor"] .feed-filter-popover {
  width: 380px;
}

.audit-actor-popover {
  padding: 0;
  overflow: hidden;
}

.audit-actor-fixed-options {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.audit-actor-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px;
  padding: 0 12px;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.audit-actor-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.audit-actor-search svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
}

.audit-actor-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.audit-actor-search-results {
  max-height: 270px;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.audit-actor-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.audit-actor-result:hover {
  background: var(--panel-strong);
}

.audit-actor-result > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.audit-actor-result strong,
.audit-actor-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-actor-result strong {
  color: var(--text);
  font-size: 14px;
}

.audit-actor-result small {
  color: var(--muted);
  font-size: 12px;
}

.audit-actor-result em {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.audit-actor-search-hint {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 16px;
  color: var(--muted);
}

.audit-actor-search-hint strong {
  color: var(--text);
  font-size: 14px;
}

.audit-actor-search-hint span {
  font-size: 12px;
  line-height: 1.45;
}

.audit-actor-search-hint.is-empty strong {
  color: var(--error);
}

.audit-section-filters .feed-filter-popover.feed-choice-list {
  max-height: min(360px, calc(100vh - 150px));
  overflow-y: auto;
}

.audit-section-filters .feed-date-popover {
  max-height: min(520px, calc(100vh - 150px));
  overflow-y: auto;
}

.audit-date-mode-list {
  max-height: 310px;
  overflow-y: auto;
}

.audit-date-mode-list + .feed-date-inputs {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.audit-filter-fields > .feed-filter-menu:nth-of-type(n + 5) > .feed-filter-popover {
  right: 0;
  left: auto;
}

.audit-page-actions .btn-primary {
  min-width: 154px;
}

.audit-product-table th:nth-child(1) { width: 12%; }
.audit-product-table th:nth-child(2) { width: 16%; }
.audit-product-table th:nth-child(3) { width: 20%; }
.audit-product-table th:nth-child(4) { width: 17%; }
.audit-product-table th:nth-child(5) { width: 18%; }
.audit-product-table th:nth-child(6) { width: 17%; }

.audit-product-table td {
  height: 72px;
}

@media (max-width: 1180px) {
  .audit-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .audit-product-table {
    display: table;
    width: 1080px;
    max-width: none;
  }
}

@media (max-width: 620px) {
  .audit-page-head,
  .audit-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-page-actions .btn-primary {
    width: 100%;
  }

  .audit-filter-bar .section-filter-primary,
  .audit-filter-fields,
  .audit-filter-fields .feed-filter-menu,
  .audit-filter-fields .feed-filter-menu > summary {
    width: 100%;
  }

  .audit-section-filters .feed-filter-popover {
    width: 100%;
  }

  .audit-section-filters [data-audit-filter-menu="actor"] .feed-filter-popover {
    width: 100%;
  }

  .audit-list-head,
  .audit-list-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .audit-list-footer > span:last-child {
    margin-left: 0;
  }
}
