

:root {
  --bg:       #0a0a0a;
  --surface:  #121212;
  --raised:   #1a1a1a;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.12);
  --muted:    #404040;
  --subtle:   #6b6b6b;
  --secondary:#9a9a9a;
  --primary:  #e2e2e2;
  --bright:   #ffffff;
  --red:      #ff4444;
  --red-bg:   rgba(255,68,68,0.07);
  --sans:     'Geist', system-ui, -apple-system, sans-serif;
  --serif:    'Instrument Serif', Georgia, serif;
  --mono:     'Geist Mono', 'SF Mono', monospace;
  --r:        12px;
  --r-sm:     8px;
  --nav-h:    56px;
  --tab-h:    56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--primary);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse, rgba(255,255,255,0.022) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════
   BLOCKED
═══════════════════════════════ */
#blockedScreen {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.blk-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  animation: fadeUp 0.5s ease both;
  max-width: 340px;
  width: 100%;
}

.blk-icon {
  width: 52px; height: 52px;
  border: 1px solid var(--border2);
  border-radius: 14px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}

.blk-badge {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}
.blk-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.blk-title {
  font-family: var(--serif);
  font-size: 30px;
  font-style: italic;
  color: var(--bright);
  margin-bottom: 12px;
  line-height: 1.15;
}

.blk-desc {
  font-size: 14px;
  color: var(--subtle);
  line-height: 1.7;
  margin-bottom: 28px;
}

.blk-pill {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--subtle);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 99px;
  padding: 8px 18px;
}

/* ═══════════════════════════════
   LOADING
═══════════════════════════════ */
#loadingScreen {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.4s ease;
}

.ld-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
  opacity: 0.5;
}
.ld-icon { width: 22px; height: 22px; image-rendering: pixelated; }
.ld-name { font-size: 15px; font-weight: 600; color: var(--secondary); }

.ld-bar {
  width: 140px; height: 2px;
  background: var(--raised);
  border-radius: 2px;
  overflow: hidden;
}
.ld-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  border-radius: 2px;
}
.ld-txt {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════
   APP SHELL
═══════════════════════════════ */
#app { display: none; min-height: 100vh; }

/* ── TOP NAVBAR ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  gap: 0;
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  flex: 1;
}

.nav-skull { width: 22px; height: 22px; image-rendering: pixelated; }

.nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--bright);
  letter-spacing: -0.01em;
}

.nav-pill {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 13px;
  font-size: 12px;
  color: var(--subtle);
  white-space: nowrap;
}

.dot-live {
  width: 6px; height: 6px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(74,222,128,0.5);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

/* ── BOTTOM TAB BAR ── */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--tab-h);
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 100;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 0;
  transition: opacity 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: var(--r-sm);
}

.tab-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: color 0.15s;
}

.tab-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.tab-btn.active .tab-icon { color: var(--bright); }
.tab-btn.active .tab-label { color: var(--bright); }

/* ── CONTENT AREA ── */
.content {
  padding-top: var(--nav-h);
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── PAGES ── */
.page {
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeUp 0.22s ease both;
}

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

/* ── PAGE HEADER ── */
.ph {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ph-left { display: flex; flex-direction: column; gap: 4px; }

.ph-eye {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ph-title {
  font-family: var(--serif);
  font-size: 30px;
  font-style: italic;
  color: var(--bright);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border2);
  background: var(--raised);
  color: var(--secondary);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: -0.01em;
  white-space: nowrap;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:active { opacity: 0.75; }
.btn-primary { background: var(--bright); color: #000; border-color: var(--bright); font-weight: 600; }
.btn-primary:active { background: #ddd; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--subtle); }
.btn-danger { background: transparent; border-color: rgba(255,68,68,0.2); color: var(--red); }
.btn-danger:active { background: var(--red-bg); }
.btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 15px; }

/* ── STAT GRID ── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 18px;
}

.stat-val {
  font-family: var(--serif);
  font-size: 38px;
  color: var(--bright);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-lbl {
  font-size: 12px;
  color: var(--subtle);
}

/* ── SCRIPT CARDS (mobile list) ── */
.script-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.script-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 18px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.script-card:active { border-color: var(--border2); background: var(--raised); }

.sc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sc-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--bright);
  letter-spacing: -0.01em;
  line-height: 1.3;
  flex: 1;
}

.sc-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ic-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--subtle);
  cursor: pointer;
  transition: all 0.12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.ic-btn:active { opacity: 0.6; }
.ic-btn.red { color: var(--red); border-color: rgba(255,68,68,0.15); background: var(--red-bg); }

.sc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500;
  color: var(--secondary);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 10px;
}

.sc-date { font-size: 12px; color: var(--muted); }

/* ── SECTION CARD ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.card-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  letter-spacing: -0.01em;
}

.card-body {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--raised);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── FORM ── */
.field { display: flex; flex-direction: column; gap: 8px; }

.fl {
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary);
  letter-spacing: -0.01em;
}

.fi {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--primary);
  font-family: var(--sans);
  font-size: 15px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}

.fi:focus {
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
}

.fi::placeholder { color: var(--muted); }

.fi-code {
  background: #050505;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--secondary);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 14px;
  resize: vertical;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, color 0.15s;
  -webkit-appearance: none;
}

.fi-code:focus {
  border-color: rgba(255,255,255,0.2);
  color: var(--primary);
}

.fi-code::placeholder { color: var(--muted); }

.fhint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
}

/* ── DROP ZONE ── */
.dropzone {
  border: 1px dashed var(--border2);
  border-radius: var(--r);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.dropzone.on { border-color: rgba(255,255,255,0.22); background: var(--raised); }
.dz-label { font-size: 14px; color: var(--secondary); margin-bottom: 4px; font-weight: 400; }
.dz-sub { font-size: 12px; color: var(--muted); }

.file-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--secondary);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 12px;
  margin-top: 8px;
}

/* ── OR DIVIDER ── */
.or-row { display: flex; align-items: center; gap: 12px; }
.or-line { flex: 1; height: 1px; background: var(--border); }
.or-txt { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ── LOADSTRING DISPLAY ── */
.ls-box {
  background: #050505;
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  padding: 14px 50px 14px 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--subtle);
  line-height: 1.75;
  cursor: pointer;
  word-break: break-all;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.ls-box:active { background: var(--raised); }

.ls-copy {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 9px;
  pointer-events: none;
}

/* ── COLLAPSE ── */
.collapse {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 10px;
}

.collapse-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.collapse-head:active { background: var(--raised); }

.c-name {
  font-size: 14px; font-weight: 500;
  color: var(--bright);
  letter-spacing: -0.01em;
  flex: 1;
  padding-right: 12px;
}

.c-right { display: flex; align-items: center; gap: 10px; }
.c-chev { color: var(--muted); font-size: 12px; transition: transform 0.2s; }
.c-chev.open { transform: rotate(180deg); }

.collapse-body {
  display: none;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
}
.collapse-body.open { display: block; }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 400;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

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

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.28s cubic-bezier(0.4,0,0.2,1);
  padding-bottom: env(safe-area-inset-bottom);
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0.5; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-handle {
  width: 40px; height: 4px;
  background: var(--muted);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 16px; font-weight: 600;
  color: var(--bright);
  letter-spacing: -0.01em;
  flex: 1;
  padding-right: 12px;
}

.modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--raised); border: 1px solid var(--border);
  border-radius: 8px; color: var(--subtle); cursor: pointer;
  font-size: 14px; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px;
  flex-shrink: 0;
}

/* ── INLINE CHIPS ── */
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  font-size: 11px; font-weight: 500;
  color: var(--muted);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
}

/* ── NOTICE ── */
.notice {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--subtle);
  line-height: 1.7;
}
.notice strong { color: var(--secondary); font-weight: 500; }

/* ── EMPTY STATE ── */
.empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 64px 20px; gap: 12px; text-align: center;
}
.empty-ico {
  width: 50px; height: 50px;
  background: var(--raised); border: 1px solid var(--border);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.empty-t { font-size: 15px; font-weight: 500; color: var(--secondary); }
.empty-d { font-size: 13px; color: var(--muted); }

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px);
  left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--bright); color: #000;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 11px 20px; border-radius: 99px;
  z-index: 9000; opacity: 0;
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  letter-spacing: -0.01em;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: var(--raised); }
::selection { background: rgba(255,255,255,0.15); }


/* ═══════════════════════════════
   LOGIN SCREEN
═══════════════════════════════ */
#loginScreen {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 320px;
  animation: fadeUp 0.5s ease both;
}

.login-icon {
  width: 60px; height: 60px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
}

.login-brand {
  font-size: 17px;
  font-weight: 600;
  color: var(--bright);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--subtle);
  margin-bottom: 40px;
  line-height: 1.5;
}

.pin-dots {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.pin-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: transparent;
  transition: all 0.15s cubic-bezier(0.4,0,0.2,1);
}

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

.pin-error {
  font-size: 12px;
  color: var(--red);
  height: 18px;
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 12px;
}

.pin-key {
  width: 72px; height: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--primary);
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.12s;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  letter-spacing: -0.01em;
}

.pin-key:active {
  background: var(--raised);
  border-color: var(--border2);
  transform: scale(0.93);
}

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

.pin-key-del {
  font-size: 18px;
  color: var(--subtle);
}

.pin-pad.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%,100%  { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}

/* ═══════════════════════════════
   UNAUTHORIZED SCREEN
═══════════════════════════════ */
#unauthorizedScreen {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.unauth-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 300px;
  width: 100%;
  animation: fadeUp 0.5s ease both;
}

.unauth-icon {
  width: 56px; height: 56px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
}

.unauth-code {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--red);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
}

.unauth-code::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--red);
}

.unauth-title {
  font-family: var(--serif);
  font-size: 32px;
  font-style: italic;
  color: var(--bright);
  margin-bottom: 10px;
  line-height: 1.15;
}

.unauth-desc {
  font-size: 13px;
  color: var(--subtle);
  line-height: 1.75;
  margin-bottom: 28px;
}

.unauth-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 18px;
}

/* ── NOTIFICATIONS ── */
#notif-container {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 400px;
  pointer-events: none;
}

.notif {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 13px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  animation: notifIn 0.3s cubic-bezier(0.4,0,0.2,1) both;
  pointer-events: all;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.notif.hide {
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
}

@keyframes notifIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.notif-icon.success { background: rgba(74,222,128,0.1); }
.notif-icon.error   { background: rgba(255,68,68,0.1); }
.notif-icon.info    { background: rgba(255,255,255,0.06); }
.notif-icon.warning { background: rgba(251,191,36,0.1); }

.notif-body { flex: 1; min-width: 0; }

.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--bright);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.notif-desc {
  font-size: 11px;
  color: var(--subtle);
  margin-top: 2px;
  letter-spacing: -0.01em;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-close {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  flex-shrink: 0;
  border-radius: 6px;
  transition: all 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.notif-close:active { background: var(--raised); color: var(--primary); }

.notif-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  background: rgba(255,255,255,0.15);
  border-radius: 0 0 var(--r) var(--r);
  animation: progress linear forwards;
}

@keyframes progress {
  from { width: 100%; }
  to   { width: 0%; }
}

.notif { position: relative; overflow: hidden; }

