/* ========== Calculator Page ========== */
.page-header-simple {
  margin-bottom: 28px;
}

.page-header-desc {
  color: var(--color-text-muted);
  margin-top: 8px;
  font-size: 15px;
}

.calc-wrapper {
  --calc-info: var(--color-accent-secondary);
  --calc-new: var(--color-accent-warning);
  margin-bottom: 40px;
}

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

.setup-panel,
.visual-section,
.empty-state {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--color-bg-card), var(--color-bg-secondary));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 30px rgba(0, 0, 0, 0.18);
}

.setup-panel {
  padding: 20px 18px 18px;
}

.setup-panel::before,
.visual-section::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-text-muted);
  box-shadow: 11px 0 0 var(--color-text-muted);
  opacity: 0.55;
}

.setup-old {
  border-bottom: 4px solid var(--calc-info);
}

.setup-next {
  border-bottom: 4px solid var(--calc-new);
}

.panel-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-kicker,
.section-kicker {
  display: block;
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.panel-title,
.section-title {
  display: block;
  margin-top: 4px;
  color: var(--color-text-primary);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.setup-panel .panel-kicker {
  color: var(--calc-info);
}

.setup-next .panel-kicker {
  color: var(--calc-new);
}

.field {
  min-width: 0;
}

.spec-field {
  margin-top: 18px;
}

.spec-picker-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.spec-picker-shell {
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 104px;
  padding: 12px;
  border: 1px solid rgba(125, 165, 184, 0.5);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(125, 165, 184, 0.16), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), var(--color-bg-card));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -10px 24px rgba(0, 0, 0, 0.12), 0 8px 18px rgba(0, 0, 0, 0.14);
  transition: border-color 120ms ease, transform 120ms ease;
}

.spec-picker-shell:hover,
.spec-picker-trigger:focus-visible .spec-picker-shell,
.spec-input-shell:focus-within {
  border-color: var(--color-accent);
}

.spec-picker-trigger:focus-visible {
  outline: none;
}

.spec-picker-shell::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--calc-info), rgba(125, 165, 184, 0.18));
  box-shadow: 0 0 12px rgba(125, 165, 184, 0.32);
}

.setup-next .spec-picker-shell {
  border-color: rgba(255, 122, 47, 0.54);
  background:
    linear-gradient(135deg, rgba(255, 122, 47, 0.15), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), var(--color-bg-card));
}

.setup-next .spec-picker-shell::before {
  background: linear-gradient(180deg, var(--calc-new), rgba(255, 122, 47, 0.18));
  box-shadow: 0 0 12px rgba(255, 122, 47, 0.32);
}

.spec-segments {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px minmax(0, 1fr) 8px minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
}

.spec-segment {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 8px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.spec-segment-label {
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.spec-segment-value {
  max-width: 100%;
  color: var(--color-text-primary);
  font-size: 32px;
  font-weight: 900;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spec-segment-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  outline: none;
}

.spec-segment-input:focus {
  color: var(--color-accent);
}

.spec-segment-input::placeholder {
  color: var(--color-text-faint);
}

.setup-next .spec-segment-value {
  color: #ffad70;
}

.setup-next .spec-segment-input,
.setup-next .spec-segment-input:focus {
  color: #ffad70;
}

.spec-divider {
  width: 8px;
  min-height: 76px;
  background: linear-gradient(180deg, transparent, rgba(125, 165, 184, 0.42), transparent) center / 1px 100% no-repeat;
}

.setup-next .spec-divider {
  background: linear-gradient(180deg, transparent, rgba(255, 122, 47, 0.42), transparent) center / 1px 100% no-repeat;
}

.picker-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(125, 165, 184, 0.46);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.16);
  transform: translateY(-50%);
}

.picker-chevron::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-right: 3px solid var(--calc-info);
  border-bottom: 3px solid var(--calc-info);
  transform: rotate(45deg);
}

.setup-next .picker-chevron {
  border-color: rgba(255, 122, 47, 0.52);
}

.setup-next .picker-chevron::after {
  border-color: #ff9a5f;
}

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

.label {
  display: block;
  margin-bottom: 8px;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.input {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-input);
  color: var(--color-text-primary);
  font-size: 18px;
  font-weight: 800;
}

.input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.visual-section,
.empty-state {
  margin-top: 18px;
  padding: 24px 20px 20px;
}

.visual-section[hidden],
.empty-state[hidden],
.spec-picker-mask[hidden] {
  display: none;
}

.tire-section {
  overflow: hidden;
}

.tire-section .section-head {
  position: relative;
  align-items: center;
  min-height: 58px;
}

.section-note {
  flex: 0 1 auto;
}

.tire-view-tabs,
.rear-metric-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
  height: 42px;
  padding: 5px;
  border: 1px solid var(--color-border-accent);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.1));
}

.tire-view-tab,
.rear-metric-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 30px;
  min-width: 58px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.tire-view-tab-active {
  border-color: rgba(255, 203, 120, 0.42);
  background: linear-gradient(135deg, rgba(255, 173, 112, 0.92), rgba(255, 122, 47, 0.88));
  color: #fff7ed;
}

.rear-metric-tab-active {
  border-color: var(--color-border-accent);
  background: var(--color-accent-glow);
  color: var(--color-accent);
}

.tire-visual {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  min-height: 252px;
  margin-top: 64px;
  margin-bottom: 12px;
  gap: 16px;
}

.tire-visual::before {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  top: 206px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
  z-index: 0;
}

.compare-swap-dock {
  position: absolute;
  left: 50%;
  top: 103px;
  z-index: 7;
  transform: translate(-50%, -50%);
}

.setup-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: rgba(255, 198, 41, 0.86);
  font-size: 28px;
  font-weight: 800;
  cursor: pointer;
}

.tire-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 206px auto;
  align-items: center;
  justify-items: center;
  min-height: 252px;
}

.tire-overhang-tag {
  position: absolute;
  left: 50%;
  top: -34px;
  z-index: 5;
  max-width: 250px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
}

.tire-side-label {
  position: absolute;
  top: 88px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 42px;
  height: 34px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 14px;
  font-weight: 900;
  pointer-events: none;
}

.tire-side-label-old {
  left: 0;
}

.tire-side-label-new {
  right: 0;
}

.tire-stage {
  position: relative;
  grid-row: 1;
  display: flex;
  align-items: center;
  align-self: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  min-width: 152px;
  min-height: 152px;
  max-width: 206px;
  max-height: 206px;
}

.tire {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 152px;
  min-height: 152px;
  max-width: 206px;
  max-height: 206px;
  border: 18px solid #07090c;
  border-radius: 50%;
  background: #0d1117;
}

.tire-thickness {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 3deg, rgba(255, 255, 255, 0.08) 0 3deg, transparent 3deg 10deg), radial-gradient(circle, transparent 0 58%, rgba(0, 0, 0, 0.38) 59% 100%);
  opacity: 0.42;
}

.rim {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  aspect-ratio: 1 / 1;
  border: 5px solid #e8edf1;
  border-radius: 50%;
  background: radial-gradient(circle, #202832 0 18%, transparent 19% 42%, rgba(220, 228, 235, 0.26) 43% 48%, transparent 49%), #080c10;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.08), inset 0 0 0 9px rgba(28, 34, 42, 0.3), inset 0 0 18px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}

.rim-spoke {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 45%;
  margin-left: -4.5px;
  margin-top: -4px;
  border-radius: 999px 999px 7px 7px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.22)), linear-gradient(180deg, #f8fbfd 0%, #b8c2ca 48%, #687480 100%);
  transform-origin: 50% 4px;
}

.spoke-vertical { transform: rotate(0deg); }
.spoke-horizontal { transform: rotate(72deg); }
.spoke-diagonal-a { transform: rotate(144deg); }
.spoke-diagonal-b { transform: rotate(216deg); }
.spoke-five { transform: rotate(288deg); }

.rim-hub {
  position: relative;
  z-index: 2;
  width: 24%;
  height: 24%;
  border: 4px solid #dfe6ec;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-border) 0 38%, #151b22 40% 100%);
}

.bottom-diameter-guide {
  position: relative;
  grid-row: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
  width: 206px;
  max-width: 100%;
  height: 38px;
  margin-top: 22px;
  color: currentColor;
}

.bottom-diameter-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 2px;
  background: currentColor;
  opacity: 0.58;
}

.bottom-diameter-tick {
  position: absolute;
  top: 0;
  width: 2px;
  height: 14px;
  background: currentColor;
  opacity: 0.58;
}

.bottom-diameter-tick-left { left: 0; }
.bottom-diameter-tick-right { right: 0; }

.bottom-diameter-value {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 16px;
  padding: 0 7px;
  color: currentColor;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.18;
  text-align: center;
  white-space: nowrap;
}

.old-text {
  color: #a9cad9;
}

.new-text {
  color: #ffad70;
}

.side-ride-height-guide {
  position: absolute;
  z-index: 4;
  width: 54px;
  color: var(--color-accent);
  pointer-events: none;
  transform: translateX(-50%);
}

.side-ride-height-guide.delta-positive,
.metric-value.delta-positive,
.offset-guide-value.delta-positive,
.tire-height-delta.delta-positive {
  color: var(--color-accent-danger);
}

.side-ride-height-guide.delta-negative,
.metric-value.delta-negative,
.offset-guide-value.delta-negative,
.tire-height-delta.delta-negative {
  color: var(--color-accent-success);
}

.side-ride-height-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: currentColor;
  opacity: 0.62;
  transform: translateX(-50%);
}

.side-ride-height-tick {
  position: absolute;
  left: 50%;
  width: 34px;
  height: 2px;
  background: currentColor;
  opacity: 0.62;
  transform: translateX(-50%);
}

.side-ride-height-tick-top { top: 0; }
.side-ride-height-tick-bottom { bottom: -3px; }

.side-ride-height-value {
  position: absolute;
  bottom: 4px;
  padding: 3px 8px;
  color: currentColor;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.12;
  white-space: nowrap;
}

.side-ride-height-old .side-ride-height-value {
  left: 92px;
}

.side-ride-height-next .side-ride-height-value {
  right: 92px;
}

.rear-stage {
  position: relative;
  height: 450px;
  margin-top: 18px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 198, 41, 0.08) 1px, transparent 1px), linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), radial-gradient(circle at 50% 55%, rgba(255, 122, 47, 0.12), transparent 38%), var(--color-bg-primary);
  background-size: 28px 28px, 28px 28px, auto, auto;
  overflow: hidden;
}

.rear-wheel-area {
  position: absolute;
  left: 50%;
  top: 82px;
  width: 360px;
  height: 294px;
  margin-left: -152px;
  z-index: 4;
}

.rear-metric-tabs {
  position: absolute;
  left: 43%;
  top: -70px;
  z-index: 14;
  height: 40px;
  transform: translateX(-50%);
}

.simple-suspension {
  position: absolute;
  left: 0;
  top: 0;
  width: 360px;
  height: 294px;
  z-index: 10;
  pointer-events: none;
}

.shock-absorber {
  position: absolute;
  left: -62px;
  top: 14px;
  width: 52px;
  height: 238px;
  transform: rotate(4deg);
  transform-origin: center bottom;
}

.shock-rod {
  position: absolute;
  left: 23px;
  top: 0;
  width: 7px;
  height: 238px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f2f5f7, #7d8792);
}

.shock-body {
  position: absolute;
  left: 16px;
  top: 102px;
  width: 21px;
  height: 96px;
  border-radius: 14px;
  background: linear-gradient(90deg, #8f9aa5, #d8dee3 42%, #606b76);
}

.shock-spring {
  position: absolute;
  left: 3px;
  width: 46px;
  height: 20px;
  border: 5px solid var(--color-accent);
  border-right: 0;
  border-left: 0;
  border-radius: 50%;
}

.spring-a { top: 46px; }
.spring-b { top: 78px; }
.spring-c { top: 110px; }

.shock-cap {
  position: absolute;
  left: 11px;
  width: 30px;
  height: 12px;
  border-radius: 10px;
  background: #707b86;
}

.cap-top { top: 30px; }
.cap-bottom { top: 202px; }

.simple-arm {
  position: absolute;
  left: -42px;
  width: 234px;
  height: 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, #7b8793, #c0c8cf);
  transform-origin: left center;
}

.arm-upper {
  top: 110px;
  transform: rotate(19deg);
}

.arm-lower {
  top: 194px;
  transform: rotate(-19deg);
}

.simple-knuckle {
  position: absolute;
  left: 162px;
  top: 118px;
  width: 36px;
  height: 78px;
  border-radius: 16px;
  background: linear-gradient(180deg, #a6b0ba, #4e5964);
}

.hub-mount {
  position: absolute;
  left: 166px;
  top: 146px;
  width: 28px;
  height: 28px;
  box-sizing: border-box;
  border: 5px solid var(--color-accent);
  border-radius: 50%;
  background: var(--color-bg-primary);
}

.rear-tire {
  position: absolute;
  border-radius: 34px;
  border: 5px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.18), inset 0 0 22px rgba(0, 0, 0, 0.2);
}

.rear-tire-wheel {
  border-radius: 0;
}

.old-rear {
  z-index: 3;
  border-color: rgba(169, 202, 217, 0.58);
  background: linear-gradient(90deg, rgba(125, 165, 184, 0.1), rgba(125, 165, 184, 0.24), rgba(125, 165, 184, 0.1));
}

.new-rear {
  z-index: 4;
  border-color: rgba(255, 173, 112, 0.68);
  background: linear-gradient(90deg, rgba(255, 122, 47, 0.12), rgba(255, 122, 47, 0.25), rgba(255, 122, 47, 0.12));
}

.center-line {
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 3px;
  transform: translateX(-50%);
  background: rgba(255, 198, 41, 0.58);
  z-index: 12;
}

.offset-diff-guide {
  position: absolute;
  top: 294px;
  height: 34px;
  z-index: 13;
}

.offset-guide-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 16px;
  height: 3px;
  background: var(--color-accent);
}

.offset-guide-tick {
  position: absolute;
  top: 0;
  width: 3px;
  height: 32px;
  background: var(--color-accent);
}

.tick-start { left: 0; }
.tick-end { right: 0; }

.offset-guide-value {
  position: absolute;
  padding: 4px 8px;
  border: 1px solid var(--color-border-accent);
  border-radius: 6px;
  background: var(--color-bg-input);
  color: var(--color-accent);
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  z-index: 14;
}

.inner-guide-value {
  left: -28px;
  top: 324px;
}

.outer-guide-value {
  right: -28px;
  top: 324px;
  text-align: right;
}

.tire-height-guide {
  position: absolute;
  z-index: 13;
  width: 34px;
  min-height: 2px;
}

.tire-height-guide-line {
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-accent);
}

.tire-height-guide .tick-start,
.tire-height-guide .tick-end {
  left: 1px;
  width: 32px;
  height: 3px;
}

.tire-height-guide .tick-start { top: 0; }
.tire-height-guide .tick-end { bottom: 0; top: auto; }

.tire-height-delta {
  left: 42px;
  top: 50%;
  transform: translateY(-50%);
}

.replacement-advice {
  border-color: rgba(120, 140, 164, 0.24);
}

.replacement-advice-caution {
  border-color: rgba(255, 198, 41, 0.36);
}

.replacement-advice-danger {
  border-color: rgba(255, 95, 86, 0.38);
}

.advice-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  margin-top: 16px;
  padding: 18px 20px 18px 18px;
  border: 1px solid rgba(111, 132, 156, 0.32);
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(159, 178, 191, 0.1), transparent 52%), var(--color-bg-input);
}

.advice-banner-ok {
  border-color: rgba(72, 209, 122, 0.34);
  background: linear-gradient(90deg, rgba(72, 209, 122, 0.14), transparent 52%), var(--color-bg-input);
}

.advice-banner-caution {
  border-color: rgba(255, 198, 41, 0.38);
  background: linear-gradient(90deg, rgba(255, 198, 41, 0.16), transparent 52%), var(--color-bg-input);
}

.advice-banner-danger {
  border-color: rgba(255, 95, 86, 0.4);
  background: linear-gradient(90deg, rgba(255, 95, 86, 0.16), transparent 52%), var(--color-bg-input);
}

.advice-banner-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(159, 178, 191, 0.42);
  border-radius: 50%;
  box-sizing: border-box;
}

.advice-banner-ok .advice-banner-icon {
  border-color: var(--color-accent-success);
  background: var(--color-accent-success);
}

.advice-banner-caution .advice-banner-icon {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.advice-banner-danger .advice-banner-icon {
  border-color: var(--color-accent-danger);
  background: var(--color-accent-danger);
}

.advice-summary {
  display: block;
  color: var(--color-text-primary);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

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

.advice-card {
  display: flex;
  min-width: 0;
  min-height: 118px;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  text-align: left;
}

.advice-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.advice-card-title {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.advice-card-status {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 800;
}

.advice-card-value {
  color: var(--color-text-primary);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.advice-card-value-text {
  font-size: 22px;
}

.advice-card-standard {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.advice-card-ok {
  border-color: rgba(72, 209, 122, 0.24);
}

.advice-card-caution {
  border-color: rgba(255, 198, 41, 0.32);
}

.advice-card-danger {
  border-color: rgba(255, 95, 86, 0.36);
}

.advice-card-ok .advice-card-status,
.advice-card-ok .advice-card-value {
  color: var(--color-accent-success);
}

.advice-card-caution .advice-card-status,
.advice-card-caution .advice-card-value {
  color: var(--color-accent);
}

.advice-card-danger .advice-card-status,
.advice-card-danger .advice-card-value {
  color: var(--color-accent-danger);
}

.spec-picker-mask {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  background: var(--color-bg-overlay);
}

.spec-picker-drawer {
  box-sizing: border-box;
  width: 100%;
  max-height: min(680px, 92vh);
  padding: 0 20px 24px;
  border-top: 1px solid var(--color-border-accent);
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, var(--color-bg-elevated), var(--color-bg-primary) 68%, var(--color-bg-input));
  box-shadow: 0 -18px 38px rgba(0, 0, 0, 0.38);
}

.spec-picker-topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 0 132px;
  border-bottom: 1px solid var(--color-border-light);
}

.spec-picker-action {
  position: absolute;
  top: 50%;
  width: 116px;
  height: 56px;
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 800;
  line-height: 56px;
  cursor: pointer;
  transform: translateY(-50%);
}

.spec-picker-action.muted {
  left: 14px;
  color: var(--color-text-secondary);
  text-align: left;
}

.spec-picker-action.confirm {
  right: 14px;
  color: var(--color-accent);
  text-align: right;
}

.spec-picker-title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.spec-picker-title span:first-child {
  max-width: 100%;
  color: var(--color-text-primary);
  font-size: 18px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spec-picker-title span:last-child {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 700;
}

.spec-picker-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 12px;
}

.spec-picker-readout div {
  display: flex;
  min-height: 74px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.spec-picker-readout span:first-child {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.spec-picker-readout-value {
  color: var(--color-text-primary);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.setup-next .spec-picker-readout-value {
  color: #ffad70;
}

.spec-picker-view {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg-card);
}

.spec-picker-column {
  width: 100%;
  min-height: 220px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-input);
  color: var(--color-text-primary);
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--color-text-secondary);
}

.empty-title {
  color: var(--color-text-primary);
  font-size: 18px;
  font-weight: 800;
}

.empty-copy {
  color: var(--color-text-muted);
  font-size: 14px;
}

.miniapp-guide {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--color-border-accent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--color-accent-glow), transparent 48%),
    linear-gradient(180deg, var(--color-bg-card), var(--color-bg-secondary));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 26px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.miniapp-guide:hover,
.miniapp-guide:focus-visible {
  border-color: var(--color-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 30px rgba(0, 0, 0, 0.2);
  outline: none;
  transform: translateY(-1px);
}

.miniapp-guide img {
  flex: 0 0 auto;
  width: 112px;
  height: 112px;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.miniapp-guide-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.miniapp-guide-kicker {
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.miniapp-guide-title {
  color: var(--color-text-primary);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.miniapp-guide-text {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.miniapp-guide-top {
  box-sizing: border-box;
  width: 100%;
  margin: -10px 0 24px;
  padding: 16px 22px;
}

.miniapp-guide-top img {
  width: 92px;
  height: 92px;
}

.miniapp-guide-top .miniapp-guide-title {
  font-size: 18px;
}

.miniapp-guide-top .miniapp-guide-text {
  font-size: 13px;
}

.miniapp-modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--color-bg-overlay);
}

.miniapp-modal-mask[hidden] {
  display: none;
}

.miniapp-modal {
  position: relative;
  display: flex;
  box-sizing: border-box;
  width: min(390px, 100%);
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 24px 24px;
  border: 1px solid var(--color-border-accent);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--color-bg-elevated), var(--color-bg-primary));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.miniapp-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-bg-input);
  color: var(--color-text-secondary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.miniapp-modal-close:hover,
.miniapp-modal-close:focus-visible {
  border-color: var(--color-accent);
  color: var(--color-accent);
  outline: none;
}

.miniapp-modal-kicker {
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.miniapp-modal-title {
  color: var(--color-text-primary);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
}

.miniapp-modal img {
  width: min(280px, 76vw);
  height: min(280px, 76vw);
  margin: 8px 0 4px;
  border: 1px solid var(--color-border-light);
  border-radius: 10px;
  background: #fff;
  object-fit: cover;
}

.miniapp-modal-text {
  max-width: 280px;
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

html[data-theme="light"] .setup-panel,
html[data-theme="light"] .visual-section,
html[data-theme="light"] .empty-state {
  background: linear-gradient(180deg, #ffffff, var(--color-bg-secondary));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 12px 30px rgba(120, 94, 51, 0.1);
}

html[data-theme="light"] .spec-picker-shell {
  background:
    linear-gradient(135deg, rgba(76, 127, 150, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), var(--color-bg-card));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -10px 22px rgba(117, 95, 52, 0.05), 0 8px 18px rgba(120, 94, 51, 0.08);
}

html[data-theme="light"] .setup-next .spec-picker-shell {
  background:
    linear-gradient(135deg, rgba(215, 96, 27, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), var(--color-bg-card));
}

html[data-theme="light"] .spec-segment,
html[data-theme="light"] .picker-chevron,
html[data-theme="light"] .spec-picker-readout div {
  border-color: rgba(79, 66, 43, 0.08);
  background: rgba(255, 250, 240, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .spec-segment-value,
html[data-theme="light"] .spec-segment-input {
  color: var(--color-text-primary);
}

html[data-theme="light"] .setup-next .spec-segment-value,
html[data-theme="light"] .setup-next .spec-segment-input,
html[data-theme="light"] .setup-next .spec-picker-readout-value {
  color: var(--color-accent-warning);
}

html[data-theme="light"] .input,
html[data-theme="light"] .spec-picker-column,
html[data-theme="light"] .offset-guide-value {
  background: #fffdf8;
}

html[data-theme="light"] .tire-overhang-tag,
html[data-theme="light"] .tire-side-label {
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 6px 16px rgba(120, 94, 51, 0.08);
}

html[data-theme="light"] .tire-visual::before {
  background: linear-gradient(90deg, transparent, rgba(79, 66, 43, 0.18), transparent);
}

html[data-theme="light"] .rear-stage {
  background:
    linear-gradient(90deg, rgba(199, 137, 0, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(79, 66, 43, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 50% 55%, rgba(215, 96, 27, 0.1), transparent 38%),
    #fffdf8;
}

html[data-theme="light"] .hub-mount {
  background: #fffdf8;
}

html[data-theme="light"] .advice-banner {
  background: linear-gradient(90deg, rgba(116, 128, 142, 0.09), transparent 52%), #fffdf8;
}

html[data-theme="light"] .advice-banner-ok {
  background: linear-gradient(90deg, rgba(38, 141, 85, 0.1), transparent 52%), #fffdf8;
}

html[data-theme="light"] .advice-banner-caution {
  background: linear-gradient(90deg, rgba(199, 137, 0, 0.13), transparent 52%), #fffdf8;
}

html[data-theme="light"] .advice-banner-danger {
  background: linear-gradient(90deg, rgba(202, 62, 53, 0.12), transparent 52%), #fffdf8;
}

html[data-theme="light"] .advice-card {
  background: rgba(255, 253, 248, 0.68);
}

html[data-theme="light"] .advice-card-status {
  background: rgba(79, 66, 43, 0.06);
}

html[data-theme="light"] .spec-picker-drawer {
  background: linear-gradient(180deg, #ffffff, var(--color-bg-primary) 68%, #fffdf8);
  box-shadow: 0 -18px 38px rgba(90, 68, 34, 0.16);
}

html[data-theme="light"] .spec-picker-view {
  background: #ffffff;
}

html[data-theme="light"] .miniapp-guide {
  background:
    linear-gradient(135deg, rgba(199, 137, 0, 0.1), transparent 48%),
    linear-gradient(180deg, #ffffff, var(--color-bg-secondary));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 26px rgba(120, 94, 51, 0.1);
}

html[data-theme="light"] .miniapp-modal {
  background: linear-gradient(180deg, #ffffff, var(--color-bg-primary));
  box-shadow: 0 24px 60px rgba(90, 68, 34, 0.2);
}

/* ========== Existing Reference Section ========== */
.calc-ref-section {
  margin-bottom: 40px;
}

@media (max-width: 1100px) {
  .advice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .page-header-simple {
    margin-bottom: 20px;
  }

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

  .setup-panel {
    padding: 14px 10px 12px;
    overflow: visible;
  }

  .panel-title {
    font-size: 16px;
  }

  .panel-kicker {
    font-size: 10px;
  }

  .spec-picker-shell {
    min-height: 82px;
    padding: 8px;
  }

  .spec-segments {
    grid-template-columns: minmax(0, 1fr) 4px minmax(0, 1fr) 4px minmax(0, 1.08fr);
  }

  .spec-segment {
    min-height: 62px;
    padding: 6px 3px;
    gap: 3px;
  }

  .spec-segment-label {
    font-size: 9px;
  }

  .spec-segment-value,
  .spec-segment-input {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    overflow: visible;
    text-overflow: clip;
  }

  .picker-chevron {
    right: -6px;
    top: -6px;
    width: 18px;
    height: 18px;
    opacity: 0.86;
    transform: none;
  }

  .picker-chevron::after {
    left: 5px;
    top: 4px;
    width: 5px;
    height: 5px;
    border-width: 0 2px 2px 0;
  }

  .mini-fields {
    gap: 7px;
    margin-top: 10px;
  }

  .label {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .input {
    height: 36px;
    padding: 0 8px;
    font-size: 15px;
  }

  .visual-section,
  .empty-state {
    margin-top: 14px;
    padding: 18px 12px 16px;
  }

  .section-title {
    font-size: 18px;
  }

  .tire-section .section-head {
    min-height: auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
  }

  .tire-view-tabs {
    align-self: stretch;
    width: 100%;
    height: 38px;
    padding: 4px;
  }

  .tire-view-tab {
    min-width: 48px;
    padding: 0 8px;
    font-size: 12px;
  }

  .tire-visual {
    min-height: calc(var(--side-stage-size) + 82px);
    margin-top: 50px;
    gap: 0;
  }

  .tire-visual::before {
    left: 18px;
    right: 18px;
    top: var(--side-ground-top);
  }

  .compare-swap-dock {
    top: var(--side-swap-top);
  }

  .setup-swap {
    width: 44px;
    height: 34px;
    font-size: 22px;
  }

  .tire-wrap {
    grid-template-rows: var(--side-stage-size) auto;
    min-height: calc(var(--side-stage-size) + 82px);
    overflow: visible;
  }

  .tire-stage {
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    transform: none;
  }

  .tire {
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    border-width: 13px;
  }

  .tire-thickness {
    inset: -11px;
  }

  .rim {
    border-width: 4px;
  }

  .tire-side-label {
    top: var(--side-label-top);
    width: 32px;
    height: 26px;
    font-size: 12px;
  }

  .tire-side-label-old {
    left: -8px;
  }

  .tire-side-label-new {
    right: -8px;
  }

  .tire-overhang-tag {
    top: -28px;
    max-width: 148px;
    font-size: 11px;
  }

  .bottom-diameter-guide {
    height: 42px;
    margin-top: 22px;
  }

  .bottom-diameter-line {
    top: 7px;
  }

  .bottom-diameter-value {
    margin-top: 16px;
    white-space: nowrap;
  }

  .bottom-diameter-value,
  .side-ride-height-value,
  .offset-guide-value {
    font-size: 10px;
  }

  .rear-stage {
    height: 390px;
    margin-left: -6px;
    margin-right: -6px;
  }

  .rear-wheel-area {
    transform: scale(0.86);
    transform-origin: top center;
  }

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

  .advice-card {
    min-height: 110px;
    padding: 12px 10px;
  }

  .advice-card-value {
    font-size: 19px;
  }

  .advice-card-title,
  .advice-card-standard {
    font-size: 11px;
  }

  .advice-card-status {
    font-size: 10px;
  }

  .spec-picker-drawer {
    padding: 0 14px 18px;
  }

  .spec-picker-topbar {
    min-height: 76px;
    padding: 0 78px;
  }

  .spec-picker-action {
    width: 70px;
    font-size: 16px;
  }

  .spec-picker-view {
    gap: 8px;
    padding: 10px;
  }

  .spec-picker-column {
    min-height: 190px;
    padding: 8px 4px;
    font-size: 18px;
  }

  .miniapp-guide {
    gap: 14px;
    padding: 14px;
  }

  .miniapp-guide-top {
    margin: -6px 0 20px;
  }

  .miniapp-guide img {
    width: 92px;
    height: 92px;
  }

  .miniapp-guide-title {
    font-size: 17px;
  }

  .miniapp-guide-text {
    font-size: 13px;
  }
}

@media (max-width: 430px) {
  .setup-grid {
    gap: 8px;
  }

  .setup-panel {
    padding: 13px 8px 11px;
  }

  .panel-title {
    font-size: 15px;
  }

  .spec-picker-shell {
    min-height: 74px;
    padding: 7px;
  }

  .spec-segment {
    min-height: 56px;
    padding: 5px 2px;
  }

  .spec-segment-label {
    font-size: 8px;
  }

  .spec-segment-value,
  .spec-segment-input {
    font-size: 16px;
  }

  .input {
    height: 34px;
    font-size: 14px;
  }

  .tire-section .section-head {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
  }

  .tire-view-tabs {
    align-self: stretch;
    width: 100%;
  }

  .tire-stage {
    transform: none;
  }

  .tire-overhang-tag {
    max-width: 118px;
  }

  .tire-visual {
    min-height: calc(var(--side-stage-size) + 78px);
    margin-top: 46px;
  }

  .tire-wrap {
    grid-template-rows: var(--side-stage-size) auto;
    min-height: calc(var(--side-stage-size) + 78px);
  }

  .bottom-diameter-value {
    font-size: 9px;
    padding: 0 3px;
  }

  .bottom-diameter-guide {
    height: 38px;
  }

  .tire-side-label {
    width: 30px;
    height: 24px;
  }

  .tire {
    border-width: 11px;
  }

  .tire-thickness {
    inset: -9px;
  }

  .rim {
    border-width: 3px;
  }

  .rear-stage {
    height: 360px;
  }

  .rear-wheel-area {
    transform: scale(0.76);
  }

  .inner-guide-value {
    left: 0;
  }

  .outer-guide-value {
    right: 0;
  }

  .advice-banner {
    padding: 14px 12px;
  }

  .advice-summary {
    font-size: 13px;
  }

  .spec-picker-readout-value {
    font-size: 22px;
  }

  .miniapp-guide {
    align-items: flex-start;
  }

  .miniapp-guide-top {
    margin-top: -4px;
  }

  .miniapp-guide img {
    width: 82px;
    height: 82px;
  }

  .miniapp-guide-kicker {
    font-size: 10px;
  }

  .miniapp-guide-title {
    font-size: 15px;
  }
}
