:root {
  color-scheme: dark;
  --marathon-blue: #14469c;
  --marathon-yellow: #e8e03d;
  --blueprint-bg: #061b38;
  --blueprint-grid: rgb(112 197 255 / 0.14);
  --blueprint-grid-strong: rgb(161 218 255 / 0.24);
  --blueprint-line: rgb(196 232 255 / 0.12);
  --panel-black: #041124;
  --panel-glass: rgb(4 17 36 / 0.86);
  --line-subtle: rgb(164 218 255 / 0.18);
  --line-blue: rgb(104 192 255 / 0.42);
  --line-yellow: rgb(232 224 61 / 0.58);
  --text-white: #ffffff;
  --text-black: #000000;
  --text-muted: #c8c8c8;
  --danger: #ff5a48;
  --font-tech: "OCR-A", "Courier New", monospace;
  --font-mono: "Terminus", "Courier New", monospace;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  background: var(--blueprint-bg);
  color: var(--text-white);
  font-synthesis: none;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@font-face {
  font-family: "OCR-A";
  src: url("assets/FONT_OCRA.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Terminus";
  src: url("assets/FONT_Terminus.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(90deg, var(--blueprint-grid) 1px, transparent 1px),
    linear-gradient(0deg, var(--blueprint-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--blueprint-grid-strong) 1px, transparent 1px),
    linear-gradient(0deg, var(--blueprint-grid-strong) 1px, transparent 1px),
    radial-gradient(circle at 72% 12%, rgb(50 142 255 / 0.18), transparent 34%),
    linear-gradient(135deg, rgb(255 255 255 / 0.045) 0 1px, transparent 1px 120px),
    var(--blueprint-bg);
  background-size:
    24px 24px,
    24px 24px,
    120px 120px,
    120px 120px,
    auto,
    120px 120px,
    auto;
  color: var(--text-white);
}

body::before {
  content: "";
  position: fixed;
  inset: 80px 0 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(1 9 24 / 0.1) 0%, transparent 24%, rgb(1 9 24 / 0.28) 100%),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 5px,
      rgb(255 255 255 / 0.026) 6px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 119px,
      rgb(255 255 255 / 0.035) 120px
    );
}

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

button {
  min-height: 40px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 0;
  background: rgb(0 0 0 / 0.84);
  color: var(--text-white);
  cursor: pointer;
  font-family: var(--font-tech);
  font-size: 12px;
  letter-spacing: 0.04em;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

button:hover {
  border-color: var(--marathon-yellow);
  background: var(--marathon-blue);
  color: var(--text-white);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary-button {
  border-color: rgb(0 0 0 / 0.88);
  background: var(--marathon-yellow);
  color: var(--text-black);
  font-weight: 400;
}

.primary-button:hover {
  border-color: var(--marathon-yellow);
  background: var(--marathon-blue);
  color: var(--text-white);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 104px 24px 24px;
}

.catalog-panel,
.side-panel {
  min-width: 0;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  min-height: 80px;
  border: 0;
  border-bottom: 1px solid rgb(0 0 0 / 0.7);
  background: var(--marathon-yellow);
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.48);
}

.brand-panel {
  display: flex;
  width: min(24vw, 220px);
  min-width: 154px;
  min-height: 80px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: var(--marathon-blue);
}

.brand-panel img {
  display: block;
  width: min(180px, 100%);
  height: auto;
  max-height: 54px;
  object-fit: contain;
}

.model-meta {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  padding: 10px 26px 8px;
  color: var(--text-black);
}

.eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--marathon-blue);
  font-family: var(--font-tech);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: min(42vw, 640px);
  overflow: hidden;
  color: var(--text-black);
  font-family: var(--font-tech);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.07em;
  line-height: 1.1;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-meta p {
  margin-top: 4px;
  overflow: hidden;
  color: rgb(0 0 0 / 0.74);
  font-family: var(--font-mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  color: var(--text-white);
  font-family: var(--font-tech);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  min-height: 80px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
}

.language-toggle-button {
  min-height: 34px;
  border-color: rgb(0 0 0 / 0.5);
  background: rgb(0 0 0 / 0.08);
  color: var(--text-black);
  padding: 0 12px;
}

.language-toggle-button:hover {
  border-color: rgb(0 0 0 / 0.78);
  background: var(--marathon-blue);
  color: var(--text-white);
}

.silicore-advance-button {
  display: inline-flex;
  width: 184px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  padding: 0;
  background: transparent;
  color: var(--text-black);
  cursor: pointer;
}

.silicore-advance-button:hover,
.silicore-advance-button[aria-pressed="true"] {
  border-color: rgb(0 0 0 / 0.78);
  background: rgb(0 0 0 / 0.08);
}

.silicore-logo-mark {
  display: block;
  width: 150px;
  height: 43px;
  background: #000000;
  mask: url("assets/TEX_Silicore_Logo.svg") center / contain no-repeat;
  -webkit-mask: url("assets/TEX_Silicore_Logo.svg") center / contain no-repeat;
}

.catalog-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.controls,
.detail-panel,
.cart-panel,
.admin-panel {
  border: 1px solid var(--line-subtle);
  border-radius: 0;
  background: var(--panel-glass);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.035),
    0 18px 50px rgb(0 0 0 / 0.38);
  backdrop-filter: blur(12px);
}

.controls {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(180px, 1.2fr) minmax(112px, 0.8fr) 112px auto;
  gap: 12px;
  align-items: end;
  border-color: var(--line-blue);
  padding: 14px 16px 16px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span {
  display: block;
  color: var(--marathon-yellow);
  font-family: var(--font-tech);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 0;
  background: rgb(0 0 0 / 0.78);
  color: var(--text-white);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--marathon-yellow);
  box-shadow: 0 0 0 1px rgb(232 224 61 / 0.4);
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgb(255 255 255 / 0.48);
}

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

.color-field input {
  padding: 4px;
}

.button-row,
.export-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.button-row button,
.export-tools button {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 12px;
}

.status-bar {
  min-height: 28px;
  color: var(--marathon-yellow);
  font-family: var(--font-mono);
  font-size: 14px;
}

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

.fabric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
  align-items: start;
  padding-bottom: 20px;
}

.fabric-card {
  --fabric-color: #d0d0d0;
  --label-text: #111111;
  position: relative;
  display: grid;
  grid-template-rows: 1fr 24px;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1.22;
  overflow: hidden;
  border: 3px solid var(--fabric-color);
  border-radius: 0;
  padding: 0;
  background: #eee9dd;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.9),
    0 10px 24px rgb(0 0 0 / 0.35);
}

.fabric-card:hover {
  border-color: var(--marathon-yellow);
  transform: translateY(-1px);
}

.fabric-card.rnd-card:hover {
  border-color: transparent;
}

.fabric-card.rnd-card {
  border-color: transparent;
  background:
    linear-gradient(
      to bottom right,
      rgb(34 201 255 / 0.96) 0%,
      rgb(65 112 255 / 0.98) 30%,
      rgb(128 78 255 / 0.96) 54%,
      rgb(244 76 236 / 0.9) 78%,
      rgb(255 255 255 / 0.78) 100%
    );
  background-origin: border-box;
  background-clip: border-box;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.9),
    0 0 18px rgb(55 188 255 / 0.34),
    0 0 34px rgb(145 75 255 / 0.3),
    0 0 44px rgb(255 72 235 / 0.13),
    0 14px 30px rgb(0 0 0 / 0.42);
}

.fabric-card.rnd-card::before,
.fabric-card.rnd-card::after {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
}

.fabric-card.rnd-card::before {
  background:
    linear-gradient(
      118deg,
      transparent 0%,
      transparent 14%,
      rgb(255 255 255 / 0.2) 23%,
      rgb(36 205 255 / 0.5) 29%,
      rgb(117 76 255 / 0.48) 35%,
      rgb(255 69 232 / 0.36) 41%,
      rgb(255 255 255 / 0.22) 48%,
      transparent 60%,
      transparent 100%
    );
  opacity: 0.9;
  mask: radial-gradient(ellipse 64% 54% at 50% 42%, transparent 0 23%, rgb(0 0 0 / 0.2) 41%, #000 82%);
  -webkit-mask: radial-gradient(ellipse 64% 54% at 50% 42%, transparent 0 23%, rgb(0 0 0 / 0.2) 41%, #000 82%);
  transform: translateX(-120%) skewX(-16deg);
  animation: rare-card-sweep 4.2s ease-in-out infinite;
}

.fabric-card.rnd-card::after {
  background:
    linear-gradient(
      to bottom right,
      rgb(42 215 255 / 0.34) 0%,
      rgb(74 126 255 / 0.36) 30%,
      rgb(132 92 255 / 0.34) 54%,
      rgb(255 78 232 / 0.28) 78%,
      rgb(255 255 255 / 0.22) 100%
    ),
    radial-gradient(circle at 18% 22%, rgb(255 255 255 / 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 18%, rgb(64 219 255 / 0.95) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 66%, rgb(255 91 232 / 0.86) 0 1px, transparent 2px),
    radial-gradient(circle at 12% 72%, rgb(137 107 255 / 0.82) 0 1px, transparent 2px),
    linear-gradient(115deg, transparent 0 30%, rgb(73 212 255 / 0.3) 38%, rgb(255 92 232 / 0.24) 45%, rgb(255 255 255 / 0.22) 50%, transparent 60% 100%),
    linear-gradient(45deg, rgb(32 199 255 / 0.18), rgb(102 74 255 / 0.18), rgb(255 67 232 / 0.14), rgb(72 231 255 / 0.12));
  background-size:
    100% 100%,
    auto,
    auto,
    auto,
    auto,
    220% 100%,
    100% 100%;
  background-position:
    0 0,
    0 0,
    0 0,
    0 0,
    0 0,
    -120% 0,
    0 0;
  opacity: 0.78;
  mask: radial-gradient(ellipse 72% 58% at 50% 42%, rgb(0 0 0 / 0.06) 0 24%, rgb(0 0 0 / 0.34) 44%, #000 84%);
  -webkit-mask: radial-gradient(ellipse 72% 58% at 50% 42%, rgb(0 0 0 / 0.06) 0 24%, rgb(0 0 0 / 0.34) 44%, #000 84%);
  animation: rare-card-pulse 2.8s ease-in-out infinite;
}

.fabric-card:focus-visible,
.fabric-card.selected {
  outline: 2px solid var(--marathon-yellow);
  outline-offset: 2px;
}

.image-frame {
  display: block;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #f7f4ee;
}

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

.fabric-card.rnd-card .image-frame::before,
.fabric-card.rnd-card .image-frame::after {
  content: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.fabric-card.rnd-card .image-frame::before {
  background:
    linear-gradient(
      118deg,
      transparent 0%,
      transparent 16%,
      rgb(255 255 255 / 0.2) 24%,
      rgb(36 205 255 / 0.48) 29%,
      rgb(117 76 255 / 0.44) 34%,
      rgb(255 69 232 / 0.34) 39%,
      rgb(255 255 255 / 0.2) 45%,
      transparent 56%,
      transparent 100%
    );
  mix-blend-mode: screen;
  opacity: 0.88;
  mask: radial-gradient(circle at 50% 50%, transparent 0 24%, rgb(0 0 0 / 0.22) 40%, #000 80%);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 24%, rgb(0 0 0 / 0.22) 40%, #000 80%);
  transform: translateX(-120%) skewX(-16deg);
  animation: rare-card-sweep 4.2s ease-in-out infinite;
}

.fabric-card.rnd-card .image-frame::after {
  background:
    radial-gradient(circle at 18% 22%, rgb(255 255 255 / 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 18%, rgb(64 219 255 / 0.95) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 66%, rgb(255 91 232 / 0.86) 0 1px, transparent 2px),
    radial-gradient(circle at 12% 72%, rgb(137 107 255 / 0.82) 0 1px, transparent 2px),
    linear-gradient(135deg, rgb(255 255 255 / 0.06) 0 1px, transparent 1px 9px),
    linear-gradient(45deg, rgb(32 199 255 / 0.18), rgb(102 74 255 / 0.18), rgb(255 67 232 / 0.14), rgb(72 231 255 / 0.12));
  background-size:
    auto,
    auto,
    auto,
    auto,
    9px 9px,
    100% 100%;
  mix-blend-mode: screen;
  opacity: 0.82;
  mask: radial-gradient(circle at 50% 50%, rgb(0 0 0 / 0.08) 0 25%, rgb(0 0 0 / 0.28) 43%, #000 82%);
  -webkit-mask: radial-gradient(circle at 50% 50%, rgb(0 0 0 / 0.08) 0 25%, rgb(0 0 0 / 0.28) 43%, #000 82%);
}

.fabric-card.rnd-card .id-strip {
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.32),
    inset 0 0 12px rgb(102 230 255 / 0.18);
}

.id-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  padding: 0 5px 0 28px;
  background: var(--fabric-color);
  color: var(--label-text);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delta-badge {
  position: absolute;
  right: 4px;
  bottom: 27px;
  z-index: 3;
  max-width: 50%;
  padding: 2px 5px;
  background: rgb(0 0 0 / 0.82);
  color: var(--marathon-yellow);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.1;
}

.status-badge {
  position: absolute;
  left: 4px;
  bottom: 2px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 54px;
  height: 20px;
  padding: 1px 3px;
  border: 0;
  background: rgb(24 24 28 / 0.76);
  color: var(--text-white);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.rnd-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background: currentColor;
  mask: var(--rnd-icon-url) center / contain no-repeat;
  -webkit-mask: var(--rnd-icon-url) center / contain no-repeat;
}

.nrnd-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background: currentColor;
  mask: var(--nrnd-icon-url) center / contain no-repeat;
  -webkit-mask: var(--nrnd-icon-url) center / contain no-repeat;
}

.status-badge.rnd {
  background: transparent;
  padding-left: 0;
  color: var(--label-text);
  text-shadow: 0 1px 1px rgb(255 255 255 / 0.45);
}

.status-badge.nrnd {
  background: transparent;
  padding-left: 0;
  color: var(--label-text);
  text-shadow: 0 1px 1px rgb(255 255 255 / 0.45);
}

@keyframes rare-card-sweep {
  0%,
  42% {
    transform: translateX(-125%) skewX(-16deg);
  }

  64%,
  100% {
    transform: translateX(125%) skewX(-16deg);
  }
}

@keyframes rare-card-pulse {
  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fabric-card.rnd-card,
  .fabric-card.rnd-card::before,
  .fabric-card.rnd-card::after,
  .fabric-card.rnd-card .image-frame::before {
    animation: none;
  }

  .fabric-card.rnd-card .image-frame::before {
    transform: translateX(0) skewX(-16deg);
    opacity: 0.24;
  }
}

.hidden {
  display: none !important;
}

.side-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 128px);
  overflow: auto;
  scrollbar-color: var(--marathon-yellow) rgb(0 0 0 / 0.42);
}

.detail-panel,
.cart-panel,
.admin-panel {
  padding: 0 0 16px;
}

.panel-heading,
.detail-panel::before {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 16px;
  background: var(--marathon-blue);
  color: var(--text-white);
}

.detail-panel::before {
  content: var(--detail-heading, "FABRIC_DETAIL");
  font-family: var(--font-tech);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.detail-collapse-button {
  display: none;
}

.panel-heading h2 {
  color: inherit;
  font-size: 12px;
}

.panel-heading span {
  color: var(--marathon-yellow);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
}

.empty-state {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 16px;
  border: 1px dashed rgb(255 255 255 / 0.28);
  background: rgb(0 0 0 / 0.34);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 14px;
  text-align: center;
  padding: 14px;
}

.detail-content {
  display: grid;
  gap: 14px;
  padding: 0 16px;
}

.detail-content img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgb(255 255 255 / 0.18);
  background: #ffffff;
  object-fit: cover;
}

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

.detail-title span {
  flex: 0 0 auto;
  color: var(--marathon-yellow);
  font-family: var(--font-mono);
  font-weight: 700;
}

dl {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
}

dl div {
  display: grid;
  grid-template-columns: minmax(126px, max-content) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

dt {
  min-width: 0;
  color: var(--marathon-yellow);
  font-family: var(--font-tech);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

dd {
  margin: 0;
  min-width: 0;
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 14px;
  overflow-wrap: anywhere;
}

#detailFlags {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-status-icon {
  width: 18px;
  height: 18px;
}

.wide-button {
  width: 100%;
}

.cart-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0 16px;
}

.cart-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgb(255 255 255 / 0.16);
  background: rgb(0 0 0 / 0.56);
  padding: 7px;
}

.cart-item.dragging {
  opacity: 0.48;
}

.cart-item img {
  width: 56px;
  height: 56px;
  border: 2px solid var(--fabric-color, #ccc);
  background: #f8f4ed;
  object-fit: cover;
}

.cart-item-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.cart-item-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.cart-item-title strong,
.cart-item-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-title strong {
  flex: 0 0 auto;
  color: var(--marathon-yellow);
  font-family: var(--font-mono);
}

.cart-item-title span {
  flex: 1 1 auto;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.cart-item input {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgb(255 255 255 / 0.18);
  background: rgb(0 0 0 / 0.72);
  color: var(--text-white);
  padding: 4px 6px;
  font-family: var(--font-mono);
}

.cart-actions {
  display: grid;
  gap: 3px;
}

.cart-actions button {
  width: 26px;
  min-height: 24px;
  padding: 0;
  font-size: 12px;
}

.remove-item {
  border-color: rgb(255 90 72 / 0.7);
  color: var(--danger);
}

.remove-item:hover {
  background: var(--danger);
  color: var(--text-black);
}

.export-tools,
.import-field,
.export-output {
  margin: 10px 16px 0;
}

.export-output {
  display: none;
  width: calc(100% - 32px);
  border: 1px solid rgb(255 255 255 / 0.18);
  background: rgb(0 0 0 / 0.78);
  color: var(--text-white);
  padding: 8px;
  resize: vertical;
  font-family: var(--font-mono);
}

.export-output.has-output {
  display: block;
}

.admin-panel {
  border-color: var(--line-yellow);
}

.admin-panel .panel-heading {
  background: var(--marathon-yellow);
  color: var(--text-black);
}

.admin-panel .panel-heading span {
  color: var(--marathon-blue);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    max-height: none;
  }

}

@media (max-width: 780px) {
  .topbar {
    min-height: 78px;
  }

  .brand-panel {
    width: 88px;
    min-width: 88px;
    min-height: 78px;
    padding: 0 6px;
  }

  .brand-panel img {
    width: 78px;
    max-height: 40px;
  }

  .model-meta {
    padding: 8px 8px;
  }

  .eyebrow {
    font-size: 9px;
    letter-spacing: 0.05em;
  }

  h1 {
    max-width: 100%;
    font-size: 15px;
    letter-spacing: 0.03em;
  }

  .model-meta p {
    max-width: 100%;
    font-size: 11px;
  }

  .topbar-actions {
    min-height: 78px;
    gap: 6px;
    padding: 0 6px 0 0;
  }

  .language-toggle-button {
    min-height: 30px;
    padding: 0 7px;
    font-size: 10px;
  }

  .silicore-advance-button {
    width: 58px;
    min-height: 48px;
  }

  .silicore-logo-mark {
    width: 46px;
    height: 20px;
  }

  .app-shell {
    gap: 16px;
    padding: 94px 14px 170px;
  }

  .catalog-panel {
    display: contents;
  }

  .controls {
    order: 1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .search-field,
  .color-field,
  .controls > .button-row {
    grid-column: 1 / -1;
  }

  .field {
    gap: 4px;
  }

  .field > span {
    font-size: 10px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .field textarea {
    min-height: 66px;
  }

  .color-field input {
    height: 34px;
  }

  .controls > .button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  button {
    min-height: 34px;
    font-size: 11px;
  }

  .button-row,
  .export-tools {
    flex-wrap: wrap;
  }

  .side-panel {
    order: 2;
    gap: 10px;
  }

  .detail-panel {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: 0;
    left: max(10px, env(safe-area-inset-left));
    z-index: 30;
    max-height: min(48vh, 360px);
    overflow: auto;
    border-color: var(--line-blue);
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    box-shadow:
      inset 0 0 0 1px rgb(255 255 255 / 0.035),
      0 -10px 36px rgb(0 0 0 / 0.58);
    scrollbar-color: var(--marathon-yellow) rgb(0 0 0 / 0.42);
  }

  .detail-panel::before {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-right: 82px;
  }

  .detail-collapse-button {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 3;
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-color: rgb(255 255 255 / 0.28);
    background: rgb(0 0 0 / 0.42);
    color: var(--marathon-yellow);
    font-size: 11px;
  }

  .detail-panel.mobile-collapsed {
    max-height: calc(40px + env(safe-area-inset-bottom));
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .detail-panel.mobile-collapsed::before {
    margin-bottom: 0;
  }

  .detail-panel.mobile-collapsed .empty-state,
  .detail-panel.mobile-collapsed .detail-content {
    display: none !important;
  }

  .detail-panel,
  .cart-panel,
  .admin-panel {
    scroll-margin-top: 88px;
  }

  .status-bar {
    order: 3;
    min-height: 22px;
    font-size: 12px;
  }

  .fabric-grid {
    order: 4;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
  }

  .cart-panel,
  .admin-panel {
    padding-bottom: 10px;
  }

  .panel-heading,
  .detail-panel::before {
    min-height: 34px;
    margin-bottom: 10px;
    padding: 8px 10px;
  }

  .empty-state {
    min-height: 44px;
    margin: 0 10px;
    padding: 10px;
    font-size: 12px;
  }

  .detail-content {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px;
    padding: 0 10px;
  }

  .detail-content img {
    width: 104px;
    height: 104px;
  }

  .detail-title {
    align-items: flex-start;
  }

  .detail-title h2 {
    font-size: 14px;
  }

  dl {
    gap: 6px;
    margin: 8px 0 10px;
  }

  dl div {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
  }

  dt,
  dd {
    font-size: 12px;
  }

  .wide-button {
    min-height: 34px;
  }

  .cart-list {
    padding: 0 10px;
  }

  .cart-item {
    grid-template-columns: 46px minmax(0, 1fr) 28px;
    gap: 8px;
    padding: 6px;
  }

  .cart-item img {
    width: 46px;
    height: 46px;
  }

  .cart-item input {
    min-height: 28px;
    font-size: 12px;
  }

  .cart-actions button {
    width: 24px;
    min-height: 22px;
  }

  .cart-panel > .export-tools,
  .cart-panel > .button-row,
  .admin-panel .export-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 10px;
  }

  .import-field {
    margin: 10px 10px 0;
  }

  .export-output {
    margin: 10px 10px 0;
    width: calc(100% - 20px);
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .topbar,
  .brand-panel,
  .topbar-actions {
    min-height: 64px;
  }

  .brand-panel {
    min-width: 110px;
    width: 110px;
  }

  .brand-panel img {
    width: 88px;
    max-height: 50px;
  }

  h1 {
    font-size: 16px;
  }

  .app-shell {
    padding-top: 82px;
  }
}
