.movement-library {
  display: grid;
  min-width: 0;
  gap: 16px;
  padding: 22px 28px 40px;
}

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

.movement-heading {
  align-items: flex-start;
  margin-bottom: 0;
}

.movement-heading h1,
.movement-heading p,
.movement-settings h2,
.movement-setting-group p,
.movement-detail-header h2,
.movement-detail-header p,
.movement-section-heading h3,
.movement-assessments h4,
.movement-assessments p,
.movement-history p,
.movement-action-dialog .modal-header p {
  margin: 0;
}

.movement-heading p,
.movement-detail-header p,
.movement-action-dialog .modal-header p {
  margin-top: 5px;
  color: var(--muted);
}

.movement-view-toggle,
.movement-setting-actions,
.movement-dialog-actions,
.movement-action-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.movement-view-toggle .active {
  background: var(--cobalt);
  color: #fff;
}

.movement-view-toggle button span {
  min-width: 22px;
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 11px;
}

.movement-settings {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.movement-settings > summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 800;
}

.movement-settings-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.movement-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.movement-setting-group {
  display: grid;
  min-width: 0;
  gap: 12px;
  align-content: space-between;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.movement-setting-group:last-child {
  border-right: 0;
}

.movement-setting-group h2 {
  font-size: 15px;
}

.movement-setting-group p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.movement-source-rules {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.movement-source-rules h2,
.movement-source-rules p {
  margin: 0;
}

.movement-source-rules h2 {
  font-size: 15px;
}

.movement-source-rules p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.movement-source-rules ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.movement-source-rules li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
}

.movement-source-rules li > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.movement-source-rules code {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.movement-source-rules small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movement-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(6, minmax(118px, auto));
  gap: 8px;
}

.movement-filters .select,
.movement-filters .input {
  width: 100%;
  min-width: 0;
}

.movement-search {
  display: flex;
  min-width: 0;
  gap: 6px;
}

.movement-mobile-filter-sheet {
  display: none;
}

.movement-bulk-bar {
  position: sticky;
  top: 72px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(53, 107, 244, 0.35);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #eaf0ff;
  box-shadow: 0 6px 18px rgba(31, 41, 51, 0.08);
}

.movement-live-status {
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.movement-notice {
  margin: 0;
}

.movement-notice.error,
.movement-inline-error {
  border-color: rgba(185, 28, 28, 0.25);
  color: var(--red);
  background: #fff7f7;
}

.movement-inline-error {
  margin: 0;
  border: 1px solid rgba(185, 28, 28, 0.25);
  border-radius: var(--radius);
  padding: 10px;
}

.movement-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(260px, 1fr));
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 10px;
  overscroll-behavior-inline: contain;
}

.movement-lane {
  display: grid;
  min-width: 260px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f4ef;
}

.movement-lane > header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.movement-lane > header h2 {
  margin: 0;
  font-size: 13px;
}

.movement-lane > header > span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 800;
}

.movement-lane-items {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 8px;
}

.movement-lane-empty {
  margin: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.movement-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(31, 41, 51, 0.03);
}

.movement-card:focus-within {
  border-color: var(--cobalt);
}

.movement-card-select {
  padding: 12px 0 0 10px;
}

.movement-card-open {
  display: grid;
  min-width: 0;
  gap: 8px;
  border: 0;
  padding: 11px 10px 11px 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.movement-card-open > * {
  min-width: 0;
}

.movement-card-open:hover strong {
  color: var(--cobalt-dark);
}

.movement-card-open > strong {
  font-size: 14px;
  line-height: 1.3;
}

.movement-card-kicker,
.movement-card-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.movement-card-decision {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.movement-card-kicker > span,
.movement-card-footer > span,
.movement-card-footer time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movement-card-kicker span:last-child {
  text-align: right;
}

.movement-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.movement-chip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  padding: 3px 6px;
  color: var(--cobalt-dark);
  background: var(--mist);
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movement-chip.audience {
  color: #4c3bb3;
  background: #f0edff;
}

.movement-card-decision {
  justify-content: flex-start;
  color: var(--cobalt-dark);
  overflow-wrap: anywhere;
}

.movement-card-reason {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
}

.movement-card-reason strong,
.movement-card-reason span {
  display: block;
}

.movement-card-reason span {
  margin-top: 3px;
}

.movement-load-more {
  display: flex;
  justify-content: center;
}

.movement-mobile-lanes {
  display: none;
}

.movement-archive-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.movement-detail-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.movement-detail-dialog::backdrop {
  background: rgba(31, 41, 51, 0.46);
}

.movement-detail-shell {
  display: grid;
  max-height: calc(100vh - 34px);
  overflow: auto;
}

.movement-detail-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  background: var(--surface);
}

.movement-detail-header h2 {
  max-width: 760px;
  font-size: 22px;
}

.movement-detail-content {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0;
}

.movement-detail-content > section {
  min-width: 0;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.movement-detail-content > section:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.movement-section-heading,
.movement-assessment-title,
.movement-history li > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.movement-section-heading {
  margin-bottom: 12px;
}

.movement-section-heading h3 {
  font-size: 17px;
}

.movement-section-heading > span,
.movement-version-line,
.movement-history time,
.movement-history li > span {
  color: var(--muted);
  font-size: 11px;
}

.movement-public-preview img {
  width: 100%;
  max-height: 220px;
  border-radius: var(--radius);
  object-fit: cover;
}

.movement-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.movement-preview-card {
  display: grid;
  min-width: 0;
  gap: 6px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.movement-preview-card.empty {
  background: var(--mist);
}

.movement-preview-card h4,
.movement-preview-card p {
  margin: 0;
}

.movement-preview-card h4 {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.movement-preview-card > span,
.movement-preview-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.movement-public-preview > p {
  color: var(--muted);
  line-height: 1.55;
}

.movement-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}

.movement-facts div {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.movement-facts dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.movement-facts dd {
  margin: 3px 0 0;
  font-weight: 750;
}

.movement-reasoning {
  display: grid;
  gap: 12px;
  margin: 0;
}

.movement-reasoning div {
  display: grid;
  gap: 3px;
}

.movement-reasoning dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.movement-reasoning dd {
  margin: 0;
  line-height: 1.45;
}

.movement-overrides {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.movement-overrides > strong {
  font-size: 12px;
}

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

.movement-overrides ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.movement-overrides li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--radius);
  padding: 7px 9px;
  background: var(--mist);
}

.movement-gate-list,
.movement-history,
.movement-evidence {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.movement-gate-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: start;
}

.movement-gate-list li > span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.movement-gate-list li.failed > span {
  background: var(--red);
}

.movement-gate-list strong,
.movement-gate-list p {
  margin: 0;
}

.movement-gate-list p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.movement-assessments {
  display: grid;
  gap: 10px;
}

.movement-assessments article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.movement-assessment-title h4 {
  font-size: 13px;
}

.movement-assessments article > p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.movement-verdict {
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--amber);
  background: #fff7e8;
  font-size: 10px;
  font-weight: 850;
}

.movement-verdict.allow {
  color: var(--green);
  background: #edf9f0;
}

.movement-verdict.reject {
  color: var(--red);
  background: #fff0f0;
}

.movement-evidence {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.movement-evidence a {
  color: var(--cobalt-dark);
  font-size: 11px;
  font-weight: 750;
}

.movement-history {
  display: grid;
  gap: 0;
}

.movement-version-list,
.movement-operational-evidence ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.movement-version-list li,
.movement-operational-evidence li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.movement-version-list li > span,
.movement-operational-evidence li {
  min-width: 0;
}

.movement-version-list strong,
.movement-version-list time,
.movement-operational-evidence li span,
.movement-operational-evidence li small {
  display: block;
}

.movement-version-list time,
.movement-version-list small,
.movement-operational-evidence small {
  color: var(--muted);
  font-size: 11px;
}

.movement-operational-evidence {
  display: grid;
  gap: 16px;
}

.movement-operational-evidence h4 {
  margin: 0 0 8px;
}

.movement-operational-evidence a {
  color: var(--cobalt-dark);
  font-size: 11px;
  font-weight: 750;
}

.movement-history li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.movement-history li:last-child {
  border-bottom: 0;
}

.movement-history p {
  margin-top: 4px;
  color: var(--muted);
}

.movement-action-grid .button {
  flex: 0 1 auto;
}

.movement-action-dialog .modal-card {
  gap: 18px;
}

.movement-action-dialog .modal-header {
  align-items: flex-start;
}

.movement-action-dialog .modal-header p {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.movement-action-form {
  display: grid;
  gap: 14px;
}

.movement-action-form > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.movement-action-form .textarea {
  min-height: 92px;
  resize: vertical;
}

.movement-action-form small {
  color: var(--muted);
}

.movement-source-rule-preview {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid rgba(185, 28, 28, 0.22);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff7f7;
}

.movement-source-rule-preview div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.movement-source-rule-preview dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.movement-source-rule-preview dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.movement-bulk-preview,
.movement-bulk-results {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--mist);
}

.movement-bulk-preview h3,
.movement-bulk-preview p {
  margin: 0;
}

.movement-bulk-preview p {
  margin-top: 4px;
  color: var(--muted);
}

.movement-bulk-preview ul,
.movement-bulk-results ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.movement-bulk-preview li,
.movement-bulk-results li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.movement-bulk-preview code,
.movement-bulk-results code {
  overflow: hidden;
  text-overflow: ellipsis;
}

.movement-bulk-results summary {
  cursor: pointer;
  font-weight: 800;
}

.movement-bulk-results .failed {
  color: var(--red);
}

.movement-bulk-results .succeeded {
  color: var(--green);
}

@media (max-width: 1100px) {
  .movement-settings-grid {
    grid-template-columns: 1fr;
  }

  .movement-setting-group {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .movement-setting-group:last-child {
    border-bottom: 0;
  }

  .movement-filters {
    grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(130px, auto));
  }

  .movement-desktop-secondary-filter {
    display: none;
  }
}

@media (max-width: 700px) {
  .movement-library {
    padding: 18px 14px 32px;
  }

  .movement-heading,
  .movement-setting-group {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .movement-view-toggle,
  .movement-view-toggle .button,
  .movement-setting-actions,
  .movement-setting-actions .button,
  .movement-search,
  .movement-search .button {
    width: 100%;
  }

  .movement-view-toggle .button,
  .movement-setting-actions .button {
    flex: 1 1 0;
  }

  .movement-settings > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .movement-filters {
    grid-template-columns: 1fr 1fr;
  }

  .movement-search {
    grid-column: 1 / -1;
  }

  .movement-mobile-filter-sheet {
    display: block;
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .movement-mobile-filter-sheet summary {
    padding: 10px 12px;
    font-weight: 750;
    cursor: pointer;
  }

  .movement-mobile-filter-sheet > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding: 10px;
  }

  .movement-bulk-bar {
    top: 8px;
    align-items: stretch;
    flex-direction: column;
  }

  .movement-mobile-lanes {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .movement-mobile-lanes button {
    flex: 0 0 auto;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--muted);
    background: var(--surface);
    font-size: 12px;
    font-weight: 750;
  }

  .movement-mobile-lanes button.active {
    border-color: var(--cobalt);
    color: #fff;
    background: var(--cobalt);
  }

  .movement-board {
    display: block;
    overflow: visible;
  }

  .movement-lane {
    display: none;
    min-width: 0;
  }

  .movement-lane:not([hidden]) {
    display: grid;
  }

  .movement-board .movement-lane {
    margin-bottom: 10px;
  }

  .movement-board[data-mobile-filtered="true"] .movement-lane {
    display: none;
  }

  .movement-lane-items {
    gap: 10px;
  }

  .movement-card-open > strong {
    font-size: 15px;
  }

  .movement-detail-dialog,
  .movement-action-dialog {
    width: 100vw;
    max-width: none;
    max-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .movement-detail-shell,
  .movement-action-dialog .modal-card {
    min-height: 100vh;
    max-height: 100vh;
  }

  .movement-detail-content {
    grid-template-columns: 1fr;
  }

  .movement-detail-content > section:nth-child(odd) {
    border-right: 0;
  }

  .movement-detail-header {
    padding: 14px;
  }

  .movement-detail-header h2 {
    font-size: 19px;
  }

  .movement-facts {
    grid-template-columns: 1fr;
  }

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

  .movement-dialog-actions,
  .movement-dialog-actions .button {
    width: 100%;
  }

  .movement-dialog-actions .button {
    flex: 1 1 100%;
  }

  .movement-source-rule-preview div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .movement-library *,
  .movement-library *::before,
  .movement-library *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
