.hx-placement-mode-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #d8e5ee;
  border-radius: 12px;
  background: linear-gradient(135deg, #f6fbff 0%, #fff 75%);
}

.hx-placement-mode-copy strong { display: block; color: #17364d; font-size: 14px; }
.hx-placement-mode-copy span { display: block; margin-top: 3px; color: #718398; font-size: 12px; }
.hx-placement-mode-actions { display: inline-flex; gap: 8px; }
.hx-placement-mode-actions button { min-height: 36px; }
.hx-placement-mode-actions .is-active { background: #0077c8; color: #fff; border-color: #0077c8; }

.hx-rotation-shell { min-height: 520px; }
.hx-rotation-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.hx-rotation-step {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #dfe7ee;
  border-radius: 10px;
  background: #f8fafc;
  color: #6c7b8c;
}
.hx-rotation-step > span {
  display: inline-flex;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e7edf2;
  font-size: 12px;
  font-weight: 800;
}
.hx-rotation-step strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.hx-rotation-step.is-active { border-color: #9cd3f4; background: #edf8ff; color: #076da8; }
.hx-rotation-step.is-active > span { background: #0077c8; color: #fff; }
.hx-rotation-step.is-done { border-color: #b8dfca; background: #f1faf5; color: #16734f; }
.hx-rotation-step.is-done > span { background: #1a9a69; color: #fff; }

.hx-rotation-view[hidden] { display: none !important; }
.hx-rotation-section {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid #dfe7ee;
  border-radius: 12px;
  background: #fff;
}
.hx-rotation-section.is-blue { border-left: 4px solid #2495d0; background: #fbfdff; }
.hx-rotation-section.is-green { border-left: 4px solid #27a273; background: #fbfffd; }
.hx-rotation-section.is-amber { border-left: 4px solid #e2a03b; background: #fffdf9; }
.hx-rotation-section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 13px; }
.hx-rotation-section-heading h3 { margin: 0; color: #17364d; font-size: 15px; line-height: 22px; }
.hx-rotation-section-heading p { margin: 3px 0 0; color: #77889a; font-size: 12px; line-height: 19px; }

.hx-rotation-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hx-rotation-form-grid.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hx-rotation-form-grid .form-group { min-width: 0; margin: 0; }
.hx-rotation-form-grid input,
.hx-rotation-form-grid select,
.hx-rotation-form-grid textarea { width: 100%; }
.hx-rotation-form-grid .span-2 { grid-column: span 2; }
.hx-rotation-form-grid .span-all { grid-column: 1 / -1; }
.hx-rotation-inline-check { display: flex; min-height: 40px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #d7e1e8; border-radius: 8px; background: #fff; color: #42586c; font-size: 12px; }
.hx-rotation-inline-check input { width: auto; margin: 0; }

.hx-rotation-toggle { display: inline-flex; gap: 6px; padding: 4px; border-radius: 10px; background: #eef3f7; }
.hx-rotation-toggle button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: #52657a; cursor: pointer; }
.hx-rotation-toggle button.is-active { background: #fff; color: #006fac; box-shadow: 0 2px 8px rgba(15, 23, 42, .08); font-weight: 750; }

.hx-rotation-city-list,
.hx-rotation-property-list { display: grid; gap: 8px; }
.hx-rotation-city-list { grid-template-columns: repeat(5, minmax(90px, 1fr)); }
.hx-rotation-city-list label,
.hx-rotation-property-item { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 9px; border: 1px solid #e0e7ed; border-radius: 8px; background: #fff; font-size: 12px; color: #41566b; }
.hx-rotation-property-list { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 240px; overflow: auto; padding-right: 4px; }
.hx-rotation-property-item small { margin-left: auto; color: #8b99a8; }
.hx-rotation-property-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 9px; }
.hx-rotation-property-toolbar input { max-width: 300px; }

.hx-rotation-baseline-summary,
.hx-rotation-validation,
.hx-rotation-commit-summary {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid #d9e8f2;
  border-radius: 9px;
  background: #f3f9fd;
  color: #49677d;
  font-size: 12px;
  line-height: 19px;
}
.hx-rotation-validation.is-error { border-color: #efc4bf; background: #fff5f3; color: #b42318; }
.hx-rotation-validation.is-warning { border-color: #ecd4a5; background: #fff9ec; color: #94610c; }

.hx-rotation-period-table { max-height: 390px; overflow: auto; border: 1px solid #e0e7ed; border-radius: 10px; }
.hx-rotation-period-table table { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0; }
.hx-rotation-period-table th { position: sticky; top: 0; z-index: 2; background: #f2f6f9; color: #516477; font-size: 12px; }
.hx-rotation-period-table th,
.hx-rotation-period-table td { padding: 9px; border-bottom: 1px solid #e8edf1; text-align: left; vertical-align: middle; }
.hx-rotation-period-table input { width: 100%; min-width: 105px; }
.hx-rotation-period-table input[type="number"] { min-width: 80px; }
.hx-rotation-period-table tr.is-baseline { background: #f3f9fd; }
.hx-rotation-quota-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.hx-rotation-quota-field { display: grid; grid-template-columns: auto 70px; align-items: center; gap: 5px; }
.hx-rotation-quota-field span { white-space: nowrap; color: #596d80; font-size: 11px; }

.hx-rotation-result-list { display: grid; gap: 12px; }
.hx-rotation-period-card { border: 1px solid #dfe7ee; border-radius: 12px; background: #fff; overflow: hidden; }
.hx-rotation-period-card.is-shortage { border-color: #e9c68b; }
.hx-rotation-period-card-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; background: #f7fafc; border-bottom: 1px solid #e8edf1; }
.hx-rotation-period-card-header h3 { margin: 0; color: #17364d; font-size: 14px; }
.hx-rotation-period-card-header p { margin: 3px 0 0; color: #758699; font-size: 11px; }
.hx-rotation-period-actions { display: flex; align-items: center; gap: 8px; }
.hx-rotation-period-badge { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: #e7f5fd; color: #0871ad; font-size: 11px; font-weight: 750; }
.hx-rotation-period-card.is-shortage .hx-rotation-period-badge { background: #fff1d7; color: #965c00; }
.hx-rotation-metrics { display: grid; grid-template-columns: repeat(8, minmax(75px, 1fr)); gap: 8px; padding: 12px 14px; }
.hx-rotation-metric { padding: 9px; border: 1px solid #e8edf1; border-radius: 8px; background: #fff; }
.hx-rotation-metric span { display: block; color: #8492a1; font-size: 10px; }
.hx-rotation-metric strong { display: block; margin-top: 3px; color: #17364d; font-size: 16px; }
.hx-rotation-property-adjust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 14px 12px; }
.hx-rotation-property-adjust label { display: grid; grid-template-columns: minmax(0, 1fr) 72px; align-items: center; gap: 6px; padding: 7px 8px; border: 1px solid #e2e8ee; border-radius: 8px; color: #44596d; font-size: 11px; }
.hx-rotation-property-adjust input { width: 100%; }
.hx-rotation-point-details { border-top: 1px solid #edf1f4; }
.hx-rotation-point-details summary { padding: 10px 14px; color: #0b74ad; font-size: 12px; font-weight: 700; cursor: pointer; }
.hx-rotation-point-table { max-height: 320px; overflow: auto; padding: 0 14px 12px; }
.hx-rotation-point-table table { width: 100%; min-width: 760px; border-collapse: collapse; }
.hx-rotation-point-table th,
.hx-rotation-point-table td { height: 38px; padding: 7px 8px; border-bottom: 1px solid #edf1f4; text-align: left; font-size: 11px; white-space: nowrap; }
.hx-allocation-tag { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: #eef7fd; color: #126e9e; font-size: 10px; }
.hx-allocation-tag.is-fallback { background: #fff3df; color: #925d09; }

.hx-rotation-overlap { margin: 0 14px 12px; color: #718397; font-size: 11px; }
.hx-rotation-footer { display: flex !important; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px !important; padding: 13px 0 0 !important; border-top: 1px solid #e5ebf0; }
.hx-rotation-footer-actions { display: flex; gap: 9px; margin-left: auto; }
.hx-rotation-progress { display: none; margin-top: 12px; }
.hx-rotation-progress.is-active { display: block; }
.hx-rotation-progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e5ebf0; }
.hx-rotation-progress-bar { width: 0; height: 100%; background: linear-gradient(90deg, #0077c8, #20a4e2); transition: width .2s ease; }
.hx-rotation-progress-text { margin-top: 6px; color: #687b8f; font-size: 11px; }

.hx-rotation-plan-group td { padding: 0 !important; background: #f3f9fd; }
.hx-rotation-plan-group-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-left: 4px solid #1584c4; }
.hx-rotation-plan-group-inner > div:nth-child(2) { min-width: 0; margin-right: auto; }
.hx-rotation-plan-group-inner strong { display: block; color: #17425d; }
.hx-rotation-plan-group-inner small { display: block; margin-top: 3px; color: #6d8296; font-size: 11px; }
.hx-rotation-plan-group-actions { display: flex; gap: 8px; }
.hx-rotation-period-row td:first-child { padding-left: 28px; }
.hx-rotation-view-summary .preview-table { max-height: 520px; overflow: auto; }
.hx-rotation-view-summary table { width: 100%; border-collapse: collapse; }
.hx-rotation-view-summary th,
.hx-rotation-view-summary td { padding: 9px 10px; border-bottom: 1px solid #e6edf2; text-align: left; }

@media (max-width: 1180px) {
  .hx-rotation-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-rotation-city-list { grid-template-columns: repeat(3, minmax(90px, 1fr)); }
  .hx-rotation-property-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-rotation-metrics { grid-template-columns: repeat(4, minmax(75px, 1fr)); }
  .hx-rotation-property-adjust { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .hx-rotation-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-rotation-form-grid,
  .hx-rotation-form-grid.is-three,
  .hx-rotation-property-list { grid-template-columns: 1fr; }
  .hx-rotation-form-grid .span-2 { grid-column: auto; }
  .hx-rotation-city-list { grid-template-columns: repeat(2, minmax(90px, 1fr)); }
  .hx-rotation-metrics { grid-template-columns: repeat(2, minmax(75px, 1fr)); }
  .hx-rotation-property-adjust { grid-template-columns: 1fr; }
  .hx-placement-mode-switch { align-items: flex-start; flex-direction: column; }
}

/* 2026.08 unified workbench visual pass */
.hx-rotation-shell {
  color: #334155;
}

.hx-rotation-steps {
  gap: 10px;
  margin-bottom: 18px;
}

.hx-rotation-step {
  min-height: 48px;
  padding: 10px 13px;
  border-color: #dfe7ef;
  border-radius: 12px;
  background: #f7f9fc;
}

.hx-rotation-step.is-active {
  border-color: #8fc7e7;
  background: #eef8fe;
  box-shadow: 0 5px 15px rgba(0, 119, 200, .08);
}

.hx-rotation-section {
  margin-bottom: 16px;
  padding: 18px;
  border-color: #dfe7ef;
  border-radius: 14px;
  box-shadow: 0 3px 14px rgba(15, 23, 42, .035);
}

.hx-rotation-section.is-blue,
.hx-rotation-section.is-green,
.hx-rotation-section.is-amber {
  border-left-width: 3px;
}

.hx-rotation-section.is-blue { border-left-color: #3b8ec2; background: #fbfdff; }
.hx-rotation-section.is-green { border-left-color: #398d75; background: #fbfefd; }
.hx-rotation-section.is-amber { border-left-color: #c78931; background: #fffdf9; }

.hx-rotation-section-heading {
  min-height: 42px;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8eef3;
}

.hx-rotation-form-grid {
  gap: 14px 12px;
  align-items: end;
}

.hx-rotation-form-grid .form-group > label {
  display: block;
  min-height: 20px;
  margin-bottom: 6px;
}

.hx-rotation-inline-check,
.hx-rotation-city-list label,
.hx-rotation-property-item {
  border-color: #d9e3eb;
  border-radius: 9px;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.hx-rotation-inline-check:hover,
.hx-rotation-city-list label:hover,
.hx-rotation-property-item:hover {
  border-color: #9dcce7;
  background: #f5faff;
}

.hx-rotation-shell input[type="checkbox"] {
  position: relative;
  width: 15px !important;
  height: 15px !important;
  flex: 0 0 15px !important;
  margin: 0 !important;
  appearance: none;
  border: 1px solid #9eafbd;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
}

.hx-rotation-shell input[type="checkbox"]:checked {
  border-color: #1778ad;
  background: #1778ad;
}

.hx-rotation-shell input[type="checkbox"]:checked::after {
  position: absolute;
  top: 2px;
  left: 4px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  transform: rotate(45deg);
}

.hx-rotation-shell input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(0, 119, 200, .15);
  outline-offset: 2px;
}

.hx-placement-mode-actions button,
.hx-rotation-toggle button,
.hx-rotation-period-actions button,
.hx-rotation-footer button {
  transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.hx-placement-mode-actions button:not(.is-active):hover,
.hx-rotation-toggle button:not(.is-active):hover {
  background: #e6f3fb;
  color: #006da9;
}

.hx-placement-mode-actions button.is-active:hover {
  border-color: #005f9f;
  background: #005f9f;
  color: #fff;
}

.hx-rotation-city-list label:has(input:checked),
.hx-rotation-property-item:has(input:checked) {
  border-color: #8fc7e7;
  background: #eef8fe;
  box-shadow: 0 3px 10px rgba(0, 119, 200, .07);
}

.hx-rotation-property-list {
  gap: 9px;
  max-height: 260px;
  padding: 2px 5px 2px 2px;
}

.hx-rotation-period-table,
.hx-rotation-period-card {
  border-color: #dfe7ef;
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .035);
}

.hx-rotation-period-table th,
.hx-rotation-period-card-header {
  background: #f5f8fb;
}

.hx-rotation-period-table th,
.hx-rotation-period-table td {
  padding: 10px 11px;
}

.hx-rotation-metric,
.hx-rotation-property-adjust label {
  border-color: #e1e8ef;
  border-radius: 9px;
}

.hx-rotation-footer {
  min-height: 62px;
  padding-top: 14px !important;
}

/* Refined neutral layout: keep the rotation workflow visually subordinate to the workbench. */
#rotationPlanModal .modal-content.hx-dialog-xl {
  width: 1040px;
}

#rotationPlanModal .hx-dialog-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.hx-rotation-shell {
  min-height: 0;
  padding: 18px 22px 0;
  background: #f7f9fb;
}

.hx-rotation-view,
.hx-rotation-result-list {
  min-height: 0;
}

.hx-rotation-steps {
  gap: 8px;
  margin: 0 0 14px;
}

.hx-rotation-step,
.hx-rotation-step.is-done,
.hx-rotation-step.is-active {
  min-height: 44px;
  padding: 9px 11px;
  border-color: #dde5ec;
  background: #fff;
  color: #65768a;
  box-shadow: none;
}

.hx-rotation-step > span,
.hx-rotation-step.is-done > span {
  background: #edf1f5;
  color: #617386;
}

.hx-rotation-step.is-active {
  border-color: #b9d7e9;
  background: #f6fbfe;
  color: #185f87;
}

.hx-rotation-step.is-active > span {
  background: #3f7f9f;
  color: #fff;
}

.hx-rotation-section,
.hx-rotation-section.is-blue,
.hx-rotation-section.is-green,
.hx-rotation-section.is-amber {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #dfe6ed;
  border-left: 1px solid #dfe6ed;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.hx-rotation-section-heading {
  min-height: 36px;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom-color: #edf1f4;
}

.hx-rotation-section-heading h3 { color: #24445a; }
.hx-rotation-section-heading p { color: #7c8b9b; }

.hx-rotation-form-grid {
  align-items: end;
  gap: 12px;
}

.hx-rotation-form-grid .form-group > label:not(.hx-rotation-inline-check) {
  display: block;
  min-height: 20px;
  margin: 0 0 6px;
}

.hx-rotation-form-grid .form-group > .hx-rotation-inline-check {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 11px;
  border-color: #cfd9e3;
  border-radius: 8px;
  background: #fff;
  color: #40566a;
  line-height: 20px;
}

.hx-rotation-shell input[type="checkbox"]:checked {
  border-color: #477f9f;
  background: #477f9f;
}

/* Keep the fallback checkbox compact even when generic modal form rules set
   inputs to full width or a 40px minimum height. */
.hx-admin-v2 #rotationPlanModal .hx-rotation-inline-check input#rotationAllowFallback {
  all: unset;
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  width: 15px !important;
  min-width: 15px !important;
  max-width: 15px !important;
  height: 15px !important;
  min-height: 15px !important;
  max-height: 15px !important;
  flex: 0 0 15px !important;
  padding: 0 !important;
  border: 1px solid #9eafbd;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
  cursor: pointer;
}

.hx-admin-v2 #rotationPlanModal .hx-rotation-inline-check input#rotationAllowFallback:checked {
  border-color: #477f9f;
  background: #477f9f;
}

.hx-admin-v2 #rotationPlanModal .hx-rotation-inline-check input#rotationAllowFallback:checked::after {
  position: absolute;
  top: 2px;
  left: 4px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  transform: rotate(45deg);
}

.hx-admin-v2 #rotationPlanModal .hx-rotation-inline-check input#rotationAllowFallback:focus-visible {
  outline: 3px solid rgba(0, 119, 200, .15);
  outline-offset: 2px;
}

.hx-rotation-city-list label:has(input:checked),
.hx-rotation-property-item:has(input:checked) {
  border-color: #bad3e2;
  background: #f3f8fb;
  box-shadow: none;
}

.hx-rotation-toggle {
  border: 1px solid #e0e7ed;
  background: #f4f6f8;
}

.hx-rotation-toggle button.is-active {
  color: #1d668f;
  box-shadow: 0 1px 5px rgba(15, 23, 42, .07);
}

.hx-rotation-baseline-summary,
.hx-rotation-validation,
.hx-rotation-commit-summary {
  border-color: #dde7ee;
  background: #f7fafc;
  color: #526a7c;
}

.hx-rotation-period-badge,
.hx-allocation-tag {
  background: #eef4f7;
  color: #356b88;
}

.hx-rotation-period-card.is-shortage .hx-rotation-period-badge,
.hx-allocation-tag.is-fallback {
  background: #faf5ea;
  color: #82622d;
}

.hx-rotation-footer {
  margin: 0 -22px !important;
  padding: 12px 22px !important;
  border-top-color: #e3e9ef;
  background: #fff;
}
