/* ─── TOP NAV ────────────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg);
  border-bottom: .5px solid var(--border);
  transition: background .25s;
}
.top-nav .logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  color: var(--t1);
  letter-spacing: -.02em;
  user-select: none;
}
.top-nav .logo span { color: var(--amber); }
.nav-actions { display: flex; gap: 8px; align-items: center; }

/* ─── ICON BUTTON ───────────────────────────────────────── */
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg3);
  border: .5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s, transform .15s;
  flex-shrink: 0;
}
.icon-btn:active { transform: scale(.93); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: var(--t2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.active svg { stroke: var(--amber); }

/* ─── THEME TOGGLE ──────────────────────────────────────── */
.theme-toggle {
  width: 44px; height: 24px;
  border-radius: 12px;
  background: var(--bg3);
  border: .5px solid var(--border2);
  position: relative;
  cursor: pointer;
  transition: background .25s;
  flex-shrink: 0;
}
.theme-toggle .thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  display: flex; align-items: center; justify-content: center;
  transition: left .2s cubic-bezier(.4,0,.2,1), background .2s;
}
.theme-toggle .thumb svg { width: 10px; height: 10px; fill: none; stroke-width: 1.5; stroke-linecap: round; }
[data-theme="dark"]  .theme-toggle .thumb { left: 23px; background: var(--amber); }
[data-theme="dark"]  .theme-toggle .thumb svg { stroke: #1a0e00; }
[data-theme="light"] .theme-toggle .thumb { left: 3px;  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
[data-theme="light"] .theme-toggle .thumb svg { stroke: #B87010; }

/* ─── BOTTOM NAV ────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg);
  border-top: .5px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  transition: background .25s;
}
.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 20px;
  cursor: pointer;
  opacity: .4;
  transition: opacity .2s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.bn-item.active { opacity: 1; }
.bn-item svg { width: 22px; height: 22px; fill: none; stroke: var(--t2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.bn-item.active svg { stroke: var(--amber); }
.bn-label { font-size: 10px; color: var(--t3); letter-spacing: .03em; }
.bn-item.active .bn-label { color: var(--amber); }
.bn-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--amber); }

/* ─── CATEGORY TAGS ─────────────────────────────────────── */
.tag-strip {
  display: flex;
  gap: 8px;
  padding: 12px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tag-strip::-webkit-scrollbar { display: none; }
.tag {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, color .2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tag.active {
  background: var(--amber);
  color: #fff;
  font-weight: 500;
}
.tag.inactive {
  background: var(--bg3);
  color: var(--t2);
  border: .5px solid var(--border);
}

/* ─── PRIMARY BUTTON ────────────────────────────────────── */
.btn-primary {
  width: 100%;
  background: var(--amber);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:active { transform: scale(.97); opacity: .9; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }

.btn-secondary {
  width: 100%;
  background: transparent;
  color: var(--t2);
  border: .5px solid var(--border2);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-secondary:active { background: var(--bg3); }
.btn-secondary svg { width: 15px; height: 15px; fill: none; stroke: var(--amber); stroke-width: 1.5; stroke-linecap: round; }

/* ─── FORM FIELDS ───────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 6px;
}
.field-input {
  width: 100%;
  background: var(--bg3);
  border: .5px solid var(--border2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--t1);
  outline: none;
  transition: border-color .2s, background .25s;
  appearance: none;
}
.field-input::placeholder { color: var(--t3); }
.field-input:focus { border-color: var(--amber); }
.field-input-icon {
  position: relative;
}
.field-input-icon input { padding-right: 40px; }
.field-input-icon .fi-icon {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.field-input-icon .fi-icon svg { width: 16px; height: 16px; fill: none; stroke: var(--amber); stroke-width: 1.5; stroke-linecap: round; }
.field-prefix {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg3);
  border: .5px solid var(--border2);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .2s, background .25s;
}
.field-prefix:focus-within { border-color: var(--amber); }
.field-prefix .prefix-sym {
  padding: 12px 4px 12px 14px;
  color: var(--t3);
  font-size: 14px;
  user-select: none;
}
.field-prefix input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 14px 12px 2px;
  font-size: 14px;
  color: var(--t1);
  outline: none;
}
.field-prefix input::placeholder { color: var(--t3); }

/* ─── TOGGLE ROW ────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg3);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: .5px solid var(--border);
  transition: background .25s;
  gap: 12px;
}
.toggle-text strong { display: block; font-size: 13px; color: var(--t1); font-weight: 500; margin-bottom: 2px; }
.toggle-text span   { font-size: 11px; color: var(--t3); line-height: 1.4; }
.ios-toggle {
  width: 44px; height: 26px;
  border-radius: 13px;
  border: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background .25s;
  background: var(--bg4);
}
.ios-toggle.on { background: var(--amber); }
.ios-toggle .knob {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: left .2s cubic-bezier(.4,0,.2,1);
}
.ios-toggle .knob { left: 3px; }
.ios-toggle.on .knob { left: 21px; }

/* ─── LEGAL NOTE ────────────────────────────────────────── */
.legal-note {
  font-size: 11px;
  color: var(--t3);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--bg2);
  border-radius: 10px;
  border: .5px solid var(--border);
  margin-bottom: 16px;
  transition: background .25s;
}

/* ─── TOAST ─────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 420px;
}
.toast {
  background: var(--bg4);
  color: var(--t1);
  border: .5px solid var(--border2);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .3s ease forwards;
  pointer-events: all;
  box-shadow: var(--shadow);
}
.toast.error  { border-color: rgba(220,60,60,.35); }
.toast.success{ border-color: rgba(80,180,100,.35); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.toast.error   .toast-dot { background: #e05050; }
.toast.success .toast-dot { background: #50c060; }
.toast.info    .toast-dot { background: var(--amber); }
.toast.out { animation: toastOut .3s ease forwards; }

@keyframes toastIn  { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { from { opacity:1; transform:translateY(0); } to { opacity:0; transform:translateY(-8px); } }

/* ─── AVATAR / USER CHIP ────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--amber-dim);
  border: 1px solid var(--amber);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--amber-txt);
  flex-shrink: 0;
  user-select: none;
}

/* ─── BADGE ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; padding: 3px 9px;
  border-radius: 20px; letter-spacing: .03em;
}
.badge-amber { background: var(--amber-dim); color: var(--amber-txt); border: .5px solid transparent; }
.badge-approved { background: rgba(80,180,100,.12); color: #50c060; border: .5px solid rgba(80,180,100,.25); }

/* ─── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 12px;
}
.empty-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--bg3); display: flex; align-items: center; justify-content: center; }
.empty-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--t3); stroke-width: 1.3; stroke-linecap: round; }
.empty-state p { font-size: 14px; color: var(--t2); max-width: 260px; line-height: 1.6; }

/* ─── LOADING SPINNER ───────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── PAGE TRANSITIONS ───────────────────────────────────── */
.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
