/* ===== VARIABLES ===== */
:root {
  --amz-navy:    #131921;
  --amz-dark:    #232F3E;
  --amz-orange:  #FF9900;
  --amz-orange-h:#e68a00;
  --amz-red:     #B12704;
  --amz-green:   #007600;
  --amz-link:    #0066c0;
  --amz-bg:      #EAECEE;
  --amz-surface: #FFFFFF;
  --amz-border:  #ddd;
  --amz-muted:   #555;
  --amz-text:    #111;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
  --radius:      4px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  background: var(--amz-bg);
  color: var(--amz-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.body-scroll-locked {
  position: fixed;
  overflow: hidden;
  inset: 0;
  width: 100%;
  overscroll-behavior: none;
}
body.scan-mode {
  background: linear-gradient(180deg, #f7f1e8 0%, #efe5d7 100%);
}
body.scan-mode #header-mount,
body.scan-mode #footer-mount {
  display: none;
}
body.scan-mode #app {
  min-height: 100vh;
}
a { color: var(--amz-link); text-decoration: none; }
a:hover { color: var(--amz-red); text-decoration: underline; }
button { cursor: pointer; font: inherit; border: none; background: none; }
input, select, textarea { font: inherit; }
#app { flex: 1; width: 100%; }

/* ===== HEADER ===== */
.amz-header { background: var(--amz-navy); color: #fff; position: sticky; top: 0; z-index: 100; }

.amz-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  max-width: 1500px;
  margin: 0 auto;
}

.amz-header-brand-row,
.amz-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.amz-header-brand-row {
  flex-shrink: 0;
}

.amz-search-row {
  flex: 1;
  min-width: 0;
}

.amz-account-nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.amz-logo {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
  text-decoration: none;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 2px;
}
.amz-logo:hover { border-color: #fff; color: #fff; text-decoration: none; }
.amz-logo-image { display: block; height: 34px; width: auto; }

.amz-deliver {
  font-size: 11px;
  color: #ccc;
  line-height: 1.3;
  white-space: nowrap;
}
.amz-deliver strong { color: #fff; }

.amz-search {
  flex: 1;
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  min-width: 0;
}
.amz-search-cat {
  background: #f3f3f3;
  color: #333;
  border: none;
  padding: 0 8px;
  font-size: 12px;
  cursor: pointer;
  border-right: 1px solid #cdba8f;
  flex-shrink: 0;
}
.amz-search-input {
  flex: 1;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  min-width: 0;
}
.amz-search-btn {
  background: var(--amz-orange);
  border: none;
  padding: 0 14px;
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
  transition: background 0.1s;
}
.amz-search-btn:hover { background: var(--amz-orange-h); }

.amz-nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.amz-nav-misc {
  display: flex;
  align-items: center;
  gap: 4px;
}

.amz-nav-item {
  color: #fff;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
.amz-nav-item:hover { border-color: #fff; color: #fff; text-decoration: none; }
.amz-nav-item .line1 { display: block; font-size: 11px; color: #ccc; }
.amz-nav-item .line2 { display: block; font-size: 13px; font-weight: 700; }

.amz-cart {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 2px;
  text-decoration: none;
  font-weight: 700;
}
.amz-cart:hover { border-color: #fff; color: #fff; text-decoration: none; }
.amz-cart-count { color: var(--amz-orange); font-size: 18px; font-weight: 700; }

.amz-mobile-utility-row {
  display: none;
}

.amz-mobile-chip {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.amz-mobile-chip:hover {
  color: #fff;
  text-decoration: none;
}

.amz-subnav {
  background: var(--amz-dark);
  display: flex;
  align-items: center;
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.amz-subnav::-webkit-scrollbar { display: none; }
.amz-subnav a {
  color: #fff;
  font-size: 13px;
  padding: 8px 10px;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}
.amz-subnav a:hover { border-color: #fff; text-decoration: none; color: #fff; }

/* ===== LAYOUT ===== */
.amz-page { max-width: 1500px; margin: 0 auto; padding: 16px; }
.amz-page-narrow { max-width: 900px; margin: 0 auto; padding: 16px; }

/* ===== BREADCRUMB ===== */
.breadcrumb { font-size: 12px; color: var(--amz-muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--amz-link); }
.breadcrumb span { margin: 0 4px; }

/* ===== CARDS ===== */
.product-card {
  background: var(--amz-surface);
  border: 1px solid var(--amz-border);
  border-radius: var(--radius);
  padding: 12px;
  transition: box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.14); }

.product-card img,
.product-card .product-img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f5f5f5;
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.product-card .product-img-placeholder { display: flex; align-items: center; justify-content: center; font-size: 40px; }
.product-card h3 { font-size: 14px; line-height: 1.4; margin-bottom: 4px; }
.product-card h3 a { color: var(--amz-text); }
.product-card h3 a:hover { color: var(--amz-red); text-decoration: none; }
.product-card .price { color: var(--amz-red); font-size: 16px; font-weight: 700; }
.product-card .category { font-size: 12px; color: var(--amz-muted); margin-bottom: 4px; }
.product-card .seller { font-size: 12px; color: var(--amz-muted); }
.product-card .stock-ok { color: var(--amz-green); font-size: 12px; }
.product-card .stock-out { color: var(--amz-red); font-size: 12px; }
.product-card .card-actions {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.product-card .card-actions > span {
  min-width: 20px;
  text-align: center;
  font-weight: 700;
}

/* ===== PRODUCT GRID ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--amz-orange);
  color: #111;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: background 0.1s;
  display: inline-block;
  text-align: center;
}
.btn-primary:hover { background: var(--amz-orange-h); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: #111;
  font-weight: 400;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: background 0.1s;
  display: inline-block;
  text-align: center;
}
.btn-secondary:hover { background: #f5f5f5; }

.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 12px; }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-info    { background: #d1ecf1; color: #0c5460; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--amz-muted); margin-bottom: 4px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
  color: var(--amz-text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: 2px solid var(--amz-orange); border-color: var(--amz-orange); }
.form-group textarea { resize: vertical; }
.form-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== PANELS ===== */
.panel {
  background: var(--amz-surface);
  border: 1px solid var(--amz-border);
  border-radius: var(--radius);
  padding: 16px;
}
.panel h2 { font-size: 18px; margin-bottom: 14px; border-bottom: 1px solid var(--amz-border); padding-bottom: 8px; }
.panel h3 { font-size: 16px; margin-bottom: 12px; }

/* ===== ALERT ===== */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; }
.alert-error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; }
.alert-success { background: #eafaf1; color: #1e8449; border: 1px solid #c3e6cb; }
.alert-info { background: #ebf5fb; color: #1a5276; border: 1px solid #bee5eb; }

/* ===== HOME PAGE ===== */
.home-banner {
  background: linear-gradient(135deg, #1a2332, #2d3e50);
  color: #fff;
  padding: 32px 28px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.home-banner h1 { font-size: 24px; margin-bottom: 8px; }
.home-banner p { font-size: 14px; color: #ccc; margin-bottom: 16px; }
.home-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.category-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.category-chip {
  background: var(--amz-surface);
  border: 1px solid var(--amz-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  color: var(--amz-text);
  transition: background 0.1s;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}
.category-chip:hover { background: #f0f0f0; text-decoration: none; color: var(--amz-text); }
.category-chip.active { background: var(--amz-orange); border-color: var(--amz-orange); font-weight: 700; }

.section-heading { font-size: 20px; font-weight: 700; margin-bottom: 14px; border-bottom: 2px solid var(--amz-orange); padding-bottom: 6px; display: inline-block; }

/* ===== PRODUCTS PAGE ===== */
.products-layout { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; }

.filter-panel { background: var(--amz-surface); border: 1px solid var(--amz-border); border-radius: var(--radius); padding: 16px; }
.filter-panel h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.filter-section { margin-bottom: 16px; }
.filter-section h4 { font-size: 13px; font-weight: 700; color: var(--amz-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.filter-option { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; cursor: pointer; }
.filter-option input[type=radio],
.filter-option input[type=checkbox] { cursor: pointer; }
.filter-option strong { margin-left: auto; font-size: 11px; color: var(--amz-muted); font-weight: 600; }

.sort-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--amz-surface);
  border: 1px solid var(--amz-border);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  flex-wrap: wrap;
}
.sort-bar span { color: var(--amz-muted); }
.sort-btn { padding: 4px 10px; border-radius: 12px; font-size: 12px; cursor: pointer; border: 1px solid #ccc; background: #fff; }
.sort-btn.active { background: var(--amz-orange); border-color: var(--amz-orange); font-weight: 700; }

.products-search-page {
  max-width: 1520px;
}

.products-search-layout {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
}

.products-filter-panel {
  position: sticky;
  top: 96px;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.filter-panel-header {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ececec;
}

.filter-panel-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amz-muted);
  margin-bottom: 6px;
}

.filter-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.filter-mini-copy {
  font-size: 11px;
  color: var(--amz-muted);
}

.filter-clear-button {
  width: 100%;
}

.seller-filter-list {
  display: grid;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.products-main {
  min-width: 0;
}

.products-results-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 12px;
  border: 1px solid var(--amz-border);
  border-radius: 12px;
  background:
    radial-gradient(circle at top right, rgba(255, 153, 0, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
}

.products-results-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amz-muted);
  margin-bottom: 6px;
}

.products-results-hero h1 {
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 6px;
}

.products-summary-line {
  color: var(--amz-muted);
  line-height: 1.6;
}

.products-results-meta {
  display: grid;
  justify-items: end;
  gap: 12px;
  flex-shrink: 0;
}

.products-results-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff6e8;
  color: #8a4f00;
  font-size: 18px;
  font-weight: 700;
}

.sort-pill-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.products-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.active-filter-chip,
.products-active-filters-empty {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
}

.active-filter-chip {
  background: #eef6ff;
  border: 1px solid #d8e8fb;
  color: #0d4c92;
  font-weight: 600;
}

.products-active-filters-empty {
  color: var(--amz-muted);
  background: #f7f7f7;
  border: 1px solid #ececec;
}

.products-search-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.product-search-card {
  position: relative;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.05);
}

.product-search-card .product-image-link {
  display: block;
}

.product-search-card img,
.product-search-card .product-img-placeholder {
  border-radius: 10px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #f7f7f7 0%, #efefef 100%);
}

.product-card-body {
  display: grid;
  gap: 7px;
}

.product-card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-category-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f4f7fb;
  color: #32506f;
  font-size: 11px;
  font-weight: 700;
}

.product-stock-copy {
  font-size: 11px;
  font-weight: 700;
}

.product-stock-copy.is-in {
  color: var(--amz-green);
}

.product-stock-copy.is-out {
  color: var(--amz-red);
}

.product-search-card h3 {
  font-size: 15px;
  line-height: 1.45;
  min-height: 44px;
}

.product-card-seller {
  color: var(--amz-muted);
  font-size: 12px;
}

.product-card-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5f6368;
  font-size: 12px;
}

.product-card-rating .stars {
  color: #ffb400;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.product-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-fulfillment-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f4f5f6;
  color: #374151;
  font-size: 11px;
  font-weight: 700;
}

.product-fulfillment-badge-accent {
  background: #fff4dc;
  color: #8f5300;
}

.product-pickup-copy {
  color: #444;
  font-size: 12px;
  line-height: 1.5;
  min-height: 36px;
}

.product-card-actions {
  gap: 8px;
  flex-wrap: wrap;
}

.product-card-actions .btn-primary,
.product-card-actions .btn-secondary {
  min-height: 38px;
}

.product-card-actions .btn-primary {
  flex: 1 1 100%;
}

.product-card-actions .btn-secondary {
  flex: 1 1 auto;
}

/* ===== PRODUCT DETAIL PAGE ===== */
.detail-layout { display: grid; grid-template-columns: 400px 1fr 250px; gap: 20px; align-items: start; }
.detail-image-box { background: var(--amz-surface); border: 1px solid var(--amz-border); border-radius: var(--radius); padding: 20px; }
.detail-image-box img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.detail-image-placeholder { width: 100%; aspect-ratio: 1; background: #f5f5f5; display: flex; align-items: center; justify-content: center; font-size: 80px; border-radius: var(--radius); }
.detail-info h1 { font-size: 22px; line-height: 1.3; margin-bottom: 10px; }
.detail-info .price { font-size: 26px; font-weight: 700; color: var(--amz-red); margin-bottom: 10px; }
.detail-info .stock { font-size: 16px; color: var(--amz-green); margin-bottom: 10px; }
.detail-info .stock.out { color: var(--amz-red); }
.detail-info .meta { font-size: 13px; color: var(--amz-muted); margin-bottom: 8px; }
.detail-info .description { font-size: 14px; line-height: 1.7; margin-top: 14px; border-top: 1px solid var(--amz-border); padding-top: 14px; white-space: pre-line; }
.detail-buy-box { background: var(--amz-surface); border: 1px solid var(--amz-border); border-radius: var(--radius); padding: 16px; }
.detail-buy-box .price { font-size: 22px; font-weight: 700; color: var(--amz-red); margin-bottom: 10px; }
.detail-buy-box .stock { font-size: 14px; color: var(--amz-green); margin-bottom: 14px; }
.detail-buy-box .stock.out { color: var(--amz-red); }
.detail-buy-box .btn-primary,
.detail-buy-box .btn-secondary { width: 100%; margin-bottom: 8px; padding: 10px; }
.detail-buy-box #detailCartControls .card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.detail-buy-box #detailCartControls .btn-secondary {
  width: auto;
  margin-bottom: 0;
  padding: 8px 14px;
}
.detail-buy-box #detailCartControls span {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
}

/* ===== CART PAGE ===== */
.cart-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.cart-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--amz-border); }
.cart-item img,
.cart-item .cart-item-img { width: 100px; height: 100px; object-fit: contain; background: #f5f5f5; border-radius: var(--radius); flex-shrink: 0; }
.cart-item-info { flex: 1; }
.cart-item-info h3 { font-size: 16px; margin-bottom: 6px; }
.cart-item-info .seller { font-size: 12px; color: var(--amz-muted); margin-bottom: 8px; }
.cart-item-price { font-size: 18px; font-weight: 700; color: var(--amz-red); flex-shrink: 0; }
.cart-qty { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cart-qty-btn { width: 28px; height: 28px; border: 1px solid #ccc; border-radius: 50%; background: #fff; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.cart-qty-btn:hover { background: #f0f0f0; }
.cart-qty-num { font-size: 15px; font-weight: 600; min-width: 24px; text-align: center; }
.cart-remove { font-size: 12px; color: var(--amz-link); cursor: pointer; background: none; border: none; padding: 0; margin-left: 12px; }
.cart-remove:hover { text-decoration: underline; }
.cart-summary { background: var(--amz-surface); border: 1px solid var(--amz-border); border-radius: var(--radius); padding: 16px; }
.cart-summary h2 { font-size: 20px; margin-bottom: 14px; }
.cart-summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 15px; }
.cart-summary-row.total { font-size: 18px; font-weight: 700; border-top: 1px solid var(--amz-border); padding-top: 10px; margin-top: 6px; }
.cart-summary .btn-primary { width: 100%; padding: 12px; font-size: 16px; margin-top: 12px; }

/* ===== CHECKOUT PAGE ===== */
.checkout-steps { display: flex; margin-bottom: 24px; }
.checkout-step { flex: 1; text-align: center; padding: 10px; background: #f0f0f0; font-size: 13px; border-right: 1px solid #ddd; }
.checkout-step:last-child { border-right: none; }
.checkout-step.active { background: var(--amz-orange); font-weight: 700; }
.checkout-step.done { background: #d4edda; color: #155724; }
.checkout-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.paypay-result-panel { max-width: 560px; margin: 40px auto 0; text-align: center; }
.paypay-result-spinner {
  width: 42px;
  height: 42px;
  margin: 20px auto 0;
  border-radius: 50%;
  border: 4px solid #e5e7eb;
  border-top-color: var(--amz-orange);
  animation: paypay-spin 0.9s linear infinite;
}
.paypay-result-action { margin-top: 16px; }
@keyframes paypay-spin {
  to { transform: rotate(360deg); }
}

/* ===== MYPAGE ===== */
.mypage-header { background: var(--amz-surface); border: 1px solid var(--amz-border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px; }
.mypage-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--amz-dark); display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; flex-shrink: 0; }
.mypage-tabs { display: flex; border-bottom: 2px solid var(--amz-orange); margin-bottom: 16px; }
.mypage-tab { padding: 10px 20px; font-size: 14px; cursor: pointer; border: none; background: none; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.mypage-tab.active { border-bottom-color: var(--amz-orange); font-weight: 700; }
.account-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.account-action-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--amz-border);
  border-radius: 10px;
  background: #fff;
  color: var(--amz-text);
}
.account-action-card:hover {
  text-decoration: none;
  border-color: var(--amz-orange);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.account-action-card strong { font-size: 15px; }
.account-action-card span { font-size: 12px; color: var(--amz-muted); line-height: 1.6; }
.order-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--amz-border); align-items: flex-start; }
.order-row-detail { flex-wrap: wrap; }
.order-img-wrap { position: relative; width: 60px; height: 60px; flex-shrink: 0; }
.order-row img,
.order-row .order-img { width: 60px; height: 60px; object-fit: contain; background: #f5f5f5; border-radius: var(--radius); flex-shrink: 0; }
.order-img { display: flex; align-items: center; justify-content: center; }
.order-img-count {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--amz-orange);
  color: #111;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.order-row-info { flex: 1; }
.order-row-info h4 { font-size: 14px; margin-bottom: 4px; }
.order-row-info p { font-size: 12px; color: var(--amz-muted); }
/* ===== ADMIN PAGE ===== */
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-box { background: var(--amz-surface); border: 1px solid var(--amz-border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-box .stat-num { font-size: 28px; font-weight: 700; color: var(--amz-orange); }
.stat-box .stat-label { font-size: 12px; color: var(--amz-muted); margin-top: 4px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { background: var(--amz-dark); color: #fff; padding: 8px 12px; text-align: left; font-weight: 600; }
.admin-table td { padding: 8px 12px; border-bottom: 1px solid var(--amz-border); vertical-align: middle; }
.admin-table tr:hover td { background: #fafafa; }
.table-scroll { overflow-x: auto; }
.seller-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.seller-page-toolbar h2 {
  border: 0;
  padding: 0;
  margin-bottom: 6px;
}
.seller-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.qr-scan-panel {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(260px, 1fr);
  gap: 16px;
  align-items: start;
}
.qr-scan-video {
  width: 100%;
  min-height: 240px;
  border-radius: 12px;
  background: #111;
  border: 1px solid var(--amz-border);
}
.qr-scan-side {
  display: grid;
  gap: 10px;
}
.seller-form-panel { max-width: 760px; }
.seller-wizard-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.seller-wizard-sidebar {
  position: sticky;
  top: 96px;
}
.seller-wizard-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amz-muted);
  margin-bottom: 8px;
}
.seller-wizard-sidebar h2 {
  margin-bottom: 8px;
  border: 0;
  padding: 0;
}
.seller-step-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.seller-step-pill {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--amz-border);
  border-radius: 12px;
  background: #f8f9fb;
}
.seller-step-pill-num {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--amz-border);
  font-weight: 700;
}
.seller-step-pill strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}
.seller-step-pill span {
  font-size: 12px;
  color: var(--amz-muted);
  line-height: 1.5;
}
.seller-step-pill.active {
  border-color: #f2c16a;
  background: #fff7ea;
}
.seller-step-pill.active .seller-step-pill-num {
  background: var(--amz-orange);
  border-color: var(--amz-orange);
}
.seller-step-pill.done {
  border-color: #cfe8d3;
  background: #f1fbf3;
}
.seller-step-pill.done .seller-step-pill-num {
  background: #dff2e3;
  border-color: #b7d9bf;
}
.seller-wizard-main {
  max-width: 760px;
}
.seller-card-header {
  margin-bottom: 18px;
}
.seller-card-step {
  font-size: 12px;
  font-weight: 700;
  color: var(--amz-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.seller-card-header h3 {
  font-size: 28px;
  margin-bottom: 6px;
}
.seller-card-body {
  min-height: 380px;
}
.seller-single-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--amz-border);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.06);
}
.seller-single-card label {
  font-size: 15px;
  font-weight: 700;
}
.seller-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.seller-barcode-scanner {
  max-width: 360px;
}
.seller-scan-status {
  font-size: 13px;
  color: var(--amz-muted);
  line-height: 1.6;
}
.seller-error-copy {
  color: #c0392b;
  font-weight: 600;
}
.seller-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.seller-card-footer .btn-primary,
.seller-card-footer .btn-secondary {
  min-width: 140px;
}
.seller-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.seller-review-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--amz-border);
  border-radius: 12px;
  background: #fff;
}
.seller-review-item span {
  font-size: 12px;
  color: var(--amz-muted);
}
.seller-review-item strong {
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.seller-review-item-wide {
  grid-column: 1 / -1;
}
.seller-review-image {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--amz-border);
  border-radius: 12px;
  background: #fff;
}
.seller-review-image img {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
}
.prepaid-page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.prepaid-auth-panel,
.prepaid-info-panel {
  max-width: 520px;
}
.prepaid-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 16px;
  align-items: start;
}
.prepaid-page-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.upload-dropzone {
  border: 2px dashed #c7ccd1;
  border-radius: 10px;
  background: #fafbfc;
  padding: 18px;
  transition: border-color 0.15s, background 0.15s;
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--amz-orange);
  background: #fff7ec;
}
.upload-dropzone-inner {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}
.upload-preview {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}
.upload-preview img {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--amz-border);
  background: #fff;
}

.support-faq {
  display: grid;
  gap: 10px;
}
.support-faq-item {
  border: 1px solid var(--amz-border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.support-faq-item summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.support-faq-item p {
  margin-top: 10px;
  color: var(--amz-muted);
  line-height: 1.7;
}
.legal-page {
  display: grid;
  gap: 16px;
}
.legal-section {
  display: grid;
  gap: 8px;
}
.legal-intro {
  line-height: 1.7;
}
.legal-section h2 {
  margin-bottom: 0;
}
.legal-section p {
  line-height: 1.8;
}
.legal-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}
.legal-table {
  display: grid;
  gap: 0;
  border: 1px solid var(--amz-border);
  border-radius: 10px;
  overflow: hidden;
}
.legal-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-bottom: 1px solid var(--amz-border);
}
.legal-row:last-child {
  border-bottom: 0;
}
.legal-row dt,
.legal-row dd {
  margin: 0;
  padding: 14px 16px;
  line-height: 1.8;
}
.legal-row dt {
  background: #f8fafc;
  font-weight: 700;
  border-right: 1px solid var(--amz-border);
}
.legal-row dd {
  background: #fff;
}
.support-ticket-list {
  display: grid;
  gap: 12px;
}
.support-ticket {
  border: 1px solid var(--amz-border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}
.support-ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  align-items: flex-start;
}
.support-ticket-message {
  line-height: 1.7;
  white-space: pre-wrap;
}
.support-ticket-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cart-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 24px);
  width: min(560px, calc(100vw - 24px));
  background: rgba(19, 25, 33, 0.96);
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.cart-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.cart-toast-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}
.cart-toast-copy strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.cart-toast-copy p {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}
.cart-toast-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.cart-toast .btn-primary,
.cart-toast .btn-secondary {
  border-radius: 999px;
  padding: 8px 14px;
}
.cart-toast .btn-secondary {
  border-color: rgba(255,255,255,0.28);
  background: transparent;
  color: #fff;
}
.cart-toast .btn-secondary:hover {
  background: rgba(255,255,255,0.08);
}

/* ===== FOOTER ===== */
.amz-footer { background: var(--amz-dark); color: #fff; margin-top: 40px; padding: 20px 16px; text-align: center; }
.amz-footer-inner { max-width: 1500px; margin: 0 auto; font-size: 13px; }
.amz-footer-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.amz-footer-links a {
  color: #fff;
}
.amz-footer-links a:hover {
  color: #fff;
}
.amz-footer-sub { font-size: 11px; color: #aaa; margin-top: 6px; }
.amz-footer-logo { display: inline-block; height: 36px; width: auto; }

/* ===== UTILITIES ===== */
.empty-state { text-align: center; padding: 48px 16px; color: var(--amz-muted); }
.empty-state p { font-size: 16px; margin-bottom: 16px; }
.hidden { display: none !important; }
.text-muted { color: var(--amz-muted); }
.text-price { color: var(--amz-red); font-weight: 700; }
.not-found { text-align: center; padding: 80px 16px; }
.not-found h1 { font-size: 48px; color: var(--amz-muted); margin-bottom: 12px; }

/* ===== LOGIN PROMPT ===== */
.login-prompt { background: var(--amz-surface); border: 1px solid var(--amz-border); border-radius: var(--radius); padding: 32px; text-align: center; margin: 24px 0; }
.login-prompt h2 { font-size: 20px; margin-bottom: 12px; }
.login-prompt p { font-size: 14px; color: var(--amz-muted); margin-bottom: 20px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .products-layout { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .cart-layout { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .account-action-grid { grid-template-columns: 1fr; }
  .qr-scan-panel { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .amz-header {
    position: sticky;
    top: 0;
  }
  .amz-header-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "utility utility utility utility"
      "brand search cart account";
    align-items: center;
    gap: 6px;
    padding: 8px 10px 8px;
  }
  .amz-header-brand-row {
    grid-area: brand;
    justify-content: flex-start;
    gap: 8px;
  }
  .amz-search-row {
    grid-area: search;
    flex: initial;
    min-width: 0;
    gap: 0;
  }
  .amz-account-nav {
    display: flex;
    grid-area: account;
    justify-content: flex-end;
    min-width: 0;
  }
  .amz-logo {
    font-size: 17px;
    padding: 0;
    border: 0;
  }
  .amz-logo-image { height: 28px; }
  .amz-logo:hover {
    border: 0;
  }
  .amz-deliver-desktop {
    display: none;
  }
  .amz-nav-right {
    grid-area: cart;
    gap: 0;
    justify-content: flex-end;
    min-width: 0;
  }
  .amz-nav-misc {
    gap: 0;
    margin-left: 0;
  }
  .amz-nav-misc .amz-nav-item {
    display: none;
  }
  .amz-nav-item {
    min-width: auto;
    padding: 4px 6px;
  }
  .amz-account-nav .amz-nav-item {
    min-width: 0;
    padding: 4px 4px 4px 6px;
  }
  .amz-nav-item .line1 {
    display: none;
  }
  .amz-nav-item .line2 {
    font-size: 12px;
    font-weight: 600;
  }
  .amz-cart {
    gap: 2px;
    padding: 4px 4px 4px 6px;
    border: 1px solid transparent;
    font-size: 12px;
  }
  .amz-cart span:last-child {
    font-size: 12px;
  }
  .amz-cart-count {
    font-size: 16px;
  }
  .amz-search {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    border: 2px solid #febd69;
  }
  .amz-search-cat {
    display: none;
  }
  .amz-search-input {
    padding: 10px 12px;
    font-size: 16px;
  }
  .amz-search-btn {
    min-width: 48px;
    padding: 0 12px;
  }
  .amz-mobile-utility-row {
    grid-area: utility;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 7px 10px;
    margin: 0 -10px;
    background: #37475a;
  }
  .amz-mobile-utility-row::-webkit-scrollbar {
    display: none;
  }
  .amz-subnav {
    padding: 0 6px;
    background: #232f3e;
  }
  .amz-subnav a {
    padding: 10px 8px;
    font-size: 12px;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
  }
  .home-banner {
    background: #fff;
    color: var(--amz-text);
    border: 1px solid var(--amz-border);
    border-radius: 8px;
    padding: 16px 14px;
    margin-bottom: 12px;
  }
  .home-banner h1 {
    font-size: 18px;
    margin-bottom: 6px;
  }
  .home-banner p {
    color: var(--amz-muted);
    margin-bottom: 10px;
  }
  .category-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-bottom: 12px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .category-nav::-webkit-scrollbar {
    display: none;
  }
  .category-chip {
    flex: 0 0 auto;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
  }
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .product-card {
    border-radius: 8px;
    padding: 10px;
  }
  .product-card .price {
    font-size: 15px;
  }
  .seller-toolbar-actions {
    width: 100%;
  }
  .seller-wizard-layout {
    grid-template-columns: 1fr;
  }
  .seller-wizard-sidebar {
    position: static;
  }
  .seller-card-header h3 {
    font-size: 22px;
  }
  .seller-card-body {
    min-height: 0;
  }
  .seller-single-card {
    padding: 16px;
    border-radius: 14px;
  }
  .seller-card-footer {
    flex-direction: column-reverse;
  }
  .seller-card-footer .btn-primary,
  .seller-card-footer .btn-secondary {
    width: 100%;
  }
  .seller-review-grid {
    grid-template-columns: 1fr;
  }
  .form-two-col { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
  .amz-page, .amz-page-narrow { padding: 10px; }
  .support-ticket-head { flex-direction: column; }
  .legal-row { grid-template-columns: 1fr; }
  .legal-row dt { border-right: 0; border-bottom: 1px solid var(--amz-border); }
  .cart-toast-body {
    flex-direction: column;
    align-items: stretch;
  }
  .cart-toast-actions {
    width: 100%;
  }
  .cart-toast .btn-primary,
  .cart-toast .btn-secondary {
    flex: 1;
    text-align: center;
  }
  .products-search-layout {
    grid-template-columns: 1fr;
  }
  .products-filter-panel {
    position: static;
  }
  .products-results-hero {
    flex-direction: column;
    padding: 14px;
  }
  .products-results-hero h1 {
    font-size: 22px;
  }
  .products-results-meta {
    justify-items: start;
  }
  .sort-pill-group {
    justify-content: flex-start;
  }
  .products-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .product-search-card {
    border-radius: 10px;
    padding: 10px;
  }
  .product-search-card h3 {
    min-height: auto;
    font-size: 14px;
  }
  .product-pickup-copy {
    min-height: 0;
  }
  .product-card-actions .btn-primary,
  .product-card-actions .btn-secondary {
    width: 100%;
  }
  .seller-filter-list {
    max-height: none;
  }
  .prepaid-page-grid {
    grid-template-columns: 1fr;
  }
  .prepaid-page-header {
    align-items: stretch;
    flex-direction: column;
  }
}

/* ===== SCAN PAGE ===== */
.scan-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at top, rgba(255, 153, 0, 0.16), transparent 26%),
    linear-gradient(180deg, #f8f2e8 0%, #efe3d2 100%);
}
.scan-shell-camera {
  background:
    radial-gradient(circle at top, rgba(19, 25, 33, 0.12), transparent 24%),
    linear-gradient(180deg, #f2eee8 0%, #e6ddd0 100%);
}
.scan-camera-stage {
  position: relative;
  min-height: 100dvh;
  min-height: 100vh;
  background: #0f1720;
  overflow: hidden;
}
.scan-camera-overlay {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)) 16px;
  background:
    linear-gradient(180deg, rgba(9, 12, 16, 0.78) 0%, rgba(9, 12, 16, 0.24) 22%, rgba(9, 12, 16, 0.08) 45%, rgba(9, 12, 16, 0.5) 72%, rgba(9, 12, 16, 0.86) 100%);
}
.scan-camera-top,
.scan-camera-bottom {
  width: min(100%, 560px);
  margin: 0 auto;
}
.scan-camera-top {
  text-align: center;
  padding-top: 8px;
}
.scan-camera-top .scan-flow-step,
.scan-camera-top .scan-flow-title,
.scan-camera-top .scan-flow-copy,
.scan-camera-bottom .scan-flow-manual-label {
  color: #fff;
}
.scan-camera-top .scan-flow-copy {
  color: rgba(255, 255, 255, 0.88);
}
.scan-camera-guide {
  width: min(86vw, 420px);
  aspect-ratio: 1.6 / 1;
  margin: 20px auto;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.18),
    0 24px 60px rgba(0, 0, 0, 0.35);
}
.scan-flow-card {
  width: min(100%, 520px);
  padding: 28px 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 22px 56px rgba(48, 33, 16, 0.14);
  text-align: center;
}
.scan-flow-card-form {
  text-align: left;
}
.scan-flow-card-complete {
  display: grid;
  gap: 12px;
  justify-items: center;
}
.scan-flow-step {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8b5a1e;
  margin-bottom: 10px;
}
.scan-flow-title {
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.16;
  margin-bottom: 12px;
  color: #18120b;
}
.scan-flow-copy {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #5c5248;
  margin-bottom: 18px;
}
.scan-camera-box {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #0f1720;
  z-index: 0;
}
.scan-camera-box video,
.scan-camera-box canvas,
.scan-camera-box > div,
.scan-camera-box > section {
  width: 100% !important;
  height: 100% !important;
}
.scan-camera-box *,
.scan-camera-box video,
.scan-camera-box canvas {
  position: relative;
  z-index: 0 !important;
}
.scan-camera-box video,
.scan-camera-box canvas {
  object-fit: cover;
}
.scan-flow-alert {
  margin-top: 14px;
  text-align: left;
}
.scan-flow-manual {
  margin-top: 18px;
}
.scan-flow-manual-label {
  font-size: 12px;
  font-weight: 700;
  color: #6b5a48;
  margin-bottom: 8px;
}
.scan-manual-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.scan-manual-form input {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
}
.scan-form-panel {
  display: grid;
  gap: 12px;
}
.scan-form-panel .form-group {
  margin-bottom: 0;
}
.scan-form-panel .form-group label {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #41362d;
}
.scan-form-panel input {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #d3c3b2;
}
.scan-form-submit,
.scan-complete-button {
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  border-radius: 999px;
}
.scan-complete-mark {
  width: 88px;
  height: 88px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #1f8f4f;
  color: #fff;
  font-size: 46px;
  font-weight: 900;
}
.scan-complete-product {
  font-size: 1rem;
  font-weight: 700;
  color: #2f241a;
}
.scan-cash-screen {
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 153, 0, 0.18), transparent 24%),
    linear-gradient(180deg, #2a140c 0%, #170d09 100%);
}
.scan-cash-inner {
  text-align: center;
  padding: 28px;
  max-width: 560px;
  margin: 0 auto;
  width: min(100%, 560px);
  border-radius: 28px;
  background: linear-gradient(180deg, #fff7ef 0%, #fff 100%);
  border: 2px solid rgba(255, 153, 0, 0.38);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.28);
}
.scan-cash-alert {
  padding: 24px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff0d9 0%, #ffe0b2 100%);
  border: 2px solid rgba(177, 39, 4, 0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.scan-cash-alert-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #b12704;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.scan-cash-label {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: #8e1f02;
  margin-bottom: 18px;
  line-height: 1.15;
  letter-spacing: 0.02em;
}
.scan-cash-amount {
  font-size: clamp(3.4rem, 10vw, 5.4rem);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 14px;
  color: #111;
}
.scan-cash-helper {
  font-size: 1rem;
  color: #5d4037;
  font-weight: 700;
}
.scan-cash-meta {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #f0d7bf;
}
.scan-cash-product {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111;
}
  .scan-cash-btn {
    width: 100%;
    font-size: 1.2rem;
    padding: 18px 28px;
    margin-top: 22px;
    border-radius: 999px;
    box-shadow: 0 16px 28px rgba(255, 153, 0, 0.34);
  }

@media (max-width: 640px) {
  .scan-camera-stage {
    min-height: 100dvh;
  }
  .scan-camera-overlay {
    min-height: 100dvh;
    padding: max(14px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom)) 14px;
  }
  .scan-camera-guide {
    width: min(88vw, 420px);
    border-radius: 22px;
  }
  .scan-shell,
  .scan-cash-screen {
    min-height: 100vh;
    padding: 0;
  }
  .scan-flow-card,
  .scan-cash-inner {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    padding: 28px 18px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .scan-camera-box {
    width: 100%;
    min-height: 0;
    border-radius: 0;
  }
  .scan-manual-form {
    grid-template-columns: 1fr;
  }
  .scan-flow-title {
    font-size: 2rem;
  }
  .scan-cash-inner {
    padding: 24px 16px;
  }
}

/* ===== STUDENT ID MODAL ===== */
.sid-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sid-modal {
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  width: min(420px, 90vw);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.sid-modal h2 { margin-bottom: 8px; }
.sid-modal p { margin-bottom: 20px; }
