:root {
  color-scheme: light;
  --paper: #f7f8f4;
  --panel: #ffffff;
  --ink: #1f2623;
  --muted: #64706a;
  --line: #dce2da;
  --green: #2f8b57;
  --green-soft: #dff2e7;
  --amber: #c9851d;
  --amber-soft: #fff0d6;
  --steel: #4d7088;
  --steel-soft: #e0eef5;
  --danger: #b94b4b;
  --shadow: 0 18px 45px rgba(34, 43, 38, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 0;
  height: 100%;
  min-height: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(120deg, rgba(47, 139, 87, 0.08), rgba(201, 133, 29, 0.08)),
    var(--paper);
  overflow: hidden;
}

.auth-gate {
  display: grid;
  width: 100%;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(47, 139, 87, 0.08), rgba(201, 133, 29, 0.06)),
    #f7f8f4;
}

.auth-card {
  display: grid;
  width: min(460px, 100%);
  gap: 18px;
  padding: 28px;
  border: 1px solid #d8e2d9;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(31, 38, 35, 0.14);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
  border: 1px solid #dbe5dc;
  border-radius: 7px;
  background: #f1f5f1;
}

.auth-mode-tabs button {
  height: 38px;
  border: 0;
  border-radius: 5px;
  color: #637068;
  font-size: 13px;
  font-weight: 900;
  background: transparent;
  cursor: pointer;
}

.auth-mode-tabs button.active {
  color: #17643c;
  background: #fff;
  box-shadow: 0 2px 8px rgba(35, 73, 50, 0.12);
}

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

.auth-form label {
  display: grid;
  gap: 7px;
  color: #425048;
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #ccd8ce;
  border-radius: 6px;
  color: var(--ink);
  background: #fbfcfa;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 139, 87, 0.12);
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 8px;
}

.auth-code-button {
  border: 1px solid #bcd6c4;
  border-radius: 6px;
  color: #26784b;
  font-size: 13px;
  font-weight: 900;
  background: #edf8f1;
  cursor: pointer;
}

.auth-code-button:disabled {
  color: #8a948e;
  border-color: #d9dfda;
  background: #f4f6f4;
  cursor: not-allowed;
}

.auth-submit {
  height: 46px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-weight: 900;
  background: var(--green);
  cursor: pointer;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.62;
}

.auth-status {
  min-height: 20px;
  color: #68756e;
  font-size: 13px;
  text-align: center;
}

.auth-status.error {
  color: var(--danger);
}

.auth-sms-hint {
  padding: 10px 12px;
  border: 1px solid #ead5ad;
  border-radius: 6px;
  color: #8a5c13;
  font-size: 12px;
  line-height: 1.6;
  background: #fff8e9;
}

.auth-demo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #e2e8e2;
  color: #738078;
  font-size: 12px;
}

.auth-demo button {
  border: 0;
  color: var(--green);
  font-weight: 800;
  background: transparent;
  cursor: pointer;
}

button,
input,
select {
  font: inherit;
}

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

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 20px 92px;
  min-width: 0;
  min-height: 0;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  scrollbar-width: none;
}

.side-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.customer-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #d9e6df;
  border-radius: 7px;
  background: #f3f8f5;
}

.customer-account > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.customer-account span,
.customer-account small {
  color: #6d7a73;
  font-size: 10px;
}

.customer-account strong {
  overflow: hidden;
  color: #245f42;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-account button {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #bdd6c5;
  border-radius: 5px;
  color: #2f7d51;
  font-size: 12px;
  font-weight: 800;
  background: #fff;
  cursor: pointer;
}

.brand-logo {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 12px 24px rgba(47, 139, 87, 0.24);
}

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

h1 {
  font-size: 21px;
  line-height: 1.25;
}

.brand-block p,
.top-bar p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.input-form {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.test-case-loader {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid #d9e6df;
  border-radius: 8px;
  background: #f2f7f4;
}

.test-case-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.test-case-head span {
  color: #245f42;
  font-size: 12px;
  font-weight: 900;
}

.test-case-head small {
  color: #708078;
  font-size: 10px;
  font-weight: 800;
}

.test-case-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 6px;
}

.test-case-controls select,
.test-case-controls button {
  height: 32px;
}

.cut-mode-panel {
  display: none;
  gap: 12px;
  min-width: 0;
}

.cut-mode-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc, #eef7ff);
  box-shadow: 0 10px 24px rgba(31, 38, 35, 0.06);
}

.cut-mode-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cut-mode-head span {
  color: #0369a1;
  font-size: 12px;
  font-weight: 900;
}

.cut-mode-head strong {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-mode-cutting .input-form {
  display: none;
}

.app-mode-cutting .cut-mode-panel {
  display: grid;
}

.app-mode-plan .cut-mode-panel {
  display: none;
}

.animation-explain-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(251, 146, 60, 0.34);
  border-radius: 8px;
  background: rgba(255, 251, 235, 0.94);
  box-shadow: 0 12px 28px rgba(31, 38, 35, 0.08);
}

.animation-explain-card .scene-animation-main strong {
  white-space: normal;
}

.animation-explain-card .scene-animation-flow div {
  background: rgba(255, 255, 255, 0.86);
}

.animation-explain-card[data-phase="output"] .scene-animation-flow-active {
  border-color: rgba(34, 197, 94, 0.42) !important;
  background: #ecfdf5 !important;
}

.animation-explain-card[data-phase="output"] .scene-animation-flow-active span {
  background: #16a34a;
}

.form-section,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(31, 38, 35, 0.06);
}

.form-section {
  --section-padding: 14px;
  overflow: hidden;
  padding: var(--section-padding);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: calc(var(--section-padding) * -1) calc(var(--section-padding) * -1) 12px;
  padding: 10px var(--section-padding);
  border-bottom: 1px solid #e6eee4;
  background: linear-gradient(90deg, rgba(47, 139, 87, 0.12), rgba(201, 133, 29, 0.08));
  font-weight: 700;
}

.section-title span {
  font-size: 16px;
}

.section-title small {
  color: var(--muted);
  font-weight: 500;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

input[type="number"] {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fbfcfa;
  outline: none;
}

select {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fbfcfa;
  outline: none;
}

input[type="number"]:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 139, 87, 0.14);
}

.preset-row,
.product-preset-row,
.table-action-row {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.preset-row,
.product-preset-row {
  grid-template-columns: minmax(0, 1fr);
  padding: 8px;
  border: 1px solid #e8eee6;
  border-radius: 8px;
  background: #f8faf7;
}

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

.board-candidate-box {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #dce9dd;
  border-radius: 8px;
  background: #f5faf6;
}

.board-candidate-head,
.board-candidate-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.board-candidate-head {
  justify-content: space-between;
  color: #46564e;
  font-size: 12px;
  font-weight: 800;
}

.board-candidate-head strong {
  color: var(--green);
}

.board-candidate-actions .mini-button {
  flex: 1;
  padding: 0 5px;
}

.board-candidate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.board-candidate-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid #cae1cf;
  border-radius: 6px;
  color: #356148;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}

.board-plan-switcher {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 252, 249, 0.96);
}

.board-plan-switcher[hidden] {
  display: none;
}

.board-plan-switcher label {
  color: #526159;
  font-size: 12px;
  font-weight: 800;
}

.board-plan-switcher select {
  height: 32px;
  min-width: 0;
  font-weight: 800;
}

.table-action-row {
  grid-template-columns: 1fr 1fr;
  margin: 0 0 10px;
}

.product-toolbox {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #e8eee6;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfcfa, #f3f8f3);
}

.tool-strip,
.product-toolbox .table-action-row,
.product-toolbox .product-preset-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin: 0;
}

.product-toolbox .product-preset-row {
  grid-template-columns: 38px minmax(0, 1fr) 58px;
  padding: 0;
  border: 0;
  background: transparent;
}

.tool-strip-label {
  color: #53635b;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.preset-actions-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 0 44px;
}

.mini-button-strong {
  border-color: rgba(47, 139, 87, 0.28);
  color: var(--green);
  background: #eef8f1;
}

.mode-toolbox {
  display: grid;
  gap: 6px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid #e3ebe1;
}

.mode-toolbox-bottom {
  margin: 0;
  padding-top: 0;
  border-top: 0;
}

.mode-toolbox-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.global-mode-select {
  display: none;
}

.mode-segmented-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

.mode-segment-button {
  height: 30px;
  border: 1px solid #d8e2d5;
  border-radius: 7px;
  color: #53635b;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.mode-segment-button-active {
  border-color: rgba(47, 139, 87, 0.45);
  color: #fff;
  background: var(--green);
}

.mode-state {
  display: grid;
  min-width: 38px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  color: #047857;
  background: #e6f6eb;
  font-size: 11px;
  font-weight: 900;
}

.mode-state-hidden {
  display: none;
}

.mode-state-mixed {
  color: #9a3412;
  background: #ffedd5;
}

.product-mode-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.product-mode-item {
  display: grid;
  grid-template-columns: auto minmax(68px, 1fr);
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid #e3ebe1;
  border-radius: 7px;
  background: #fff;
}

.product-mode-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.product-mode-item select {
  height: 27px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 800;
}

.submit-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #dce8dc;
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfcfa, #eff7f0);
  box-shadow: 0 10px 28px rgba(31, 38, 35, 0.07);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fbfcfa;
  cursor: pointer;
}

.segmented input:checked + span {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
  font-weight: 700;
}

.product-rows {
  display: grid;
  gap: 8px;
}

.product-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e7eee5;
  border-radius: 8px;
  background: #fff;
}

.product-row:last-of-type {
  border-bottom: 1px solid #e7eee5;
}

.product-row-active {
  border-color: rgba(47, 139, 87, 0.28);
  background: rgba(47, 139, 87, 0.06);
}

.product-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-row-head strong {
  font-size: 14px;
}

.product-row-head .mini-button {
  width: 46px;
  height: 28px;
  padding: 0;
}

.secondary-button,
.mini-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.secondary-button {
  width: 100%;
  height: 36px;
  margin-top: 12px;
  color: var(--green);
  font-weight: 800;
}

.mini-button {
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.preset-row select,
.product-preset-row select {
  height: 34px;
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
}

.preset-actions .mini-button,
.table-action-row .mini-button {
  height: 32px;
}

.mini-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.primary-button,
.text-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.primary-button {
  height: 44px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: var(--ink);
  box-shadow: 0 14px 24px rgba(31, 38, 35, 0.16);
}

.primary-button:hover {
  background: #2d3933;
}

.floating-actions {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(520px, calc(100vw - 36px));
  padding: 8px;
  border: 1px solid rgba(220, 226, 218, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 38px rgba(31, 38, 35, 0.16);
  backdrop-filter: blur(8px);
}

.floating-action {
  min-width: 94px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: 999px;
  color: #fff;
  background: #16a34a;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.floating-action-secondary {
  color: var(--green);
  background: #fff;
}

.floating-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status-line {
  min-height: 38px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: #eef3ed;
  font-size: 13px;
}

.status-line.error {
  color: var(--danger);
  background: #fdecec;
}

.main-stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  padding: 24px;
  gap: 12px;
  height: 100vh;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

h2 {
  font-size: 26px;
}

.toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.icon-button,
.text-button {
  height: 38px;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 20px rgba(31, 38, 35, 0.08);
}

.icon-button {
  width: 38px;
  font-size: 19px;
}

.text-button {
  padding: 0 15px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 390px);
  gap: 18px;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.app-mode-cutting .workspace {
  grid-template-columns: minmax(420px, 1fr) minmax(330px, 410px);
}

.app-mode-plan .cutting-only,
.app-mode-cutting .plan-only {
  display: none !important;
}

.app-mode-plan .scene-action-panel,
.app-mode-plan .scene-step-controls {
  display: none;
}

.app-mode-cutting .scene-animation-label {
  display: none;
}

.scene-host {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  min-width: 0;
  position: relative;
  top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #fdfefb, #edf3ef);
  box-shadow: var(--shadow);
}

.scene-host canvas {
  display: block;
}

.scene-view-controls {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 9;
  display: grid;
  gap: 5px;
  width: 122px;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.scene-projection-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
}

.scene-projection-button {
  height: 28px;
  border: 1px solid rgba(153, 174, 160, 0.42);
  border-radius: 5px;
  color: #52635a;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.scene-projection-button:hover {
  color: #166534;
}

.scene-projection-button-active {
  border-color: rgba(47, 139, 87, 0.42);
  color: #166534;
  background: rgba(231, 246, 236, 0.9);
  box-shadow: 0 2px 5px rgba(31, 75, 47, 0.08);
}

.scene-view-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 94px;
}

.view-cube-canvas {
  width: 94px;
  height: 94px;
  border-radius: 6px;
  background: transparent;
}

.scene-action-panel {
  display: flex;
  flex: 1 1 520px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.scene-speed-panel {
  display: flex;
  flex: 1 1 560px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 7px;
  width: auto;
  min-width: 0;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(220, 226, 218, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(31, 38, 35, 0.1);
}

.scene-speed-panel label {
  display: grid;
  grid-template-columns: 30px minmax(70px, 1fr) 38px;
  flex: 0 1 150px;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.scene-speed-panel input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.scene-distance-controls {
  display: grid;
  flex: 0 1 236px;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 7px;
  min-width: 224px;
}

.scene-distance-controls label {
  grid-template-columns: 30px 52px 22px;
  flex: none;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(47, 139, 87, 0.16);
  border-radius: 7px;
  background: rgba(246, 248, 244, 0.78);
}

.scene-distance-controls input[type="number"] {
  width: 52px;
  height: 25px;
  padding: 0 5px;
  border: 1px solid rgba(47, 139, 87, 0.2);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.scene-distance-controls input[type="number"]::-webkit-outer-spin-button,
.scene-distance-controls input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.scene-distance-controls input[type="number"]:focus {
  border-color: rgba(47, 139, 87, 0.52);
  box-shadow: 0 0 0 3px rgba(47, 139, 87, 0.1);
}

.scene-speed-panel strong {
  color: var(--green);
  font-size: 12px;
  text-align: right;
}

.scene-speed-panel .dimension-skip-toggle {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  grid-template-columns: none;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid rgba(47, 139, 87, 0.18);
  border-radius: 7px;
  background: rgba(246, 248, 244, 0.82);
  cursor: pointer;
}

.dimension-skip-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dimension-skip-switch {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 18px;
  border: 1px solid rgba(100, 116, 139, 0.28);
  border-radius: 999px;
  background: #e2e8f0;
  transition: background 140ms ease, border-color 140ms ease;
}

.dimension-skip-switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
  transition: transform 140ms ease;
}

.dimension-skip-toggle input:checked + .dimension-skip-switch {
  border-color: rgba(22, 163, 74, 0.45);
  background: #16a34a;
}

.dimension-skip-toggle input:checked + .dimension-skip-switch i {
  transform: translateX(14px);
}

.dimension-skip-toggle input:focus-visible + .dimension-skip-switch {
  outline: 3px solid rgba(47, 139, 87, 0.16);
  outline-offset: 2px;
}

.scene-speed-panel .dimension-skip-toggle > strong {
  color: #475569;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

.speed-default-button {
  height: 28px;
  flex: 0 0 auto;
  width: auto;
  padding: 0 10px;
  border: 1px solid rgba(47, 139, 87, 0.24);
  border-radius: 7px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.scene-settings-button {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(47, 139, 87, 0.24);
  border-radius: 7px;
  color: var(--green);
  background: #fff;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.scene-settings-button:hover {
  background: var(--green-soft);
}

.scene-long-image-button {
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(47, 139, 87, 0.22);
  border-radius: 7px;
  color: #397a55;
  background: rgba(255, 255, 255, 0.94);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.scene-long-image-button:hover {
  background: var(--green-soft);
}

.scene-long-image-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.scene-view-controls {
  position: absolute;
}

.scene-view-reset {
  position: absolute;
  top: 31px;
  right: 0;
  z-index: 2;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(47, 139, 87, 0.2);
  border-radius: 50%;
  color: #397a55;
  background: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.animation-settings-dialog {
  width: min(440px, calc(100vw - 28px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.animation-settings-dialog::backdrop {
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(2px);
}

.animation-settings-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(47, 139, 87, 0.18);
  border-radius: 8px;
  background: #fff;
}

.animation-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.animation-settings-head span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.animation-settings-head h2 {
  margin: 3px 0 0;
  font-size: 20px;
}

.animation-settings-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #475569;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.animation-settings-dialog .scene-speed-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.animation-settings-dialog .scene-speed-panel > label {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 46px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #e2e8e3;
  border-radius: 7px;
  background: #f8faf8;
  font-size: 13px;
}

.animation-settings-dialog .scene-distance-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
}

.animation-settings-dialog .scene-distance-controls label {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 26px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #e2e8e3;
  border-radius: 7px;
  background: #f8faf8;
}

.animation-settings-dialog .scene-distance-controls input[type="number"] {
  width: 100%;
  height: 30px;
}

.animation-settings-dialog .scene-speed-panel .dimension-skip-toggle {
  display: flex;
  justify-content: flex-start;
  gap: 9px;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid #e2e8e3;
  background: #f8faf8;
}

.animation-settings-dialog .scene-speed-panel .dimension-skip-toggle > strong {
  display: block;
  font-size: 13px;
}

.animation-settings-dialog .scene-speed-panel .cut-animation-skip-toggle::after {
  content: none;
}

.animation-settings-dialog .speed-default-button {
  width: 100%;
  height: 38px;
  font-size: 13px;
}

.scene-step-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 8;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(220, 226, 218, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 28px rgba(31, 38, 35, 0.12);
  backdrop-filter: blur(8px);
}

.app-mode-plan .scene-step-controls {
  display: flex;
}

.app-mode-plan .scene-step-controls > :not(.scene-settings-button):not(.scene-long-image-button) {
  display: none;
}

.long-image-dialog {
  width: min(920px, calc(100vw - 28px));
  max-width: none;
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.long-image-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.long-image-preview-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid rgba(47, 139, 87, 0.18);
  border-radius: 8px;
  background: #fff;
}

.long-image-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.long-image-preview-head span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.long-image-preview-head h2 {
  margin-top: 3px;
  font-size: 20px;
}

.long-image-preview-body {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: #e8ede8;
}

.long-image-preview-body img {
  display: block;
  width: min(100%, 760px);
  height: auto;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.long-image-preview-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

.long-image-preview-actions button {
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: #16a34a;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.long-image-sheet {
  position: fixed;
  top: 0;
  left: -10000px;
  z-index: 9999;
  display: grid;
  gap: 20px;
  width: 900px;
  padding: 38px;
  color: #17201b;
  background: #f3f6f3;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.long-image-sheet-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid #d8e4da;
  border-radius: 8px;
  background: #fff;
}

.long-image-brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #2f8b57;
  font-size: 28px;
  font-weight: 900;
}

.long-image-sheet-head span {
  color: #4c6457;
  font-size: 15px;
  font-weight: 800;
}

.long-image-sheet-head h1 {
  margin-top: 4px;
  font-size: 32px;
}

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

.long-image-summary div {
  display: grid;
  gap: 5px;
  padding: 15px 17px;
  border: 1px solid #d8e4da;
  border-radius: 8px;
  background: #fff;
}

.long-image-summary span {
  color: #64746b;
  font-size: 13px;
}

.long-image-summary strong {
  font-size: 20px;
}

.long-image-order-note {
  padding: 14px 17px;
  border-left: 5px solid #2f8b57;
  border-radius: 6px;
  color: #17633a;
  background: #e9f7ee;
  font-size: 16px;
  font-weight: 850;
}

.long-image-process,
.long-image-cutting-info {
  display: grid;
  gap: 16px;
}

.long-image-sheet .phase-card {
  padding: 18px;
  border: 1px solid #cfe0d3;
  border-radius: 8px;
  background: #fff;
}

.long-image-sheet .section-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dce6df;
  border-radius: 8px;
  background: #f8faf8;
}

.long-image-sheet .reserve-choice-card {
  padding: 18px;
  background: #fff;
}

.long-image-sheet .reserve-choice-button[aria-pressed="true"] {
  color: #fff;
  background: #2f8b57;
}

.long-image-sheet footer {
  padding-top: 16px;
  border-top: 1px solid #ccd8cf;
  color: #738078;
  font-size: 13px;
  text-align: center;
}

.scene-step-skip-toggle {
  position: relative;
  display: flex;
  height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid rgba(47, 139, 87, 0.22);
  border-radius: 7px;
  color: #475569;
  background: rgba(255, 255, 255, 0.94);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.scene-step-skip-toggle > strong {
  color: #475569;
  font-size: 11px;
}

.scene-step-skip-toggle .dimension-skip-switch {
  width: 28px;
  height: 16px;
}

.scene-step-skip-toggle .dimension-skip-switch i {
  width: 10px;
  height: 10px;
}

.scene-step-skip-toggle input:checked + .dimension-skip-switch i {
  transform: translateX(12px);
}

.scene-step-button {
  min-width: 78px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(22, 163, 74, 0.28);
  border-radius: 999px;
  color: #fff;
  background: #16a34a;
  box-shadow: 0 14px 32px rgba(22, 101, 52, 0.2);
  font-size: 14px;
  font-weight: 900;
  pointer-events: auto;
  cursor: pointer;
}

.scene-step-button:hover {
  background: #15803d;
}

.scene-step-button.text-button-active {
  border-color: rgba(249, 115, 22, 0.38);
  color: #9a3412;
  background: #ffedd5;
  box-shadow: 0 14px 32px rgba(154, 52, 18, 0.16);
}

.scene-step-button-secondary {
  min-width: 68px;
  border-color: rgba(47, 139, 87, 0.22);
  color: var(--green);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(31, 38, 35, 0.1);
}

.scene-step-button-secondary:hover {
  background: var(--green-soft);
}

.scene-step-button:disabled,
.scene-step-button:disabled:hover,
.speed-default-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  box-shadow: none;
}

.scene-step-button-done,
.scene-step-button-done:hover {
  border-color: rgba(100, 116, 139, 0.28);
  color: #64748b;
  background: #f1f5f9;
}

.scene-dimension-panel {
  position: absolute;
  left: 12px;
  top: auto;
  bottom: 12px;
  z-index: 6;
  display: grid;
  gap: 5px;
  width: min(190px, calc(100% - 24px));
  padding: 7px 8px 9px;
  border: 1px solid rgba(249, 115, 22, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(31, 38, 35, 0.11);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.scene-dimension-panel-visible {
  opacity: 1;
  transform: translateY(0);
}

.scene-dimension-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.scene-dimension-head span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: #9a3412;
  background: #ffedd5;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.scene-dimension-body {
  min-width: 0;
}

.scene-dimension-panel strong {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-dimension-ruler {
  display: flex;
  position: relative;
  flex-direction: column-reverse;
  gap: 0;
  width: 100%;
  height: 136px;
  min-height: 136px;
  overflow: hidden;
  padding: 4px 0 17px 28px;
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.62);
}

.scene-dimension-ruler::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 7px;
  bottom: 21px;
  width: 6px;
  border-radius: 999px;
  background: #fed7aa;
  box-shadow: inset 0 0 0 1px rgba(194, 65, 12, 0.2);
}

.scene-dimension-ruler::after {
  content: "0";
  position: absolute;
  left: 9px;
  bottom: 4px;
  color: #9a3412;
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
}

.scene-dimension-segment {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  max-width: 100%;
  min-height: 24px;
  padding: 0 0 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.scene-dimension-segment::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 999px;
  background: var(--dimension-color, #fb923c);
  box-shadow: inset 0 0 0 1px rgba(124, 45, 18, 0.18);
}

.scene-dimension-segment:first-child {
  border-bottom: 0;
}

.scene-dimension-segment em {
  max-width: 100%;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid var(--dimension-border, rgba(249, 115, 22, 0.22));
  border-radius: 999px;
  color: var(--dimension-ink, #7c2d12);
  background: var(--dimension-soft, rgba(255, 241, 223, 0.95));
  font-size: 20px;
  font-style: normal;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-dimension-segment-waste {
  background: transparent;
}

.scene-dimension-segment-waste::before {
  background: var(--dimension-color, #94a3b8);
}

.scene-dimension-segment-waste em {
  border-color: var(--dimension-border, rgba(148, 163, 184, 0.34));
  color: var(--dimension-ink, #475569);
  background: var(--dimension-soft, rgba(241, 245, 249, 0.96));
}

.scene-animation-label {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  display: grid;
  gap: 7px;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid rgba(251, 146, 60, 0.34);
  border-radius: 8px;
  background: rgba(255, 251, 235, 0.94);
  box-shadow: 0 14px 32px rgba(31, 38, 35, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.scene-animation-label-visible {
  opacity: 1;
  transform: translateY(0);
}

.scene-animation-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.scene-animation-main span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: #9a3412;
  background: #ffedd5;
  font-size: 12px;
  font-weight: 900;
}

.scene-animation-main strong {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-animation-sub {
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.scene-animation-flow {
  display: grid;
  gap: 5px;
}

.scene-animation-flow div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  min-height: 27px;
  padding: 5px 7px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.scene-animation-flow span {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #64748b;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 900;
}

.scene-animation-flow strong {
  min-width: 0;
  overflow: visible;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
  white-space: normal;
}

.scene-animation-flow-active {
  border-color: rgba(249, 115, 22, 0.45) !important;
  background: #fff7ed !important;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.14);
}

.scene-animation-flow-active span {
  color: #fff;
  background: #f97316;
}

.scene-animation-flow-active strong {
  color: #111827;
}

.scene-animation-label[data-phase="output"] .scene-animation-flow-active {
  border-color: rgba(34, 197, 94, 0.42) !important;
  background: #ecfdf5 !important;
}

.scene-animation-label[data-phase="output"] .scene-animation-flow-active span {
  background: #16a34a;
}

.scene-animation-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #fde7c7;
}

.scene-animation-track i {
  display: block;
  width: 3%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f97316, #22c55e);
}

.result-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.result-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-row div {
  min-height: 74px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 38, 35, 0.07);
}

.metric-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-row strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.card {
  padding: 14px;
}

.card h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.plan-confirm-card {
  display: grid;
  gap: 10px;
}

.plan-confirm-card h3 {
  margin-bottom: 0;
}

.plan-confirm-card p {
  color: #64706a;
  font-size: 13px;
  line-height: 1.6;
}

.plan-confirm-card .primary-button {
  width: 100%;
  height: 40px;
  background: #16a34a;
}

.plan-confirm-card .primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.info-list {
  display: grid;
  gap: 9px;
}

.info-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 7px;
  background: #f8faf7;
}

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

.info-value {
  font-size: 15px;
  font-weight: 800;
}

.cutting-info,
.cut-section {
  display: grid;
  gap: 10px;
}

.cut-summary,
.cut-step,
.cut-block {
  padding: 10px;
  border-radius: 7px;
  background: #f8faf7;
}

.cut-summary p,
.cut-step p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.cut-section h4 {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.cut-block {
  display: grid;
  gap: 10px;
}

.cut-block-head {
  display: grid;
  gap: 4px;
}

.cut-block-head span {
  color: var(--muted);
  font-size: 12px;
}

.direction-table {
  display: grid;
  gap: 6px;
}

.cut-direction-row {
  display: grid;
  grid-template-columns: 34px 58px 1fr auto;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.order-pill {
  display: grid;
  width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 99px;
  color: var(--steel);
  background: var(--steel-soft);
  font-weight: 800;
}

.order-pill.ignore {
  color: var(--green);
  background: var(--green-soft);
}

.cut-direction-row em {
  color: var(--muted);
  font-style: normal;
}

.empty {
  color: var(--muted);
  font-size: 13px;
}

.reserve-choice-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #cfe8d5;
  border-radius: 8px;
  background: linear-gradient(135deg, #f5fbf6, #fffaf0);
}

.reserve-choice-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.reserve-choice-copy span {
  color: #047857;
  font-size: 12px;
  font-weight: 900;
}

.reserve-choice-copy strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}

.reserve-choice-copy em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.4;
}

.reserve-choice-warning {
  padding: 7px 8px;
  border: 1px solid rgba(251, 146, 60, 0.34);
  border-radius: 8px;
  color: #9a3412;
  background: #fff7ed;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.reserve-choice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reserve-choice-button {
  min-height: 34px;
  border: 1px solid #d8e2d5;
  border-radius: 8px;
  color: #53635b;
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.reserve-choice-button-active {
  border-color: rgba(47, 139, 87, 0.48);
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 16px rgba(47, 139, 87, 0.18);
}

.phase-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fafc;
}

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

.phase-badge {
  min-width: 44px;
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  color: #fff;
  background: #ea580c;
  font-size: 13px;
  font-weight: 900;
  line-height: 26px;
  text-align: center;
}

.detail-badge {
  background: #0369a1;
}

.phase-title {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.rough-confirm-card,
.take-board-line,
.board-repeat-tip,
.rough-direction-card,
.section-take-box,
.operation-take-box,
.operation-info-item,
.operation-summary {
  padding: 10px;
  border-radius: 7px;
  background: #fff;
}

.rough-take-label,
.section-take-label,
.operation-take-label {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.rough-take-value,
.section-take-value,
.operation-take-value {
  color: #111827;
  font-size: 15px;
  font-weight: 900;
}

.section-take-box {
  display: grid;
  gap: 8px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid #a7f3d0;
  background: #f0fdf4;
}

.section-take-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-take-label {
  color: #166534;
  font-size: 13px;
}

.section-take-size {
  padding: 9px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 7px;
  color: #052e16;
  background: #fff;
  font-size: 19px;
  font-weight: 900;
}

.section-take-value {
  color: #052e16;
  font-size: 18px;
}

.board-repeat-tip {
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 900;
}

.rough-direction-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #ecfdf5;
}

.rough-direction-label {
  color: #047857;
  font-size: 12px;
  font-weight: 900;
}

.rough-direction-card strong {
  color: #065f46;
  font-size: 14px;
}

.rough-flow-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #ffedd5;
  border-radius: 8px;
  background: #fffaf4;
}

.rough-flow-title {
  justify-self: start;
  padding: 4px 9px;
  border-radius: 7px;
  color: #fff;
  background: #f97316;
  font-size: 13px;
  font-weight: 900;
}

.rough-order-step {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fffdf8;
}

.rough-order-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
}

.rough-order-no {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #f97316;
  font-size: 17px;
  font-weight: 900;
}

.rough-order-head strong {
  font-size: 15px;
  font-weight: 900;
}

.rough-order-take {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #fed7aa;
  border-radius: 7px;
  background: #fff;
}

.rough-order-take span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 7px;
  color: #c2410c;
  background: #ffedd5;
  font-size: 12px;
  font-weight: 900;
}

.rough-order-take strong {
  color: #111827;
  font-size: 17px;
  font-weight: 900;
}

.rough-order-take em {
  flex: 1 1 100%;
  min-width: 0;
  color: #0f766e;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.5;
}

.rough-order-formula {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 7px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
  color: #111827;
  font-size: 13px;
  line-height: 1.8;
}

.rough-axis-title {
  flex: 0 0 auto;
  color: #0f172a;
  font-weight: 900;
}

.rough-order-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-weight: 900;
}

.rough-cut-piece strong {
  display: inline-block;
  padding: 0 8px;
  border: 1px solid #fdba74;
  border-radius: 6px;
  color: #9a3412;
  background: #fed7aa;
}

.rough-waste-size {
  color: #64748b;
  font-weight: 900;
}

.rough-result-title {
  color: #c2410c;
  font-size: 12px;
  font-weight: 900;
}

.rough-result-list {
  display: grid;
  gap: 8px;
}

.rough-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #bbf7d0;
  border-radius: 7px;
  background: #ecfdf5;
}

.rough-result-row strong {
  color: #064e3b;
  font-size: 15px;
  font-weight: 900;
}

.rough-result-waste {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.rough-result-waste strong {
  color: #475569;
}

.cut-animation-active {
  position: relative;
  z-index: 1;
  animation: cutCardPulse 860ms ease-in-out infinite alternate;
}

.cut-animation-take {
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.13);
}

.cut-animation-cut {
  border-color: #fb923c !important;
  background: #fff7ed !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

.cut-animation-output {
  border-color: #86efac !important;
  background: #ecfdf5 !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

@keyframes cutCardPulse {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-1px);
  }
}

.rough-flow-step {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 7px;
  background: #fff;
}

.rough-flow-step-head,
.rough-flow-take,
.operation-top,
.operation-take-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rough-flow-no {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #f97316;
  font-weight: 900;
}

.rough-flow-step-title {
  color: #111827;
  font-weight: 900;
}

.rough-flow-small-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.rough-flow-link-badge {
  display: inline-grid;
  min-width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.rough-flow-take-text {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.section-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.section-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-kicker {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.section-link-badge {
  flex: 0 0 auto;
}

.operation-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.operation-top {
  justify-content: space-between;
}

.operation-label,
.operation-qty-small,
.operation-info-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.operation-product,
.operation-qty-num {
  color: #111827;
  font-size: 17px;
  font-weight: 900;
}

.operation-qty {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  color: #047857;
  background: #ecfdf5;
}

.operation-qty-small {
  color: #047857;
  font-size: 12px;
}

.operation-qty-num {
  color: #047857;
  font-size: 22px;
  line-height: 1;
}

.operation-lines-panel {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid #cfe5ef;
  border-radius: 8px;
  background: #eef7fb;
}

.operation-lines-title {
  justify-self: start;
  padding: 3px 9px;
  border-radius: 999px;
  color: #334155;
  background: #ffffff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(79, 112, 136, 0.12);
}

.operation-line {
  padding: 8px 10px;
  border: 1px solid #ddebf2;
  border-radius: 7px;
  background: #fff;
}

.operation-formula-row {
  display: grid;
  gap: 5px;
  color: #111827;
  font-size: 13px;
  white-space: normal;
}

.operation-row-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  min-width: 0;
  padding: 3px 7px;
  border: 1px solid #cfe5ef;
  border-radius: 7px;
  background: #eef8fc;
}

.operation-placement {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 7px;
  color: #0f766e;
  background: #ecfdf5;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.operation-reserve-hint {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #fed7aa;
  border-radius: 7px;
  color: #9a3412;
  background: #fff7ed;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.operation-reserve-warning {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 7px;
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.operation-reserve-warning-block {
  border-color: rgba(251, 146, 60, 0.24);
  color: #9a3412;
  background: #fff7ed;
}

.operation-axis,
.operation-count,
.operation-divisor,
.operation-total {
  font-weight: 900;
}

.operation-axis {
  min-width: 0;
}

.operation-expression {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.operation-count,
.operation-divisor,
.operation-result,
.operation-total {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 6px;
  line-height: 1;
}

.operation-count {
  padding: 0 7px;
  color: #334155;
  background: #f1f5f9;
}

.operation-divisor {
  padding: 0 8px;
  border: 1px solid #fed7aa;
  color: #9a3412;
  background: #ffedd5;
}

.operation-total {
  padding: 0 2px;
  border: 0;
  color: #111827;
  background: transparent;
}

.operation-result {
  padding: 0 7px;
  color: #475569;
  background: #f8fafc;
}

.rough-formula-card {
  display: grid;
  gap: 7px;
  padding: 8px;
  border-radius: 7px;
  background: #fff;
}

.rough-formula-row {
  align-items: flex-start;
  white-space: normal;
}

.rough-formula-parts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-weight: 900;
}

.rough-formula-part {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.rough-formula-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.rough-formula-waste {
  color: #64748b;
}

.rough-formula-keep {
  color: #047857;
}

.operation-order-badge {
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  min-width: 44px;
  height: 22px;
  padding: 0 7px;
  align-items: center;
  justify-content: center;
  justify-self: start;
  align-self: center;
  place-items: center;
  border-radius: 999px;
  color: #155e75;
  background: #dff1f8;
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(21, 94, 117, 0.12);
}

.operation-order-badge-next {
  color: #155e75;
  background: #dff1f8;
}

.operation-order-badge-none {
  color: #047857;
  background: #d8f3e4;
  min-width: 34px;
  font-size: 12px;
  box-shadow: inset 0 0 0 2px rgba(4, 120, 87, 0.12);
}

@media (max-width: 980px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .side-panel {
    max-height: none;
    overflow: visible;
    padding: 14px 14px 86px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-block {
    gap: 10px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  h1 {
    font-size: 18px;
  }

  .main-stage {
    height: auto;
    overflow: visible;
    padding: 14px;
  }

  .top-bar {
    align-items: stretch;
    justify-content: flex-start;
  }

  .scene-action-panel {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .scene-speed-panel {
    justify-content: stretch;
  }

  .scene-speed-panel > label {
    flex: 1 1 180px;
  }

  .scene-distance-controls {
    flex: 1 1 240px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .scene-host {
    position: relative;
    top: 0;
    height: 62vh;
    min-height: 360px;
  }

  .result-panel {
    max-height: none;
    min-height: 0;
    overflow: visible;
  }

  .floating-actions {
    left: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 680px) {
  .side-panel,
  .main-stage {
    padding: 14px;
  }

  .side-panel {
    padding-bottom: 86px;
  }

  .top-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .scene-action-panel,
  .scene-speed-panel,
  .scene-step-controls {
    width: auto;
  }

  .scene-step-controls {
    left: 10px;
    right: 10px;
    justify-content: center;
  }

  .scene-step-button {
    flex: 0 1 auto;
  }

  .metric-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .grid-2 {
    gap: 7px;
  }

  .form-section {
    --section-padding: 10px;
  }

  .mini-button {
    padding: 0 6px;
    font-size: 11px;
  }
}

.operation-info-value {
  display: block;
  margin-top: 3px;
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.operation-info-subvalue {
  display: block;
  margin-top: 4px;
  color: #047857;
  font-size: 12px;
  font-weight: 900;
}

.operation-summary {
  color: #047857;
  background: #ecfdf5;
  font-size: 13px;
  font-weight: 900;
}

.text-button-active {
  color: #9a3412;
  background: #ffedd5;
}

/* Desktop production workspace */
:root {
  --paper: #edf1ed;
  --panel: #ffffff;
  --ink: #18211d;
  --muted: #66736c;
  --line: #d7dfd8;
  --green: #2f8b57;
  --green-soft: #e5f3ea;
  --amber: #c47718;
  --amber-soft: #fff1dc;
  --steel: #416d85;
  --steel-soft: #e9f2f6;
  --shadow: 0 8px 22px rgba(29, 42, 35, 0.08);
}

body {
  background: var(--paper);
}

.app-shell {
  grid-template-columns: 308px minmax(0, 1fr);
  background: var(--paper);
}

.app-shell.app-mode-cutting {
  grid-template-columns: 268px minmax(0, 1fr);
}

.side-panel {
  gap: 10px;
  padding: 12px;
  border-right-color: #d5ddd6;
  background: #f8faf8;
  scrollbar-gutter: auto;
}

.brand-block {
  min-height: 52px;
  gap: 10px;
  padding: 4px 3px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  box-shadow: none;
}

h1 {
  font-size: 18px;
}

.brand-block p {
  margin-top: 3px;
  font-size: 12px;
}

.input-form,
.cut-mode-panel {
  gap: 9px;
}

.form-section,
.card,
.cut-mode-head,
.animation-explain-card,
.submit-panel,
.metric-row div {
  box-shadow: none;
}

.form-section {
  --section-padding: 11px;
  border-color: #d9e1da;
}

.section-title {
  min-height: 42px;
  margin-bottom: 10px;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom-color: #dce7de;
  background: #edf5ef;
}

.product-section .section-title {
  border-bottom-color: #dce6eb;
  background: #eef4f7;
}

.section-title span {
  font-size: 15px;
}

.grid-2 {
  gap: 7px;
}

label {
  gap: 4px;
  font-size: 11px;
}

input[type="number"] {
  height: 34px;
  border-color: #d8e0d9;
  background: #fff;
}

select {
  border-color: #d8e0d9;
  background: #fff;
}

.preset-row,
.product-preset-row {
  margin-top: 7px;
  padding: 7px;
  border-color: #e0e6e1;
  background: #f5f7f5;
}

.product-toolbox {
  gap: 6px;
  margin-bottom: 9px;
  padding: 8px;
  border-color: #e0e6e1;
  background: #f5f7f5;
}

.product-rows {
  gap: 6px;
}

.product-row {
  gap: 7px;
  padding: 8px;
  border-color: #e0e6e1;
  background: #fff;
}

.product-row-active {
  border-color: rgba(47, 139, 87, 0.34);
  background: #f0f7f2;
}

.secondary-button {
  height: 34px;
  margin-top: 8px;
  background: #f8faf8;
}

.submit-panel {
  gap: 8px;
  padding: 9px;
  border-color: #d9e3da;
  background: #eef5f0;
}

.submit-panel > .primary-button {
  display: none;
}

.mode-toolbox-head {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.mode-segment-button {
  height: 29px;
}

.product-mode-list {
  gap: 5px;
}

.product-mode-item {
  padding: 4px;
}

.cut-mode-head {
  padding: 10px;
  border-color: #d9e6ec;
  background: #eef5f8;
}

.animation-explain-card {
  gap: 7px;
  padding: 10px;
  border-color: #efcf9e;
  background: #fffaf1;
}

.status-line {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #e0e6e1;
  background: #f1f4f1;
  font-size: 12px;
}

.floating-actions {
  position: sticky;
  left: auto;
  bottom: -1px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex-wrap: initial;
  gap: 6px;
  width: 100%;
  max-width: none;
  margin-top: auto;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid #dfe5df;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(248, 250, 248, 0), #f8faf8 30%);
  box-shadow: none;
  backdrop-filter: none;
}

.floating-action {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
}

.main-stage {
  position: relative;
  gap: 10px;
  padding: 12px;
}

.app-mode-plan .main-stage {
  grid-template-rows: minmax(0, 1fr);
}

.app-mode-plan .top-bar {
  position: absolute;
  top: 20px;
  left: auto;
  right: 20px;
  z-index: 12;
  pointer-events: none;
}

.app-mode-plan .top-bar .toolbar {
  pointer-events: auto;
}

.top-bar {
  min-height: 38px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
}

.toolbar {
  gap: 6px;
}

.icon-button,
.text-button {
  height: 32px;
  box-shadow: 0 3px 10px rgba(29, 42, 35, 0.07);
}

.icon-button {
  width: 32px;
  font-size: 17px;
}

.workspace {
  grid-template-columns: minmax(500px, 1fr) 314px;
  gap: 10px;
}

.app-mode-cutting .workspace {
  grid-template-columns: minmax(520px, 1fr) 348px;
}

.scene-host {
  border-color: #d5ddd6;
  background: #f7f9f7;
  box-shadow: none;
}

.scene-speed-panel {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  width: fit-content;
  gap: 4px 7px;
  padding: 4px 6px;
  border-color: #d9e1da;
  background: #fff;
  box-shadow: none;
}

.scene-action-panel {
  flex: 1 1 auto;
}

.scene-speed-panel label {
  flex: 0 1 124px;
  grid-template-columns: 27px minmax(58px, 1fr) 33px;
  gap: 4px;
  font-size: 11px;
}

.scene-distance-controls {
  flex: 0 0 190px;
  grid-template-columns: repeat(2, 92px);
  min-width: 190px;
  gap: 6px;
}

.scene-distance-controls label {
  grid-template-columns: 26px 42px 18px;
  gap: 3px;
  padding: 0;
  border: 0;
  background: transparent;
}

.scene-distance-controls input[type="number"] {
  width: 42px;
  height: 24px;
  padding: 0 3px;
  font-size: 11px;
}

.scene-speed-panel strong {
  font-size: 11px;
}

.scene-speed-panel .dimension-skip-toggle {
  gap: 4px;
  padding: 2px 4px;
  border: 0;
  background: transparent;
}

.dimension-skip-switch {
  width: 28px;
  height: 16px;
}

.dimension-skip-switch i {
  width: 10px;
  height: 10px;
}

.dimension-skip-toggle input:checked + .dimension-skip-switch i {
  transform: translateX(12px);
}

.scene-speed-panel .dimension-skip-toggle > strong {
  font-size: 10px;
}

.speed-default-button {
  height: 25px;
  padding: 0 7px;
  border-color: #d7e3da;
  color: #397a55;
  background: #f3f8f4;
  font-size: 10px;
}

.scene-step-controls {
  top: 10px;
  right: 10px;
  gap: 5px;
  padding: 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 18px rgba(29, 42, 35, 0.1);
}

.scene-step-button {
  min-width: 72px;
  height: 34px;
  padding: 0 11px;
  border-radius: 6px;
  box-shadow: none;
  font-size: 13px;
}

.scene-step-button-secondary {
  min-width: 62px;
  box-shadow: none;
}

.scene-step-button-restart {
  min-width: 82px;
}

.scene-dimension-panel {
  left: 10px;
  bottom: 10px;
  width: min(164px, calc(100% - 20px));
  padding: 6px 7px 8px;
  box-shadow: 0 6px 16px rgba(29, 42, 35, 0.08);
}

.scene-dimension-panel strong {
  font-size: 14px;
}

.scene-dimension-ruler {
  height: 112px;
  min-height: 112px;
  padding-left: 26px;
}

.scene-dimension-segment em {
  padding: 3px 6px;
  font-size: 15px;
}

.result-panel {
  gap: 9px;
  padding: 10px;
  border: 1px solid #d5ddd6;
  border-radius: 8px;
  background: #f8faf8;
}

.metric-row {
  gap: 6px;
}

.metric-row div {
  min-height: 62px;
  padding: 9px;
  border-color: #dde4de;
}

.metric-row strong {
  margin-top: 5px;
  font-size: 19px;
}

.result-panel > .card {
  padding: 11px;
  border-color: #dde4de;
  background: #fff;
}

.card h3 {
  margin-bottom: 9px;
  font-size: 15px;
}

.plan-confirm-card {
  gap: 8px;
}

.plan-confirm-card p {
  font-size: 12px;
  line-height: 1.5;
}

.plan-confirm-card .primary-button {
  height: 38px;
  box-shadow: none;
}

.info-list {
  gap: 6px;
}

.info-item {
  gap: 3px;
  padding: 8px;
  background: #f4f6f4;
}

.info-value {
  font-size: 14px;
}

.cutting-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.cutting-card > h3 {
  position: static;
  z-index: 5;
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #dfe5df;
  background: #ffffff;
}

.app-mode-cutting .result-panel {
  overflow: hidden;
}

.app-mode-cutting .cutting-info {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 8px;
  scrollbar-width: none;
}

.app-mode-cutting .cutting-info::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.cutting-info,
.cut-section {
  gap: 8px;
}

.cut-summary,
.cut-step,
.cut-block {
  padding: 8px;
}

.reserve-choice-card {
  gap: 8px;
  padding: 9px;
  border-color: #d8e2d9;
  background: #fff;
}

.reserve-choice-button-active {
  box-shadow: none;
}

.phase-card {
  gap: 9px;
  padding: 9px;
  border-color: #dce4e7;
  background: #f4f7f8;
}

.rough-flow-card {
  gap: 7px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid #e6ded2;
  border-radius: 0;
  background: transparent;
}

.rough-order-step {
  gap: 8px;
  padding: 8px;
  border-color: #ead4b8;
  background: #fff;
}

.rough-order-take,
.rough-order-formula {
  padding: 8px;
}

.section-card {
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

.section-take-box {
  padding: 9px;
}

.operation-card {
  gap: 8px;
  padding: 8px;
  border: 1px solid #dfe6e8;
  background: #fff;
}

.operation-lines-panel {
  gap: 6px;
  padding: 7px;
  border-color: #d9e6eb;
  background: #eef4f7;
}

.operation-line {
  padding: 7px 8px;
}

@media (max-width: 1180px) and (min-width: 981px) {
  .app-shell {
    grid-template-columns: 286px minmax(0, 1fr);
  }

  .app-shell.app-mode-cutting {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .workspace {
    grid-template-columns: minmax(400px, 1fr) 292px;
  }

  .app-mode-cutting .workspace {
    grid-template-columns: minmax(420px, 1fr) 320px;
  }

  .main-stage {
    padding: 10px;
  }

  .scene-speed-panel > label {
    flex-basis: 122px;
  }

  .scene-speed-panel .dimension-skip-toggle > strong {
    display: none;
  }

  .scene-speed-panel .cut-animation-skip-toggle::after {
    content: "跳切割";
    color: #475569;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
  }

}

@media (max-width: 980px) {
  .app-shell,
  .app-shell.app-mode-cutting {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-panel {
    gap: 9px;
    padding: 12px;
  }

  .main-stage {
    padding: 12px;
  }

  .app-mode-plan .main-stage {
    grid-template-rows: minmax(0, 1fr);
  }

  .app-mode-plan .top-bar {
    top: 20px;
    left: auto;
    right: 20px;
  }

  .workspace,
  .app-mode-cutting .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .result-panel {
    padding: 10px;
  }

  .floating-actions {
    left: auto;
    bottom: -1px;
    max-width: none;
  }
}

@media (max-width: 680px) {
  .side-panel,
  .main-stage {
    padding: 10px;
  }

  .app-mode-plan .top-bar {
    top: 18px;
    left: auto;
    right: 18px;
    width: auto;
  }

  .scene-speed-panel,
  .scene-action-panel,
  .toolbar {
    width: 100%;
  }

  .scene-speed-panel {
    flex-wrap: wrap;
  }

  .scene-speed-panel > label {
    flex: 1 1 120px;
  }

  .scene-distance-controls {
    flex: 1 1 190px;
  }

  .scene-step-controls {
    top: 143px;
    left: 8px;
    right: 8px;
  }

  .scene-view-controls {
    top: 8px;
    left: 8px;
  }
}
