:root {
  color-scheme: light;
  --ink: #17232d;
  --muted: #66727d;
  --line: #d8e0e5;
  --line-strong: #bac7cf;
  --canvas: #f3f6f7;
  --surface: #ffffff;
  --surface-soft: #eef3f5;
  --primary: #176b87;
  --primary-strong: #0f536a;
  --primary-soft: #e1f0f5;
  --green: #16845b;
  --green-soft: #e4f5ec;
  --amber: #b66a0c;
  --amber-soft: #fff2d9;
  --red: #bf3e43;
  --red-soft: #fdebec;
  --violet: #7656a6;
  --violet-soft: #f0eafa;
  --shadow: 0 10px 28px rgba(23, 35, 45, 0.08);
  --radius: 8px;
  --header-height: 72px;
  --tab-height: 68px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

svg {
  width: 1em;
  height: 1em;
  stroke-width: 2;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(23, 107, 135, 0.08), transparent 48%),
    var(--canvas);
}

.login-panel {
  width: min(100%, 410px);
  padding: 34px 28px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: var(--primary);
  font-size: 27px;
}

.login-kicker {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.login-panel h1 {
  margin: 0 0 28px;
  font-size: 25px;
  line-height: 1.3;
}

.login-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--red);
  font-size: 13px;
  text-align: center;
}

.app {
  min-height: 100vh;
}

.app-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: calc(var(--header-height) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  color: #fff;
  background: #173c49;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.header-inner {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  width: min(100%, 900px);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 14px;
}

.header-inner > .icon-btn[hidden] {
  display: inline-grid !important;
  visibility: hidden;
}

.header-copy {
  min-width: 0;
  padding: 0 8px;
  text-align: center;
}

.header-copy p {
  margin: 0 0 2px;
  color: #bddbe5;
  font-size: 11px;
  line-height: 1.2;
}

.header-copy h1 {
  overflow: hidden;
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: 21px;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.screen {
  width: min(100%, 900px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--header-height) + env(safe-area-inset-top) + 18px) 16px calc(var(--tab-height) + env(safe-area-inset-bottom) + 26px);
  outline: none;
}

.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-height) + env(safe-area-inset-bottom));
  padding: 5px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -4px 18px rgba(23, 35, 45, 0.07);
}

.tabbar button {
  display: flex;
  min-width: 0;
  min-height: 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.tabbar button svg {
  font-size: 21px;
}

.tabbar button.active {
  color: var(--primary);
  font-weight: 700;
}

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.page-intro h2,
.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.page-intro p,
.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.date-chip {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

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

.metric {
  min-width: 0;
  min-height: 106px;
  padding: 15px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric.green { border-left-color: var(--green); }
.metric.amber { border-left-color: var(--amber); }
.metric.red { border-left-color: var(--red); }

.metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.metric-label svg {
  flex: 0 0 auto;
  font-size: 17px;
}

.metric-value {
  display: block;
  margin-top: 12px;
  color: var(--primary);
  font-size: 24px;
  font-weight: 750;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.metric.green .metric-value { color: var(--green); }
.metric.amber .metric-value { color: var(--amber); }
.metric.red .metric-value { color: var(--red); }

.metric-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.section {
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.section-accent {
  border-color: #aed2df;
  background: #f5fbfd;
}

.section-warning {
  border-color: #e7c47f;
  background: #fffaf0;
}

.section-danger {
  border-color: #e8afb2;
  background: #fff7f7;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading:last-child {
  margin-bottom: 0;
}

.section-heading .heading-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 18px;
}

.heading-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

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

.module-btn {
  display: flex;
  min-width: 0;
  min-height: 94px;
  aspect-ratio: 1 / 0.92;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}

.module-btn svg {
  color: var(--primary);
  font-size: 25px;
}

.module-btn:hover,
.module-btn:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.module-btn span {
  overflow-wrap: anywhere;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(8, minmax(46px, 1fr));
  gap: 0;
  overflow-x: auto;
  padding: 2px 0 7px;
  scrollbar-width: thin;
}

.workflow-step {
  position: relative;
  min-width: 66px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.workflow-step::after {
  position: absolute;
  top: 14px;
  left: calc(50% + 15px);
  width: calc(100% - 30px);
  height: 2px;
  content: "";
  background: var(--line);
}

.workflow-step:last-child::after {
  display: none;
}

.workflow-dot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  margin: 0 auto 7px;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  font-size: 14px;
}

.workflow-step.done .workflow-dot {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.workflow-step.done::after {
  background: var(--green);
}

.workflow-step.current .workflow-dot {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-soft);
}

.progress-list {
  display: grid;
  gap: 12px;
}

.progress-item {
  display: grid;
  grid-template-columns: minmax(84px, 0.8fr) minmax(120px, 2fr) 48px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-soft);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 250ms ease;
}

.progress-fill.green { background: var(--green); }
.progress-fill.amber { background: var(--amber); }
.progress-fill.red { background: var(--red); }
.progress-fill.violet { background: var(--violet); }

.segmented-bar {
  display: flex;
  width: 100%;
  height: 16px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface-soft);
}

.segment {
  min-width: 0;
  height: 100%;
}

.segment.s1 { background: #2f7ea1; }
.segment.s2 { background: #28a079; }
.segment.s3 { background: #cc8a2f; }
.segment.s4 { background: #7c64a8; }
.segment.s5 { background: #c95358; }

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

.legend-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.legend-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.swatch {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 2px;
}

.swatch.s1 { background: #2f7ea1; }
.swatch.s2 { background: #28a079; }
.swatch.s3 { background: #cc8a2f; }
.swatch.s4 { background: #7c64a8; }
.swatch.s5 { background: #c95358; }

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

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

.form-grid > .btn {
  align-self: end;
}

.field {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.field.full {
  grid-column: 1 / -1;
}

.field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.field input,
.field select,
.field textarea,
.inline-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.13);
}

.field input[readonly] {
  color: var(--muted);
  background: var(--surface-soft);
}

.input-with-icon {
  position: relative;
  display: block;
}

.input-with-icon svg {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  color: var(--muted);
  font-size: 17px;
  transform: translateY(-50%);
}

.input-with-icon input {
  padding-left: 39px;
}

.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.field-with-action .icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--primary);
  background: var(--surface);
}

.field-with-action .icon-btn:hover,
.field-with-action .icon-btn:focus-visible {
  background: var(--primary-soft);
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.btn svg {
  flex: 0 0 auto;
  font-size: 18px;
}

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

.btn-primary {
  color: #fff;
  background: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--primary-strong);
}

.btn-success {
  color: #fff;
  background: var(--green);
}

.btn-warning {
  color: #fff;
  background: var(--amber);
}

.btn-danger {
  color: #fff;
  background: var(--red);
}

.btn-secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

.btn-quiet {
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-block {
  width: 100%;
}

.btn-row .btn {
  flex: 1 1 0;
}

.calculation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid #acd0dc;
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.calculation.danger {
  border-color: #e4aaae;
  background: var(--red-soft);
}

.calc-item {
  min-width: 0;
}

.calc-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.calc-item strong {
  display: block;
  margin-top: 5px;
  color: var(--primary-strong);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.calculation.danger .calc-item strong {
  color: var(--red);
}

.status-badge {
  display: inline-flex;
  max-width: 100%;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}

.status-badge.success { color: var(--green); background: var(--green-soft); }
.status-badge.warning { color: var(--amber); background: var(--amber-soft); }
.status-badge.danger { color: var(--red); background: var(--red-soft); }
.status-badge.info { color: var(--primary); background: var(--primary-soft); }

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

.equipment-btn {
  display: grid;
  min-width: 0;
  min-height: 64px;
  place-items: center;
  padding: 7px 4px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  color: var(--primary);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
}

.equipment-btn strong,
.equipment-btn small {
  display: block;
}

.equipment-btn strong {
  font-size: 14px;
}

.equipment-btn small {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 400;
}

.equipment-btn.active {
  color: #fff;
  background: var(--primary);
}

.equipment-btn.complete:not(.active) {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.ports-table {
  display: grid;
  gap: 8px;
}

.port-row {
  display: grid;
  grid-template-columns: 34px minmax(80px, 1fr) minmax(80px, 1fr) minmax(90px, 0.7fr);
  align-items: center;
  gap: 8px;
}

.port-label {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 800;
}

.port-row input,
.port-row select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 8px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  min-width: 610px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: #41505a;
  background: var(--surface-soft);
  font-weight: 750;
  white-space: nowrap;
}

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

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.record h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.record p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.record-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.text-btn {
  padding: 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  display: grid;
  min-height: 170px;
  place-items: center;
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  margin-bottom: 10px;
  font-size: 34px;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

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

.summary-item {
  min-width: 0;
  padding: 12px;
  border-left: 3px solid var(--primary);
  background: var(--surface-soft);
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.summary-item strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.timeline {
  position: relative;
  display: grid;
  gap: 13px;
  padding-left: 24px;
}

.timeline::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 7px;
  width: 2px;
  content: "";
  background: var(--line);
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  position: absolute;
  top: 5px;
  left: -22px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  content: "";
  background: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.timeline-item h4 {
  margin: 0;
  font-size: 13px;
}

.timeline-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 13px;
}

.avatar {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: 20px;
  font-weight: 800;
}

.profile-row h2 {
  margin: 0;
  font-size: 18px;
}

.profile-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.action-list {
  border-top: 1px solid var(--line);
}

.action-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.action-item:last-child {
  border-bottom: 0;
}

.action-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 17px;
}

.action-item strong,
.action-item small {
  display: block;
}

.action-item strong {
  font-size: 13px;
}

.action-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.action-item > svg {
  color: var(--muted);
  font-size: 17px;
}

.toast {
  position: fixed;
  z-index: 100;
  bottom: calc(var(--tab-height) + env(safe-area-inset-bottom) + 14px);
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: 6px;
  color: #fff;
  background: #17232d;
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: var(--red);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(17, 27, 34, 0.45);
}

.modal {
  width: min(100%, 560px);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-header .icon-btn {
  width: 36px;
  height: 36px;
  color: var(--ink);
}

.modal-header .icon-btn:hover {
  background: var(--surface-soft);
}

.loader {
  display: grid;
  min-height: 45vh;
  place-items: center;
  color: var(--muted);
}

.loader svg {
  font-size: 28px;
  animation: spin 0.9s linear infinite;
}

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

@media (min-width: 900px) {
  :root {
    --tab-height: 72px;
  }

  .screen {
    padding-right: 22px;
    padding-left: 22px;
  }

  .modal-layer {
    place-items: center;
  }

  .module-btn {
    aspect-ratio: auto;
    min-height: 105px;
  }
}

@media (max-width: 560px) {
  .screen {
    padding-right: 12px;
    padding-left: 12px;
  }

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

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

  .field.full {
    grid-column: auto;
  }

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

  .progress-item {
    grid-template-columns: 84px minmax(100px, 1fr) 42px;
    gap: 7px;
  }

  .workflow {
    grid-template-columns: repeat(8, minmax(38px, 1fr));
    overflow-x: visible;
  }

  .workflow-step {
    min-width: 0;
    font-size: 10px;
  }

  .workflow-dot {
    width: 28px;
    height: 28px;
  }

  .workflow-step::after {
    top: 13px;
    left: calc(50% + 14px);
    width: calc(100% - 28px);
  }

  .port-row {
    grid-template-columns: 30px minmax(72px, 1fr) minmax(72px, 1fr);
  }

  .port-row select {
    grid-column: 2 / 4;
  }

  .port-label {
    grid-row: 1 / 3;
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 360px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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

  .btn-row {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
