/* ============================================================
   CLIPPER BY RABS — Main Stylesheet  (Design B — Electric Blue)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ===== BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
button, a { touch-action: manipulation; }
input, select, textarea { font-size: 16px !important; } /* prevent iOS zoom */

:root {
  --bg:          #000000;
  --card:        #0D0D0D;
  --card2:       #141414;
  --border:      #1E1E1E;
  --border2:     #2A2A2A;
  --blue:        #00A3FF;
  --blue-dim:    rgba(0,163,255,0.10);
  --blue-mid:    rgba(0,163,255,0.18);
  --text:        #FFFFFF;
  --text-dim:    #666;
  --text-mid:    #999;
  --text-faint:  #333;

  /* keep sp- vars for compat */
  --sp-bg:       #0D0D0D;
  --sp-card:     #0D0D0D;
  --sp-input:    #141414;
  --sp-border:   #1E1E1E;
  --sp-muted:    #666;
  --sp-accent:   #00A3FF;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Space Grotesk', system-ui, sans-serif;
}

.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 16px); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }
.custom-scroll::-webkit-scrollbar { width: 3px; height: 3px; }
.custom-scroll::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }

/* ===== GLASS — kept minimal for modals ===== */
.glass {
  background: rgba(15,15,15,0.97);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
  color: var(--blue);
}

/* ===== PROCESSING MODAL ===== */
#proc-modal-wrap {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 72vh;
  z-index: 9999;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8);
  background: rgba(10,10,10,0.98);
  border: 1px solid var(--border2);
}
#proc-pill {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 9999;
  background: rgba(10,10,10,0.98);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 10px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px; font-weight: 700;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

/* ===== LOGIN ANIMATIONS ===== */
@keyframes loginGlow {
  0%, 100% { opacity: .4; transform: scale(1); }
  50%       { opacity: .7; transform: scale(1.08); }
}
@keyframes loginFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-7px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* ===== LOGIN UI ===== */
.login-card { animation: loginFadeUp .5s cubic-bezier(.16,1,.3,1) both; }
.login-shake { animation: loginShake .4s ease both; }

.login-input {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 4px;
  width: 100%;
  padding: 15px 16px;
  font-size: 16px !important;
  color: var(--text);
  outline: none;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
}
.login-input::placeholder { color: var(--text-faint); }
.login-input:focus {
  border-color: var(--blue);
  background: var(--card2);
}

.login-btn {
  width: 100%;
  padding: 16px;
  border-radius: 4px;
  font-size: 14px; font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s;
  border: none;
  min-height: 52px;
  font-family: 'Space Grotesk', sans-serif;
  background: var(--blue) !important;
  color: #000 !important;
}
.login-btn:hover { background: #33B5FF !important; box-shadow: 0 0 32px rgba(0,163,255,0.3); }
.login-btn:active:not(:disabled) { background: #0090E0 !important; }
.login-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   HEADER
   ============================================================ */
header {
  background: rgba(0,0,0,0.98) !important;
  border-bottom: 1px solid var(--border) !important;
}

/* Desktop nav */
#desktop-nav {
  background: transparent !important;
  border: 1px solid var(--border2) !important;
  border-radius: 4px !important;
  padding: 3px !important;
}
#desktop-nav button {
  border-radius: 3px !important;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 10px !important;
}
#btn-tab-studio, #btn-tab-clips, #btn-tab-tutorial {
  color: var(--text-dim) !important;
  background: transparent !important;
  border: none !important;
  transition: all .15s;
}
#btn-tab-studio:hover, #btn-tab-clips:hover, #btn-tab-tutorial:hover {
  color: var(--text) !important;
}
/* active tab set by JS using background:#fff;color:#000 — override */
#desktop-nav button[style*="background:#fff"],
#desktop-nav button[style*="background: #fff"] {
  background: var(--blue-mid) !important;
  color: var(--blue) !important;
}
/* mobile header buttons */
#mobile-header-actions button {
  border-radius: 4px !important;
  background: var(--card) !important;
  border: 1px solid var(--border2) !important;
}

/* ============================================================
   STUDIO PANEL  (sp- prefix)
   ============================================================ */

/* Wrapper card */
.sp-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
}

/* Section separator title */
.sp-section-title {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .15em;
  margin: 16px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
}
.sp-section-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--blue);
  border-radius: 2px;
  flex-shrink: 0;
}
.sp-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Upload area */
.sp-upload {
  border: 2px dashed var(--border2);
  border-radius: 4px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: rgba(255,255,255,0.015);
  position: relative;
  overflow: hidden;
}
.sp-upload:hover {
  border-color: var(--blue);
  background: var(--blue-dim);
}
.sp-upload i {
  font-size: 22px;
  color: var(--blue);
  flex-shrink: 0;
}
.sp-upload-text h3 {
  font-size: 14px; font-weight: 800;
  color: var(--text);
  margin: 0 0 3px;
  font-family: 'Space Grotesk', sans-serif;
}
.sp-upload-text p  {
  font-size: 11px;
  color: var(--text-dim);
  margin: 0;
}

/* Row & column layout */
.sp-row { display: flex; gap: 8px; margin-bottom: 10px; }
.sp-col { flex: 1; }

/* Labels */
.sp-label {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .08em;
  margin-bottom: 5px;
}

/* Number inputs */
.sp-input {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 0 10px;
  border-radius: 4px;
  font-size: 14px; font-weight: 700;
  outline: none;
  height: 36px;
  text-align: center;
  transition: border-color .2s;
  -webkit-appearance: none;
  appearance: none;
}
.sp-input:focus { border-color: var(--blue); }

/* Segmented controls */
.sp-seg {
  display: flex;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 4px;
  overflow: hidden;
  height: 36px;
}
.sp-seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border2);
  color: var(--text-dim);
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sp-seg-btn:last-child { border-right: none; }
.sp-seg-btn:hover { color: var(--text); background: var(--blue-dim); }
.sp-seg-btn.s-active {
  background: var(--blue-mid);
  color: var(--blue);
}

/* Select dropdowns */
.sp-select-wrap { position: relative; }
.sp-select {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 0 28px 0 10px;
  border-radius: 4px;
  font-size: 12px; font-weight: 600;
  outline: none;
  height: 36px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s;
}
.sp-select:focus { border-color: var(--blue); }
.sp-select option { background: #111; color: var(--text); }
.sp-select-wrap::after {
  content: "▾";
  font-size: 10px;
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--blue);
  pointer-events: none;
}

/* Color dots */
.sp-color-row { display: flex; gap: 8px; align-items: center; height: 36px; }
.sp-color-dot {
  width: 26px; height: 26px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  flex-shrink: 0;
}
.sp-color-dot.s-active {
  border-color: var(--blue);
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(0,163,255,0.2);
}

/* Toggle rows */
.sp-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 12px;
  background: var(--card2);
  border-radius: 4px;
  border: 1px solid var(--border2);
  margin-bottom: 6px;
  gap: 10px;
  transition: border-color .15s;
}
.sp-toggle-row:hover { border-color: var(--border2); }
.sp-toggle-row.accent-border {
  border-color: rgba(0,163,255,0.25);
  background: rgba(0,163,255,0.04);
}
.sp-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px; font-weight: 700;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
}
.sp-toggle-label i {
  font-size: 13px;
  color: var(--text-dim);
  width: 16px;
  text-align: center;
}
.sp-toggle-sub {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 2px;
  font-family: 'Inter', sans-serif;
}

/* PRO badge */
.sp-badge-pro {
  background: var(--blue);
  color: #000;
  font-size: 8px; font-weight: 900;
  padding: 2px 5px;
  border-radius: 2px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* CSS Toggle switch */
.sp-switch {
  position: relative;
  display: inline-block;
  width: 38px; height: 22px;
  flex-shrink: 0;
}
.sp-switch input {
  opacity: 0;
  width: 0; height: 0;
  position: absolute;
}
.sp-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 3px;
  transition: background .2s, border-color .2s;
}
.sp-slider::before {
  position: absolute;
  content: "";
  height: 14px; width: 14px;
  left: 3px; bottom: 3px;
  background: #444;
  border-radius: 2px;
  transition: transform .2s, background .2s;
}
.sp-switch input:checked + .sp-slider {
  background: var(--blue-mid);
  border-color: var(--blue);
}
.sp-switch input:checked + .sp-slider::before {
  transform: translateX(16px);
  background: var(--blue);
}

/* CTA button */
.sp-cta {
  width: 100%;
  background: var(--blue);
  color: #000;
  border: none;
  padding: 15px;
  font-size: 14px; font-weight: 900;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 14px;
  transition: all .15s;
  letter-spacing: .08em;
  text-transform: uppercase;
  min-height: 50px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  box-shadow: 0 4px 20px rgba(0,163,255,0.2);
}
.sp-cta:hover {
  background: #33B5FF;
  box-shadow: 0 8px 32px rgba(0,163,255,0.35);
  transform: translateY(-1px);
}
.sp-cta:active { transform: translateY(0); background: #0090E0; }

/* Watermark expand panel */
.sp-wm-expand {
  padding: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sp-wm-input {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.sp-wm-input:focus { border-color: var(--blue); }
.sp-wm-input::placeholder { color: var(--text-faint); }

/* Watermark position grid */
.sp-pos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.sp-pos-btn {
  background: var(--card2);
  border: 1px solid var(--border2);
  color: var(--text-dim);
  padding: 8px;
  border-radius: 3px;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.sp-pos-btn:hover { border-color: var(--border2); color: var(--text-mid); }
.sp-pos-btn.s-active {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
}

/* ============================================================
   SOURCE TABS — override inline styles
   ============================================================ */
#source-tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 0 !important;
  margin-bottom: 12px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  overflow: hidden;
}
#src-tab-upload, #src-tab-url {
  padding: 11px 8px !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  border-right: 1px solid var(--border2) !important;
  color: var(--text-dim) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .05em !important;
  text-transform: uppercase;
  font-family: 'Space Grotesk', sans-serif;
  transition: all .15s !important;
  cursor: pointer;
}
#src-tab-url { border-right: none !important; }
/* Active states set by switchSource() via inline style — we override with attribute trick */
#src-tab-upload[style*="background:#fff"],
#src-tab-upload[style*="background: #fff"] {
  background: var(--blue-mid) !important;
  color: var(--blue) !important;
  border-right-color: var(--border2) !important;
}
#src-tab-url[style*="background:#fff"],
#src-tab-url[style*="background: #fff"] {
  background: var(--blue-mid) !important;
  color: var(--blue) !important;
}

/* URL panel */
#source-url-panel > div {
  background: var(--card2) !important;
  border: 1px solid var(--border2) !important;
  border-radius: 4px !important;
}
/* URL row (each row item) */
#url-rows .url-row-wrap,
#url-rows > div {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 3px;
}
#btn-add-url {
  background: var(--blue-dim) !important;
  border: 1px solid rgba(0,163,255,.25) !important;
  color: var(--blue) !important;
  border-radius: 3px !important;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px !important;
  font-weight: 800 !important;
}
#btn-add-url:hover { background: var(--blue-mid) !important; }

/* upload queue */
#upload-queue-panel { margin-top: 10px; }
#limit-warning {
  border-radius: 3px !important;
}

/* ============================================================
   CLIPS TAB — history-container
   ============================================================ */
#history-container .glass,
#history-container > div {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
}

/* Clip card styling (generated by JS) — target common patterns */
.clip-card,
[class*="clip-card"] {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
}

/* batch select / delete buttons */
#btn-batch-select {
  background: var(--card2) !important;
  border: 1px solid var(--border2) !important;
  border-radius: 3px !important;
  color: var(--text-dim) !important;
  font-family: 'Space Grotesk', sans-serif;
}
#btn-batch-delete {
  border-radius: 3px !important;
  font-family: 'Space Grotesk', sans-serif;
}

/* ============================================================
   TUTORIAL / PANDUAN  (tp- prefix)
   ============================================================ */

.tp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.tp-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.tp-header i {
  font-size: 13px;
  color: var(--blue);
  width: 28px; height: 28px;
  background: var(--blue-dim);
  border: 1px solid rgba(0,163,255,.2);
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px;
  flex-shrink: 0;
}
.tp-header h3 {
  font-size: 13px; font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -.01em;
  font-family: 'Space Grotesk', sans-serif;
}

.tp-steps { display: flex; flex-direction: column; }
.tp-step {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.tp-step:last-child { border-bottom: none; padding-bottom: 0; }
.tp-step:first-child { padding-top: 0; }

.tp-num {
  width: 22px; height: 22px;
  border-radius: 3px;
  background: var(--blue);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900;
  flex-shrink: 0;
  margin-top: 1px;
  font-family: 'Space Grotesk', sans-serif;
}
.tp-step-body { flex: 1; min-width: 0; }
.tp-step-title {
  font-size: 13px; font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  font-family: 'Space Grotesk', sans-serif;
}
.tp-step-desc { font-size: 11px; color: var(--text-mid); line-height: 1.55; margin: 0; }

.tp-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.tp-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 11px; color: var(--text-mid); line-height: 1.45; }
.tp-list li i { font-size: 8px; color: var(--blue); margin-top: 3px; flex-shrink: 0; }
.tp-list li b { color: var(--text); font-weight: 700; }

.tp-links { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tp-link {
  display: flex; align-items: center; gap: 6px;
  flex: 1; min-width: 100px;
  padding: 8px 10px;
  border-radius: 3px;
  border: 1px solid var(--border2);
  background: var(--card2);
  text-decoration: none;
  transition: border-color .15s;
}
.tp-link:hover { border-color: var(--blue); }
.tp-link i { font-size: 11px; flex-shrink: 0; }
.tp-link-name { font-size: 11px; font-weight: 700; }
.tp-link-sub  { font-size: 9px; color: var(--text-dim); }
.tp-link-ext  { font-size: 8px; color: var(--text-faint); margin-left: auto; }

.tp-instr {
  background: var(--blue-dim);
  border: 1px solid rgba(0,163,255,0.15);
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 5px;
}
.tp-instr-row { display: flex; gap: 8px; align-items: flex-start; font-size: 11px; color: var(--text-mid); }
.tp-instr-n { color: var(--blue); font-weight: 800; flex-shrink: 0; font-family: 'Space Grotesk', sans-serif; }
.tp-instr-row a { color: var(--blue); text-decoration: underline; font-weight: 600; }
.tp-instr-row code {
  background: var(--border2);
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 10px; color: var(--text-mid);
}
.tp-instr-note { font-size: 10px; color: var(--text-dim); margin: 4px 0 0; line-height: 1.5; }

.tp-ai-list { display: flex; flex-direction: column; gap: 10px; }
.tp-ai-item { display: flex; gap: 10px; align-items: flex-start; }
.tp-ai-item i { font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.tp-ai-title { font-size: 12px; font-weight: 700; color: var(--text); margin: 0 0 3px; font-family: 'Space Grotesk', sans-serif; }
.tp-ai-desc  { font-size: 11px; color: var(--text-mid); line-height: 1.5; margin: 0; }

.tp-notes {
  background: rgba(255,165,0,0.04);
  border: 1px solid rgba(255,165,0,0.15);
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.tp-notes-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 9px; font-weight: 800;
  color: rgba(255,165,0,0.7);
  text-transform: uppercase; letter-spacing: .12em;
  margin-bottom: 9px;
  font-family: 'Space Grotesk', sans-serif;
}
.tp-notes-list { display: flex; flex-direction: column; gap: 6px; }
.tp-notes-row  { display: flex; gap: 8px; align-items: flex-start; font-size: 11px; color: var(--text-mid); }
.tp-notes-row i { font-size: 9px; color: rgba(255,165,0,0.5); margin-top: 2px; flex-shrink: 0; }
.tp-notes-row b { color: var(--text); font-weight: 700; }

.tp-badge-free {
  font-size: 8px; font-weight: 900;
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid rgba(0,163,255,0.25);
  border-radius: 2px;
  padding: 1px 5px;
  letter-spacing: .04em;
  vertical-align: middle;
  font-family: 'Space Grotesk', sans-serif;
}

/* ============================================================
   SETTINGS MODAL overrides
   ============================================================ */
#settings-modal > div,
#settings-content {
  background: rgba(10,10,10,0.99) !important;
  border: 1px solid var(--border2) !important;
  border-radius: 6px !important;
}
#settings-content h3 {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -.02em;
}
#settings-content input[type="password"],
#settings-content input[type="text"] {
  background: var(--card2) !important;
  border: 1px solid var(--border2) !important;
  border-radius: 4px !important;
  color: var(--text) !important;
}
#settings-content input:focus {
  border-color: var(--blue) !important;
}
#settings-content button[onclick="saveSettings()"] {
  background: var(--blue) !important;
  color: #000 !important;
  border-radius: 4px !important;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900 !important;
  letter-spacing: .06em;
}
#settings-content button[onclick="saveSettings()"]:hover {
  background: #33B5FF !important;
}
#usage-estimate-panel {
  background: rgba(255,255,255,0.02) !important;
  border: 1px solid var(--border2) !important;
  border-radius: 4px !important;
}

/* ============================================================
   INFO MODAL
   ============================================================ */
#modal-content {
  background: rgba(10,10,10,0.99) !important;
  border: 1px solid var(--border2) !important;
  border-radius: 6px !important;
}
#modal-content button[onclick="closeModal()"] {
  background: var(--blue) !important;
  border-radius: 4px !important;
  border: none !important;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800 !important;
}

/* ============================================================
   BOTTOM TAB BAR  (btab)
   ============================================================ */
.btab {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(0,0,0,0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: none;
  align-items: stretch;
  z-index: 45;
  padding-bottom: env(safe-area-inset-bottom);
}
.btab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-family: 'Space Grotesk', sans-serif;
  transition: color .15s;
  padding: 8px 4px;
  position: relative;
}
.btab-item i {
  font-size: 17px;
  transition: all .15s;
}
.btab-item.bt-active {
  color: var(--blue);
}
.btab-item.bt-active i {
  color: var(--blue);
  filter: drop-shadow(0 0 6px rgba(0,163,255,0.5));
}
.btab-item.bt-active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 2px;
  border-radius: 0 0 3px 3px;
  background: var(--blue);
  box-shadow: 0 0 8px rgba(0,163,255,0.5);
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  #desktop-nav { display: none !important; }
  #mobile-header-actions { display: flex !important; }
  .btab { display: flex; }
  #app > main,
  main[style] {
    padding-bottom: calc(60px + 14px + env(safe-area-inset-bottom)) !important;
  }
  #proc-modal-wrap { bottom: calc(68px + env(safe-area-inset-bottom)); right: 12px; width: calc(100vw - 24px); }
  #proc-pill       { bottom: calc(68px + env(safe-area-inset-bottom)); right: 12px; }
}

@media (max-width: 480px) {
  .sp-row { flex-wrap: wrap; gap: 8px; }
  .sp-col { min-width: 0; width: 100%; }
  .sp-select, .sp-input { height: 38px; }
  .sp-color-dot { width: 28px !important; height: 28px !important; }
  body { overflow-x: hidden; }
}

@media (min-width: 481px) and (max-width: 768px) {
  .sp-col { min-width: 0; }
}
