/* ===== Card ===== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  animation: fadeIn var(--transition-base) both;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}
.card:active {
  transform: scale(0.98);
}

.card-header {
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: var(--bg-hover);
  border: 1px solid var(--border);
}
.card-info h3 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.card-info .category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
  text-transform: none;
}

.card-body {
  padding: 14px 15px 12px;
}
.card-footer {
  padding: 11px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  gap: 12px;
}
.card-footer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-quick-use {
  min-width: 52px;
  height: 30px;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 850;
}
.card-quick-use:disabled {
  opacity: 0.45;
  cursor: default;
}
.card-quick-use:not(:disabled):hover {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge-accent {
  background: var(--grad-brand);
  color: #ffffff;
  border-color: transparent;
}
.badge-neutral {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border-color: var(--border-strong);
}
.badge-success {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: #04261b;
  border: none;
}
.badge-warning {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #3a2400;
  border: none;
}
.badge-danger {
  background: linear-gradient(135deg, #fb7185, #ef4444);
  color: #fff;
  border: none;
}

/* ===== Stamp Board ===== */
.stamp-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin: 10px 0;
}
.stamp {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
  background: var(--bg-hover);
}
.stamp svg {
  width: 20px;
  height: 20px;
  stroke: var(--success);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stamp.used {
  border-color: var(--success);
  background: oklch(60% 0.15 145 / 0.15);
}
.stamp.used svg {
  opacity: 1;
  transform: scale(1);
}
.stamp.reward svg {
  opacity: 0.55;
  transform: none;
  stroke: var(--accent-gold);
  stroke-width: 2;
}
.stamp.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ripple);
}
.stamp.current::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid var(--accent);
  animation: pulse-ring 1.6s ease-out infinite;
}

/* ===== Progress ===== */
.progress-bar {
  height: 8px;
  background: var(--bg-hover);
  border-radius: 100px;
  overflow: hidden;
  margin: 8px 0;
}
.card-progress-meta,
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 7px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  min-width: 4px;
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-120%);
  animation: shimmer 2.4s ease-in-out infinite;
}
.progress-fill.success::after { display: none; }
.progress-fill.success { background: linear-gradient(135deg, #34d399, #10b981); }

/* ===== Button ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-primary {
  background: var(--grad-brand);
  background-size: 180% 180%;
  color: #ffffff;
  box-shadow: var(--glow-brand);
}
.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: var(--glow-brand);
}
.btn-primary:active {
  transform: scale(0.97);
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-active);
}
.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
}
.subtle-danger {
  margin-top: 10px;
}
.btn-ghost {
  color: var(--text-secondary);
  padding: 8px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.btn-block {
  width: 100%;
}

/* ===== Form ===== */
.form-group {
  margin-bottom: 15px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group {
  flex: 1;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border-strong);
  border-radius: 2px;
}
.timeline-item {
  position: relative;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child {
  border-bottom: none;
}
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 16px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--accent);
  z-index: 1;
}
.timeline-item.success .timeline-dot {
  border-color: var(--success);
  background: var(--success);
}
.timeline-item.success .timeline-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bg-surface);
}
.timeline-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.timeline-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.timeline-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== Popup / Modal Overlay ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.popup-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.overlay.active .popup-sheet {
  transform: translateY(0);
}

.popup-header {
  padding: 16px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.popup-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
}
.popup-body {
  padding: 8px 20px 20px;
  overflow-y: auto;
  flex: 1;
}
.popup-footer {
  padding: 12px 20px calc(12px + var(--safe-bottom));
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border);
}
.popup-footer .btn {
  flex: 1;
}
.confirm-message {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
}
.toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--success);
}

/* ===== Summary Cards ===== */
.summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}
.summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px 10px;
  text-align: center;
  transition: border-color var(--transition-fast);
}
.summary-card:hover {
  border-color: var(--accent);
}
.summary-card .value {
  font-size: 1.28rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--text-primary);
}
.summary-card .label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== Nearby Card ===== */
.nearby-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUp var(--transition-base);
}
.nearby-card .icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: pop 0.4s ease;
}
.nearby-card .icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.nearby-card .info {
  flex: 1;
  min-width: 0;
}
.nearby-card .info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.nearby-card .info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Shop Detail Header ===== */
.detail-header {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
}
.detail-header .hero {
  padding: 22px 20px;
  background: var(--bg-elevated);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.detail-header .hero h2 {
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.detail-header .hero .address {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.detail-header .stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 13px 0;
}
.detail-header .stats .stat {
  text-align: center;
  padding: 0 8px;
  border-right: 1px solid var(--border);
}
.detail-header .stats .stat:last-child {
  border-right: none;
}
.detail-header .stats .stat .num {
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.detail-header .stats .stat .lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ===== Skin Selector ===== */
.skin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.skin-option {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  background: var(--bg-elevated);
}
.skin-option:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.skin-option.selected {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent), 0 8px 24px var(--accent-ripple);
}
.skin-option .swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto 8px;
  border: 1px solid var(--border-strong);
}
.skin-option .name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.skin-option .desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Settings Toggle ===== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child {
  border-bottom: none;
}
.toggle-row .info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.toggle-row .info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.toggle-switch {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-primary);
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.toggle-switch.active {
  background: var(--grad-brand);
  border-color: transparent;
}
.toggle-switch.active::after {
  transform: translateX(20px);
  background: var(--text-inverse);
}

/* ===== Category Icon Map ===== */
.category-icon {
  font-size: 1.4rem;
  line-height: 1;
}

/* ===== Dashboard ===== */
.product-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #ebf3ff 0%, #ffffff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}
.product-hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(37,99,235,.12), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}
.product-hero > * {
  position: relative;
  z-index: 1;
}
.product-hero h1 {
  font-size: 1.46rem;
  line-height: 1.2;
  margin: 4px 0 6px;
  font-weight: 850;
  background: var(--grad-brand);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradShift 6s ease infinite;
}
.product-hero p {
  max-width: 560px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.eyebrow {
  color: var(--accent-gold);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}
.priority-panel {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 18px;
  padding: 15px;
  margin-bottom: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  text-align: left;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.priority-panel:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.priority-panel strong {
  display: block;
  margin: 3px 0;
  font-size: 1.05rem;
}
.priority-panel span {
  color: var(--text-secondary);
  font-size: 0.86rem;
}
.priority-meter {
  width: 14px;
  min-height: 58px;
  border-radius: 10px;
  background: var(--bg-hover);
  display: flex;
  align-items: flex-end;
  padding: 3px;
}
.priority-meter span {
  width: 100%;
  border-radius: 8px;
  background: var(--accent);
}

/* ===== Home Tools ===== */
.home-tools {
  display: grid;
  grid-template-columns: 1fr 136px;
  gap: 10px;
  margin: 10px 0 12px;
}
.home-tools input[type="search"] {
  min-height: 44px;
}
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar {
  display: none;
}
.status-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 4px 0 10px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}
.status-tab {
  min-height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 850;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.status-tab.active {
  background: var(--grad-brand);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(34,211,238,.22);
}

/* ===== Detail Actions ===== */
.detail-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin: 16px 0;
}
.detail-actions .btn {
  min-height: 44px;
}

.memo-input {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  resize: vertical;
  min-height: 84px;
  outline: none;
}
.memo-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ripple);
}

.detail-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.detail-status.neutral { background: var(--bg-hover); color: var(--text-secondary); }
.detail-status.success { background: var(--success); color: var(--text-inverse); }
.detail-status.warning { background: var(--warning); color: var(--text-inverse); }
.detail-status.danger { background: var(--danger); color: var(--text-inverse); }
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.quick-action {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 800;
}
.quick-action.disabled {
  color: var(--text-muted);
  pointer-events: none;
}
.quick-action.readonly {
  color: var(--accent-gold);
}
.note-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  padding: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.progress-wrap {
  margin: 12px 0;
}

.settings-panel,
.settings-card {
  margin-bottom: 16px;
}
.settings-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: 15px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.section-title h3 {
  font-size: 1rem;
}
.section-title span {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.metric {
  padding: 12px 8px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: border-color var(--transition-fast);
}
.metric:hover {
  border-color: var(--accent);
}
.metric strong {
  display: block;
  font-size: 1.2rem;
}
.metric span {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
}
.form-spacer {
  height: 8px;
}
.empty-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== Map ===== */
.map-page {
  display: grid;
  gap: 12px;
}
.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
}
.map-toolbar h2 {
  font-size: 1.32rem;
  line-height: 1.2;
  margin: 4px 0;
}
.map-toolbar p {
  color: var(--text-secondary);
  font-size: 0.88rem;
}
.coupon-map {
  height: min(58vh, 520px);
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  position: relative;
}
.map-loading,
.map-empty {
  height: 100%;
}
.leaflet-container {
  font-family: var(--font);
  background: var(--bg-elevated);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.leaflet-popup-content {
  min-width: 150px;
  line-height: 1.45;
}
.leaflet-popup-content span {
  color: var(--text-secondary);
}
.coupon-map-pin {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--bg-primary);
  border: 2px solid var(--text-inverse);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.coupon-map-pin span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent-blue);
}
.coupon-map-pin.me span { background: var(--accent-blue); }
.coupon-map-pin.success span { background: var(--success); }
.coupon-map-pin.warning span { background: var(--warning); }
.coupon-map-pin.danger span { background: var(--danger); }
.coupon-map-pin.neutral span { background: var(--accent); }
.map-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.map-summary div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}
.map-summary strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.map-summary span {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 750;
}
.nearby-shop-list {
  display: grid;
  gap: 8px;
}
.nearby-shop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}
.nearby-shop-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  background: none;
  text-align: left;
}
.nearby-shop-main strong,
.nearby-shop-main span {
  display: block;
}
.nearby-shop-main span {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 52vw;
}
.nearby-shop-main em {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 850;
}
.nearby-dir {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--grad-brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}
.nearby-dir svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Map floating selected-shop card */
.coupon-map-wrap { position: relative; }
.map-float {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: fadeIn var(--transition-base);
}
.map-float[hidden] { display: none; }
.map-float-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.map-float-ico {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: var(--grad-brand-soft);
  flex-shrink: 0;
  font-size: 1.2rem;
}
.map-float-text { min-width: 0; }
.map-float-text strong { display: block; font-size: 0.95rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-float-text span { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; }
.map-float-actions { display: flex; gap: 8px; flex-shrink: 0; }
.map-float-actions .btn { min-height: 38px; padding: 8px 14px; font-size: 0.82rem; }

/* Detail stamp header */
.stamp-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 8px; }
.stamp-head span { font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); }
.stamp-head strong { font-size: 1.05rem; font-weight: 850; color: var(--accent); font-variant-numeric: tabular-nums; }
.stamp-head strong em { color: var(--text-muted); font-style: normal; font-weight: 700; font-size: 0.9rem; }

/* ===== Animations for pages ===== */
.page-enter {
  animation: fadeIn 0.3s ease forwards;
}

/* ===== Filter Chips ===== */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.chip.active {
  background: var(--grad-brand);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--glow-brand);
}
.chip:hover:not(.active) {
  background: var(--bg-hover);
}

/* ===== Responsive tablet ===== */
@media (min-width: 768px) {
  #app {
    max-width: 960px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
  .main {
    padding: 24px;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
  }
  .popup-sheet {
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
    max-height: 75vh;
  }
  .overlay {
    align-items: center;
  }
  .bottom-nav {
    max-width: 460px;
    margin: 0 auto 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    height: 60px;
    padding: 8px;
  }
  .fab {
    right: calc(50% - 430px);
  }
}

@media (max-width: 420px) {
  .product-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .product-hero .btn {
    width: 100%;
  }
  .summary-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .summary-card {
    padding: 10px 8px;
  }
  .detail-actions {
    grid-template-columns: 1fr 1fr;
  }
  .detail-actions #btn-use {
    grid-column: 1 / -1;
  }
  .home-tools {
    grid-template-columns: 1fr;
  }
  .status-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .detail-meta-grid {
    grid-template-columns: 1fr;
  }
  .nav-item {
    min-width: 0;
    flex: 1;
    padding: 0 6px;
    font-size: 0.72rem;
  }
  .nav-item svg {
    width: 18px;
    height: 18px;
  }
  .map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .map-toolbar .btn {
    width: 100%;
  }
  .coupon-map {
    min-height: 330px;
    height: 48vh;
  }
  .map-summary {
    grid-template-columns: 1fr;
  }
}

/* Reward hint */
.reward-hint { margin-top: 8px; font-size: 0.78rem; font-weight: 750; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }
.reward-hint.done { color: var(--accent); }
/* Completion glow */
.card.is-complete { box-shadow: 0 0 0 1px var(--accent-ripple), 0 14px 30px var(--accent-ripple); }
/* Bottom-sheet grab handle (glass affordance) */
.popup-sheet::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 999px; background: var(--border-strong); margin: 8px auto 0; flex-shrink: 0; }
/* Confetti */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti-piece { position: absolute; top: -14px; width: 9px; height: 14px; background: var(--c, #34d399); border-radius: 2px; opacity: 0; animation: confetti-fall var(--dur, 2s) var(--delay, 0s) cubic-bezier(.2,.6,.4,1) forwards; }
@keyframes confetti-fall { 0% { opacity: 0; transform: translate3d(0,-14px,0) rotate(0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translate3d(calc(var(--x,0) * 30vw), 102vh, 0) rotate(var(--rot, 360deg)); } }
@media (prefers-reduced-motion: reduce) { .confetti-piece { display: none; } }

/* Full-screen reward modal */
.reward-modal { position: fixed; inset: 0; z-index: 250; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity var(--transition-base); }
.reward-modal.active { opacity: 1; pointer-events: auto; }
.reward-card { width: 100%; max-width: 360px; text-align: center; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 32px 24px 24px; box-shadow: var(--shadow-lg); transform: scale(.8) translateY(12px); opacity: 0; transition: transform var(--transition-slow) cubic-bezier(.34,1.56,.64,1), opacity var(--transition-base); }
.reward-modal.active .reward-card { transform: scale(1) translateY(0); opacity: 1; }
.reward-badge { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; background: var(--grad-brand); color: #ffffff; display: flex; align-items: center; justify-content: center; box-shadow: var(--glow-brand); position: relative; }
.reward-badge svg { width: 40px; height: 40px; }
.reward-badge::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--accent); animation: pulse-ring 1.8s ease-out infinite; }
.reward-eyebrow { color: var(--accent-gold); font-size: 0.68rem; font-weight: 850; letter-spacing: 0.12em; }
.reward-card h2 { font-size: 1.8rem; font-weight: 850; margin: 6px 0 10px; }
.reward-card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; margin-bottom: 20px; }
@media (prefers-reduced-motion: reduce) { .reward-card { transition: opacity var(--transition-base); transform: none; } .reward-badge::after { animation: none; } }

/* Add-form: live stamp preview */
.stamp-preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.stamp-counter { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.field-hint { margin-top: 6px; font-size: 0.78rem; color: var(--text-muted); }
.stamp-preview { margin-top: 12px; }

/* Ad banner (free-tier ad slot) */
.ad-banner { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-surface); }
.ad-banner .ad-ico { width: 40px; height: 40px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--grad-brand-soft); color: var(--accent); flex-shrink: 0; }
.ad-banner .ad-ico svg { width: 20px; height: 20px; }
.ad-banner .ad-body { flex: 1; min-width: 0; }
.ad-banner .ad-body h4 { font-size: 0.9rem; font-weight: 700; }
.ad-banner .ad-body p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-badge { position: absolute; top: 8px; right: 10px; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.12em; color: var(--text-muted); border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 5px; }
.ad-chevron { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }

/* Home: swipeable shop rail (옆으로 미는 카드) */
.rail-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 10px; }
.rail-header h2 { font-size: 1.28rem; font-weight: 800; }
.rail-header p { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }
.rail-more { color: var(--accent); font-weight: 800; font-size: 0.88rem; padding: 6px 4px; white-space: nowrap; }
.shop-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 2px 16px 10px; scrollbar-width: none; }
.shop-rail::-webkit-scrollbar { display: none; }
.shop-rail > .card { scroll-snap-align: center; }
.shop-rail.is-empty { display: block; grid-auto-flow: row; margin: 0; padding: 0; }
@media (min-width: 768px) {
  .shop-rail { grid-auto-columns: 48%; }
}
