:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --text: #111318;
  --muted: #3d4553;
  --border: #c5ccd6;
  --primary: #0b6e4f;
  --primary-text: #ffffff;
  --hold: #0891b2;
  --watch: #6d28d9;
  --send: #0b6e4f;
  --keep: var(--hold);
  --skip: #4a5568;
  --danger: #b42318;
  --focus: #0b6e4f;
  --shadow: 0 2px 8px rgba(17, 19, 24, 0.12);
  --radius: 14px;
  --tap: 56px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    linear-gradient(180deg, #f7f9fb 0%, #e8edf2 100%);
}

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 12px 12px 96px;
}

.app-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.header-lists {
  display: flex;
  gap: 8px;
}

.btn-header-list {
  flex: 1;
  min-height: 48px;
  padding: 6px 4px;
  font-size: 0.72rem;
  letter-spacing: -0.01em;
}

.app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  column-gap: 0;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(244, 246, 248, 0.97);
  border-top: 2px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.app-footer .btn {
  box-shadow: none;
  font-weight: 700;
  color: var(--muted);
}

.footer-slot {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

/* Reserved far-left footer slot for Back on every screen (now and future). */
.footer-back-btn.is-idle,
.footer-adv-reset-btn.is-idle {
  visibility: hidden;
  pointer-events: none;
}

.footer-icon-btn {
  width: 100%;
  max-width: 64px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-icon {
  display: block;
}

.footer-advanced-btn.is-active {
  color: var(--primary);
}

.footer-reset-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 10px;
  background: #1f2937;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  z-index: 45;
  box-shadow: var(--shadow);
}

.footer-reset-tip[hidden] {
  display: none !important;
}

.footer-menu {
  position: relative;
}

.footer-menu-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 160px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 40;
}

.footer-menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.footer-menu-item:last-child {
  border-bottom: 0;
}

.footer-menu-item:active,
.footer-menu-item:focus {
  background: #f0f2f5;
}

.orders-new-bar {
  margin-bottom: 12px;
}

.orders-new-bar .btn {
  width: 100%;
}

.orders-new-bar .btn:disabled,
.orders-new-bar .btn.is-disabled {
  opacity: 0.55;
}

.orders-mode-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-mode {
  background: #fff;
  color: var(--muted);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  min-height: 48px;
  font-weight: 800;
}

.btn-mode.is-active {
  background: #ecfdf5;
  color: var(--primary);
  border-color: var(--primary);
}

.orders-search-bar {
  margin-bottom: 12px;
}

.orders-search-bar .input {
  width: 100%;
}

.orders-range-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  align-items: end;
}

.orders-range-bar .btn {
  grid-column: 1 / -1;
}

.orders-date-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 800;
  color: var(--muted);
  font-size: 0.9rem;
}

.orders-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.orders-total-chip {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}

.orders-total-chip .label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 4px;
}

.orders-total-chip .value {
  display: block;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text);
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.order-detail-meta {
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--muted);
}

.order-wheels-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.order-wheels-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 280px;
}

.order-wheels-table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 8px 6px;
  border-bottom: 2px solid var(--border);
}

.order-wheels-table th.od-date,
.order-wheels-table td.od-date {
  text-align: right;
  white-space: nowrap;
}

.order-wheels-table td {
  padding: 8px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.order-wheels-table td.is-empty {
  color: var(--muted);
}

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

.order-wheels-table .od-wa {
  font-weight: 900;
}

.order-wheels-table .od-sub {
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.order-wheels-table .od-remove {
  display: block;
  margin-top: 8px;
  min-height: 40px;
  width: 100%;
  max-width: 140px;
  font-size: 0.9rem;
  padding: 8px 12px;
}

.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.order-card-date {
  font-weight: 900;
  font-size: 1.1rem;
}

.order-card-store {
  font-weight: 800;
  color: var(--muted);
}

.order-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.order-stat .label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}

.order-stat .value {
  display: block;
  font-size: 1.05rem;
  font-weight: 900;
}

.order-paid-yes {
  color: var(--primary);
}

.order-paid-no {
  color: var(--danger);
}

.adv-slider-popup {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 19, 24, 0.35);
  pointer-events: none;
}

.adv-slider-popup[hidden] {
  display: none !important;
}

.adv-slider-popup-card {
  width: min(100%, 560px);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  text-align: center;
}

.adv-slider-popup-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.adv-slider-popup-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 12.5rem;
}

.adv-slider-popup-option {
  width: 100%;
  text-align: center;
  word-break: break-word;
  line-height: 1.12;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.adv-slider-popup-option.is-current {
  font-size: clamp(1.65rem, 6.2vw, 2.4rem);
  font-weight: 900;
  color: var(--text);
  transform: scale(1.02);
}

.adv-slider-popup-option.is-near {
  font-size: clamp(1.05rem, 3.8vw, 1.3rem);
  font-weight: 800;
  color: var(--muted);
  opacity: 0.88;
}

.adv-slider-popup-option.is-mid {
  font-size: clamp(0.95rem, 3.4vw, 1.15rem);
  font-weight: 700;
  color: var(--muted);
  opacity: 0.62;
}

.adv-slider-popup-option.is-far {
  font-size: clamp(0.85rem, 3vw, 1.02rem);
  font-weight: 700;
  color: var(--muted);
  opacity: 0.38;
}

.adv-slider-popup-option.is-empty {
  opacity: 0.12;
}

.adv-filter-panel {
  margin-bottom: 8px;
}

.adv-filter-results {
  margin-top: 8px;
  margin-bottom: 4px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.adv-filter-results:empty {
  display: none;
}

.adv-label,
.adv-field > span {
  display: block;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
  font-size: 1.02rem;
}

.adv-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.adv-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}

.adv-field {
  display: block;
}

.adv-section-make,
.adv-section-diameter,
.adv-section-spokes {
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.adv-section-make {
  background: #e3e7ec;
}

.adv-section-diameter {
  background: #dfe4ea;
}

.adv-section-spokes {
  background: #e9ecef;
}

.adv-select {
  width: 100%;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.adv-size-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.adv-size-col {
  min-width: 0;
}

.adv-size-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 800;
}

.adv-size-value {
  color: var(--primary);
  font-weight: 900;
  font-size: 1.05rem;
  white-space: nowrap;
}

.adv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adv-size-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.adv-size-chips .adv-chip {
  width: 100%;
  min-height: 44px;
  min-width: 0;
  padding: 8px 4px;
  font-size: 0.98rem;
  text-align: center;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}

.adv-size-chips .adv-chip-any {
  font-size: 0.78rem;
  letter-spacing: -0.02em;
}

.adv-chip {
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  min-height: 48px;
  min-width: 56px;
  padding: 10px 14px;
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--text);
  box-shadow: var(--shadow);
}

.adv-chip.is-active {
  background: #ecfdf5;
  border-color: var(--primary);
  color: var(--primary);
}

.adv-half-btn {
  margin-top: 8px;
  width: 100%;
  min-height: 44px;
  border: 2px dashed var(--border);
  background: #f7f9fb;
  border-radius: 12px;
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--muted);
  box-shadow: none;
}

.adv-half-btn.is-active {
  border-style: solid;
  border-color: var(--primary);
  background: #ecfdf5;
  color: var(--primary);
}

.adv-age-chips .adv-chip {
  flex: 1;
  min-width: 0;
}

@media (max-width: 420px) {
  .adv-size-cols {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }

  .adv-size-chips .adv-chip {
    min-height: 40px;
    min-width: 0;
    padding: 6px 4px;
    font-size: 0.92rem;
  }

  .adv-size-chips .adv-chip-any {
    font-size: 0.72rem;
  }
}

.adv-spokes-quick {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 0 10px;
  width: 100%;
}

.adv-spokes-quick .adv-chip {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  justify-content: center;
}

.adv-spokes-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-weight: 800;
}

.adv-spokes-value {
  color: var(--primary);
  font-weight: 900;
  font-size: 1.1rem;
}

.adv-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.adv-slider:focus {
  outline: none;
}

.adv-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: #d7dde6;
  border: 1px solid var(--border);
}

.adv-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -11px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: var(--shadow);
}

.adv-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #d7dde6;
  border: 1px solid var(--border);
}

.adv-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fff;
  box-shadow: var(--shadow);
}

.adv-more {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
}

.adv-more summary {
  font-weight: 900;
  cursor: pointer;
  color: var(--muted);
  list-style: none;
}

.adv-more summary::-webkit-details-marker {
  display: none;
}

.adv-more[open] summary {
  margin-bottom: 10px;
  color: var(--text);
}

.adv-status {
  margin: 0 0 10px;
  font-weight: 800;
  color: var(--muted);
}

body.has-app-footer #app {
  padding-bottom: 88px;
}

body.has-app-footer .toast {
  bottom: 76px;
}

body.has-app-footer .install-banner {
  bottom: 76px;
}

body.has-app-footer.has-install-banner #app {
  padding-bottom: 160px;
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 28px 0 10px;
}

.login-logo {
  display: block;
  width: min(180px, 58%);
  height: auto;
}

.brand {
  margin: 8px 0 8px;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.lede {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.1rem;
  text-align: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input {
  width: 100%;
  min-height: var(--tap);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
}

.input-lg {
  min-height: 60px;
  font-size: 1.35rem;
}

.input:focus {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}

.btn {
  min-height: var(--tap);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(1px);
}

.btn-lg {
  min-height: 64px;
  font-size: 1.35rem;
}

.btn-small {
  min-height: 44px;
  font-size: 0.95rem;
  box-shadow: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}

.btn-keep {
  background: var(--hold);
  color: #fff;
  border-color: var(--hold);
}

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

.btn-list {
  background: #fff;
  color: var(--text);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  flex: 1;
}

.btn-header-watch {
  color: var(--watch);
  border-color: var(--watch);
}

.btn-header-hold {
  color: var(--hold);
  border-color: var(--hold);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.15;
}

.btn-header-send {
  color: var(--send);
  border-color: var(--send);
}

.list-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.header-list-needed {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--hold);
}

.header-list-needed[hidden] {
  display: none !important;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.list-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.list-header h2.title-hold {
  color: var(--hold);
}

.list-header h2.title-watch {
  color: var(--watch);
}

.list-header h2.title-send {
  color: var(--send);
}

.list-store-group {
  margin: 12px 0 6px;
  padding: 6px 2px 4px;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
  border-bottom: 2px solid var(--border);
}

.list-store-group:first-child {
  margin-top: 2px;
}

.list-sub {
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--hold);
}

.list-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-needed-filter {
  background: var(--hold);
  color: #fff;
  border: 2px solid var(--hold);
  box-shadow: var(--shadow);
  min-height: 52px;
  font-weight: 800;
}

.btn-needed-filter.is-active {
  background: #0e7490;
  color: #fff;
  border: 2px solid #0e7490;
  box-shadow: var(--shadow);
}

.list-row-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

#listItems .result-row.result-row-thumb {
  position: relative;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  min-height: 120px;
  cursor: default;
}

#listItems .result-row-thumb > img.list-row-thumb {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 120px;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  background: #f0f2f5;
  cursor: pointer;
}

#listItems .result-row-thumb .list-row-body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px 8px 132px;
}

#listItems .result-row-thumb .list-row-main {
  flex: 1 1 auto;
  min-width: 0;
}

#listItems .result-row-thumb .list-title-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

#listItems .result-row-thumb .list-title-line .result-title {
  flex: 1 1 auto;
  min-width: 0;
}

#listItems .result-row-thumb .list-row-price {
  flex: 0 0 auto;
  margin-top: 0;
  font-weight: 900;
  font-size: 1.05rem;
  text-align: right;
}

#listItems .result-row-thumb .list-row-actions {
  margin-top: auto;
  gap: 6px;
}

#listItems .result-row-thumb .list-row-actions .btn {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.85rem;
  flex: 1;
  box-shadow: none;
}

#listItems .list-needed-now {
  color: #b42318;
  font-weight: 900;
}

.list-row-actions .btn {
  min-height: 44px;
  flex: 1;
  box-shadow: none;
}

.btn-skip {
  background: #d7dde6;
  color: var(--skip);
}

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

.btn-ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border-color: var(--border);
}

.btn-clear {
  background: #ffe8a3;
  color: #5c4300;
  min-width: 56px;
  padding-left: 0;
  padding-right: 0;
  font-size: 1.75rem;
  line-height: 1;
  font-weight: 700;
}

.btn-toast {
  background: #111318;
  color: #fff;
  min-height: 44px;
  box-shadow: none;
}

.hint {
  color: var(--danger);
  font-weight: 700;
}

.login-request {
  margin-top: 18px;
  text-align: center;
}

.login-request a {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.05rem;
}

.search-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
  align-items: stretch;
  padding: 6px;
  border: 3px solid transparent;
  border-radius: calc(var(--radius) + 8px);
}

.search-bar:focus-within {
  border-color: var(--primary);
  background: rgba(11, 110, 79, 0.10);
}

.search-bar:focus-within:has(#searchInput:placeholder-shown) {
  animation: search-bar-flash 0.85s ease-in-out infinite;
}

@keyframes search-bar-flash {
  0%, 100% {
    border-color: var(--primary);
    background: rgba(11, 110, 79, 0.06);
    box-shadow: 0 0 0 0 rgba(11, 110, 79, 0.12);
  }
  50% {
    border-color: #0d8a62;
    background: rgba(11, 110, 79, 0.30);
    box-shadow: 0 0 0 6px rgba(11, 110, 79, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-bar:focus-within:has(#searchInput:placeholder-shown) {
    animation: none;
  }
}

.btn-scan {
  min-width: 56px;
  padding-left: 10px;
  padding-right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.btn-scan .scan-icon {
  display: block;
}

#searchInput:focus {
  outline-color: var(--primary);
  border-color: var(--primary);
}

#searchInput::placeholder {
  font-size: 75%;
}

#searchInput[readonly] {
  caret-color: var(--primary);
}

#searchInput {
  -webkit-user-select: text;
  user-select: text;
}

.btn-clear.is-paste {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.recent {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.recent button {
  border: 2px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-busy-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 16px;
  margin: 8px 0 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}

.action-busy-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid #d5dbe3;
  border-top-color: var(--primary);
  animation: action-busy-spin 0.75s linear infinite;
}

.action-busy-loader-text {
  font-weight: 800;
  color: var(--muted);
}

@keyframes action-busy-spin {
  to {
    transform: rotate(360deg);
  }
}

.result-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 92px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.result-row img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: #f0f2f5;
  flex-shrink: 0;
}

/* Search + Advanced: 2x thumbs; card height matches image. */
#searchResults .result-row,
#variationList .result-row,
#advResults .result-row {
  min-height: 144px;
  height: 144px;
  padding: 0 12px 0 0;
  align-items: center;
  overflow: hidden;
}

#searchResults .result-row img,
#variationList .result-row img,
#advResults .result-row img {
  width: 144px;
  height: 144px;
  border-radius: 12px 0 0 12px;
}

.result-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.result-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.list-help {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.list-help h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 900;
}

.list-help p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
}

.list-help p:last-child {
  margin-bottom: 0;
}

.list-help-hold {
  border-color: var(--hold);
}

.list-help-hold h3 {
  color: var(--hold);
}

.list-help-watch {
  border-color: var(--watch);
}

.list-help-watch h3 {
  color: var(--watch);
}

.list-help-send {
  border-color: var(--send);
}

.list-help-send h3 {
  color: var(--send);
}

.list-data-age {
  font-weight: 700;
  color: #5b6472;
}

.wheel-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.thumb-wrap {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.thumb {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  background: #f0f2f5;
  display: block;
}

.wa {
  font-size: 1.5rem;
  font-weight: 900;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0;
}

.price {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin: 0;
}

.weight {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--muted);
}

.weight[hidden] {
  display: none !important;
}

.size {
  font-size: 2em;
  line-height: 1.15;
  font-weight: 700;
  color: var(--muted);
}

.make-model {
  font-weight: 700;
  color: var(--muted);
}

.wheel-years {
  font-weight: 700;
  color: var(--muted);
}

.wheel-years:empty,
.wheel-years[hidden] {
  display: none !important;
}

.message {
  margin-top: 8px;
  padding: 8px 10px;
  background: #fff3cd;
  border: 2px solid #e6c200;
  border-radius: 10px;
  font-weight: 800;
}

.message.is-we-use {
  padding: 0;
  background: transparent;
  border: 0;
}

.message-we-use-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  background: #fff3cd;
  border: 2px solid #e6c200;
  border-radius: 10px;
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.message-we-use-btn:active {
  transform: scale(0.99);
}

.choose-order-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

.wheel-idents-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.wheel-idents-block,
.wheel-notes-block {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
}

.wheel-idents-block {
  padding-left: 0;
  padding-right: 0;
}

.wheel-idents-block .wheel-meta-label {
  padding-left: 12px;
  padding-right: 12px;
}

.wheel-meta-label {
  font-weight: 900;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.wheel-ident-row,
.wheel-note-row {
  font-weight: 700;
  margin-top: 4px;
  word-break: break-word;
}

.wheel-ident-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
  text-align: left;
  background: #f4f7fb;
  border: 2px solid var(--border);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  color: var(--primary);
  font-size: 1.05em;
  line-height: 1.2;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
}

.wheel-ident-btn:active {
  transform: scale(0.99);
}

.wheel-meta-empty {
  color: var(--muted);
  font-weight: 700;
}

.wheel-need-table {
  margin: 0 0 10px;
}

.wheel-need-table[hidden] {
  display: none !important;
}

.wheel-inv-table {
  margin-bottom: 14px;
  display: grid;
  gap: 10px;
}

.wheel-inv-table[hidden] {
  display: none !important;
}

.wheel-inv-table table {
  width: 100%;
  border-collapse: collapse;
}

.wheel-inv-table th {
  text-align: right;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  padding: 4px 8px;
  border-bottom: 2px solid var(--border);
}

.wheel-inv-table th:first-child {
  text-align: left;
}

.wheel-inv-table td {
  padding: 6px 8px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.wheel-inv-table td.num,
.wheel-inv-table td[align="right"],
.wheel-inv-table td[align=right] {
  text-align: right;
}

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

.scrap-load-need-wrap {
  padding: 4px 6px;
}

.scrap-load-table-wrap {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 12px;
}

.scrap-load-table {
  width: 100%;
  border-collapse: collapse;
}

.scrap-load-need-table {
  font-size: 0.78rem;
}

.scrap-load-table th,
.scrap-load-table td {
  padding: 2px 4px;
  font-weight: 700;
  line-height: 1.2;
}

.scrap-load-table th {
  text-align: right;
  color: var(--muted);
  font-size: 0.72rem;
  padding-bottom: 3px;
}

.scrap-load-table td.num,
.scrap-load-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.kept-note {
  margin-top: 8px;
  font-weight: 700;
  color: var(--hold);
}

#wheelWatchedNote {
  color: var(--watch);
}

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

.store-grid .btn {
  min-height: 72px;
}

.store-grid .btn-send-from-hold {
  grid-column: 1 / -1;
  min-height: 64px;
  font-size: 1.15rem;
}

.send-qty-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 8px;
  align-items: stretch;
}

.send-qty-row .btn-send,
.send-qty-row .btn-send-from-hold {
  grid-column: auto;
  min-height: 64px;
  font-size: 1.05rem;
}

.send-qty-step {
  min-height: 64px;
  min-width: 56px;
  padding: 0;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  background: #fff;
  color: var(--text);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
}

.send-qty-step:disabled {
  opacity: 0.35;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.not-needed {
  grid-column: 1 / -1;
  text-align: center;
  padding: 18px;
  background: #e5e9ef;
  border-radius: var(--radius);
  font-weight: 800;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 16px;
  max-width: 536px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #1b2330;
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 40;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 2.5rem;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
}

.osk {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 12px;
}

.osk-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 6px;
}

.osk-key {
  min-width: 34px;
  min-height: 48px;
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #f7f8fa;
  font-weight: 800;
  font-size: 1.05rem;
}

.osk-key.wide {
  flex: 2.2;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 420px) {
  .wheel-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

.install-coach {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(17, 19, 24, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

.install-card {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  color: var(--text);
  border-radius: 18px 18px 12px 12px;
  padding: 20px 18px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.install-card h2 {
  margin: 0 0 10px;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.2;
}

.install-lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 650;
  font-size: 1.05rem;
}

.install-step-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--primary);
}

.install-steps {
  margin: 0 0 14px;
  padding-left: 1.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  counter-reset: none;
}

.install-steps li {
  margin-bottom: 12px;
}

.install-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #fff3cd;
  border: 2px solid #e6c200;
  border-radius: 10px;
  font-weight: 800;
}

.install-block .btn {
  width: 100%;
  margin-bottom: 10px;
}

#installIosOtherBrowser .btn-primary {
  margin-top: 2px;
}

.install-card > .btn-skip {
  width: 100%;
  margin-top: 4px;
}

.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 45;
  max-width: 536px;
  margin: 0 auto;
  min-height: 56px;
  border: 0;
  border-radius: 14px;
  background: #0b6e4f;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.write-ref-confirm {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(17, 19, 24, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.write-ref-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 28px 20px 20px;
}

.write-ref-lead {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.write-ref-store,
.write-ref-hollander {
  margin: 0 0 10px;
  font-size: 4.4rem;
  line-height: 1;
  font-weight: 900;
  color: var(--text);
  word-break: break-word;
}

.write-ref-store {
  white-space: nowrap;
  word-break: normal;
}

.write-ref-store:empty,
.write-ref-hollander:empty {
  display: none;
}

.write-ref-digits {
  margin: 0 0 22px;
  font-size: 4.4rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--text);
}

.write-ref-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.write-ref-actions .btn {
  min-height: 56px;
  font-size: 1.25rem;
}
