/* HK Plate Scanner v2 — Clean Modern Style
   Half-screen camera + bottom sheet
   iOS-inspired: white/soft-gray, large type, minimal chrome */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --border: #e5e5ea;
  --border-hi: #d1d1d6;
  --text: #1c1c1e;
  --text-2: #48484a;
  --text-3: #8e8e93;
  --text-4: #c7c7cc;
  --accent: #007aff;       /* iOS blue */
  --accent-2: #0051d5;
  --success: #34c759;
  --warn: #ff9500;
  --danger: #ff3b30;
  --hk: #007aff;
  --mo: #af52de;
  --cn: #ff2d55;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-2: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-3: 0 -4px 16px rgba(0,0,0,0.06);
  --font-ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang HK', 'Microsoft JhengHei', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, monospace;
  --radius: 14px;
  --radius-sm: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --border: #38383a;
    --border-hi: #48484a;
    --text: #ffffff;
    --text-2: #ebebf5;
    --text-3: #8e8e93;
    --text-4: #48484a;
    --shadow-1: 0 1px 2px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
    --shadow-2: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-3: 0 -4px 16px rgba(0,0,0,0.4);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* === Camera half === */
.cam-half {
  position: relative;
  height: 48vh;
  min-height: 320px;
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
}

.cam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cam-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cam-overlay svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Top HUD */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(env(safe-area-inset-top, 0) + 12px) 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
  z-index: 5;
}

.hud > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.brand .dot.err { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.brand .dot.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }

.hud-btns {
  display: flex;
  gap: 8px;
}

.hud-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.1s;
}
.hud-btn:active { transform: scale(0.9); }
.hud-btn.on { background: white; color: #000; }
.hud-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Reticle (subtle) */
.reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 78%;
  aspect-ratio: 2.4 / 1;
  pointer-events: none;
}
.reticle::before, .reticle::after,
.reticle .c1, .reticle .c2 {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(255,255,255,0.85);
  border-radius: 3px 0 0 0;
}
.reticle::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.reticle::after { top: 0; right: 0; border-left: none; border-bottom: none; border-radius: 0 3px 0 0; }
.reticle .c1 { bottom: 0; left: 0; border-right: none; border-top: none; border-radius: 0 0 0 3px; }
.reticle .c2 { bottom: 0; right: 0; border-left: none; border-top: none; border-radius: 0 0 3px 0; }

.reticle.scanning::before, .reticle.scanning::after,
.reticle.scanning .c1, .reticle.scanning .c2 {
  border-color: var(--warn);
  animation: reticle-pulse 1.2s ease-in-out infinite;
}
@keyframes reticle-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.scanline {
  position: absolute;
  left: 6%; right: 6%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 10px var(--accent);
  animation: scan 2.2s ease-in-out infinite;
  top: 30%;
  border-radius: 2px;
}
@keyframes scan {
  0% { top: 30%; opacity: 0; }
  15% { opacity: 1; }
  50% { top: 70%; opacity: 1; }
  65% { opacity: 0; }
  100% { top: 30%; opacity: 0; }
}

.cam-hint {
  position: absolute;
  bottom: 82px;
  left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* Bottom control bar */
.cam-controls {
  position: absolute;
  bottom: 16px;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 6;
}

.side-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.1s;
}
.side-btn:active { transform: scale(0.92); }
.side-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.shutter {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: white;
  border: 4px solid rgba(255,255,255,0.35);
  background-clip: padding-box;
  cursor: pointer;
  transition: transform 0.1s;
  padding: 0;
}
.shutter:active { transform: scale(0.94); }
.shutter.on {
  background: var(--danger);
  animation: shutter-pulse 1.2s ease-in-out infinite;
}
@keyframes shutter-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.45); }
  50% { box-shadow: 0 0 0 14px rgba(255, 59, 48, 0); }
}

/* Live detection floating chip */
.live-chip {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0) + 58px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  z-index: 4;
  pointer-events: none;
}
.plate-chip {
  padding: 8px 12px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: chip-in 0.25s cubic-bezier(.2,.9,.3,1.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
@keyframes chip-in {
  from { transform: translateY(-6px) scale(0.9); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.plate-chip .num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.02em;
}
.plate-chip .flag {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.plate-chip.new::after {
  content: 'NEW';
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  background: var(--warn);
  color: black;
  border-radius: 3px;
  letter-spacing: 0.05em;
}

/* === Bottom sheet (records) === */
.sheet {
  flex: 1;
  min-height: 0;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  margin-top: -12px;
  box-shadow: var(--shadow-3);
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border-hi);
  border-radius: 3px;
  margin: 8px auto 0;
  flex-shrink: 0;
}

.sheet-head {
  padding: 12px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.sheet-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.sheet-title h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text);
}
.sheet-title .count {
  font-size: 14px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.sheet-actions {
  display: flex;
  gap: 6px;
}
.sheet-actions button {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  display: flex; align-items: center; gap: 4px;
  transition: background 0.15s;
}
.sheet-actions button:active { background: var(--surface-2); }
.sheet-actions button:disabled { color: var(--text-4); cursor: not-allowed; }
.sheet-actions button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Filter bar */
.filter-row {
  padding: 4px 16px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.filter-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
  transition: all 0.15s;
}
.chip:active { transform: scale(0.96); }
.chip.on {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.chip .n {
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  font-size: 11px;
  padding: 0 4px;
  background: var(--surface-2);
  border-radius: 6px;
  min-width: 18px;
  text-align: center;
}
.chip.on .n { background: rgba(255,255,255,0.2); color: var(--bg); }

/* Search input */
.search-wrap {
  padding: 0 16px 8px;
  flex-shrink: 0;
}
.search {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.search:focus { border-color: var(--accent); background: var(--surface); }
.search-inner { position: relative; }
.search-inner svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; stroke: var(--text-3); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}

/* List */
.list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.record {
  padding: 12px 12px 12px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: transform 0.1s;
  position: relative;
}
.record:active { transform: scale(0.99); background: var(--surface-2); }
.record.mo, .record.cn {
  /* subtle regional tint for non-HK entries */
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 6%);
}

.rec-thumb {
  width: 56px; height: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rec-thumb .none {
  font-size: 9px;
  color: var(--text-4);
  letter-spacing: 0.05em;
  font-weight: 600;
}

.rec-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rec-line1 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rec-plate {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.rec-plate.muted { color: var(--text-2); font-weight: 600; }

.badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}
.badge.HK { background: rgba(0,122,255,0.12); color: var(--hk); }
.badge.MO { background: rgba(175,82,222,0.12); color: var(--mo); }
.badge.CN { background: rgba(255,45,85,0.12); color: var(--cn); }
.badge.note {
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 9px;
  padding: 1px 5px;
}

.rec-meta {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  gap: 8px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}
.rec-meta .dot-sep { color: var(--text-4); }
.rec-count {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
}

.rec-arrow {
  color: var(--text-4);
  flex-shrink: 0;
}
.rec-arrow svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Empty state */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
}
.empty svg { width: 44px; height: 44px; stroke: var(--text-4); fill: none; stroke-width: 1.5; margin-bottom: 12px; }
.empty .t { font-size: 15px; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.empty .d { font-size: 13px; line-height: 1.4; }

/* Loading overlay (only inside cam-half) */
.loading {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: white;
  text-align: center;
  gap: 14px;
}
.loading .spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading .msg { font-size: 13px; opacity: 0.85; font-weight: 500; }
.loading .sub { font-size: 11px; opacity: 0.5; max-width: 260px; line-height: 1.5; }
.loading .bar { width: 200px; height: 3px; background: rgba(255,255,255,0.15); border-radius: 2px; overflow: hidden; }
.loading .bar > div { height: 100%; background: white; transition: width 0.3s; }

/* Detail modal */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: back-in 0.2s;
}
@keyframes back-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  padding-bottom: calc(env(safe-area-inset-bottom, 0) + 16px);
  animation: modal-in 0.28s cubic-bezier(.2,.9,.3,1);
}
@keyframes modal-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-head {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
}
.modal-head .close {
  background: var(--surface-2);
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  cursor: pointer;
}
.modal-head .close svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.modal-body {
  padding: 0 20px;
}

.detail-thumb {
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-thumb .np { color: var(--text-4); font-size: 13px; }

.detail-plate {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
  color: var(--text);
  margin: 8px 0 6px;
}

/* Plate edit input */
.plate-edit-input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  outline: none;
  text-transform: uppercase;
  margin: 8px 0 8px;
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plate-edit-input::placeholder {
  color: var(--text-4);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.plate-edit-hint {
  text-align: center;
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 4px 12px;
  min-height: 18px;
  line-height: 1.4;
}
.detail-region {
  text-align: center;
  margin-bottom: 20px;
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.info-list {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.info-row {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.info-row + .info-row { border-top: 1px solid var(--border); }
.info-row .k {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
}
.info-row .v {
  font-size: 14px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-align: right;
}
.info-row .v.mono { font-family: var(--font-mono); }

.action-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.action-btn {
  flex: 1;
  height: 46px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  transition: transform 0.1s;
}
.action-btn:active { transform: scale(0.97); }
.action-btn.primary { background: var(--accent); color: white; }
.action-btn.secondary { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.action-btn.danger { background: var(--surface); color: var(--danger); box-shadow: var(--shadow-1); }
.action-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Export menu */
.export-menu {
  position: absolute;
  right: 16px;
  top: 44px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  z-index: 50;
  overflow: hidden;
  min-width: 180px;
  animation: menu-in 0.15s cubic-bezier(.2,.9,.3,1.4);
  border: 1px solid var(--border);
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.export-menu button {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-ui);
  display: flex; align-items: center; gap: 10px;
}
.export-menu button:active { background: var(--surface-2); }
.export-menu button + button { border-top: 1px solid var(--border); }
.export-menu button.danger { color: var(--danger); }
.export-menu button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ==== Clear confirmation dialog (custom) ==== */
.confirm-back {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: back-in 0.2s;
}
.confirm-card {
  background: var(--bg);
  border-radius: 18px;
  max-width: 360px;
  width: 100%;
  overflow: hidden;
  animation: card-pop 0.25s cubic-bezier(.2,.9,.3,1.4);
  box-shadow: var(--shadow-2);
}
@keyframes card-pop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.confirm-icon {
  width: 56px;
  height: 56px;
  margin: 20px auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-icon.warn { background: rgba(255, 149, 0, 0.15); color: var(--warn); }
.confirm-icon.danger { background: rgba(255, 59, 48, 0.15); color: var(--danger); }
.confirm-icon.info { background: rgba(0, 122, 255, 0.15); color: var(--accent); }
.confirm-icon svg {
  width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
}

.confirm-title {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  padding: 0 24px;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.confirm-desc {
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  padding: 0 24px 20px;
  line-height: 1.5;
}
.confirm-desc strong {
  color: var(--text);
  font-weight: 600;
}
.confirm-desc .highlight {
  color: var(--warn);
  font-weight: 600;
}

.confirm-actions {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.confirm-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s, opacity 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.confirm-btn:active { transform: scale(0.97); }
.confirm-btn.primary { background: var(--accent); color: white; }
.confirm-btn.danger { background: var(--danger); color: white; }
.confirm-btn.subtle { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.confirm-btn.cancel { background: transparent; color: var(--text-2); font-weight: 500; padding: 10px; }
.confirm-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.confirm-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0 2px;
}

.confirm-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px 16px;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.confirm-status.warn { color: var(--warn); }
.confirm-status.ok { color: var(--success); }
.confirm-status svg { width: 14px; height: 14px; }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0) + 20px);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  background: rgba(28,28,30,0.92);
  color: white;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  box-shadow: var(--shadow-2);
  animation: toast-in 0.25s cubic-bezier(.2,.9,.3,1.4);
  backdrop-filter: blur(20px);
}
@keyframes toast-in { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* Scrollbar */
.list::-webkit-scrollbar { width: 4px; }
.list::-webkit-scrollbar-track { background: transparent; }
.list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
