:root {
  --bg: #f3f5f2;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --ink: #17231f;
  --muted: #66736e;
  --line: #dfe7e3;
  --primary: #0c7a62;
  --primary-dark: #075c4a;
  --primary-soft: #e8f5f0;
  --warning: #b95d18;
  --warning-soft: #fff3e7;
  --danger: #b83f46;
  --danger-soft: #fff0f1;
  --shadow-sm: 0 2px 10px rgba(24, 45, 37, 0.06);
  --shadow-lg: 0 22px 60px rgba(20, 45, 36, 0.2);
  --radius: 18px;
  --radius-sm: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(12, 122, 98, 0.06), transparent 26rem),
    var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

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

button:focus,
input:focus,
select:focus {
  outline: 3px solid rgba(12, 122, 98, 0.2);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: calc(100% - 40px);
  max-width: 1260px;
  margin-right: auto;
  margin-left: auto;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  border-bottom: 1px solid rgba(207, 219, 214, 0.9);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 1px 8px rgba(25, 50, 40, 0.04);
}

.topbar-inner {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding-top: env(safe-area-inset-top);
}

.brand {
  display: flex;
  align-items: center;
}

.brand-mark {
  display: flex;
  width: 44px;
  height: 44px;
  margin-right: 12px;
  border-radius: 13px;
  background: linear-gradient(145deg, #0f9375, #075c4a);
  color: #fff;
  box-shadow: 0 7px 18px rgba(12, 122, 98, 0.22);
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.connection {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid #cae3da;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.connection-dot {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #19a37f;
  box-shadow: 0 0 0 4px rgba(25, 163, 127, 0.14);
}

.connection.is-error {
  border-color: #f1c9cc;
  background: var(--danger-soft);
  color: var(--danger);
}

.connection.is-error .connection-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(184, 63, 70, 0.13);
}

.main-content {
  padding-top: 26px;
  padding-bottom: 60px;
}

.network-card {
  position: relative;
  display: grid;
  overflow: hidden;
  align-items: center;
  padding: 24px 26px;
  border: 1px solid rgba(91, 164, 143, 0.33);
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.98), rgba(235, 248, 243, 0.98)),
    var(--surface);
  box-shadow: var(--shadow-sm);
  grid-template-columns: 56px minmax(0, 1fr) auto;
}

.network-card::after {
  position: absolute;
  top: -60px;
  right: 100px;
  width: 220px;
  height: 220px;
  border: 34px solid rgba(12, 122, 98, 0.035);
  border-radius: 50%;
  content: "";
}

.network-icon {
  display: grid;
  width: 48px;
  height: 48px;
  align-self: start;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  place-items: center;
}

.network-icon svg {
  width: 28px;
  height: 28px;
}

.network-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-right: 24px;
}

.eyebrow {
  margin-bottom: 3px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.network-copy h1,
.section-heading h2,
.modal-header h2 {
  margin: 0;
  line-height: 1.28;
}

.network-copy h1 {
  font-size: 20px;
}

.network-copy p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.address-row {
  display: flex;
  max-width: 690px;
  align-items: stretch;
}

.address-value {
  display: flex;
  min-width: 0;
  min-height: 48px;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  padding: 0 15px;
  border: 1px solid #b9d7cd;
  border-radius: 10px 0 0 10px;
  background: #fff;
  color: #064f40;
  cursor: pointer;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

.address-value span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-value svg {
  width: 19px;
  min-width: 19px;
  margin-left: 12px;
}

.address-row .button-light {
  border-radius: 0 10px 10px 0;
  border-left: 0;
}

.alternate-addresses {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.alternate-addresses a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-right: 12px;
  color: var(--primary-dark);
}

.qr-box {
  position: relative;
  z-index: 1;
  display: none;
  width: 114px;
  height: 114px;
  align-items: center;
  justify-content: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.qr-box.has-qr {
  display: flex;
}

.qr-box img,
.qr-box canvas {
  max-width: 100%;
  max-height: 100%;
}

.summary-grid {
  display: grid;
  margin-top: 18px;
  grid-gap: 14px;
  grid-template-columns: repeat(3, 1fr);
}

.summary-card {
  min-height: 116px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-card strong {
  margin-right: 6px;
  color: var(--primary-dark);
  font-size: 30px;
  line-height: 1;
}

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

.summary-alert strong {
  color: var(--warning);
}

.inventory-section,
.history-section {
  margin-top: 36px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 24px;
}

.compact-heading {
  align-items: center;
}

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

.button,
.icon-button,
.chip-button {
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid transparent;
}

.button:active,
.icon-button:active,
.chip-button:active {
  transform: translateY(1px);
}

.button[disabled],
.icon-button[disabled],
.chip-button[disabled] {
  cursor: wait;
  opacity: 0.58;
}

.button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 5px 15px rgba(12, 122, 98, 0.18);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-light {
  border-color: #b9d7cd;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.button-quiet {
  border-color: var(--line);
  background: #fff;
  color: #40504a;
}

.toolbar {
  display: flex;
  margin-bottom: 17px;
  align-items: center;
  justify-content: space-between;
}

.search-box {
  display: flex;
  width: 440px;
  max-width: calc(100% - 130px);
  min-height: 46px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: #7ebdab;
  box-shadow: 0 0 0 3px rgba(12, 122, 98, 0.11);
}

.search-box svg {
  width: 20px;
  min-width: 20px;
  margin-right: 9px;
  color: #7c8984;
}

.search-box input {
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.message {
  display: flex;
  min-height: 58px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid #efc1c5;
  border-radius: 12px;
  background: var(--danger-soft);
  color: #8f2830;
}

.message strong {
  margin-right: 8px;
}

.message span {
  flex: 1 1 auto;
}

.message button {
  min-height: 44px;
  margin-left: 12px;
  padding: 0 14px;
  border: 1px solid #dfa4a9;
  border-radius: 9px;
  background: #fff;
  color: #8f2830;
  cursor: pointer;
  font-weight: 700;
}

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

.model-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.model-top {
  display: grid;
  padding: 16px;
  border-bottom: 1px solid #ebf0ed;
  background: linear-gradient(120deg, #fff, #f9fbfa);
  grid-template-columns: 116px minmax(0, 1fr);
}

.product-image {
  position: relative;
  overflow: hidden;
  width: 116px;
  height: 116px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #eef2ef;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #88948f;
  font-size: 12px;
}

.image-placeholder span {
  margin-bottom: 5px;
  font-size: 27px;
}

.model-info {
  min-width: 0;
  padding-left: 15px;
}

.model-code-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.model-code {
  overflow: hidden;
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-pill {
  min-width: 54px;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.model-name {
  min-height: 21px;
  margin: 5px 0 10px;
  overflow: hidden;
  color: #52605b;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-meta {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.model-meta span {
  margin: 0 12px 4px 0;
}

.model-actions {
  display: flex;
}

.model-actions .button {
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
}

.model-actions .button + .button {
  margin-left: 8px;
}

.size-stock-grid {
  display: grid;
  padding: 14px 16px 16px;
  grid-gap: 7px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.size-stock {
  min-width: 0;
  padding: 8px 3px;
  border: 1px solid #e4ebe7;
  border-radius: 10px;
  background: #fbfcfb;
  text-align: center;
}

.size-stock.is-low {
  border-color: #f0cda8;
  background: var(--warning-soft);
}

.size-stock .size-label,
.size-stock .size-count {
  display: block;
}

.size-stock .size-label {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}

.size-stock .size-count {
  overflow: hidden;
  color: #2e413a;
  font-size: 17px;
  font-weight: 800;
  text-overflow: ellipsis;
}

.size-stock.is-low .size-count {
  color: var(--warning);
}

.skeleton-card {
  height: 243px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(100deg, #edf1ef 20%, #f8faf9 40%, #edf1ef 60%);
  background-size: 220% 100%;
  animation: skeleton 1.4s linear infinite;
}

@keyframes skeleton {
  from { background-position: 100% 0; }
  to { background-position: -120% 0; }
}

.empty-state {
  padding: 54px 20px;
  border: 1px dashed #cbd8d2;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.empty-illustration {
  font-size: 44px;
}

.empty-state h3 {
  margin: 10px 0 4px;
  font-size: 20px;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
}

.history-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.history-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th,
.history-table td {
  padding: 13px 15px;
  border-bottom: 1px solid #ebf0ed;
  text-align: left;
  vertical-align: middle;
}

.history-table th {
  background: #f7f9f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

.movement-value {
  font-weight: 800;
}

.movement-value.is-positive {
  color: var(--primary);
}

.movement-value.is-negative {
  color: var(--danger);
}

.table-empty {
  height: 90px;
  color: var(--muted);
  text-align: center !important;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 29, 24, 0.62);
  -webkit-overflow-scrolling: touch;
}

.modal-panel {
  display: flex;
  width: 100%;
  max-width: 650px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.modal-wide {
  width: 100%;
  max-width: 820px;
}

.modal-header {
  display: flex;
  min-height: 83px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 17px 21px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  font-size: 21px;
}

.icon-button {
  display: inline-flex;
  width: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: #5a6762;
  font-size: 26px;
  line-height: 1;
}

.modal-body {
  overflow-y: auto;
  padding: 21px;
  -webkit-overflow-scrolling: touch;
}

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

.field {
  display: block;
  min-width: 0;
}

.field > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: #34433e;
  font-size: 13px;
  font-weight: 750;
}

.field em {
  color: var(--danger);
  font-style: normal;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #ccd7d2;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
}

.field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

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

.image-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-picker {
  display: flex !important;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  padding: 0 12px;
  border: 1px dashed #8ebbad;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark) !important;
  cursor: pointer;
}

.create-preview {
  position: relative;
  width: 150px;
  margin-top: 17px;
}

.create-preview img {
  display: block;
  width: 150px;
  height: 120px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: cover;
}

.create-preview button {
  min-height: 44px;
  margin-top: 5px;
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 19px;
}

.modal-footer .button + .button {
  margin-left: 10px;
}

.sticky-footer {
  position: sticky;
  z-index: 2;
  bottom: -21px;
  margin: 21px -21px -21px;
  padding: 14px 21px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.adjust-heading {
  display: flex;
  min-width: 0;
  align-items: center;
}

.mini-product-image {
  width: 52px;
  height: 52px;
  min-width: 52px;
  margin-right: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef2ef;
}

.mini-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.adjust-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.batch-actions {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  overflow-x: auto;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.batch-actions > span {
  margin-right: 4px;
}

.chip-button {
  min-width: 84px;
  margin-left: 7px;
  padding: 0 11px;
  border: 1px solid #c6d8d1;
  background: #f5faf8;
  color: var(--primary-dark);
}

.size-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.size-editor-head,
.size-editor-row {
  display: grid;
  align-items: center;
  grid-template-columns: 0.8fr 0.8fr 2.7fr 0.9fr;
}

.size-editor-head {
  min-height: 38px;
  padding: 0 13px;
  background: #f4f7f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.size-editor-row {
  min-height: 59px;
  padding: 6px 13px;
  border-top: 1px solid #edf1ef;
}

.size-name {
  font-weight: 800;
}

.size-current,
.size-after {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.size-after {
  color: var(--primary-dark);
  font-weight: 800;
}

.size-after.is-invalid {
  color: var(--danger);
}

.stepper {
  display: grid;
  width: 100%;
  max-width: 225px;
  width: min(100%, 225px);
  align-items: center;
  grid-template-columns: 46px minmax(52px, 1fr) 46px;
}

.stepper button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #cad7d2;
  background: #fff;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 21px;
  font-weight: 700;
}

.stepper button:first-child {
  border-radius: 9px 0 0 9px;
}

.stepper button:last-child {
  border-radius: 0 9px 9px 0;
}

.stepper input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 4px;
  border: solid #cad7d2;
  border-width: 1px 0;
  border-radius: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.adjust-summary {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 13px;
}

.adjust-summary strong {
  margin: 0 5px 0 9px;
  color: var(--primary);
  font-size: 21px;
}

.adjust-summary strong.is-negative {
  color: var(--danger);
}

.form-error {
  margin-top: 15px;
  padding: 11px 13px;
  border: 1px solid #efc1c5;
  border-radius: 10px;
  background: var(--danger-soft);
  color: #8f2830;
  font-size: 13px;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  pointer-events: none;
}

.toast {
  max-width: 350px;
  margin-top: 8px;
  padding: 13px 16px;
  border-radius: 11px;
  background: #18392f;
  color: #fff;
  box-shadow: 0 10px 28px rgba(10, 33, 25, 0.25);
  font-size: 13px;
  animation: toast-in 0.2s ease-out;
}

.toast.is-error {
  background: #842c33;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.is-hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 900px) {
  .network-card {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .qr-box {
    display: none !important;
  }

  .inventory-grid,
  .loading-grid {
    grid-template-columns: 1fr;
  }

  .network-copy {
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .shell {
    width: calc(100% - 24px);
  }

  .topbar-inner {
    min-height: 64px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
    margin-right: 9px;
    border-radius: 11px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand small {
    display: none;
  }

  .connection {
    min-height: 40px;
    padding: 0 10px;
    font-size: 12px;
  }

  .main-content {
    padding-top: 14px;
    padding-bottom: 36px;
  }

  .network-card {
    padding: 17px;
    grid-template-columns: 1fr;
  }

  .network-icon {
    display: none;
  }

  .network-copy h1 {
    font-size: 17px;
  }

  .network-copy p {
    font-size: 12px;
  }

  .address-row {
    display: block;
  }

  .address-value {
    width: 100%;
    border-radius: 10px;
    font-size: 13px;
  }

  .address-row .button-light {
    width: 100%;
    margin-top: 8px;
    border: 1px solid #b9d7cd;
    border-radius: 10px;
  }

  .summary-grid {
    grid-gap: 8px;
  }

  .summary-card {
    min-height: 94px;
    padding: 14px 10px;
    text-align: center;
  }

  .summary-label {
    font-size: 11px;
  }

  .summary-card strong {
    display: block;
    margin: 0 0 4px;
    font-size: 23px;
  }

  .summary-unit {
    font-size: 10px;
  }

  .inventory-section,
  .history-section {
    margin-top: 26px;
  }

  .section-heading {
    align-items: center;
  }

  .section-heading h2 {
    font-size: 21px;
  }

  .section-heading .button {
    padding: 0 12px;
  }

  .toolbar {
    align-items: stretch;
  }

  .search-box {
    width: calc(100% - 96px);
  }

  .toolbar .button {
    width: 88px;
    padding: 0 8px;
  }

  .message {
    display: block;
    padding: 12px;
  }

  .message strong,
  .message span {
    display: block;
  }

  .message button {
    width: 100%;
    margin: 9px 0 0;
  }

  .model-top {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .product-image {
    width: 92px;
    height: 108px;
  }

  .model-info {
    padding-left: 12px;
  }

  .model-code {
    font-size: 18px;
  }

  .model-name {
    margin-bottom: 5px;
  }

  .model-meta {
    margin-bottom: 4px;
  }

  .model-actions .button {
    min-height: 44px;
    padding: 0 9px;
    font-size: 12px;
  }

  .size-stock-grid {
    padding: 11px;
    grid-gap: 5px;
  }

  .size-stock {
    padding: 7px 1px;
    border-radius: 8px;
  }

  .size-stock .size-label {
    font-size: 9px;
  }

  .size-stock .size-count {
    font-size: 14px;
  }

  .history-note {
    display: none;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-panel,
  .modal-wide {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 18px 18px 0 0;
  }

  .modal-header {
    min-height: 72px;
    padding: 12px 14px;
  }

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

  .modal-body {
    padding: 14px;
  }

  .form-grid,
  .adjust-details {
    grid-gap: 13px;
    grid-template-columns: 1fr;
  }

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

  .sticky-footer {
    bottom: -14px;
    margin: 18px -14px -14px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  }

  .sticky-footer .button {
    flex: 1 1 50%;
  }

  .size-editor-head,
  .size-editor-row {
    grid-template-columns: 46px 48px minmax(148px, 1fr) 47px;
  }

  .size-editor {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .size-editor-head,
  .size-editor-row {
    min-width: 390px;
  }

  .size-editor-head,
  .size-editor-row {
    padding-right: 8px;
    padding-left: 8px;
  }

  .adjust-body {
    padding-top: 10px;
  }

  .batch-actions {
    margin-right: -14px;
    padding-right: 14px;
  }

  .adjust-summary {
    margin-bottom: 8px;
  }

  .toast-region {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
  }

  .toast {
    max-width: none;
  }
}

@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;
  }
}
