:root {
  --bg0: #07111e;
  --bg1: #0d1b2a;
  --ink: #edf4ff;
  --muted: #b3c4de;
  --accent: #6ee7ff;
  --accent-2: #a7f3d0;
  --line: rgba(181, 212, 255, 0.28);
  --glass: rgba(18, 30, 46, 0.48);
  --glass-strong: rgba(14, 24, 38, 0.62);
  --good: #54df8a;
  --warn: #ffd166;
  --danger: #ff4d5a;
  --info: #67d4ff;
  --bad: #ff7d8a;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(900px 600px at 12% -12%, rgba(57, 168, 255, 0.24) 0%, transparent 48%),
    radial-gradient(1000px 680px at 108% 102%, rgba(45, 212, 191, 0.2) 0%, transparent 50%),
    linear-gradient(160deg, var(--bg0), var(--bg1));
  min-height: 100vh;
  overflow-x: hidden;
}

body.bench-page-open {
  overflow: hidden;
}

body.overlay-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.boot-loading {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 11, 19, 0.86);
  backdrop-filter: blur(6px);
}

.boot-loading-card {
  width: min(420px, 92vw);
  border: 1px solid rgba(161, 207, 248, 0.34);
  border-radius: 16px;
  background: rgba(9, 19, 32, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
  padding: 14px 14px 12px;
  text-align: center;
}

.boot-loading-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 8px;
  border-radius: 999px;
  border: 3px solid rgba(129, 188, 235, 0.3);
  border-top-color: rgba(116, 232, 255, 0.95);
  animation: bootspin .9s linear infinite;
}

.boot-loading-title {
  font-size: 1rem;
  font-weight: 800;
  color: #def4ff;
}

.boot-loading-text {
  margin-top: 4px;
  font-size: 0.88rem;
  color: #bdd3ea;
  line-height: 1.55;
}

.boot-loading-progress {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #8fd9ff;
  font-family: "JetBrains Mono", monospace;
}

.boot-loading-track {
  margin-top: 8px;
  height: 7px;
  border-radius: 999px;
  background: rgba(120, 156, 188, 0.35);
  overflow: hidden;
}

.boot-loading-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(110, 231, 255, 0.95), rgba(124, 255, 210, 0.95));
  transition: width .22s ease;
}

.boot-reload {
  margin-top: 10px;
  min-height: 36px;
  height: 36px;
  padding: 6px 12px;
}

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

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(circle at 50% 35%, black 35%, transparent 88%);
}

.app {
  position: relative;
  z-index: 1;
  width: min(1220px, 95vw);
  margin: 22px auto 40px;
}

.top {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(14px) saturate(130%);
  box-shadow: var(--shadow);
}

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

h1, h2, h3 { margin: 0; }
h1 {
  font-size: clamp(1.8rem, 3.2vw, 2.9rem);
  letter-spacing: 0.02em;
  font-weight: 800;
}

.achieve-entry {
  min-height: 32px;
  height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #d6f6ff;
  border-color: rgba(133, 225, 255, 0.54);
  background: linear-gradient(145deg, rgba(13, 43, 64, 0.86), rgba(11, 28, 45, 0.86));
  white-space: nowrap;
}

.achieve-entry span {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 18px;
  text-align: center;
  color: #062531;
  background: linear-gradient(120deg, #7de7ff, #a7f3d0);
}

.achieve-panel {
  position: fixed;
  inset: 0;
  z-index: 78;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(4, 10, 18, 0.7);
  backdrop-filter: blur(5px);
}

.achieve-panel-card {
  width: min(620px, 96vw);
  max-height: 88vh;
  overflow: auto;
  border: 1px solid rgba(170, 210, 246, 0.34);
  border-radius: 14px;
  background: rgba(9, 19, 32, 0.96);
  padding: 10px;
}

.achieve-panel-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  background: rgba(9, 19, 32, 0.97);
}

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

.achieve-progress {
  margin: 0 0 8px;
  border: 1px solid rgba(156, 202, 242, 0.24);
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(10, 22, 36, 0.56);
}

.achieve-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: #bcd3ea;
}

.achieve-progress-top strong {
  font-family: "JetBrains Mono", monospace;
  color: #d8fff2;
  letter-spacing: 0.01em;
}

.achieve-progress-track {
  margin-top: 6px;
  height: 8px;
  border-radius: 999px;
  background: rgba(101, 139, 176, 0.32);
  overflow: hidden;
}

.achieve-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(110, 231, 255, 0.9), rgba(124, 255, 210, 0.95));
  box-shadow: 0 0 10px rgba(106, 247, 217, 0.32);
  transition: width .28s ease;
}

.achieve-item {
  border: 1px solid rgba(163, 205, 244, 0.24);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(12, 24, 39, 0.62);
}

.achieve-item strong {
  color: #dff6ff;
}

.achieve-item .tiny {
  margin-top: 3px;
}

.achieve-empty {
  border: 1px dashed rgba(162, 203, 242, 0.28);
  border-radius: 12px;
  padding: 12px;
  color: #bcd0e8;
}

.top p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.stats > div {
  grid-column: span 3;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--glass);
  backdrop-filter: blur(10px);
}

.stats span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.stats strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
}

.inv-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats-subline {
  display: block;
  margin-top: 1px;
  font-size: 0.72rem;
  color: #8fa7c2;
  letter-spacing: 0.01em;
}

.cash-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cash-loan-btn {
  min-height: 30px;
  height: 30px;
  padding: 4px 9px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #bfe4ff;
  border-color: rgba(158, 203, 244, 0.44);
  background: rgba(12, 28, 45, 0.62);
  align-self: flex-start;
}

.cash-loan-btn:hover:not(:disabled) {
  color: #e6f5ff;
  border-color: rgba(177, 220, 255, 0.62);
}

.panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px) saturate(130%);
  box-shadow: var(--shadow);
}

.panel h2 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.panel h3 {
  margin: 14px 0 8px;
  font-size: 1rem;
  color: #d8e8ff;
  line-height: 1.4;
}

#stageRun .run-head,
#stageConfig .design-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

#stageRun .run-head h2,
#stageConfig .design-head h2 {
  margin-bottom: 0;
}

.low-freq-btn {
  min-height: 32px;
  height: 32px;
  padding: 5px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 10px;
  color: #c3d4ec;
  border-color: rgba(167, 190, 220, 0.34);
  background: rgba(22, 36, 54, 0.5);
}

.low-freq-btn:hover:not(:disabled) {
  color: #deebff;
  border-color: rgba(186, 211, 243, 0.5);
}

#stageConfig #restartDesign.restart-alert {
  color: #ffdce3;
  border-color: rgba(255, 124, 146, 0.86);
  box-shadow:
    0 0 0 1px rgba(255, 164, 180, 0.32) inset,
    0 0 14px rgba(255, 96, 128, 0.4),
    0 0 28px rgba(255, 83, 121, 0.26);
  animation: restartAlertPulse 1.6s ease-in-out infinite;
}

@keyframes restartAlertPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 164, 180, 0.24) inset,
      0 0 10px rgba(255, 96, 128, 0.3),
      0 0 20px rgba(255, 83, 121, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 180, 195, 0.42) inset,
      0 0 16px rgba(255, 116, 145, 0.46),
      0 0 30px rgba(255, 93, 130, 0.32);
  }
}

#stageRun #restart.gameover-cta,
#stageConfig #restartDesign.gameover-cta {
  color: #ffe1e7;
  border-color: rgba(255, 121, 145, 0.92);
  background: linear-gradient(145deg, rgba(84, 21, 34, 0.82), rgba(58, 15, 26, 0.86));
  box-shadow:
    0 0 0 1px rgba(255, 170, 186, 0.34) inset,
    0 0 12px rgba(255, 96, 128, 0.46),
    0 0 24px rgba(255, 84, 120, 0.28);
  animation: gameoverCtaPulse 1.25s ease-in-out infinite;
}

@keyframes gameoverCtaPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 170, 186, 0.26) inset,
      0 0 10px rgba(255, 96, 128, 0.36),
      0 0 20px rgba(255, 84, 120, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 186, 199, 0.4) inset,
      0 0 16px rgba(255, 112, 142, 0.54),
      0 0 30px rgba(255, 96, 132, 0.34);
  }
}

#stageRun #restart.celebrate-cta,
#stageConfig #restartDesign.celebrate-cta {
  color: #e8fff4;
  border-color: rgba(124, 255, 202, 0.88);
  background: linear-gradient(145deg, rgba(18, 72, 58, 0.78), rgba(12, 52, 40, 0.84));
  box-shadow:
    0 0 0 1px rgba(161, 255, 220, 0.34) inset,
    0 0 10px rgba(104, 247, 188, 0.4),
    0 0 22px rgba(84, 230, 170, 0.26);
  animation: celebrateCtaPulse 1.35s ease-in-out infinite;
}

@keyframes celebrateCtaPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(161, 255, 220, 0.26) inset,
      0 0 8px rgba(104, 247, 188, 0.32),
      0 0 18px rgba(84, 230, 170, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(180, 255, 229, 0.4) inset,
      0 0 14px rgba(121, 255, 202, 0.52),
      0 0 26px rgba(96, 241, 181, 0.32);
  }
}

#stageRun #nextMonth {
  min-height: 46px;
  height: 46px;
  padding: 10px 16px;
  font-size: 1rem;
  letter-spacing: 0.01em;
  position: relative;
  overflow: visible;
  box-shadow:
    0 0 0 1px rgba(167, 243, 208, 0.32) inset,
    0 0 18px rgba(110, 231, 255, 0.4),
    0 0 32px rgba(167, 243, 208, 0.24);
  animation: monthAdvanceGlow 2s ease-in-out infinite;
}

#stageRun #nextMonth:hover:not(:disabled) {
  box-shadow:
    0 0 0 1px rgba(167, 243, 208, 0.42) inset,
    0 0 24px rgba(110, 231, 255, 0.52),
    0 0 40px rgba(167, 243, 208, 0.34);
}

#stageRun #nextMonth::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 14px;
  border: 1px solid rgba(133, 255, 215, 0.0);
  box-shadow: 0 0 0 rgba(108, 255, 205, 0);
  pointer-events: none;
  opacity: 0;
}

#stageRun #nextMonth:active:not(:disabled),
#stageRun #nextMonth.is-pressing:not(:disabled) {
  transform: translateY(2px) scale(0.965);
  filter: brightness(1.14) saturate(1.08);
  box-shadow:
    0 0 0 1px rgba(180, 255, 228, 0.52) inset,
    0 0 14px rgba(110, 247, 214, 0.68),
    0 0 42px rgba(96, 240, 195, 0.5),
    inset 0 2px 12px rgba(3, 30, 28, 0.46);
}

#stageRun #nextMonth:active:not(:disabled)::before,
#stageRun #nextMonth.is-pressing:not(:disabled)::before {
  opacity: 1;
  border-color: rgba(149, 255, 223, 0.72);
  animation: nextMonthPressRing 0.36s ease-out 1;
}

#stageRun #continueNext {
  min-height: 44px;
  height: 44px;
  padding: 10px 14px;
  font-size: 0.94rem;
}

#stageRun #restock,
#stageRun #endCompany,
#stageRun #stop {
  min-height: 42px;
}

#stageRun #restock.restock-success {
  border-color: rgba(123, 255, 198, 0.88);
  box-shadow:
    0 0 0 1px rgba(151, 255, 213, 0.4) inset,
    0 0 18px rgba(105, 248, 188, 0.56),
    0 0 30px rgba(76, 230, 169, 0.32);
  animation: restockSuccessPulse 0.72s ease-out;
}

#stageRun #restock.restock-fail {
  border-color: rgba(255, 126, 149, 0.9);
  box-shadow:
    0 0 0 1px rgba(255, 166, 182, 0.32) inset,
    0 0 16px rgba(255, 94, 124, 0.48),
    0 0 28px rgba(255, 76, 111, 0.28);
}

@keyframes restockSuccessPulse {
  0% {
    box-shadow:
      0 0 0 1px rgba(151, 255, 213, 0.22) inset,
      0 0 8px rgba(105, 248, 188, 0.24),
      0 0 16px rgba(76, 230, 169, 0.16);
  }
  60% {
    box-shadow:
      0 0 0 1px rgba(161, 255, 219, 0.5) inset,
      0 0 22px rgba(117, 255, 201, 0.64),
      0 0 36px rgba(89, 238, 178, 0.38);
  }
  100% {
    box-shadow:
      0 0 0 1px rgba(151, 255, 213, 0.4) inset,
      0 0 18px rgba(105, 248, 188, 0.56),
      0 0 30px rgba(76, 230, 169, 0.32);
  }
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

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

.grid3 > label { grid-column: span 4; }
.grid4 > label { grid-column: span 3; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(190, 220, 255, 0.2);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

input, select, button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  color: var(--ink);
  background: rgba(11, 21, 34, 0.72);
  font: inherit;
}

input, select {
  min-height: 40px;
}

#startupDifficulty.diff-real {
  color: var(--good);
  border-color: rgba(84, 223, 138, 0.45);
}

#startupDifficulty.diff-hard {
  color: var(--danger);
  border-color: rgba(255, 77, 90, 0.5);
}

input:focus, select:focus {
  outline: none;
  border-color: rgba(110, 231, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.2);
}

button {
  cursor: pointer;
  font-weight: 700;
  position: relative;
  overflow: hidden;
  min-height: 40px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease, border-color .18s ease;
}

button:hover { transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.28);
}

button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 58%);
  opacity: 0;
  transform: scale(0.45);
  transition: opacity .18s ease, transform .22s ease;
  pointer-events: none;
}

button:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(155, 211, 255, 0.18);
}

button:active:not(:disabled)::after {
  opacity: 1;
  transform: scale(1);
}

button.is-pressing:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  filter: brightness(1.08);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(155, 211, 255, 0.2);
}

button.is-pressing:not(:disabled)::after {
  opacity: 1;
  transform: scale(1);
}

button.accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #03212b;
  border-color: transparent;
}

#launch {
  box-shadow:
    0 0 0 1px rgba(167, 243, 208, 0.28) inset,
    0 0 18px rgba(110, 231, 255, 0.34),
    0 0 34px rgba(167, 243, 208, 0.22);
  animation: launchGlow 2.2s ease-in-out infinite;
}

#launch:hover:not(:disabled) {
  box-shadow:
    0 0 0 1px rgba(167, 243, 208, 0.4) inset,
    0 0 24px rgba(110, 231, 255, 0.5),
    0 0 42px rgba(167, 243, 208, 0.32);
}

@keyframes launchGlow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(167, 243, 208, 0.28) inset,
      0 0 16px rgba(110, 231, 255, 0.3),
      0 0 30px rgba(167, 243, 208, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(167, 243, 208, 0.42) inset,
      0 0 22px rgba(110, 231, 255, 0.46),
      0 0 40px rgba(167, 243, 208, 0.3);
  }
}

#confirmEvent {
  color: #4a2b06;
  border-color: rgba(255, 194, 96, 0.78);
  background: linear-gradient(120deg, rgba(255, 171, 72, 0.98), rgba(255, 225, 132, 0.95));
  box-shadow:
    0 0 0 1px rgba(255, 214, 137, 0.36),
    0 0 14px rgba(255, 171, 74, 0.44),
    0 0 28px rgba(255, 205, 108, 0.28);
  text-shadow: 0 1px 0 rgba(255, 248, 224, 0.42);
  animation: confirmPulse 1.9s ease-in-out infinite;
}

#confirmEvent:disabled {
  color: #6a3d10;
  box-shadow:
    0 0 0 1px rgba(255, 215, 136, 0.2),
    0 0 8px rgba(255, 175, 77, 0.22);
  text-shadow: none;
}

#confirmEvent:not(:disabled):active {
  transform: translateY(1px) scale(0.992);
  box-shadow:
    0 0 0 1px rgba(255, 206, 124, 0.3),
    0 0 9px rgba(255, 162, 65, 0.35),
    inset 0 2px 8px rgba(120, 70, 12, 0.22);
}

#confirmEvent:not(:disabled):focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(255, 241, 198, 0.52),
    0 0 0 6px rgba(255, 176, 66, 0.28),
    0 0 22px rgba(255, 179, 85, 0.5);
}

.quick-guide-btn {
  width: 100%;
  max-width: 460px;
  min-height: 44px;
  padding: 10px 16px;
  border-color: rgba(142, 230, 255, 0.88);
  border-radius: 13px;
  background:
    linear-gradient(120deg, rgba(15, 63, 101, 0.94), rgba(25, 116, 144, 0.9));
  color: #f6fdff;
  letter-spacing: 0.01em;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  align-self: center;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(8, 30, 45, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 0 0 1px rgba(128, 224, 255, 0.3),
    0 10px 22px rgba(44, 158, 205, 0.24);
  font-weight: 800;
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease, border-color 0.18s ease;
}

.quick-guide-btn::before {
  content: "ⓘ";
  font-size: 0.92em;
  opacity: 0.96;
}

.quick-guide-btn:hover {
  filter: brightness(1.1);
  border-color: rgba(165, 236, 255, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 0 0 1px rgba(156, 235, 255, 0.36),
    0 12px 24px rgba(52, 171, 224, 0.32);
}

.quick-guide-btn:active {
  transform: translateY(1px) scale(0.988);
  box-shadow:
    inset 0 2px 8px rgba(8, 34, 52, 0.34),
    0 0 0 1px rgba(112, 210, 244, 0.26),
    0 5px 12px rgba(36, 133, 176, 0.24);
}

.quick-guide-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(226, 249, 255, 0.65),
    0 0 0 6px rgba(69, 180, 223, 0.34),
    0 0 20px rgba(82, 197, 240, 0.4);
}

.quick-guide-btn.guide-unseen {
  animation: quickGuidePulse 2.8s ease-in-out infinite;
}

.quick-guide-btn.guide-seen {
  border-color: rgba(144, 193, 218, 0.56);
  background: linear-gradient(120deg, rgba(23, 49, 70, 0.86), rgba(25, 71, 92, 0.82));
  color: rgba(228, 241, 250, 0.94);
  text-shadow: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(126, 171, 194, 0.22),
    0 6px 14px rgba(25, 88, 119, 0.14);
  animation: none;
}

.quick-guide-btn.guide-seen:hover {
  border-color: rgba(164, 209, 232, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(145, 191, 215, 0.28),
    0 8px 16px rgba(31, 106, 141, 0.18);
}

.quick-guide-btn.guide-seen::before {
  opacity: 0.72;
}

.quick-guide-version {
  display: block;
  margin-top: 4px;
  color: #8fa5bc;
  opacity: 0.84;
  font-size: 0.82rem;
  position: relative;
  z-index: 1;
}

.quick-guide-detail-entry {
  margin-top: 4px;
  min-height: 22px;
  height: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(132, 220, 255, 0.12);
  background: transparent;
  color: rgba(188, 225, 244, 0.54);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0.66;
  cursor: pointer;
}

.quick-guide-detail-entry:hover {
  border-color: rgba(155, 231, 255, 0.22);
  color: rgba(214, 240, 252, 0.76);
  opacity: 0.86;
}

.quick-guide-inline-version {
  margin-top: 4px;
  text-align: center;
  color: #87a0b7;
  opacity: 0.82;
}

@keyframes confirmPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 221, 156, 0.34),
      0 0 16px rgba(255, 174, 79, 0.52),
      0 0 34px rgba(255, 214, 122, 0.32);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 230, 176, 0.44),
      0 0 22px rgba(255, 187, 94, 0.66),
      0 0 42px rgba(255, 219, 136, 0.46);
  }
}

@keyframes quickGuidePulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.24),
      0 0 0 1px rgba(128, 224, 255, 0.28),
      0 8px 20px rgba(44, 158, 205, 0.2);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 0 0 1px rgba(166, 238, 255, 0.46),
      0 12px 28px rgba(64, 196, 242, 0.34);
  }
}

@keyframes monthAdvanceGlow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(167, 243, 208, 0.32) inset,
      0 0 16px rgba(110, 231, 255, 0.34),
      0 0 30px rgba(167, 243, 208, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(167, 243, 208, 0.48) inset,
      0 0 22px rgba(110, 231, 255, 0.5),
      0 0 38px rgba(167, 243, 208, 0.32);
  }
}

@keyframes nextMonthPressRing {
  0% {
    transform: scale(0.92);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.07);
    opacity: 0;
  }
}

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

.card {
  grid-column: span 4;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(10px);
  min-height: 152px;
  cursor: pointer;
  touch-action: manipulation;
}

.card.sel {
  border-color: rgba(110, 231, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.22);
}

.card h4 { margin: 0 0 6px; }
.card p { margin: 4px 0; color: var(--muted); line-height: 1.38; }

.card h4.market-buff-strong {
  color: #8dffb6;
  text-shadow: 0 0 10px rgba(84, 223, 138, 0.35);
}

.card h4.market-debuff-strong {
  color: #ff7f90;
  text-shadow: 0 0 10px rgba(255, 77, 90, 0.3);
}

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

.checks label {
  grid-column: span 4;
  flex-direction: row;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.checks input { accent-color: #80edff; }

.sku-row {
  align-items: end;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(170, 203, 239, 0.16);
}

#skuBox .row {
  align-items: center;
}

#skuBox .row .tiny {
  flex: 1 1 260px;
  min-width: 180px;
}

#skuBox #addSku {
  min-width: 112px;
  min-height: 38px;
  height: 38px;
  padding: 8px 12px;
  border-color: rgba(126, 223, 255, 0.54);
  background: linear-gradient(145deg, rgba(15, 52, 70, 0.78), rgba(14, 32, 50, 0.84));
  box-shadow: 0 0 0 1px rgba(132, 221, 252, 0.2) inset;
}

.sku-row .sku-share.sku-invalid {
  border-color: rgba(255, 110, 135, 0.9);
  box-shadow:
    0 0 0 1px rgba(255, 145, 165, 0.28) inset,
    0 0 0 3px rgba(255, 96, 126, 0.16);
}

.sku-row .sku-share.sku-valid {
  border-color: rgba(121, 255, 202, 0.86);
  box-shadow:
    0 0 0 1px rgba(156, 255, 218, 0.24) inset,
    0 0 0 3px rgba(90, 236, 185, 0.16);
}

.sku-share-hint {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #ff8ea4;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.sku-share-hint::before {
  content: "!";
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: #ffdce3;
  background: rgba(255, 103, 132, 0.34);
  border: 1px solid rgba(255, 127, 151, 0.52);
}

.int-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #ff9fb0;
}

input.input-int-invalid {
  border-color: rgba(255, 121, 145, 0.88) !important;
  box-shadow: 0 0 0 1px rgba(255, 121, 145, 0.26) inset, 0 0 0 1px rgba(255, 96, 128, 0.16);
}

.sku-row .sku-remove {
  grid-column: 1 / -1;
  justify-self: end;
  width: auto;
  min-width: 120px;
  padding: 8px 12px;
  line-height: 1.2;
  white-space: nowrap;
  word-break: keep-all;
  border-color: rgba(255, 132, 156, 0.55);
  background: linear-gradient(135deg, rgba(255, 112, 145, 0.24), rgba(255, 94, 129, 0.14));
}

.sku-row .sku-remove:disabled {
  border-color: rgba(178, 193, 214, 0.35);
  background: rgba(124, 142, 168, 0.2);
}

.box {
  margin-top: 10px;
  border: 1px solid rgba(179, 211, 255, 0.34);
  border-radius: 14px;
  padding: 13px 12px;
  line-height: 1.62;
  letter-spacing: 0.01em;
  background: rgba(6, 14, 24, 0.5);
}

.box strong {
  font-weight: 800;
}

.month-brief {
  margin-top: 8px;
  border-color: rgba(137, 199, 245, 0.42);
  background: linear-gradient(165deg, rgba(9, 22, 36, 0.72), rgba(8, 18, 30, 0.62));
  box-shadow: inset 0 0 0 1px rgba(151, 209, 255, 0.12);
}

.month-brief strong {
  color: #dff3ff;
}

.month-brief.is-end {
  border-color: rgba(255, 153, 168, 0.78);
  background: linear-gradient(165deg, rgba(50, 20, 28, 0.72), rgba(34, 16, 24, 0.68));
  box-shadow:
    inset 0 0 0 1px rgba(255, 181, 192, 0.24),
    0 0 0 1px rgba(255, 149, 170, 0.28),
    0 0 16px rgba(255, 99, 132, 0.22);
  animation: monthBriefEndPulse 1.8s ease-in-out infinite;
}

@keyframes monthBriefEndPulse {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 181, 192, 0.2),
      0 0 0 1px rgba(255, 149, 170, 0.24),
      0 0 14px rgba(255, 99, 132, 0.18);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 191, 203, 0.32),
      0 0 0 1px rgba(255, 164, 182, 0.34),
      0 0 22px rgba(255, 116, 146, 0.32);
  }
}

.quiz-box {
  margin-bottom: 10px;
  border: 1px solid rgba(124, 210, 255, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(8, 20, 32, 0.42);
  color: #dbeeff;
  line-height: 1.55;
}

.quiz-box strong {
  color: #9be8ff;
}

.ops-chart {
  display: block;
  width: 100%;
  height: 260px;
  margin-top: 8px;
  border-radius: 10px;
  background: rgba(8, 18, 31, 0.45);
  cursor: zoom-in;
}

.ops-legend {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.ops-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(162, 201, 238, 0.3);
  background: rgba(10, 22, 36, 0.52);
  color: #d6e7fa;
  font-size: 0.82rem;
  line-height: 1.2;
}

.ops-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.ops-dot.cash { background: #6ee7ff; }
.ops-dot.inv { background: #ffb37a; }
.ops-dot.sold { background: #8ee39d; }
.ops-dot.rating { background: #f8a5ff; }

.ops-chart-tip {
  margin-top: 6px;
  color: #a9c3df;
}

.phone-preview-canvas {
  display: block;
  width: 100%;
  height: 190px;
  margin-top: 8px;
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(8, 18, 31, 0.72), rgba(13, 26, 42, 0.55));
  border: 1px solid rgba(165, 205, 242, 0.26);
  cursor: zoom-in;
}

.design-eval-grid {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  justify-content: stretch;
}

.phone-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 220px);
  gap: 10px;
  justify-content: start;
}

.phone-preview-item {
  width: min(220px, 100%);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preview-color-control {
  display: inline-flex;
  margin: 0;
  min-width: 132px;
  max-width: 146px;
  height: 30px;
  padding: 0 10px;
  gap: 7px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(170, 206, 242, 0.36);
  background: rgba(9, 20, 33, 0.58);
  align-self: center;
}

.preview-color-control > span {
  font-size: 0.74rem;
  color: #b7cbe6;
  line-height: 1.1;
  white-space: nowrap;
}

.preview-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(182, 211, 245, 0.56);
  box-shadow: 0 0 0 1px rgba(10, 17, 26, 0.42) inset;
  background: var(--picked-color, #2e4a66);
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}

.preview-color-dot > input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.preview-color-dot > input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.preview-color-dot > input[type="color"]::-webkit-color-swatch {
  border: none;
}

.preview-color-dot > input[type="color"]::-moz-color-swatch {
  border: none;
}

.design-health-box {
  min-height: 300px;
  max-width: none;
  padding: 10px 10px;
  line-height: 1.45;
}

/* Stage 2 layout tuning: denser and less blank on desktop */
#stageConfig {
  padding: 14px;
}

#stageConfig h3 {
  margin: 12px 0 6px;
}

#stageConfig .grid3,
#stageConfig .grid4 {
  gap: 8px;
}

#stageConfig label {
  padding: 9px;
}

#stageConfig .cfg-grid-1 > label { grid-column: span 12; }
#stageConfig .cfg-grid-2 > label { grid-column: span 6; }
#stageConfig .cfg-grid-3 > label { grid-column: span 4; }
#stageConfig .cfg-grid-4 > label { grid-column: span 3; }

#stageConfig .cfg-grid-screen {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

#stageConfig .cfg-grid-screen > label {
  grid-column: span 2;
}

#stageConfig .checks label {
  grid-column: span 3;
  padding: 7px 9px;
}

#stageConfig #previewDetailBox {
  margin-top: 8px;
  padding: 10px 10px;
}

#stageConfig .action-row {
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

#stageConfig .procurement-inline {
  margin-left: auto;
  min-width: 250px;
  max-width: 340px;
  height: 44px;
  padding: 0 8px;
  gap: 4px;
  flex-direction: row;
  align-items: center;
  white-space: nowrap;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border-color: rgba(183, 214, 248, 0.3);
}

#stageConfig .units-inline {
  min-width: 180px;
  max-width: 240px;
  height: 44px;
  padding: 0 8px;
  gap: 4px;
  flex-direction: row;
  align-items: center;
  white-space: nowrap;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border-color: rgba(183, 214, 248, 0.3);
}

#stageConfig .action-row > button {
  height: 44px;
  min-height: 44px;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 0.94rem;
}

#stageConfig .action-row > label {
  box-sizing: border-box;
  margin: 0;
  min-height: 44px;
  font-size: 0.9rem;
}

#stageConfig .action-row .units-inline input,
#stageConfig .action-row .procurement-inline select {
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 6px 8px;
  font-size: 0.9rem;
}

#stageConfig .action-row .units-inline input {
  width: 118px;
}

#stageConfig .action-row .procurement-inline select {
  width: 170px;
}

/* Emphasize launch button in the action row */
#stageConfig .action-row #launch {
  min-width: 188px;
  flex: 1.15;
  letter-spacing: 0.01em;
  box-shadow:
    0 0 0 1px rgba(167, 243, 208, 0.32) inset,
    0 0 20px rgba(110, 231, 255, 0.38),
    0 0 38px rgba(167, 243, 208, 0.24);
}

#stageConfig .action-row #preview {
  min-width: 130px;
  flex: 0.85;
  color: #ccfff1;
  border-color: rgba(84, 239, 190, 0.76);
  background:
    linear-gradient(140deg, rgba(7, 34, 34, 0.9), rgba(10, 52, 46, 0.78));
  box-shadow:
    0 0 0 1px rgba(120, 255, 214, 0.34) inset,
    0 0 12px rgba(76, 239, 191, 0.46),
    0 0 24px rgba(57, 212, 170, 0.24);
  text-shadow: 0 0 10px rgba(94, 255, 214, 0.34);
  animation: previewTechGlow 2.1s ease-in-out infinite;
}

#stageConfig .action-row #preview:hover:not(:disabled) {
  border-color: rgba(123, 255, 222, 0.94);
  box-shadow:
    0 0 0 1px rgba(146, 255, 226, 0.46) inset,
    0 0 18px rgba(93, 247, 205, 0.62),
    0 0 34px rgba(64, 220, 179, 0.36);
}

#stageConfig .action-row #preview:active:not(:disabled) {
  box-shadow:
    0 0 0 1px rgba(130, 255, 218, 0.4) inset,
    0 0 10px rgba(75, 236, 189, 0.46),
    inset 0 2px 10px rgba(5, 28, 26, 0.4);
}

@keyframes previewTechGlow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(120, 255, 214, 0.3) inset,
      0 0 10px rgba(76, 239, 191, 0.4),
      0 0 20px rgba(57, 212, 170, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(143, 255, 224, 0.44) inset,
      0 0 16px rgba(93, 247, 205, 0.56),
      0 0 30px rgba(64, 220, 179, 0.32);
  }
}

.overview-item {
  padding: 7px 8px;
  border: 1px solid rgba(164, 204, 245, 0.2);
  border-radius: 10px;
  background: rgba(12, 23, 37, 0.46);
  margin-bottom: 7px;
}

.overview-title {
  font-size: 0.86rem;
  color: #a9caef;
  letter-spacing: 0.01em;
  margin-bottom: 3px;
}

.overview-body {
  font-size: 0.93rem;
  word-break: break-word;
  line-height: 1.5;
}

.health-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.health-list li {
  margin: 4px 0;
}

.perf-high { color: #64f0a2; font-weight: 700; }
.perf-mid { color: #ffd166; font-weight: 700; }
.perf-low { color: #ff8fb6; font-weight: 700; }

.preview-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 15, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.game-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 14px;
  background: rgba(4, 10, 18, 0.72);
  backdrop-filter: blur(6px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.game-modal-stack {
  width: min(560px, 96vw);
  display: grid;
  gap: 10px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

.game-modal-card {
  width: 100%;
  border: 1px solid rgba(168, 206, 244, 0.34);
  border-radius: 14px;
  padding: 12px;
  background: rgba(9, 19, 32, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}

.game-modal-card.modal-gameover {
  border-color: rgba(255, 132, 156, 0.74);
  box-shadow:
    0 0 0 1px rgba(255, 170, 186, 0.22) inset,
    0 14px 34px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(255, 96, 128, 0.22);
}

.game-modal-card.modal-celebrate {
  border-color: rgba(120, 245, 206, 0.7);
  background:
    radial-gradient(130% 100% at 12% -18%, rgba(128, 255, 218, 0.16), rgba(9, 19, 32, 0) 52%),
    rgba(9, 19, 32, 0.96);
  box-shadow:
    0 0 0 1px rgba(165, 255, 224, 0.2) inset,
    0 14px 34px rgba(0, 0, 0, 0.38),
    0 0 24px rgba(95, 239, 190, 0.24);
}

.game-modal-card.modal-celebrate h3 {
  color: #d8ffe9;
  text-shadow: 0 0 12px rgba(102, 243, 187, 0.26);
}

.game-modal-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.3;
}

.game-modal-body {
  color: #d8e9ff;
  line-height: 1.66;
  font-size: 0.95rem;
  padding-bottom: 4px;
}

.game-modal-card .row {
  margin-top: 10px;
  justify-content: flex-end;
}

.game-modal-card #gameModalClose {
  min-width: 96px;
}

.game-modal-close {
  min-width: 96px;
  min-height: 40px;
}

.bench-page {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 10, 18, 0.88);
  backdrop-filter: blur(8px);
  overflow: auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px));
  overscroll-behavior: contain;
}

.bench-wrap {
  width: min(980px, 96vw);
  margin: 0 auto;
  border: 1px solid rgba(163, 206, 247, 0.34);
  border-radius: 16px;
  background: rgba(9, 19, 32, 0.94);
  padding: 12px;
  padding-bottom: 14px;
}

.bench-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(9, 19, 32, 0.96);
  padding-bottom: 6px;
}

.bench-close-btn {
  min-height: 38px;
  height: 38px;
  padding: 7px 12px;
  font-size: 0.84rem;
}

.bench-sub {
  margin-top: 6px;
}

.bench-progress {
  margin-top: 8px;
  border: 1px solid rgba(151, 202, 244, 0.28);
  border-radius: 10px;
  padding: 8px;
  background: rgba(10, 22, 36, 0.58);
}

.bench-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: #bdd3ea;
}

.bench-progress-top strong {
  color: #d8fff2;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.01em;
}

.bench-progress-track {
  margin-top: 6px;
  height: 8px;
  border-radius: 999px;
  background: rgba(101, 139, 176, 0.32);
  overflow: hidden;
}

.bench-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(110, 231, 255, 0.9), rgba(124, 255, 210, 0.95));
  box-shadow: 0 0 12px rgba(106, 247, 217, 0.4);
  transition: width .28s ease;
}

.bench-card {
  margin-top: 10px;
  border: 1px solid rgba(158, 202, 244, 0.28);
  border-radius: 12px;
  background: rgba(10, 22, 36, 0.72);
  padding: 10px;
}

.bench-card.active {
  border-color: rgba(143, 214, 255, 0.7);
  box-shadow: 0 0 0 2px rgba(110, 231, 255, 0.16);
}

.bench-card-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.bench-row-grid {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
  align-items: center;
}

.bench-soc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 130px;
  gap: 10px;
  align-items: center;
}

.bench-soc-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bench-soc-canvas,
.bench-temp-canvas {
  width: 100%;
  height: 120px;
  border: 1px solid rgba(160, 205, 245, 0.24);
  border-radius: 10px;
  background: rgba(5, 13, 22, 0.8);
}

.bench-meta {
  font-size: 0.82rem;
  color: #b7d0ea;
  line-height: 1.4;
}

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

.bench-chip {
  border: 1px solid rgba(156, 198, 238, 0.28);
  border-radius: 10px;
  padding: 14px 6px;
  text-align: center;
  font-size: 0.82rem;
}

.bench-chip.color {
  background: linear-gradient(90deg, #ff6b6b, #ffd166, #9cff8f, #78d6ff, #b497ff);
  color: #05111b;
}

.bench-chip.gray {
  background: linear-gradient(90deg, #000, #555, #bbb, #fff);
  color: #0a121a;
}

.bench-chip.ufo {
  background: radial-gradient(circle at 50% 50%, rgba(183, 244, 211, 0.88), rgba(35, 108, 140, 0.5));
  color: #e9f9ff;
}

.bench-info {
  font-size: 0.9rem;
  line-height: 1.5;
}

.bench-bits {
  margin-top: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.84rem;
  color: #8ff0d7;
  opacity: 0.9;
  word-break: break-all;
  line-height: 1.38;
}

.bench-slide {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(156, 198, 238, 0.28);
  border-radius: 10px;
  background: linear-gradient(140deg, rgba(33, 65, 94, 0.8), rgba(21, 36, 55, 0.7));
}

.bench-score {
  justify-self: stretch;
  text-align: center;
  border: 1px solid rgba(163, 205, 244, 0.3);
  border-radius: 10px;
  padding: 10px 6px;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bench-score.pending {
  color: #9fb7d0;
}

.bench-score.done {
  color: #7ef0b1;
}

.bench-final {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid rgba(143, 237, 192, 0.42);
  background: linear-gradient(120deg, rgba(40, 95, 118, 0.5), rgba(28, 96, 70, 0.55));
  box-shadow: 0 0 24px rgba(102, 236, 188, 0.3);
  text-align: center;
  padding: 12px;
  font-size: 1.06rem;
}

.bench-final strong {
  font-size: 1.45rem;
  color: #cffff0;
  text-shadow: 0 0 14px rgba(127, 255, 209, 0.55);
}

.preview-lightbox-inner {
  width: min(92vw, 560px);
  border: 1px solid rgba(173, 210, 246, 0.34);
  border-radius: 14px;
  background: rgba(9, 18, 31, 0.95);
  padding: 12px;
}

.preview-lightbox-close {
  margin-left: auto;
  display: block;
}

#previewLightboxImage {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(160, 205, 246, 0.28);
  margin-top: 8px;
  background: linear-gradient(150deg, rgba(8, 18, 31, 0.72), rgba(13, 26, 42, 0.55));
}

.tiny {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.source .tiny {
  line-height: 1.5;
}

.source a {
  color: #8ce8ff;
  text-decoration: none;
}

.source a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.hidden { display: none; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.risk-info { color: var(--info); }
.risk-warn { color: var(--warn); }
.risk-danger { color: var(--danger); }

#reportBox, #marketBox, #previewBox, #finalBox {
  font-size: 0.97rem;
}

.run-mobile-dock {
  display: none;
  touch-action: manipulation;
  pointer-events: auto;
  isolation: isolate;
  transition: transform .16s ease, opacity .16s ease;
}

.run-mobile-dock.hidden {
  display: none !important;
}

.run-mobile-dock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.run-mobile-dock-label {
  font-size: 0.74rem;
  color: #9fb7cf;
  white-space: nowrap;
  letter-spacing: .02em;
  border: 1px solid rgba(146, 182, 214, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(21, 39, 60, 0.6);
}

.run-mobile-dock strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.83rem;
  font-weight: 700;
  text-align: right;
  color: #d7e8fb;
  transition: color 0.18s ease, text-shadow 0.18s ease, transform .16s ease;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-mobile-dock strong.is-good {
  color: #9af6c5;
  text-shadow: 0 0 10px rgba(123, 255, 198, 0.28);
}

.run-mobile-dock strong.is-bad {
  color: #ffb0bd;
  text-shadow: 0 0 10px rgba(255, 126, 149, 0.28);
}

.run-mobile-dock strong.is-bump {
  animation: runDockQuoteBump 0.48s ease;
}

.run-mobile-dock-meta,
.run-mobile-dock-action {
  margin-top: 6px;
  font-size: 0.79rem;
  color: #b7cae0;
  min-height: 1.3em;
  line-height: 1.33;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-mobile-dock-action {
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  padding-top: 1px;
  border-top: 1px dashed rgba(142, 176, 208, 0.2);
}

.run-mobile-dock-action.is-good {
  color: #9af6c5;
}

.run-mobile-dock-action.is-bad {
  color: #ffb0bd;
}

.run-mobile-dock-action.is-neutral {
  color: #b8cde4;
}

.run-mobile-dock-action.is-pop {
  animation: runDockActionPop 0.36s ease;
}

@keyframes runDockQuoteBump {
  0% { transform: translateY(0) scale(1); }
  38% { transform: translateY(-1px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes runDockActionPop {
  0% { transform: translateY(2px); opacity: 0.45; }
  100% { transform: translateY(0); opacity: 1; }
}

@media (max-width: 1100px) {
  .stats > div { grid-column: span 6; }
  .grid4 > label { grid-column: span 6; }
  .checks label { grid-column: span 6; }
  #stageConfig .cfg-grid-screen {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  #stageConfig .cfg-grid-screen > label { grid-column: span 6; }
  #stageConfig .cfg-grid-4 > label { grid-column: span 6; }
  #stageConfig .cfg-grid-3 > label { grid-column: span 6; }
  #stageConfig .checks label { grid-column: span 6; }
}

@media (max-width: 760px) {
  .app { width: 94vw; margin-top: 14px; }
  .top { padding: 14px; border-radius: 18px; }
  .top-head {
    align-items: center;
  }
  .achieve-entry {
    min-height: 34px;
    height: 34px;
    padding: 5px 10px;
  }
  .achieve-panel-card {
    width: 100%;
    max-height: calc(100dvh - 18px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    border-radius: 12px;
    padding: 9px;
  }
  .achieve-panel-head {
    padding-bottom: 6px;
  }
  .achieve-progress {
    position: sticky;
    top: 42px;
    z-index: 1;
    margin-bottom: 7px;
    backdrop-filter: blur(6px);
  }
  .achieve-progress-top {
    font-size: 0.78rem;
  }
  .achieve-progress-track {
    height: 7px;
  }
  .achieve-panel-head .low-freq-btn {
    min-height: 36px;
    height: 36px;
    padding: 6px 10px;
  }
  .achieve-item {
    padding: 9px;
  }
  .panel { border-radius: 18px; }
  h1 { font-size: clamp(1.45rem, 7.2vw, 2rem); }
  .top p { font-size: 0.92rem; }
  #reportBox, #marketBox, #previewBox, #finalBox {
    font-size: 0.95rem;
    line-height: 1.7;
  }
  #stageRun {
    padding: 12px;
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  }
  #stageRun .box {
    padding: 10px 10px;
    border-radius: 12px;
  }
  #stageRun #runQuiz {
    margin-bottom: 8px;
  }
  #stageRun #runPrimaryRow {
    position: sticky;
    top: 6px;
    z-index: 3;
    padding: 8px;
    border-radius: 12px;
    background: rgba(8, 18, 31, 0.9);
    border: 1px solid rgba(151, 197, 240, 0.24);
    backdrop-filter: blur(6px);
  }
  #stageRun #runPrimaryRow > button {
    flex: 1 1 100%;
  }
  #stageRun #nextMonth {
    min-height: 46px;
    height: 46px;
  }
  #stageRun #continueNext {
    min-height: 42px;
    height: 42px;
  }
  #stageRun .grid3 {
    gap: 8px;
    margin-top: 8px;
  }
  #stageRun #runBriefBox {
    margin-top: 8px;
  }
  #stageRun #restock {
    width: 100%;
    min-height: 44px;
  }
  #stageRun #marketBox,
  #stageRun #reportBox,
  #stageRun #finalBox {
    line-height: 1.72;
  }
  #stageRun #endCompany,
  #stageRun #stop {
    width: 100%;
    border-color: rgba(170, 197, 227, 0.34);
    background: rgba(16, 29, 44, 0.7);
  }
  #stageRun .ops-chart {
    height: 230px;
  }
  #stageRun .ops-legend {
    gap: 6px 8px;
  }
  #stageRun .ops-legend-item {
    padding: 4px 7px;
    font-size: 0.8rem;
  }
  #stageRun .ops-chart-tip {
    margin-top: 5px;
    font-size: 0.84rem;
    line-height: 1.45;
  }
  .quick-guide-btn {
    max-width: none;
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border-radius: 13px;
    font-size: 0.95rem;
    letter-spacing: 0.005em;
    justify-content: center;
  }
  .quick-guide-detail-entry {
    min-height: 21px;
    height: 21px;
    font-size: 0.63rem;
    opacity: 0.82;
    border-color: rgba(132, 220, 255, 0.2);
    color: rgba(198, 232, 248, 0.84);
  }
  .row > button {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
    min-height: 42px;
  }
  .row > button:only-child {
    flex-basis: 100%;
  }
  .stats > div,
  .grid3 > label,
  .grid4 > label,
  .checks label,
  .card { grid-column: span 12; }
  .checks label { min-height: 40px; }
  #stageConfig .procurement-inline {
    margin-left: 0;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    height: auto;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    white-space: normal;
  }
  #stageConfig .units-inline {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    height: auto;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    white-space: normal;
  }
  #stageConfig .action-row {
    align-items: stretch;
  }
  #stageConfig .action-row > label {
    min-height: 0;
    padding: 8px 9px;
    font-size: 0.9rem;
  }
  #stageConfig .action-row .units-inline input,
  #stageConfig .action-row .procurement-inline select {
    height: 38px;
    min-height: 38px;
  }
  #stageConfig .action-row #launch,
  #stageConfig .action-row #preview {
    min-width: 0;
    flex: 1 1 100%;
  }
  #stageConfig #previewBox .overview-item {
    padding: 8px;
    margin-bottom: 6px;
  }
  #stageConfig #previewBox .overview-title {
    font-size: 0.83rem;
    margin-bottom: 2px;
  }
  #stageConfig #previewBox .overview-body {
    font-size: 0.9rem;
    line-height: 1.44;
  }
  #stageConfig #previewDetailBox {
    line-height: 1.66;
    word-break: break-word;
  }
  #stageConfig .cfg-grid-1 > label,
  #stageConfig .cfg-grid-2 > label,
  #stageConfig .cfg-grid-3 > label,
  #stageConfig .cfg-grid-4 > label,
  #stageConfig .cfg-grid-screen > label,
  #stageConfig .checks label { grid-column: span 12; }
  .sku-row .sku-remove {
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 40px;
  }
  #skuBox .row {
    gap: 8px;
  }
  #skuBox .row .tiny {
    order: 1;
    flex: 1 1 100%;
  }
  #skuBox #addSku {
    order: 2;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    height: 42px;
  }
  #skuBox {
    padding: 10px;
  }
  #skuList {
    margin-top: 8px;
  }
  .sku-row {
    padding: 8px;
    gap: 7px;
  }
  .sku-row label {
    padding: 8px;
    border-radius: 11px;
  }
  .sku-row input,
  .sku-row select {
    min-height: 40px;
  }
  .sku-share-hint {
    margin-top: 8px;
    font-size: 0.84rem;
  }
  .design-health-box {
    min-height: 280px;
    max-width: 100%;
  }
  .phone-preview-canvas {
    height: 176px;
  }
  .design-eval-grid { grid-template-columns: 1fr; }
  .phone-preview-grid {
    grid-template-columns: 1fr;
    justify-content: center;
  }
  .phone-preview-item {
    width: 100%;
    max-width: 340px;
    margin-inline: auto;
  }
  .bench-wrap {
    width: 100%;
    padding: 10px;
  }
  .game-modal {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .game-modal-card {
    max-height: min(74dvh, 540px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .game-modal-card .row {
    justify-content: stretch;
  }
  .game-modal-close {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }
  .bench-head h2 {
    font-size: 1.02rem;
    line-height: 1.3;
  }
  .bench-sub {
    margin-top: 4px;
    margin-bottom: 2px;
  }
  .bench-progress {
    margin-top: 6px;
    padding: 7px;
  }
  .bench-progress-top {
    font-size: 0.8rem;
  }
  .bench-card {
    padding: 9px;
  }
  .bench-row-grid,
  .bench-soc-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .bench-soc-canvas,
  .bench-temp-canvas {
    height: 108px;
  }
  .bench-visuals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bench-visuals .bench-chip:last-child {
    grid-column: 1 / -1;
  }
  .bench-chip {
    padding: 10px 6px;
    font-size: 0.8rem;
  }
  .bench-slide {
    min-height: 64px;
    font-size: 0.9rem;
  }
  .bench-score {
    justify-self: auto;
    min-height: 42px;
    font-size: 0.95rem;
  }
  #stageRun .run-head,
  #stageConfig .design-head {
    align-items: flex-start;
  }
  #stageRun #restart.gameover-cta,
  #stageConfig #restartDesign.gameover-cta {
    position: sticky;
    top: calc(6px + env(safe-area-inset-top, 0px));
    z-index: 4;
  }
  .low-freq-btn {
    min-height: 30px;
    height: 30px;
    padding: 4px 9px;
    font-size: 0.82rem;
  }
  #stageRun #nextMonth {
    min-height: 44px;
    height: 44px;
    font-size: 0.96rem;
  }
  #stageRun #continueNext {
    min-height: 44px;
    height: 44px;
  }
  .preview-color-dot { width: 18px; height: 18px; }

  .run-mobile-dock {
    display: block;
    position: fixed;
    left: 50%;
    bottom: var(--run-dock-bottom, calc(8px + env(safe-area-inset-bottom, 0px)));
    transform: translateX(-50%);
    width: min(94vw, 680px);
    z-index: 26;
    border: 1px solid rgba(148, 190, 228, 0.38);
    border-radius: 14px;
    padding: 8px 10px 9px;
    background:
      linear-gradient(180deg, rgba(18, 38, 60, 0.7), rgba(8, 19, 33, 0.92));
    backdrop-filter: blur(10px) saturate(120%);
    box-shadow:
      0 12px 28px rgba(0, 8, 17, 0.4),
      0 0 0 1px rgba(151, 201, 244, 0.16) inset;
  }
  .run-mobile-dock::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(189, 226, 255, 0.14), rgba(189, 226, 255, 0));
    opacity: 0.6;
  }
}

@media (max-width: 430px) {
  .app { width: 95.5vw; margin-top: 10px; }
  .top,
  .panel {
    padding: 12px;
    border-radius: 16px;
  }
  .panel h2 {
    font-size: 1.08rem;
    line-height: 1.32;
  }
  .achieve-entry {
    min-height: 32px;
    height: 32px;
    padding: 4px 9px;
    font-size: 0.78rem;
  }
  .achieve-entry span {
    min-width: 17px;
    height: 17px;
    line-height: 17px;
    font-size: 0.72rem;
  }
  .achieve-panel {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .achieve-panel-card {
    padding: 8px;
    border-radius: 11px;
  }
  .achieve-panel-head h3 {
    font-size: 0.96rem;
  }
  .achieve-item {
    border-radius: 10px;
    padding: 8px;
  }
  .panel h3 {
    font-size: 0.96rem;
    line-height: 1.35;
  }
  .box {
    line-height: 1.66;
    letter-spacing: 0;
  }
  .row {
    gap: 8px;
  }
  #stageRun {
    padding: 10px;
    padding-bottom: calc(126px + env(safe-area-inset-bottom, 0px));
  }
  #stageRun #runPrimaryRow {
    top: 4px;
    padding: 7px;
  }
  #stageRun #nextMonth {
    min-height: 44px;
    height: 44px;
    font-size: 0.95rem;
  }
  #stageRun .ops-chart {
    height: 210px;
  }
  #stageRun .ops-legend-item {
    font-size: 0.78rem;
  }
  #stageRun .ops-dot {
    width: 7px;
    height: 7px;
  }
  .quick-guide-btn {
    min-height: 50px;
    font-size: 0.93rem;
    letter-spacing: 0;
    padding: 12px 10px;
    white-space: normal;
    line-height: 1.25;
  }
  .quick-guide-detail-entry {
    min-height: 20px;
    height: 20px;
    padding: 1px 6px;
    font-size: 0.62rem;
    opacity: 0.84;
  }
  .row > button {
    flex-basis: 100%;
    min-height: 44px;
    padding: 10px 10px;
  }
  label {
    padding: 9px;
  }
  input, select, button {
    padding: 9px 10px;
    border-radius: 11px;
    font-size: 16px;
  }
  .phone-preview-item { max-width: 100%; }
  .phone-preview-canvas {
    height: 168px;
  }
  .preview-color-control {
    min-width: 122px;
    max-width: 134px;
    height: 28px;
    padding: 0 9px;
  }
  .preview-lightbox-inner {
    width: min(95vw, 560px);
    padding: 10px;
  }
  .bench-page {
    padding-left: 8px;
    padding-right: 8px;
  }
  .bench-wrap {
    border-radius: 14px;
    padding: 8px;
  }
  .bench-head {
    gap: 8px;
  }
  .bench-close-btn {
    min-height: 36px;
    height: 36px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  .bench-card-title {
    font-size: 0.92rem;
  }
  .game-modal-card {
    padding: 10px;
    border-radius: 12px;
    max-height: min(76dvh, 560px);
  }
  .game-modal {
    padding-left: 10px;
    padding-right: 10px;
  }
  .game-modal-stack {
    width: 100%;
    gap: 8px;
  }
  .game-modal-body {
    font-size: 0.92rem;
    line-height: 1.62;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .game-modal-card .row {
    margin-top: 8px;
    position: sticky;
    bottom: 0;
    padding-top: 8px;
    background: linear-gradient(180deg, rgba(9, 19, 32, 0.02), rgba(9, 19, 32, 0.94) 32%);
  }
  .game-modal-close {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    font-size: 0.92rem;
  }
  #skuBox .row .tiny {
    font-size: 0.84rem;
    line-height: 1.46;
  }
  .sku-share-hint {
    font-size: 0.82rem;
  }
  .sku-share-hint::before {
    width: 15px;
    height: 15px;
    margin-right: 5px;
  }
  .bench-meta,
  .bench-info,
  .bench-bits {
    font-size: 0.82rem;
  }
  .preview-lightbox-close {
    min-height: 38px;
    padding: 7px 10px;
  }
}

/* Mini phones (e.g. 360~379dp class) */
@media (max-width: 379px) {
  .top p,
  .tiny {
    font-size: 0.86rem;
    line-height: 1.5;
  }
  .panel h2 {
    font-size: 1.02rem;
    font-weight: 800;
  }
  .panel h3 {
    font-size: 0.92rem;
    font-weight: 700;
  }
  .box {
    font-size: 0.92rem;
    line-height: 1.64;
  }
  .stats > div {
    padding: 10px;
  }
  .stats strong {
    font-size: 0.92rem;
  }
  .row > button {
    font-size: 0.92rem;
    min-height: 44px;
    padding: 9px 9px;
  }
  #stageRun #runPrimaryRow {
    padding: 6px;
  }
  #stageRun .ops-chart {
    height: 198px;
  }
  label {
    gap: 5px;
    padding: 8px;
  }
  input, select, button {
    font-size: 0.93rem;
  }
  .phone-preview-item { width: 100%; max-width: 100%; }
  .phone-preview-canvas {
    height: 160px;
  }
  .run-mobile-dock {
    padding: 7px 8px;
    border-radius: 12px;
  }
  .run-mobile-dock-label {
    font-size: 0.72rem;
  }
  .run-mobile-dock strong {
    font-size: 0.79rem;
  }
  .run-mobile-dock-meta,
  .run-mobile-dock-action {
    font-size: 0.75rem;
  }
  .preview-color-control {
    min-width: 116px;
    max-width: 126px;
    height: 28px;
    padding: 0 8px;
  }
}

/* Standard phones (e.g. iPhone 12/13/14/15, 390~430dp class) */
@media (min-width: 380px) and (max-width: 430px) {
  .top p,
  .tiny {
    font-size: 0.88rem;
  }
  .box {
    font-size: 0.94rem;
    line-height: 1.68;
  }
  .row > button {
    font-size: 0.95rem;
    min-height: 44px;
  }
  .phone-preview-item { width: 100%; max-width: 100%; }
  .phone-preview-canvas {
    height: 168px;
  }
}

/* Large phones (e.g. 431~760px) */
@media (min-width: 431px) and (max-width: 760px) {
  .top p,
  .tiny {
    font-size: 0.9rem;
  }
  .box {
    font-size: 0.96rem;
    line-height: 1.7;
  }
  .row > button {
    flex: 1 1 calc(50% - 10px);
    min-height: 42px;
  }
  .phone-preview-item { width: 100%; max-width: 360px; margin-inline: auto; }
  .phone-preview-canvas {
    height: 182px;
  }
  .design-health-box {
    min-height: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
