:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --line: #d9e0e3;
  --line-strong: #aebcc2;
  --text: #172024;
  --muted: #65727a;
  --accent: #176b87;
  --accent-soft: #e6f4f7;
  --warn: #a65f00;
  --bad: #b42318;
  --good: #28724f;
  --paper: #fffefa;
  --cut: #1f2528;
  --crease: #d8372a;
  --shadow: 0 8px 24px rgba(31, 45, 51, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 16px;
}

.external-test-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  color: #744300;
  background: #fff5d8;
  border: 1px solid #e5b64a;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.external-test-banner span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

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

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

h2 {
  font-size: 16px;
}

h3 {
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 10px;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.meta-line span {
  display: inline-flex;
  align-items: center;
}

.quote-chip {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: baseline;
  gap: 6px;
  min-width: 168px;
  padding: 10px 12px;
  background: #101820;
  color: #f7fbfc;
  border-radius: 8px;
  text-align: right;
}

.quote-chip strong {
  font-size: 28px;
  line-height: 1;
  color: #ffffff;
}

.parameter-panel {
  margin-bottom: 12px;
}

.parameter-card {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.parameter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.parameter-actions span {
  color: var(--muted);
  font-size: 12px;
}

.parameter-profile-bar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.4fr) auto auto;
  align-items: end;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.parameter-profile-bar label {
  display: grid;
  gap: 5px;
}

.parameter-profile-bar label span {
  color: var(--muted);
  font-size: 12px;
}

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

.parameter-summary div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

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

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

.parameter-summary strong {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
}

.print-table-settings {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.print-table-block {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.print-table-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.print-table-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.print-table-row strong {
  font-size: 13px;
}

.print-table-fields {
  display: grid;
  grid-template-columns: repeat(9, minmax(82px, 1fr));
  gap: 8px;
}

.print-table-fields label {
  position: relative;
}

.print-table-fields input {
  padding-right: 9px;
}

.price-table-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  align-items: end;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.price-table-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.price-table-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.price-table-fields input {
  padding-right: 9px;
}

.paper-price-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.paper-price-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.paper-price-fields {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(80px, 0.45fr) minmax(100px, 0.55fr) minmax(260px, 2fr);
  gap: 8px;
}

.paper-price-fields input {
  padding-right: 9px;
}

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

.corrugated-price-row {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.corrugated-price-row span {
  min-height: 34px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.corrugated-price-row input {
  min-height: 32px;
  padding-right: 9px;
}

.corrugated-price-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.corrugated-price-fields label {
  display: grid;
  gap: 4px;
}

.corrugated-price-fields label span {
  min-height: auto;
  font-size: 10px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(460px, 1fr) minmax(320px, 390px);
  gap: 12px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-panel {
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 14px;
}

.visual-panel,
.result-panel {
  padding: 14px;
}

.result-panel {
  max-height: calc(100vh - 112px);
  overflow: auto;
}

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

.small-button,
.tab-button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
}

.small-button {
  padding: 0 12px;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.data-backup-status {
  min-height: 20px;
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.feedback-button {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.feedback-button:hover {
  color: #ffffff;
  background: #12576e;
}

.feedback-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 10px;
}

.feedback-dialog::backdrop {
  background: rgba(16, 24, 32, 0.52);
  backdrop-filter: blur(2px);
}

.feedback-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(16, 24, 32, 0.22);
}

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

.feedback-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.feedback-current-quote {
  padding: 12px 14px;
  color: #164c5f;
  background: var(--accent-soft);
  border: 1px solid #b8dce5;
  border-radius: 7px;
  font-weight: 600;
  line-height: 1.6;
}

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

.feedback-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.feedback-form-grid input,
.feedback-form-grid select,
.feedback-form-grid textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  resize: vertical;
}

.feedback-note-field {
  grid-column: 1 / -1;
}

.feedback-privacy-note {
  padding: 10px 12px;
  color: var(--muted);
  background: #f7f9fa;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.65;
}

.feedback-status {
  min-height: 18px;
  color: var(--good);
  font-size: 12px;
  text-align: right;
}

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

.small-button:hover,
.tab-button:hover {
  border-color: var(--accent);
}

.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.field-group {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.field-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.field-group h3 {
  margin-bottom: 0;
}

.field-group-body {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.field-group-body[hidden] {
  display: none;
}

.field-group.collapsed {
  padding-bottom: 10px;
}

.field-group-toggle {
  display: flex;
  width: 100%;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.field-group-toggle em {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
}

.field-group-toggle:hover em,
.field-group-toggle:focus-visible em {
  color: var(--accent);
}

.field-group-toggle:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}

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

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

.field-stack {
  display: grid;
  gap: 9px;
}

#planeStructureFields,
#customStructureFields,
#customLayoutFields {
  grid-column: 1 / -1;
}

#customStructureFields > .path-note,
#customLayoutFields > .path-note {
  grid-column: 1 / -1;
}

.carton-input-stack,
.carton-module-stack {
  display: grid;
  gap: 10px;
}

.carton-module-stack[hidden] {
  display: none;
}

.carton-module-stack > .field-group {
  padding: 12px 0;
}

.carton-module-stack > .field-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.carton-module-stack .wide-field,
.carton-module-stack .path-note {
  grid-column: 1 / -1;
}

.carton-price-profile {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(23, 107, 135, 0.24);
  border-radius: 8px;
  background: var(--accent-soft);
}

.carton-price-profile h4 {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
}

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

.carton-profile-actions span {
  flex: 1 1 180px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.carton-subsection {
  display: grid;
  gap: 9px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.carton-subsection:first-child {
  padding-top: 0;
  border-top: 0;
}

.carton-subsection h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.carton-subsection .wide-field,
.carton-subsection > .path-note {
  grid-column: 1 / -1;
}

.auxiliary-stack {
  gap: 14px;
}

.auxiliary-block {
  display: grid;
  gap: 9px;
  padding: 12px 0 2px;
  border-top: 1px dashed var(--line);
}

.auxiliary-block:first-child {
  border-top: 0;
  padding-top: 0;
}

.auxiliary-block-head {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auxiliary-block-head strong {
  color: var(--text);
  font-size: 13px;
}

.auxiliary-grid,
.auxiliary-row {
  display: grid;
  gap: 8px;
}

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

.auxiliary-row-list {
  display: grid;
  gap: 8px;
}

.auxiliary-row {
  grid-template-columns: minmax(82px, 0.68fr) repeat(2, minmax(0, 1fr));
  align-items: end;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.accessory-row {
  grid-template-columns: minmax(72px, 0.55fr) minmax(120px, 1.1fr) repeat(2, minmax(0, 1fr));
}

.carton-insert-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.carton-insert-block {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfd;
}

.carton-insert-block .auxiliary-block-head {
  min-height: 28px;
}

.carton-insert-fields {
  margin-top: 10px;
}

.auxiliary-grid label,
.auxiliary-row label {
  position: relative;
}

.auxiliary-row .toggle-row {
  align-self: end;
}

.process-grid {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.process-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.process-row label {
  position: relative;
}

.process-row .toggle-row {
  grid-column: 1 / -1;
}

.process-row input {
  padding-right: 9px;
}

.process-row em {
  right: 8px;
}

.custom-craft-extra-rows {
  display: contents;
}

.custom-craft-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
}

.custom-craft-actions span {
  color: var(--muted);
  font-size: 12px;
}

label {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

label em {
  position: absolute;
  right: 10px;
  bottom: 9px;
  color: var(--muted);
  font-style: normal;
  pointer-events: none;
}

.field-grid label {
  position: relative;
}

.quote-record-grid .quote-remark-line {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  min-height: 36px;
  padding: 7px 32px 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

select {
  padding-right: 9px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.wide-field {
  position: relative;
}

.wide-field input,
.wide-field select {
  padding-right: 9px;
}

.wide-field input {
  padding-right: 58px;
}

.wide-field em {
  bottom: 9px;
}

.disabled-line {
  opacity: 0.55;
}

.path-note {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--good);
  font-size: 12px;
  line-height: 1.45;
}

.field-group > .path-note + .path-note {
  margin-top: 8px;
}

.path-note.warn {
  border-color: rgba(166, 95, 0, 0.35);
  background: #fff8ed;
  color: var(--warn);
}

.path-note.bad {
  border-color: rgba(180, 47, 36, 0.4);
  background: #ffe9e6;
  color: var(--bad);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--text);
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

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

.tab-button {
  padding: 0 10px;
}

.tab-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.drawing-stage {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}

.drawing-view {
  display: none;
  width: 100%;
  height: 100%;
}

.drawing-view.active {
  display: block;
}

svg {
  display: block;
  width: 100%;
  height: 520px;
}

.cut-line {
  fill: none;
  stroke: var(--cut);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.crease-line {
  fill: none;
  stroke: var(--crease);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
}

.dim-line {
  fill: none;
  stroke: var(--crease);
  stroke-width: 0.7;
  marker-start: url(#arrowStart);
  marker-end: url(#arrowEnd);
  vector-effect: non-scaling-stroke;
}

.ghost-box {
  fill: rgba(23, 107, 135, 0.06);
  stroke: rgba(23, 107, 135, 0.42);
  stroke-dasharray: 6 4;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.press-box {
  fill: rgba(166, 95, 0, 0.04);
  stroke: rgba(166, 95, 0, 0.45);
  stroke-dasharray: 8 5;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.paper-box {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(31, 37, 40, 0.26);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.custom-placeholder-box,
.custom-layout-box {
  fill: rgba(23, 107, 135, 0.06);
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-dasharray: 10 6;
  vector-effect: non-scaling-stroke;
}

.custom-placeholder-text {
  fill: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.custom-placeholder-subtext {
  fill: var(--muted);
  font-size: 10px;
}

.carton-panel-fill {
  fill: rgba(23, 107, 135, 0.08);
  stroke: rgba(23, 107, 135, 0.34);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.carton-side-fill {
  fill: rgba(166, 95, 0, 0.08);
  stroke: rgba(166, 95, 0, 0.34);
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}

.carton-visual-label {
  fill: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.carton-visual-note {
  fill: var(--muted);
  font-size: 10px;
}

.split-line {
  stroke: rgba(31, 37, 40, 0.32);
  stroke-width: 0.8;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}

.dim-text {
  fill: var(--crease);
  font-size: 10px;
  font-weight: 700;
}

.metric-strip,
.summary-grid {
  display: grid;
  gap: 8px;
}

.metric-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 12px;
}

.metric-strip div,
.summary-grid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.metric-strip span,
.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.metric-strip strong,
.summary-grid strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  word-break: break-word;
}

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

.result-stack {
  display: grid;
  gap: 12px;
}

.alternative-section,
.history-section,
.quote-note-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.warning-section {
  border-color: var(--line);
  background: #fbfcfd;
}

.warning-section.has-warn {
  border-color: #dfb45e;
  background: #fff7e6;
  box-shadow: inset 4px 0 0 var(--warn);
}

.warning-section.has-bad {
  border-color: #e5968e;
  background: #fff0ee;
  box-shadow: inset 4px 0 0 var(--bad);
}

.warning-section.has-warn .section-title h3,
.warning-section.has-warn .section-title span {
  color: var(--warn);
}

.warning-section.has-bad .section-title h3,
.warning-section.has-bad .section-title span {
  color: var(--bad);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

summary.section-title {
  cursor: pointer;
  list-style: none;
}

summary.section-title::-webkit-details-marker {
  display: none;
}

details.quote-note-section[open] summary.section-title {
  margin-bottom: 0;
}

.section-title h3 {
  margin: 0;
}

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

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

.quote-history {
  display: grid;
  gap: 8px;
}

.quote-note-list {
  display: grid;
  gap: 6px;
}

.quote-note {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 12px;
  line-height: 1.45;
}

.quote-note strong {
  color: var(--text);
  font-size: 13px;
}

.quote-note span {
  color: var(--muted);
}

.quote-note.warn {
  border-color: #dfb45e;
  border-left: 4px solid var(--warn);
  background: #fff4d9;
}

.quote-note.bad {
  border-color: #e5968e;
  border-left: 4px solid var(--bad);
  background: #ffe9e6;
}

.quote-note.warn strong,
.quote-note.warn span {
  color: #7d4800;
}

.quote-note.bad strong,
.quote-note.bad span {
  color: #8f1d14;
}

.alternative-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  width: 100%;
  min-height: 62px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.alternative-card:hover {
  border-color: var(--accent);
}

.alternative-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.alternative-card strong {
  font-size: 14px;
}

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

.alternative-card em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.4;
}

.history-card {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 12px;
}

.history-card strong {
  color: var(--text);
  font-size: 15px;
}

.history-card span,
.history-card small {
  color: var(--muted);
}

.empty-note {
  padding: 10px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  font-size: 12px;
}

.cost-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}

.cost-table th,
.cost-table td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.cost-table th:first-child,
.cost-table td:first-child {
  text-align: left;
  white-space: normal;
}

.cost-table th {
  background: #eef4f5;
  color: #334047;
  font-weight: 700;
}

.cost-table tr:last-child td {
  border-bottom: 0;
}

.negative {
  color: var(--good);
}

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

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

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(300px, 360px) minmax(420px, 1fr);
  }

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

  .parameter-profile-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .print-table-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .corrugated-price-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .paper-price-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-panel {
    grid-column: 1 / -1;
    max-height: none;
  }
}

@media (max-width: 840px) {
  .app-shell {
    padding: 10px;
  }

  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .quote-chip {
    width: 100%;
    justify-content: start;
    text-align: left;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .external-test-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .external-test-banner span:last-child {
    margin-left: 0;
  }

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

  .feedback-note-field {
    grid-column: auto;
  }

  .workspace {
    display: grid;
  }

  .input-panel,
  .result-panel {
    max-height: none;
  }

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

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

  .accessory-row {
    grid-template-columns: minmax(88px, 0.65fr) repeat(3, minmax(0, 1fr));
  }

  .print-table-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .parameter-profile-bar {
    grid-template-columns: 1fr;
  }

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

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

}

@media (max-width: 520px) {
  .field-grid,
  .auxiliary-grid,
  .auxiliary-row,
  .accessory-row,
  .summary-grid,
  .metric-strip,
  .parameter-summary {
    grid-template-columns: 1fr;
  }

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

  .print-table-fields {
    grid-template-columns: 1fr;
  }

  .price-table-fields,
  .paper-price-fields,
  .corrugated-price-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 20px;
  }

  svg {
    height: 430px;
  }

  .drawing-stage {
    min-height: 430px;
  }
}
