/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --bg-input: #0f3460;
  --accent: #4ecca3;
  --accent-dim: #3ba583;
  --text-primary: #eaeaea;
  --text-secondary: #a0a0b8;
  --text-muted: #666680;
  --danger: #e94560;
  --warning: #f5a623;
  --border-radius: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== App Shell ===== */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ===== Header ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-secondary);
  z-index: 10;
  flex-shrink: 0;
}

.app-header h1 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

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

.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  padding: 6px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}

.icon-btn:active {
  background: rgba(255,255,255,0.1);
}

/* ===== Camera Section ===== */
.camera-section {
  position: relative;
  flex: 1 1 50%;
  min-height: 0;
  background: #000;
  overflow: hidden;
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#capture-canvas {
  display: none;
}

/* Scan overlay: blur above/below strip, colored border on strip (FR-007) */
.scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

/* Frosted blur regions — all four sides outside the strip (FR-009) */
.scan-blur-top,
.scan-blur-bottom,
.scan-blur-side {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.scan-blur-top    { flex: 0 0 38.75%; } /* STRIP_TOP_PCT */
.scan-blur-bottom { flex: 1; }          /* remaining ~38.75% */

/* Middle row: side blurs flank the clear strip */
.scan-middle-row {
  flex: 0 0 22.5%; /* STRIP_BOTTOM_PCT - STRIP_TOP_PCT */
  display: flex;
  flex-direction: row;
}

.scan-blur-side { flex: 0 0 25%; } /* STRIP_LEFT_PCT / (1 - STRIP_RIGHT_PCT) */

/* Clear scanning strip — 22.5% of camera height, 50% of width (FR-009) */
.scan-strip {
  flex: 1;
  border: 2px solid transparent;
  transition: border-color 0.25s ease;
  box-sizing: border-box;
}

/* Red border while scanning (no match yet) */
.scan-strip.strip-scanning { border-color: var(--danger); }

/* Green border on successful recognition */
.scan-strip.strip-found    { border-color: var(--accent); }

/* Scan indicator */
.scan-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--text-secondary);
  transition: all 0.3s;
}

.scan-indicator.scanning {
  color: var(--accent);
}

.scan-indicator.scanning .scan-dot {
  background: var(--accent);
  animation: pulse 1.5s infinite;
}

.scan-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Camera permission / error states */
.camera-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
  gap: 12px;
  color: var(--text-secondary);
}

.camera-fallback-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.camera-fallback p {
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 280px;
}

/* ===== Results Panel ===== */
.results-panel {
  flex: 1 1 50%;
  min-height: 0;
  background: var(--bg-secondary);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  margin-top: -16px;
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  flex-shrink: 0;
}

.panel-handle-bar {
  width: 36px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

/* ===== Empty State (no card detected) ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 16px;
  padding: 24px 0;
}

.empty-state-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.empty-state h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 260px;
}

/* ===== Manual Input ===== */
.manual-input-section {
  width: 100%;
  max-width: 320px;
}

.manual-input-row {
  display: flex;
  gap: 8px;
}

.manual-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  text-transform: uppercase;
  font-family: "SF Mono", "Fira Code", monospace;
  letter-spacing: 1px;
  transition: border-color 0.2s;
}

.manual-input::placeholder {
  color: var(--text-muted);
  text-transform: none;
  font-family: inherit;
  letter-spacing: 0;
}

.manual-input:focus {
  border-color: var(--accent);
}

.search-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.search-btn:active {
  background: var(--accent-dim);
}

.search-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Card Result ===== */
.card-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}

.card-result-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.card-image-wrapper {
  flex-shrink: 0;
  width: 110px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
}

.card-image-wrapper img {
  width: 100%;
  display: block;
}

.card-image-placeholder {
  width: 100%;
  aspect-ratio: 63/88;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

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

.card-number-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  font-family: "SF Mono", "Fira Code", monospace;
  width: fit-content;
}

.rarity-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: #fff;
}

.rarity-c  { background: #5a5a6e; }
.rarity-u  { background: #3a7a4f; }
.rarity-r  { background: #4a6ab5; }
.rarity-lr { background: #b8860b; }
.rarity-sp { background: #8b2fc9; }

.card-name-zh {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
}

.card-name-en {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

/* FR-014: fixed 2×2 grid for Lv/Cost/AP/HP — no shifting when values are null */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Color indicator */
.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.color-blue   { background: #4a90d9; }
.color-green  { background: #50b86c; }
.color-red    { background: #d9534f; }
.color-white  { background: #e0e0e0; }
.color-purple { background: #9b59b6; }

/* ===== Card Details Section ===== */
.card-details-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-block {
  background: var(--bg-card);
  padding: 12px;
  border-radius: 10px;
}

.detail-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.detail-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
}

/* FR-011: keyword highlight token — colour set inline; class for future override */
.kw-highlight {
  font-weight: 600;
}

.traits-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trait-tag {
  background: rgba(78, 204, 163, 0.15);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
}

/* ===== Attribution ===== */
.attribution-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 10px;
}

.attribution-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.attribution-link:active {
  opacity: 0.7;
}

.attribution-credit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== Loading State ===== */
.loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 26, 0.7);
  z-index: 20;
  align-items: center;
  justify-content: center;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(78, 204, 163, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.8rem;
  text-align: center;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toast.info {
  background: rgba(22, 33, 62, 0.95);
  color: var(--text-primary);
}

.toast.success {
  background: rgba(78, 204, 163, 0.2);
  border: 1px solid rgba(78, 204, 163, 0.3);
  color: var(--accent);
}

.toast.error {
  background: rgba(233, 69, 96, 0.2);
  border: 1px solid rgba(233, 69, 96, 0.3);
  color: var(--danger);
}

.toast.warning {
  background: rgba(245, 166, 35, 0.2);
  border: 1px solid rgba(245, 166, 35, 0.3);
  color: var(--warning);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Preload Banner ===== */
.preload-banner {
  display: none;
  padding: 8px 16px;
  background: var(--bg-card);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.preload-banner.active {
  display: block;
}

.preload-progress {
  height: 2px;
  background: rgba(78, 204, 163, 0.2);
  border-radius: 1px;
  margin-top: 6px;
  overflow: hidden;
}

.preload-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  width: 0%;
  transition: width 0.3s;
}

/* ===== Auth Header ===== */
.auth-header-section {
  display: flex;
  align-items: center;
}

.auth-login-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-login-btn:active {
  background: var(--accent-dim);
}

.auth-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-display-name {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-logout-btn {
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.auth-logout-btn:active {
  border-color: var(--danger);
  color: var(--danger);
}

/* ===== Auth Modal ===== */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.auth-modal-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 360px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s;
}

.auth-modal-close:active {
  color: var(--text-primary);
}

.auth-modal-logo {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 6px;
}

.auth-modal-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.google-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  color: #333;
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.google-login-btn:active {
  background: #f0f0f0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--text-muted);
  opacity: 0.3;
}

.auth-field {
  margin-bottom: 10px;
}

.auth-field input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
  -webkit-user-select: text;
  user-select: text;
}

.auth-field input:focus {
  border-color: var(--accent);
}

.auth-field input::placeholder {
  color: var(--text-muted);
}

.auth-error {
  background: rgba(233, 69, 96, 0.12);
  border: 1px solid var(--danger);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--danger);
  margin-bottom: 10px;
  text-align: center;
}

.auth-submit-btn {
  width: 100%;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}

.auth-submit-btn:active {
  background: var(--accent-dim);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-toggle {
  text-align: center;
  margin-top: 14px;
}

.auth-toggle button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px;
}

.auth-toggle button strong {
  color: var(--accent);
}

/* ===== Tab Navigation (FR-029) ===== */
.tab-nav {
  display: flex;
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -1px;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== Tab Panes ===== */
.tab-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.tab-pane.active { display: flex; }

/* ===== Deck Auth Prompt ===== */
.deck-auth-prompt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
  color: var(--text-secondary);
}

.deck-auth-icon { font-size: 3rem; opacity: 0.5; }

.deck-auth-prompt p { font-size: 0.9rem; }

/* ===== Deck UI ===== */
.deck-ui {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.deck-top-panel {
  flex: 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.deck-bottom-panel {
  flex: 1;
  min-height: 180px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ===== Deck Toolbar ===== */
.deck-toolbar {
  padding: 8px 12px 4px;
  background: var(--bg-secondary);
  flex-shrink: 0;
  z-index: 2;
}

.deck-selector-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.deck-selector {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 0.85rem;
  outline: none;
  min-width: 0;
}

.deck-count-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.deck-count-full  { background: rgba(78,204,163,0.2); color: var(--accent); }
.deck-count-partial { background: rgba(245,166,35,0.2); color: var(--warning); }

.deck-color-warn {
  font-size: 0.7rem;
  color: var(--warning);
  flex-shrink: 0;
}

.deck-actions-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.deck-action-btn {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.deck-action-btn:active { background: rgba(255,255,255,0.08); color: var(--text-primary); }

.deck-action-danger { color: var(--danger); border-color: rgba(233,69,96,0.3); }
.deck-action-danger:active { background: rgba(233,69,96,0.1); }

/* ===== Deck Content Row (cover sidebar + card scroll) ===== */
.deck-content-row {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  overflow: hidden;
}

/* ===== Deck Cover Sidebar (FR-036) ===== */
/* Card images are 600×838 px — aspect-ratio locks the sidebar to that exact scale */
.deck-cover-sidebar {
  width: 80px;
  aspect-ratio: 600 / 838;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  background: var(--bg-card);
}

.deck-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}

.deck-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
}

/* ===== Deck Card Scroll (right column) ===== */
.deck-card-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-left: 1px solid rgba(255,255,255,0.06);
}

/* ===== Deck Card List (FR-030) ===== */
.deck-card-list { padding: 8px 0; }

.deck-empty-msg {
  text-align: center;
  padding: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.deck-type-section { margin-bottom: 4px; }

.deck-type-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.deck-type-header .type-count {
  color: var(--text-muted);
  font-weight: 400;
}

.deck-type-body { /* always visible for now */ }

.deck-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}


.deck-card-row-info {
  flex: 1;
  min-width: 0;
}

.deck-card-row-num {
  font-size: 0.65rem;
  color: var(--accent);
  font-family: "SF Mono", "Fira Code", monospace;
}

.deck-card-row-name {
  font-size: 0.85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-card-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.deck-count-display {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  color: var(--text-primary);
}

.btn-deck-minus,
.btn-deck-plus {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.btn-deck-minus { background: rgba(233,69,96,0.15); color: var(--danger); }
.btn-deck-minus:active { background: rgba(233,69,96,0.3); }

.btn-deck-plus { background: rgba(78,204,163,0.15); color: var(--accent); }
.btn-deck-plus:active { background: rgba(78,204,163,0.3); }

.btn-set-cover {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}

/* ===== Add Card Section (FR-031) ===== */
.deck-add-controls {
  padding: 8px 12px 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-secondary);
}

.btn-scan-to-deck {
  width: 100%;
  background: rgba(78,204,163,0.12);
  border: 1px solid rgba(78,204,163,0.3);
  border-radius: 8px;
  color: var(--accent);
  padding: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.btn-scan-to-deck:active { background: rgba(78,204,163,0.25); }

/* ===== Filter Section ===== */
.filter-section { margin-bottom: 6px; }

.filter-row { margin-bottom: 4px; }

.filter-category-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 3px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-count-badge {
  background: var(--accent);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-chip {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 3px 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-chip.active {
  background: rgba(78,204,163,0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-reset-filters {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
}

/* ===== Deck Search Input ===== */
.deck-search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
  -webkit-user-select: text;
  user-select: text;
}

.deck-search-input:focus { border-color: var(--accent); }
.deck-search-input::placeholder { color: var(--text-muted); }

/* ===== Deck Search Results ===== */
.deck-search-results {
}

.deck-search-hint {
  text-align: center;
  padding: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.search-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.search-result-thumb {
  width: 32px;
  height: 44px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--bg-card);
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-num {
  font-size: 0.62rem;
  color: var(--accent);
  font-family: "SF Mono", "Fira Code", monospace;
}

.search-result-name {
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-meta {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 1px;
}

.color-chip {
  font-size: 0.62rem;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
  font-weight: 600;
}

.color-chip-blue   { background: #4a90d9; }
.color-chip-green  { background: #50b86c; }
.color-chip-red    { background: #d9534f; }
.color-chip-white  { background: #888; }
.color-chip-purple { background: #9b59b6; }

.btn-add-to-result {
  background: rgba(78,204,163,0.15);
  border: 1px solid rgba(78,204,163,0.3);
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.btn-add-to-result:active { background: rgba(78,204,163,0.3); }

.btn-add4 {
  background: rgba(78,204,163,0.28);
  border-color: rgba(78,204,163,0.5);
  margin-left: 4px;
}
.btn-add4:active { background: rgba(78,204,163,0.45); }

/* ===== Scan-to-deck Banner ===== */
.scan-deck-banner {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(78,204,163,0.9);
  color: #000;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 15;
  white-space: nowrap;
}

.scan-deck-banner button {
  background: rgba(0,0,0,0.2);
  border: none;
  border-radius: 10px;
  color: #000;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
}

/* ===== Scan-to-deck Bottom Sheet (FR-032) ===== */
.scan-deck-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 16px;
  z-index: 500;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.5);
}

.sheet-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.sheet-card-thumb {
  width: 52px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-card);
  flex-shrink: 0;
}

.sheet-card-info { flex: 1; }

.sheet-card-number {
  font-size: 0.7rem;
  color: var(--accent);
  font-family: "SF Mono", "Fira Code", monospace;
  margin-bottom: 3px;
}

.sheet-card-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.sheet-card-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.sheet-actions {
  display: flex;
  gap: 10px;
}

.sheet-btn-add {
  flex: 1;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.sheet-btn-continue {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ===== Generic Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 24px;
  width: 100%;
  max-width: 360px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.modal-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.share-code-box {
  width: 100%;
  height: 80px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-family: "SF Mono", "Fira Code", monospace;
  padding: 10px;
  resize: none;
  outline: none;
  margin-bottom: 12px;
  -webkit-user-select: text;
  user-select: text;
}

/* ===== FR-033: Add to deck row in card result ===== */
.add-to-deck-row {
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}

.btn-add-to-deck {
  background: rgba(78,204,163,0.12);
  border: 1px solid rgba(78,204,163,0.3);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 20px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.btn-add-to-deck:active { background: rgba(78,204,163,0.25); }

/* ===== Stats Sheet (FR-041) ===== */
.stats-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  background: var(--bg-secondary);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  z-index: 950;
}

.stats-drag-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  flex-shrink: 0;
}

.stats-drag-bar {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
}

.stats-sheet-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 8px;
}

.stats-sheet-footer {
  flex-shrink: 0;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  border-top: 1px solid rgba(255,255,255,0.07);
}

.stats-close-btn {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 10px;
  cursor: pointer;
}

.stats-close-btn:active { background: rgba(255,255,255,0.08); }

.stats-section {
  margin-bottom: 14px;
}

.stats-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.stats-card-block {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 10px 12px;
}

.stats-color-row, .stats-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0;
}

.stats-color-chip {
  font-size: 0.88rem;
  font-weight: 600;
}

.stats-type-chip {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stats-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin: 8px 0;
}

.stats-muted {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 2px 0;
}

/* Curve bars */
.stats-curve-block { padding: 8px 12px; }

.stats-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.stats-bar-label {
  width: 52px;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: "SF Mono", "Fira Code", monospace;
}

.stats-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.3s ease;
}

.stats-bar-count {
  width: 28px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Unit averages */
.stats-avg-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.stats-avg-row + .stats-avg-row {
  border-top: 1px solid rgba(255,255,255,0.06);
}

.stats-avg-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stats-avg-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  font-family: "SF Mono", "Fira Code", monospace;
}

/* Keywords */
.stats-kw-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}

.stats-kw-row + .stats-kw-row {
  border-top: 1px solid rgba(255,255,255,0.06);
}

.stats-kw-label {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.stats-kw-count {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  font-family: "SF Mono", "Fira Code", monospace;
}

/* Rarity */
.stats-rarity-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-rarity-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stats-rarity-code {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: "SF Mono", "Fira Code", monospace;
}

.stats-rarity-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Loading within stats sheet */
.stats-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

/* ===== Account Modal (FR-043) ===== */
.auth-display-name-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}

.auth-display-name-btn:active { background: rgba(78,204,163,0.12); }

.account-info-block {
  margin-bottom: 16px;
}

.account-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.account-info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.account-info-value {
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: right;
  word-break: break-all;
}

.account-stats-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.account-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.account-stats-row-multi {
  align-items: flex-start;
}

.account-stats-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.account-stats-value {
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: right;
}

.account-card-entry {
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.account-deck-count {
  color: var(--accent);
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.78rem;
}

.account-stats-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 6px 0;
}

/* ===== FR-047 UX-NEW-001: Collect bottom sheet ===== */

.collect-sheet-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.collect-sheet-close-btn:active { background: rgba(255,255,255,0.18); }

.collect-sheet-count-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 0 4px;
}

.collect-sheet-count-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.collect-sheet-btn-add {
  background: rgba(0,180,100,0.2) !important;
  border-color: rgba(0,180,100,0.4) !important;
  color: #68d391 !important;
}
.collect-sheet-btn-add:active { background: rgba(0,180,100,0.35) !important; }

/* ===== FR-048: Collection Tab ===== */

.collect-ui {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.collect-header-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.collect-header-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.collect-count-badge {
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(99,179,237,0.1);
  border-radius: 10px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.collect-card-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.collect-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.collect-card-thumb {
  width: 36px;
  height: 50px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}

.collect-card-info {
  flex: 1;
  min-width: 0;
}

.collect-card-num {
  font-size: 0.65rem;
  color: var(--accent);
  margin-bottom: 2px;
}

.collect-card-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collect-card-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.collect-count-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.collect-count-btn:active { background: rgba(255,255,255,0.15); }
.collect-count-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.collect-count-val {
  font-size: 0.9rem;
  font-weight: 600;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.collect-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

/* ===== FR-049: Purchase Estimate section in stats sheet ===== */

.stats-purchase-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.stats-purchase-num {
  font-size: 0.68rem;
  color: var(--accent);
  flex-shrink: 0;
}

.stats-purchase-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-purchase-missing {
  font-size: 0.75rem;
  color: #f6ad55;
  flex-shrink: 0;
}

.stats-purchase-price {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.stats-purchase-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  text-align: right;
}

.stats-purchase-note {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 4px;
}

.stats-purchase-complete {
  color: #68d391;
  font-size: 0.85rem;
  padding: 4px 0;
}

/* ===== FR-033/FR-047: Add-to-deck + add-to-collection row ===== */
.btn-add-to-collection {
  display: inline-block;
  padding: 8px 14px;
  background: rgba(0,180,100,0.15);
  border: 1px solid rgba(0,180,100,0.35);
  border-radius: 8px;
  color: #68d391;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  margin-left: 6px;
}
.btn-add-to-collection:active { background: rgba(0,180,100,0.3); }

/* ===== Phase 5: Market Tab (FR-053) ===== */

.market-filter-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 4px;
}

.market-card-list {
  overflow-y: auto;
  padding: 0 12px 80px;
}

.market-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.market-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.market-stock-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.market-price-label {
  font-size: 14px;
  font-weight: 600;
  color: #4caf50;
}

.market-low-stock {
  color: #ef5350;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}

.btn-buy-card {
  background: rgba(76,175,80,0.15);
  border: 1px solid rgba(76,175,80,0.4);
  border-radius: 8px;
  color: #81c784;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-buy-card:active { background: rgba(76,175,80,0.3); }

/* ===== Phase 5: Account Tab (FR-055) ===== */

.account-tab-ui {
  overflow-y: auto;
  padding: 16px 16px 80px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}

.account-tab-info-block {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.loading-msg {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 12px 0;
}

.order-history-row {
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 10px 12px;
}

.order-history-main {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.order-history-extra {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.order-status-badge {
  display: inline-block;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
}
.badge-pending   { background: #7c5e00; color: #ffd740; }
.badge-confirmed { background: #0d3b66; color: #64b5f6; }
.badge-fulfilled { background: #1b5e20; color: #81c784; }
.badge-rejected  { background: #4a0000; color: #ef9a9a; }

/* ===== Utility ===== */
.hidden { display: none !important; }

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