/* ─── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette */
  --bg:        #0c0c0f;
  --bg2:       #141418;
  --bg3:       #1c1c22;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);
  --text:      #f0f0f2;
  --text2:     #8888a0;
  --text3:     #555568;
  --accent:    #73b91c;
  --accent2:   #4f9d20;
  --accent-rgb:115,185,28;
  --danger:    #ff5f5f;
  --warn:      #f97316;

  /* Layout */
  --sidebar-w: 220px;
  --nav-h:     68px;
  --radius:    16px;
  --radius-sm: 10px;

  /* Font */
  --font-display: 'Space Mono', monospace;
  --font-body:    'DM Sans', sans-serif;
}

html { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* ─── DESKTOP SIDEBAR ─────────────────────────────────────── */
.sidebar {
  display: none;
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  flex-direction: column;
  padding: 24px 16px 32px;
  gap: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 28px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-align: left;
  width: 100%;
}

.sidebar-nav .nav-item:hover { background: var(--bg3); color: var(--text); }
.sidebar-nav .nav-item.active { background: var(--bg3); color: var(--accent); }
.sidebar-nav .nav-item.active svg { stroke: var(--accent); }

.sidebar-goal {
  margin-top: auto;
  padding: 14px 12px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.sidebar-goal-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-bottom: 4px;
}

.sidebar-goal-val {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent);
}

/* ─── MAIN ────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ─── TAB PANELS ──────────────────────────────────────────── */
.tab-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

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

/* ─── PANEL HEADER ────────────────────────────────────────── */
.panel-header {
  padding: 20px 20px 0;
  flex-shrink: 0;
}

.header-title-group h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.1;
}

.header-title-group p {
  font-size: 13px;
  color: var(--text2);
  margin-top: 4px;
}

/* ─── BOTTOM NAV (mobile) ─────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 0 0 env(safe-area-inset-bottom);
  height: var(--nav-h);
}

.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 8px 0 4px;
  transition: color .15s;
  position: relative;
}

.bottom-nav .nav-item.active { color: var(--accent); }

.bottom-nav .nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 4px 4px;
}

.nav-icon { display: flex; align-items: center; }
.nav-label { font-size: 10px; font-weight: 500; letter-spacing: .02em; }

/* ─── CHAT ────────────────────────────────────────────────── */
.chat-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 0 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}

.msg {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  animation: msgIn .2s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg.user { flex-direction: row-reverse; }

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.msg.ai .msg-avatar { background: var(--accent); color: #000; }
.msg.user .msg-avatar { background: var(--bg3); color: var(--text2); font-size: 10px; }
.msg-avatar-logo { background: #fff !important; }
.msg-avatar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.msg-bubble {
  max-width: min(78%, 420px);
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
}

.msg.ai .msg-bubble {
  background: var(--bg3);
  border-bottom-left-radius: 4px;
  color: var(--text);
}

.msg.user .msg-bubble {
  background: var(--accent);
  color: #000;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

.example-hint { color: var(--text2); font-size: 13px; }

/* Typing dots */
.typing-indicator { display: none; }
.typing-dots { display: flex; gap: 5px; align-items: center; padding: 14px 16px; }
.typing-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text3);
  animation: dotBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Suggestions */
.chat-suggestions {
  display: flex;
  gap: 8px;
  padding: 6px 16px 10px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.chat-suggestions::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: var(--bg2);
  color: var(--text2);
  font-size: 12.5px;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb),.06); }

/* Input bar */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  border-radius: 22px;
  padding: 11px 16px;
  resize: none;
  line-height: 1.4;
  min-height: 44px;
  max-height: 120px;
  outline: none;
  transition: border-color .2s;
}
#chat-input::placeholder { color: var(--text3); }
#chat-input:focus { border-color: var(--border2); }

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .15s, opacity .15s;
}
.send-btn:hover { transform: scale(1.05); }
.send-btn:disabled { opacity: .4; transform: none; cursor: not-allowed; }

/* kcal badge in chat */
.kcal-badge {
  display: inline-block;
  background: rgba(var(--accent-rgb),.15);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  margin-bottom: 4px;
}

/* ─── DASHBOARD ───────────────────────────────────────────── */
.dash-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}

/* Ring card */
.dash-ring-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
}

.ring-svg {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--bg3);
  stroke-width: 10;
}

.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset .5s ease;
}

.ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.ring-kcal {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.ring-unit {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ring-pct {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}

.ring-stats {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  justify-content: center;
}

.ring-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.ring-stat-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.ring-stat-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.ring-stat-sep {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* Meals section */
.meals-section { }
.meals-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-bottom: 10px;
  font-weight: 600;
}

.meal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  animation: msgIn .2s ease;
}

.meal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.meal-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meal-time {
  font-size: 12px;
  color: var(--text3);
  flex-shrink: 0;
}

.meal-kcal {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.meal-delete {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.meal-delete:hover { color: var(--danger); background: rgba(255,95,95,.1); }
.meal-delete svg { stroke: currentColor; }

/* ─── HISTORY ─────────────────────────────────────────────── */
.history-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}

.hist-day {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.hist-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.hist-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.hist-total {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.hist-bar-track {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

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

.hist-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hist-pill {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--bg3);
  border-radius: 20px;
  color: var(--text2);
}

.hist-pill strong { color: var(--text); font-weight: 600; }

/* ─── SETTINGS ────────────────────────────────────────────── */
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}

.settings-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.settings-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-bottom: 16px;
  font-weight: 600;
}

.field {
  margin-bottom: 16px;
}

.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 7px;
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .2s;
  appearance: none;
  -webkit-appearance: none;
}

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

.field input::placeholder { color: var(--text3); }

.input-suffix-wrap {
  position: relative;
}

.input-suffix-wrap input { padding-right: 52px; }

.input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text3);
  pointer-events: none;
}

.save-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .15s;
  letter-spacing: .02em;
}

.save-btn:hover { opacity: .9; transform: translateY(-1px); }
.save-btn:active { transform: translateY(0); }

.save-success {
  display: none;
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

/* ─── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text2);
}

.empty-emoji {
  font-size: 36px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text2);
}

/* ─── MOBILE ──────────────────────────────────────────────── */
@media (max-width: 680px) {
  .sidebar { display: none !important; }
  .bottom-nav { display: flex; }

  .main {
    padding-bottom: var(--nav-h);
  }

  .tab-panel { height: 100%; }

  .panel-header { padding: 16px 16px 0; }

  /* Push chat input above bottom nav */
  .chat-input-bar {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

/* ─── DESKTOP ─────────────────────────────────────────────── */
@media (min-width: 681px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }

  .main { overflow: hidden; }

  .dash-body { padding: 24px 28px; }
  .history-body { padding: 20px 28px; }
  .settings-body { padding: 24px 28px; }
  .panel-header { padding: 28px 28px 0; }

  .chat-messages { padding: 12px 24px 12px; }
  .chat-suggestions { padding: 6px 24px 10px; }
  .chat-input-bar { padding: 12px 24px 20px; }

  .dash-ring-card {
    flex-direction: row;
    gap: 32px;
    padding: 28px 32px;
  }

  .ring-stats {
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    flex: 1;
  }

  .ring-stat { flex-direction: row; gap: 10px; align-items: baseline; }
  .ring-stat-sep { width: 100%; height: 1px; background: var(--border); margin: 10px 0; }

  .ring-stat-val { font-size: 22px; }
  .ring-stat-label { font-size: 12px; }
}

/* ─── DANGER ZONE ─────────────────────────────────────────── */
.danger-zone {
  margin-top: 28px;
}

.danger-zone-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--danger);
  margin-bottom: 10px;
  font-weight: 600;
  opacity: .7;
}

.danger-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255,95,95,.06);
  border: 1px solid rgba(255,95,95,.2);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.danger-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.danger-card-desc {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
}

.reset-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid rgba(255,95,95,.4);
  color: var(--danger);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}

.reset-btn:hover {
  background: rgba(255,95,95,.1);
  border-color: var(--danger);
}

/* ─── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease;
}

.modal-overlay.open { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  animation: slideUp .2s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,95,95,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--danger);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.modal-desc {
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-desc strong { color: var(--text); }

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

.modal-cancel {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.modal-cancel:hover { color: var(--text); border-color: var(--border2); }

.modal-confirm {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--danger);
  border: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}

.modal-confirm:hover { opacity: .88; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 4px; }

/* ─── ÉCRAN PIN ───────────────────────────────────────────── */
#pin-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#pin-screen.hidden { display: none; }

.pin-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.pin-card .pin-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.pin-label {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 22px;
  font-weight: 500;
  min-height: 20px;
  text-align: center;
  transition: color .2s;
}

.pin-label.error { color: var(--danger); }
.pin-label.success { color: var(--accent); }

/* Dots */
.pin-dots {
  display: flex;
  gap: 14px;
  margin-bottom: 36px;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  background: transparent;
  transition: background .15s, border-color .15s, transform .1s;
}

.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

.pin-dot.error {
  background: var(--danger);
  border-color: var(--danger);
}

/* Shake animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-8px); }
  30%       { transform: translateX(8px); }
  45%       { transform: translateX(-6px); }
  60%       { transform: translateX(6px); }
  75%       { transform: translateX(-4px); }
  90%       { transform: translateX(4px); }
}
.pin-dots.shake { animation: shake .4s ease; }

/* Numpad */
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.pin-key {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.pin-key:active {
  background: var(--bg3);
  transform: scale(.93);
}

.pin-key-empty {
  background: transparent !important;
  border-color: transparent !important;
  cursor: default;
  pointer-events: none;
}

.pin-key-del {
  background: transparent;
  border-color: transparent;
  color: var(--text2);
  font-size: 0;
}

.pin-key-del:active { background: var(--bg3) !important; }

/* ─── CHANGE PIN MODAL (smaller pad) ─────────────────────── */
.pin-dots-sm {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.pin-dots-sm .pin-dot {
  width: 11px;
  height: 11px;
}

.pin-pad-sm {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 220px;
  margin: 0 auto;
}

.pin-pad-sm .pin-key {
  font-size: 17px;
  border-radius: 50%;
}

.cp-error {
  font-size: 12px;
  color: var(--danger);
  text-align: center;
  min-height: 18px;
  margin-top: 8px;
}
