/* ==========================================================================
   喵汪電腦工房 🐾 (Japanese Minimalist Warm Cat & Dog CoolPC Builder)
   日式簡約木質溫暖風格（無粉色系 • 生成り色 × 檜木琥珀 × 焙茶 × 抹茶）
   ========================================================================== */

:root {
  /* Warm Japanese Washi / Kinari Paper & Linen Backgrounds */
  --bg-milk: #FAF7F2;
  --bg-sakura-soft: #F3EDE2;
  --bg-card: #FFFFFF;

  /* Hinoki Wood, Caramel & Roasted Hojicha Accents (Zero Pink) */
  --sakura-main: #C5894E;
  --sakura-deep: #965B26;
  --sakura-light: #F5EBE0;
  --sakura-border: #E4DBD0;

  /* Shiba Inu Warm Ochre */
  --shiba-gold: #D49552;
  --shiba-light: #F8EFE4;

  /* Matcha Green (Compatibility OK / Selected) */
  --matcha-main: #588B68;
  --matcha-bg: #EFF6F1;
  --matcha-border: #C4DEC9;

  /* Warm Yuzu / Amber (Warning) */
  --lemon-main: #D08738;
  --lemon-bg: #FDF6EB;
  --lemon-border: #EED5B3;

  /* Terracotta / Persimmon Rust (Error - No Pink) */
  --berry-err: #C24B32;
  --berry-bg: #FCF2EE;
  --berry-border: #EAC7BC;

  /* Sumi Ink & Warm Taupe Typography */
  --cocoa-text: #362E28;
  --cocoa-muted: #74675B;
  --cocoa-soft: #A6988B;

  /* Minimalist Soft Shadows & Radii */
  --shadow-soft: 0 4px 18px rgba(54, 46, 40, 0.05);
  --shadow-hover: 0 10px 26px rgba(150, 91, 38, 0.11);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --font-rounded: 'Zen Maru Gothic', 'M PLUS Rounded 1c', 'Microsoft JhengHei', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-rounded);
  color: var(--cocoa-text);
  background-color: var(--bg-milk);
  background-image: radial-gradient(#EAE2D6 1px, transparent 1px);
  background-size: 28px 28px;
  min-height: 100vh;
  line-height: 1.6;
  padding-bottom: 84px;
  -webkit-font-smoothing: antialiased;
}

/* Minimalist Subtle Watermark Paw Accents */
.ambient-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.petal {
  position: absolute;
  opacity: 0.08;
  font-size: 1.3rem;
  filter: grayscale(35%) sepia(25%);
}
.petal.p1 { top: 12%; left: 3%; }
.petal.p2 { top: 30%; right: 3.5%; }
.petal.p3 { top: 65%; left: 2.5%; }
.petal.p4 { bottom: 18%; right: 3%; }
.petal.p5 { display: none; }

/* Top Site Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sakura-border);
  box-shadow: 0 2px 12px rgba(54, 46, 40, 0.04);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mascot-duo {
  display: flex;
  align-items: center;
}

.mascot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sakura-light);
  border: 1.5px solid var(--sakura-main);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(150, 91, 38, 0.12);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.mascot-avatar.dog-avatar {
  margin-left: -10px;
  background: var(--shiba-light);
  border-color: var(--shiba-gold);
}

.mascot-duo:hover .cat-avatar {
  transform: rotate(-6deg) translateY(-2px);
}
.mascot-duo:hover .dog-avatar {
  transform: rotate(6deg) translateY(-2px);
}

.brand-jp-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--sakura-deep);
  background: var(--sakura-light);
  border: 1px solid #E5D5C3;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.site-title {
  font-size: 1.28rem;
  font-weight: 900;
  color: var(--cocoa-text);
  letter-spacing: 0.03em;
}

/* Main Navigation Tabs */
.main-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-sakura-soft);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--sakura-border);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--cocoa-muted);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.tab-btn .tab-icon {
  font-size: 1.18rem;
}

.tab-btn .tab-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.tab-btn .tab-text strong {
  font-size: 0.93rem;
}

.tab-btn .tab-text small {
  font-size: 0.69rem;
  opacity: 0.85;
}

.tab-btn .tab-pill {
  background: #E8DEC8;
  color: var(--sakura-deep);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.tab-btn:hover {
  color: var(--cocoa-text);
  background: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
  background: #B3763E;
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(150, 91, 38, 0.22);
}

.tab-btn.active .tab-pill {
  background: #FFFFFF;
  color: var(--sakura-deep);
}

/* Compact Sync Action Pill in Header */
.sync-status-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--cocoa-muted);
  background: #FFFFFF;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--sakura-border);
  white-space: nowrap;
}

.sync-short-label {
  font-weight: 700;
  color: var(--cocoa-muted);
  font-size: 0.71rem;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--matcha-main);
  box-shadow: 0 0 0 2px rgba(88, 139, 104, 0.2);
  flex-shrink: 0;
}

.btn-mini-sync {
  border: 1px solid var(--sakura-main);
  background: var(--bg-sakura-soft);
  color: var(--sakura-deep);
  font-family: inherit;
  font-size: 0.69rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-mini-sync:hover {
  background: var(--sakura-main);
  color: #FFFFFF;
}

/* Main Workspace Layout */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 20px auto;
  padding: 0 24px;
}

/* Warm Minimalist Intro Banner */
.kawaii-banner {
  background: #FFFFFF;
  border: 1px solid var(--sakura-border);
  border-left: 4px solid var(--sakura-main);
  border-radius: var(--radius-lg);
  padding: 15px 20px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-soft);
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 480px;
}

.stamp-badge {
  background: var(--sakura-deep);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.banner-desc {
  font-size: 0.89rem;
  color: var(--cocoa-text);
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-preset {
  border: 1px solid #D8CBB8;
  background: var(--bg-milk);
  color: var(--sakura-deep);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.83rem;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-preset.hidden {
  display: none !important;
}
.btn-preset#btn-run-check {
  background: var(--matcha-bg);
  border-color: var(--matcha-border);
  color: #2E5A3C;
}
.btn-preset#btn-run-check:hover {
  background: var(--matcha-main);
  border-color: var(--matcha-main);
  color: #FFFFFF;
}
.btn-preset#btn-restore-build {
  background: #F4EFE6;
  border-color: var(--sakura-main);
  color: var(--sakura-deep);
}
.btn-preset:hover {
  background: var(--sakura-light);
  border-color: var(--sakura-main);
  transform: translateY(-1px);
}

.btn-preset-warn {
  border-color: var(--lemon-border);
  background: var(--lemon-bg);
  color: #9A5B1A;
}
.btn-preset-warn:hover {
  background: #F7E8D0;
  border-color: var(--lemon-main);
}

.btn-clear-all {
  border: 1px solid var(--sakura-border);
  background: #FFFFFF;
  color: var(--cocoa-muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.83rem;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-clear-all:hover {
  background: var(--berry-bg);
  color: var(--berry-err);
  border-color: var(--berry-border);
}

/* Builder Two-Column Grid */
.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-heading h2 {
  font-size: 1.14rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cocoa-text);
}

.section-heading h2 small {
  font-size: 0.74rem;
  color: var(--sakura-deep);
  background: var(--sakura-light);
  border: 1px solid #E5D5C3;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

.global-filter-wrap {
  flex: 1 1 280px;
  max-width: 440px;
}

.kawaii-input,
.kawaii-select {
  width: 100%;
  font-family: inherit;
  font-size: 0.89rem;
  color: var(--cocoa-text);
  background: #FFFFFF;
  border: 1.5px solid var(--sakura-border);
  border-radius: var(--radius-md);
  padding: 9px 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kawaii-input:focus,
.kawaii-select:focus {
  border-color: var(--sakura-main);
  box-shadow: 0 0 0 3px rgba(197, 137, 78, 0.16);
}

/* Component Category Cards */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--sakura-border);
  border-radius: var(--radius-lg);
  padding: 15px 18px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
  border-color: #CBBBA6;
}

.category-card.has-selection {
  border-color: var(--matcha-main);
  border-left: 4px solid var(--matcha-main);
  background: linear-gradient(to right, #FFFFFF 0%, #F7FAF8 100%);
}

.category-card.has-conflict {
  border-color: var(--berry-err);
  border-left: 4px solid var(--berry-err);
  background: linear-gradient(to right, #FFFFFF 0%, #FDF7F5 100%);
  box-shadow: 0 6px 20px rgba(194, 75, 50, 0.1);
}

.cat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.cat-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cat-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-sakura-soft);
  border: 1px solid var(--sakura-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.cat-name-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-name-group h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--cocoa-text);
}

.cat-jp-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cocoa-muted);
  background: var(--bg-milk);
  border: 1px solid var(--sakura-border);
  padding: 1px 9px;
  border-radius: var(--radius-pill);
}

.cat-count-tag {
  font-size: 0.74rem;
  color: var(--sakura-deep);
  font-weight: 700;
}

.cat-card-controls {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--sakura-border);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  overflow: hidden;
  height: 40px;
}

.qty-btn {
  border: none;
  background: var(--bg-sakura-soft);
  color: var(--sakura-deep);
  width: 28px;
  height: 100%;
  font-weight: 900;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s;
}
.qty-btn:hover {
  background: #E6DDD0;
}

.qty-val {
  flex: 1;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
}

/* Selected Preview Strip inside Category Card */
.cat-selected-chip {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--matcha-bg);
  border: 1px solid var(--matcha-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
}

.category-card.has-conflict .cat-selected-chip {
  background: var(--berry-bg);
  border-color: var(--berry-border);
}

.chip-specs-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.spec-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: #FFFFFF;
  color: var(--cocoa-text);
  border: 1px solid var(--sakura-border);
}

.spec-pill.pill-accent {
  background: var(--sakura-light);
  color: var(--sakura-deep);
  border-color: #DFCBB5;
}

.chip-price-right {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.chip-price {
  font-weight: 900;
  color: var(--sakura-deep);
  font-size: 0.95rem;
}

.btn-remove-chip {
  border: none;
  background: rgba(194, 75, 50, 0.12);
  color: var(--berry-err);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.76rem;
  transition: all 0.15s;
}
.btn-remove-chip:hover {
  background: var(--berry-err);
  color: #FFFFFF;
}

.btn-jump-cases {
  border: 1px solid var(--sakura-main);
  background: var(--sakura-light);
  color: var(--sakura-deep);
  font-family: inherit;
  font-size: 0.77rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-jump-cases:hover {
  background: var(--sakura-main);
  color: #FFFFFF;
}

/* Right Sticky Summary & Compatibility Doctor */
.summary-column {
  position: sticky;
  top: 84px;
}

.summary-sticky-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.compat-box,
.receipt-box {
  background: var(--bg-card);
  border: 1px solid var(--sakura-border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.compat-box.state-error {
  border-color: var(--berry-err);
  background: #FFFCFA;
}

.compat-box.state-ok {
  border-color: var(--matcha-main);
}

.compat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sakura-border);
}

.compat-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compat-mascot-icon {
  font-size: 1.65rem;
}

.compat-title-row h3 {
  font-size: 1rem;
  font-weight: 900;
}

.compat-subtitle {
  font-size: 0.77rem;
  color: var(--cocoa-muted);
}

.compat-status-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.compat-status-badge.status-idle {
  background: var(--bg-sakura-soft);
  color: var(--cocoa-muted);
}
.compat-status-badge.status-ok {
  background: var(--matcha-bg);
  color: #2E5A3C;
  border: 1px solid var(--matcha-border);
}
.compat-status-badge.status-error {
  background: var(--berry-bg);
  color: var(--berry-err);
  border: 1px solid var(--berry-border);
  animation: pulseAlert 1.8s infinite;
}
.compat-status-badge.status-warn {
  background: var(--lemon-bg);
  color: #9A5B1A;
  border: 1px solid var(--lemon-border);
}

@keyframes pulseAlert {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Visual Dimension Progress Bars */
.dimension-meters {
  background: var(--bg-milk);
  border: 1px solid var(--sakura-border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dimension-meters.hidden {
  display: none;
}

.meter-row {
  font-size: 0.79rem;
}

.meter-label-line {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 4px;
}

.meter-bar-bg {
  width: 100%;
  height: 8px;
  background: #E6DDD0;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.meter-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--matcha-main);
  transition: width 0.3s ease;
}
.meter-bar-fill.fill-warn {
  background: var(--lemon-main);
}
.meter-bar-fill.fill-danger {
  background: var(--berry-err);
}

/* Compatibility Check Messages List */
.compat-checks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.compat-empty-hint {
  font-size: 0.83rem;
  color: var(--cocoa-muted);
  background: var(--bg-milk);
  border: 1px solid var(--sakura-border);
  padding: 10px 12px;
  border-radius: var(--radius-md);
}

.check-item {
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  border-left: 3.5px solid transparent;
}

.check-item.level-error {
  background: var(--berry-bg);
  border-left-color: var(--berry-err);
  color: #7D2B19;
}

.check-item.level-warning {
  background: var(--lemon-bg);
  border-left-color: var(--lemon-main);
  color: #7D4716;
}

.check-item.level-ok {
  background: var(--matcha-bg);
  border-left-color: var(--matcha-main);
  color: #234B31;
}

.check-item strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.86rem;
}

/* Selected Items Receipt Box */
.receipt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sakura-border);
}

.receipt-header h3 {
  font-size: 1.02rem;
  font-weight: 900;
}

.receipt-header small {
  font-size: 0.73rem;
  color: var(--cocoa-muted);
}

.selected-count-badge {
  background: var(--sakura-light);
  color: var(--sakura-deep);
  border: 1px solid #E5D5C3;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.selected-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.empty-receipt {
  text-align: center;
  padding: 24px 12px;
  color: var(--cocoa-muted);
  font-size: 0.85rem;
}

.empty-illust {
  font-size: 1.9rem;
  margin-bottom: 6px;
}

.receipt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  background: var(--bg-milk);
  border: 1px solid var(--sakura-border);
  border-radius: var(--radius-md);
  font-size: 0.83rem;
}

.receipt-item-left {
  min-width: 0;
  flex: 1;
}

.receipt-cat-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  background: var(--sakura-light);
  color: var(--sakura-deep);
  border: 1px solid #E2D2C0;
  padding: 1px 6px;
  border-radius: 5px;
  margin-right: 6px;
}

.receipt-item-name {
  font-weight: 700;
  color: var(--cocoa-text);
  word-break: break-word;
}

.receipt-item-right {
  text-align: right;
  white-space: nowrap;
}

.receipt-item-price {
  font-weight: 900;
  color: var(--sakura-deep);
  display: block;
}

.receipt-item-qty {
  font-size: 0.72rem;
  color: var(--cocoa-muted);
}

.receipt-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #D5C8B8;
}

.total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.total-label {
  font-size: 0.94rem;
  font-weight: 800;
}

.total-amount {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--sakura-deep);
}

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

.btn-primary-kawaii,
.btn-secondary-kawaii {
  border: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.86rem;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary-kawaii {
  background: #B3763E;
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(150, 91, 38, 0.22);
}
.btn-primary-kawaii:hover:not(:disabled) {
  background: var(--sakura-deep);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(150, 91, 38, 0.3);
}

.btn-secondary-kawaii {
  background: var(--bg-sakura-soft);
  color: var(--sakura-deep);
  border: 1px solid #D5C5B2;
}
.btn-secondary-kawaii:hover:not(:disabled) {
  background: var(--sakura-light);
  border-color: var(--sakura-main);
}

.btn-primary-kawaii:disabled,
.btn-secondary-kawaii:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

/* ==========================================================================
   TAB 2: CASE GALLERY (IGrp=14)
   ========================================================================== */

.cases-hero {
  background: #FFFFFF;
  border: 1px solid var(--sakura-border);
  border-left: 4px solid var(--sakura-main);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-soft);
}

.cases-hero h2 {
  font-size: 1.28rem;
  font-weight: 900;
  margin: 4px 0;
}

.cases-hero p {
  font-size: 0.89rem;
  color: var(--cocoa-muted);
}

.cases-smart-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--sakura-border);
}

.smart-compat-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.89rem;
  color: var(--cocoa-text);
}

.smart-compat-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--sakura-deep);
}

.btn-back-to-builder {
  border: 1px solid var(--sakura-main);
  background: var(--sakura-light);
  color: var(--sakura-deep);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-back-to-builder:hover {
  background: var(--sakura-main);
  color: #FFFFFF;
}

.cases-toolbar {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 12px;
  background: #FFFFFF;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--sakura-border);
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}

.filter-item label {
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--cocoa-muted);
  margin-bottom: 4px;
}

.cases-results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 0.89rem;
  font-weight: 700;
  color: var(--cocoa-muted);
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-btn {
  border: 1px solid var(--sakura-border);
  background: #FFFFFF;
  color: var(--cocoa-text);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--sakura-main);
  background: var(--bg-milk);
}
.page-btn.active {
  background: #B3763E;
  color: #FFFFFF;
  border-color: #B3763E;
}
.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Case Cards Grid */
.cases-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.case-card {
  background: #FFFFFF;
  border: 1px solid var(--sakura-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.case-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--sakura-main);
}

.case-card.is-selected-case {
  border-color: var(--matcha-main);
  box-shadow: 0 0 0 2.5px rgba(88, 139, 104, 0.25);
}

.case-card.has-compat-conflict {
  border-color: var(--berry-border);
}

.case-img-box {
  position: relative;
  height: 210px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  border-bottom: 1px solid var(--sakura-border);
  cursor: pointer;
}

.case-img-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.case-card:hover .case-img-box img {
  transform: scale(1.04);
}

.case-brand-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(250, 247, 242, 0.94);
  border: 1px solid var(--sakura-border);
  color: var(--cocoa-muted);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
}

.case-compat-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.71rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}
.case-compat-tag.tag-ok {
  background: var(--matcha-bg);
  color: #2E5A3C;
  border: 1px solid var(--matcha-border);
}
.case-compat-tag.tag-err {
  background: var(--berry-bg);
  color: var(--berry-err);
  border: 1px solid var(--berry-border);
}

.case-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.case-card-title {
  font-size: 0.93rem;
  font-weight: 800;
  color: var(--cocoa-text);
  line-height: 1.42;
  cursor: pointer;
}
.case-card-title:hover {
  color: var(--sakura-deep);
}

.case-key-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.case-spec-list {
  font-size: 0.78rem;
  color: var(--cocoa-muted);
  background: var(--bg-milk);
  border: 1px solid #EDE5DA;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.case-card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--sakura-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.case-price {
  font-size: 1.16rem;
  font-weight: 900;
  color: var(--sakura-deep);
}

.case-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-case-detail {
  border: 1px solid var(--sakura-border);
  background: #FFFFFF;
  color: var(--cocoa-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-case-detail:hover {
  border-color: var(--sakura-main);
  color: var(--sakura-deep);
}

.btn-select-case {
  border: none;
  background: #B3763E;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 800;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-select-case:hover {
  background: var(--sakura-deep);
}
.btn-select-case.selected {
  background: var(--matcha-main);
}

.cases-footer-pagination {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

/* Modal Dialog */
.kawaii-modal {
  border: none;
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 720px;
  width: 92vw;
  margin: auto;
  box-shadow: 0 20px 50px rgba(45, 36, 28, 0.22);
  background: transparent;
}

.kawaii-modal::backdrop {
  background: rgba(45, 36, 28, 0.42);
  backdrop-filter: blur(4px);
}

.modal-card {
  background: #FFFFFF;
  border: 1.5px solid var(--sakura-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--sakura-border);
  background: var(--bg-milk);
  color: var(--cocoa-muted);
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-close-btn:hover {
  background: var(--sakura-light);
  color: var(--sakura-deep);
}

.modal-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: center;
}

.modal-img-wrap {
  background: #FFFFFF;
  border: 1px solid var(--sakura-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  text-align: center;
}

.modal-img-wrap img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

/* Site Footer */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  background: var(--bg-sakura-soft);
  border-top: 1px solid var(--sakura-border);
  padding: 22px 16px;
  text-align: center;
  color: var(--cocoa-muted);
  font-size: 0.83rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.footer-source {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.footer-source a {
  color: var(--sakura-deep);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-source a:hover {
  color: var(--cocoa-text);
}

.footer-sync-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.79rem;
}

.footer-sync-info strong {
  color: var(--cocoa-text);
  background: #FFFFFF;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--sakura-border);
}

/* Toast Notification */
.kawaii-toast {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 200;
  background: var(--cocoa-text);
  color: #FAF7F2;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(45, 36, 28, 0.22);
}

/* Mobile Sticky Bottom Bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 95;
  background: rgba(250, 247, 242, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--sakura-border);
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 16px rgba(54, 46, 40, 0.08);
}

.btn-mobile-summary {
  border: none;
  background: #B3763E;
  color: #FFFFFF;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.84rem;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

/* ==========================================================================
   RESPONSIVE WEB DESIGN (RWD) BREAKPOINTS
   ========================================================================== */

@media (max-width: 1080px) {
  .site-header {
    position: relative;
  }
  .builder-grid {
    grid-template-columns: 1fr;
  }
  .summary-column {
    position: static;
  }
  .cases-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .cases-toolbar .filter-search {
    grid-column: 1 / -1;
  }
  .mobile-bottom-bar {
    display: flex;
  }
}

@media (max-width: 680px) {
  .main-container {
    margin: 12px auto;
    padding: 0 12px;
  }

  .header-inner {
    padding: 10px 12px;
    gap: 10px;
  }

  .mascot-avatar {
    width: 38px;
    height: 38px;
  }
  .mascot-avatar svg {
    width: 32px;
    height: 32px;
  }

  .brand-jp-badge {
    font-size: 0.68rem;
    padding: 1px 8px;
  }

  .site-title {
    font-size: 1.08rem;
  }

  .main-tabs {
    width: 100%;
    justify-content: stretch;
    padding: 4px;
  }

  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 7px 10px;
  }

  .tab-btn .tab-text small {
    display: none;
  }

  .sync-status-box {
    align-self: flex-end;
    padding: 3px 8px;
    font-size: 0.68rem;
  }

  .footer-divider {
    display: none;
  }

  .kawaii-banner {
    padding: 12px 14px;
    margin-bottom: 14px;
    gap: 10px;
  }

  .banner-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .banner-desc {
    font-size: 0.82rem;
  }

  .banner-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .btn-preset,
  .btn-clear-all {
    font-size: 0.78rem;
    padding: 6px 10px;
    text-align: center;
  }

  .cat-card-controls {
    grid-template-columns: 1fr;
  }

  .cat-selected-chip {
    flex-direction: column;
    align-items: flex-start;
  }

  .chip-price-right {
    width: 100%;
    justify-content: space-between;
  }

  .cases-toolbar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .modal-card {
    padding: 16px;
    max-height: 88vh;
    overflow-y: auto;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .kawaii-toast {
    left: 16px;
    right: 16px;
    bottom: 70px;
    text-align: center;
  }
}

@media print {
  .site-header,
  .kawaii-banner,
  .components-column,
  .receipt-actions,
  .mobile-bottom-bar {
    display: none !important;
  }
  .builder-grid {
    grid-template-columns: 1fr;
  }
}
