:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dbe2ea;
  --line-strong: #c4ceda;
  --text: #172033;
  --muted: #657184;
  --blue: #1769e0;
  --blue-soft: #eaf2ff;
  --green: #14804a;
  --green-soft: #e9f7ef;
  --amber: #a76705;
  --amber-soft: #fff4df;
  --red: #c93535;
  --red-soft: #fff0f0;
  --shadow: 0 8px 26px rgba(29, 41, 57, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

a {
  color: var(--blue);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  font-weight: 800;
  font-size: 17px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #fff;
  background: #174ea6;
  font-size: 13px;
}

.steps {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.steps::-webkit-scrollbar {
  display: none;
}

.step-btn {
  height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}

.step-btn.active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #c7dcff;
}

.flow-steps {
  flex: 1;
  justify-content: center;
  gap: 8px;
}

.flow-steps .step-btn {
  height: auto;
  min-height: 42px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: var(--line);
  background: #fff;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.flow-steps .step-btn:hover {
  transform: translateY(-1px);
  border-color: #9ec2ff;
  box-shadow: 0 8px 18px rgba(23, 105, 224, 0.1);
}

.step-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.step-copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.step-label {
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
}

.step-state {
  color: var(--muted);
  font-size: 11px;
}

.step-done {
  border-color: #b7e2ca;
  background: var(--green-soft);
}

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

.step-current {
  border-color: #9ec2ff;
  background: var(--blue-soft);
  box-shadow: 0 8px 18px rgba(23, 105, 224, 0.08);
}

.step-current .step-dot {
  color: #fff;
  background: var(--blue);
}

.step-todo {
  opacity: 0.72;
}

.user-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 190px;
}

.user-chip {
  max-width: 180px;
  padding: 6px 9px;
  color: #334155;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.page {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 22px 24px 34px;
}

.page-detail {
  width: min(1600px, 100%);
  height: calc(100vh - 58px);
  height: calc(100dvh - 58px);
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px 16px 20px;
}

.page-detail .page-header {
  flex: 0 0 auto;
  align-items: center;
  margin-bottom: 8px;
}

.page-detail .page-title {
  font-size: 19px;
}

.page-detail .page-subtitle {
  margin-top: 2px;
  line-height: 1.35;
}

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

.page-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.page-subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.route-header {
  width: min(1120px, 100%);
}

.route-header .page-header {
  align-items: center;
}

.header-actions {
  justify-content: flex-end;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: stretch;
}

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

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

.panel-body {
  min-width: 0;
  padding: 16px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

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

.tiny {
  font-size: 12px;
}

.login-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 420px);
  gap: 18px;
  align-items: stretch;
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 760px;
}

.route-home > .home-actions {
  align-self: center;
  width: min(520px, 100%);
  max-width: 520px;
}

.business-tile,
.template-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 138px;
  padding: 24px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.business-tile:hover,
.template-tile:hover,
.row-action:hover {
  border-color: #9ec2ff;
  box-shadow: 0 8px 18px rgba(23, 105, 224, 0.1);
}

.template-tile:hover {
  transform: translateY(-2px);
}

.business-tile {
  min-height: 168px;
}

.business-tile:hover {
  transform: translateY(-2px);
}

.tile-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 800;
}

.tile-title {
  display: block;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.tile-desc {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 18px;
}

.route-templates .template-grid {
  align-self: center;
  width: min(920px, 100%);
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.route-templates .template-tile {
  min-height: 112px;
  padding: 18px;
}

.route-templates .template-icon {
  width: 54px;
  height: 54px;
  font-size: 28px;
}

.route-templates .tile-title {
  font-size: 17px;
}

.route-templates .tile-desc {
  margin-top: 4px;
}

.template-tile.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 12px 28px rgba(23, 105, 224, 0.12);
}

.template-icon {
  width: 70px;
  height: 70px;
  font-size: 34px;
}

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

.selected-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  color: var(--blue);
  background: #fff;
  border: 1px solid #c7dcff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

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

.label {
  color: #344054;
  font-weight: 700;
}

.required {
  color: var(--red);
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
}

.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}

.date-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.date-picker-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 38px;
  min-height: 38px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}

.date-picker-button:hover {
  border-color: #9ec2ff;
  box-shadow: 0 6px 14px rgba(23, 105, 224, 0.09);
}

.date-picker-icon {
  width: 20px;
  height: 20px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%231769e0'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M8%202v4'/%3E%3Cpath%20d='M16%202v4'/%3E%3Crect%20x='3'%20y='4'%20width='18'%20height='18'%20rx='2'/%3E%3Cpath%20d='M3%2010h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
}

.date-picker-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  color: transparent;
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0;
}

.date-picker-input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}

.choice-row,
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice,
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 9px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.actions.right {
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  text-decoration: none;
}

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

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

.btn.warning {
  color: #7a4500;
  border-color: #f1c36d;
  background: var(--amber-soft);
}

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

.btn.ghost {
  background: transparent;
}

.btn.small {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 13px;
}

.btn:hover:not(:disabled) {
  border-color: #9ec2ff;
  box-shadow: 0 6px 14px rgba(23, 105, 224, 0.09);
}

.btn.primary:hover:not(:disabled),
.btn.success:hover:not(:disabled) {
  filter: brightness(1.03);
}

.section-gap {
  margin-top: 14px;
}

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

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.summary-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
}

.legacy-batch-table {
  display: none;
}

.batch-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 10px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.batch-count-input {
  width: 150px;
  min-height: 34px;
}

.batch-table-wrap {
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.batch-table {
  min-width: 860px;
}

.batch-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.route-batch .grid-2 {
  flex: 1 1 auto;
  min-height: min(640px, calc(100vh - 190px));
  align-items: stretch;
}

.route-batch .grid-2 > .panel,
.route-batch .grid-2 > aside {
  height: 100%;
  min-height: 0;
}

.route-batch .grid-2 > .panel {
  display: flex;
  flex-direction: column;
}

.route-batch .grid-2 > .panel > .panel-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.route-batch .batch-table-wrap {
  flex: 1 1 auto;
  max-height: none;
  min-height: 220px;
}

.route-batch .grid-2 > aside {
  display: flex;
  flex-direction: column;
}

.route-batch .grid-2 > aside .panel:last-child {
  flex: 1 1 auto;
}

.data-table tr.row-warning {
  background: var(--amber-soft);
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

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

.data-table th {
  color: #475467;
  background: var(--surface-soft);
  font-size: 12px;
  text-transform: uppercase;
}

.data-table tr.history {
  background: var(--green-soft);
}

.admin-table {
  min-width: 860px;
}

.admin-table td:last-child {
  min-width: 280px;
}

.cell-input {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
}

.cell-input:focus {
  background: #fff;
  border-color: var(--blue);
  outline: none;
}

.cell-input.invalid {
  border-color: #e0a238;
  background: #fffaf0;
}

.paste-box {
  display: grid;
  gap: 10px;
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.ok,
.tag.green {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.wait,
.tag.amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.tag.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr) minmax(260px, 320px);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.detail-three {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  align-items: stretch;
}

.detail-column {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

.detail-main-panel {
  min-width: 0;
}

.detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-bottom: 22px;
}

.page-detail .panel-title {
  flex: 0 0 auto;
  padding: 9px 12px;
  font-size: 15px;
}

.page-detail .panel-body {
  padding: 10px 12px 18px;
}

.page-detail .form-grid {
  gap: 10px;
}

.page-detail .status-pill {
  display: none;
}

.page-detail .detail-scroll {
  padding-bottom: 24px;
}

.page-detail .product-tabs {
  padding-right: 6px;
}

.product-tabs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.product-tab {
  display: grid;
  gap: 6px;
  align-content: start;
  flex: 0 0 96px;
  width: 100%;
  height: 96px;
  min-width: 0;
  padding: 12px;
  overflow: hidden;
  text-align: left;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-tab.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}

.product-tab strong {
  display: -webkit-box;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-tab-name {
  display: -webkit-box;
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-tab-count {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.product-tab .status-pill {
  justify-self: start;
}

.detail-bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(10px);
}

.detail-bottom-info {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.detail-bottom-sku {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-bottom-name {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-bottom-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.detail-bottom-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.detail-bottom-actions .btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.detail-bottom-actions .btn.success {
  min-width: 106px;
}

.rich-list {
  gap: 10px;
}

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

.rich-list-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rich-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin-top: 8px;
  max-width: 100%;
  min-width: 0;
}

.image-item {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.image-item a {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-placeholder,
.image-error {
  display: none;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 8px;
  color: var(--muted);
  background: #eef2f7;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  word-break: break-word;
}

.image-broken .image-placeholder,
.image-broken .image-error {
  display: grid;
}

.image-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: #fff;
  background: rgba(17, 24, 39, 0.72);
  border: 0;
  border-radius: 8px;
}

.file-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.file-input {
  max-width: 100%;
}

.empty {
  padding: 26px 14px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.45);
}

.modal {
  width: min(680px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.26);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  margin: 0;
  font-size: 17px;
}

.modal-body {
  padding: 16px;
}

.match-list {
  display: grid;
  gap: 9px;
  max-height: 360px;
  overflow: auto;
}

.match-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.match-row > div {
  min-width: 0;
}

.match-row strong,
.match-row .muted {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.history-thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  min-width: 0;
}

.history-thumb {
  display: block;
  width: 58px;
  height: 58px;
  min-width: 58px;
  overflow: hidden;
  color: inherit;
  background: #eef2f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.history-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--green-soft);
  border: 1px solid #b7e2ca;
  border-radius: 8px;
}

.error-box {
  padding: 12px;
  white-space: pre-wrap;
  color: #8d1f1f;
  background: var(--red-soft);
  border: 1px solid #f0bbbb;
  border-radius: 8px;
}

.loading-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 90;
  transform: translateX(-50%);
  padding: 10px 14px;
  color: #fff;
  background: #111827;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 40px));
  padding: 11px 13px;
  color: #fff;
  background: #111827;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.icp {
  margin-top: auto;
  padding-top: 22px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1080px) {
  .grid-2,
  .login-wrap,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-three {
    height: auto;
    min-height: 0;
  }

  .route-batch .grid-2 {
    min-height: auto;
  }

  .route-batch .grid-2 > .panel,
  .route-batch .grid-2 > aside {
    height: auto;
  }

  .page-detail {
    height: auto;
    min-height: calc(100vh - 58px);
    overflow: visible;
  }

  .detail-scroll {
    max-height: 58vh;
    overflow: auto;
  }

  .product-tabs {
    max-height: 42vh;
  }

  .detail-bottom-nav {
    bottom: 8px;
    align-items: stretch;
    flex-direction: column;
  }

  .detail-bottom-actions {
    justify-content: stretch;
  }

  .detail-bottom-actions .btn {
    flex: 1 1 140px;
  }

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

  .user-area {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
  }

  .brand,
  .user-area {
    width: 100%;
    justify-content: space-between;
  }

  .steps {
    width: 100%;
  }

  .flow-steps {
    justify-content: flex-start;
  }

  .flow-steps .step-btn {
    min-width: 145px;
  }

  .page {
    padding: 16px 12px 28px;
  }

  .page-detail {
    padding: 10px 12px 16px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-detail .page-header {
    align-items: stretch;
  }

  .template-grid,
  .form-grid,
  .grid-3,
  .home-actions {
    grid-template-columns: 1fr;
  }

  .route-templates .template-grid {
    grid-template-columns: 1fr;
  }

  .route-templates .template-tile {
    min-height: 104px;
    padding: 16px;
  }

  .detail-bottom-nav {
    padding: 10px;
  }

  .detail-bottom-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .detail-bottom-actions .btn.success {
    grid-column: 1 / -1;
  }

  .business-tile,
  .template-tile {
    min-height: 124px;
  }
}
