*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent:      #d1fe17;
  --accent-dim:  rgba(209, 254, 23, 0.12);
  --accent-ring: rgba(209, 254, 23, 0.15);
  --text:        #ffffff;
  --text-muted:  rgba(255, 255, 255, 0.6);
  --radius-card: 14px;
  --radius-btn:  10px;
  --glass-bg:    rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.13);
  --t:           200ms ease;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 10px;
  border: 1px solid rgba(209, 254, 23, 0.12);
  border-radius: 20px;
  pointer-events: none;
  z-index: 9999;
  box-shadow:
    inset 0 0 40px rgba(209, 254, 23, 0.025),
    0 0 40px rgba(209, 254, 23, 0.025);
}

/* ── Background: subtle lime glow top-right ── */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    ellipse 900px 700px at 100% 0%,
    rgba(209, 254, 23, 0.055) 0%,
    transparent 60%
  );
}

.mesh-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(209, 254, 23, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, black 10%, rgba(0,0,0,0.5) 50%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, black 10%, rgba(0,0,0,0.5) 50%, transparent 80%);
  pointer-events: none;
}

.mesh-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.045;
  pointer-events: none;
}

.blob {
  display: block;
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.blob-1 {
  width: 520px; height: 520px;
  top: -100px; right: -80px;
  background: rgba(209, 254, 23, 0.07);
  filter: blur(100px);
  animation-name: blobFloat1;
  animation-duration: 22s;
}

.blob-2 {
  width: 600px; height: 600px;
  bottom: -120px; left: -100px;
  background: rgba(163, 230, 53, 0.09);
  filter: blur(120px);
  animation-name: blobFloat2;
  animation-duration: 28s;
}

.blob-3 {
  width: 400px; height: 400px;
  top: calc(40% - 200px);
  left: calc(35% - 200px);
  background: rgba(250, 204, 21, 0.08);
  filter: blur(90px);
  animation-name: blobFloat3;
  animation-duration: 18s;
}

.blob-4 {
  width: 350px; height: 350px;
  top: -60px; left: -60px;
  background: rgba(52, 211, 153, 0.07);
  filter: blur(80px);
  animation-name: blobFloat4;
  animation-duration: 30s;
}

/* ── App container (transparent on dark bg) ── */
.app-card {
  position: relative;
  width: 100%;
  max-width: 1160px;
  min-height: calc(100vh - 48px);
  padding: 24px 0 56px;
}

/* ── Glassy pill navbar ── */
.navbar {
  position: sticky;
  top: 20px;
  width: fit-content;
  min-width: 420px;
  margin: 0 auto 32px;
  padding: 10px 12px 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(48px) saturate(180%);
  -webkit-backdrop-filter: blur(48px) saturate(180%);
  border: 1px solid rgba(209, 254, 23, 0.22);
  border-radius: 20px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px rgba(209, 254, 23, 0.06);
  z-index: 100;
  animation: navFloat 4s ease-in-out infinite;
  will-change: transform;
  transition: box-shadow 0.25s ease;
}

.navbar:hover {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.6),
    0 20px 56px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(209, 254, 23, 0.10);
}

@keyframes navFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  text-decoration: none;
}

.nav-logo {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
  transition: transform var(--t), filter var(--t);
}

.nav-brand-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}

.nav-brand:hover .nav-logo {
  transform: scale(1.05);
  filter: drop-shadow(0 0 6px rgba(209, 254, 23, 0.5));
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
  flex-shrink: 0;
}

.nav-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.nav-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(209, 254, 23, 0.25);
}

.nav-btn-add {
  background: var(--accent);
  color: #0a0a0a;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(209, 254, 23, 0.25);
}

.nav-btn-add:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

/* ── Collapsible search bar ── */
.search-wrapper[hidden] { display: none; }

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 680px;
  margin: 0 auto 24px;
  padding: 0 24px;
  animation: slideDown 0.22s ease both;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-icon {
  position: absolute;
  left: calc(24px + 1rem);
  width: 17px;
  height: 17px;
  color: var(--accent);
  pointer-events: none;
  flex-shrink: 0;
}

#searchInput {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text);
  padding: 0.75rem 2.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  -webkit-appearance: none;
}

#searchInput::placeholder { color: rgba(255, 255, 255, 0.4); }

#searchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(209, 254, 23, 0.12);
}

#searchInput::-webkit-search-cancel-button { display: none; }

.search-clear {
  position: absolute;
  right: calc(24px + 0.8rem);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.68rem;
  transition: background var(--t), color var(--t);
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* ── Sort menu (navbar) ── */
.sort-menu {
  position: relative;
}

.sort-dropdown {
  min-width: 160px;
}

.sort-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.sort-item.active svg {
  color: var(--accent);
}

/* ── Main content ── */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Tag filter bar ── */
.tag-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.filter-pill {
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.16);
}

.filter-pill.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(209, 254, 23, 0.3);
  font-weight: 600;
}

/* ── Grid ── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

/* ── Cards ── */
.link-card {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 2px 12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(209, 254, 23, 0.07);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  animation: fadeInUp 0.4s ease both;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.link-card { cursor: pointer; }

.link-card:hover {
  transform: translateY(-1px);
  border-color: rgba(209, 254, 23, 0.15);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(209, 254, 23, 0.22),
    0 0 24px rgba(209, 254, 23, 0.08);
}

.link-card.deleting {
  animation: fadeOutScale 0.28s ease forwards;
  pointer-events: none;
}

.link-card.dragging {
  opacity: 0.45;
  transform: scale(0.97) rotate(1deg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  cursor: grabbing;
}

.link-card[draggable="true"]:not(.drag-disabled) {
  cursor: grab;
}

.link-card.drag-disabled {
  cursor: grab;
  opacity: 0.85;
}

.link-card.drag-over-top {
  border-top: 2px solid var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(209, 254, 23, 0.22),
    0 -2px 12px rgba(209, 254, 23, 0.18);
}

.link-card.drag-over-bottom {
  border-bottom: 2px solid var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(209, 254, 23, 0.22),
    0 2px 12px rgba(209, 254, 23, 0.18);
}

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

@keyframes fadeOutScale {
  to { opacity: 0; transform: scale(0.88); }
}

@keyframes blobFloat1 {
  0%   { transform: translate(0px,   0px)   scale(1);    }
  25%  { transform: translate(40px, -30px)  scale(1.04); }
  50%  { transform: translate(20px,  50px)  scale(0.97); }
  75%  { transform: translate(-25px, 20px)  scale(1.02); }
  100% { transform: translate(0px,   0px)   scale(1);    }
}

@keyframes blobFloat2 {
  0%   { transform: translate(0px,   0px)   scale(1);    }
  30%  { transform: translate(-50px, 30px)  scale(1.05); }
  60%  { transform: translate(30px,  60px)  scale(0.96); }
  100% { transform: translate(0px,   0px)   scale(1);    }
}

@keyframes blobFloat3 {
  0%   { transform: translate(0px,   0px)   scale(1);    }
  33%  { transform: translate(60px,  20px)  scale(1.06); }
  66%  { transform: translate(-40px, 40px)  scale(0.95); }
  100% { transform: translate(0px,   0px)   scale(1);    }
}

@keyframes blobFloat4 {
  0%   { transform: translate(0px,   0px)   scale(1);    }
  40%  { transform: translate(30px, -50px)  scale(1.03); }
  70%  { transform: translate(-30px, 25px)  scale(0.98); }
  100% { transform: translate(0px,   0px)   scale(1);    }
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.favicon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  object-fit: contain;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.edit-btn,
.delete-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--accent);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.72rem;
  opacity: 0;
  transition: opacity var(--t), transform var(--t), box-shadow var(--t);
  flex-shrink: 0;
}

.link-card:hover .edit-btn,
.link-card:hover .delete-btn { opacity: 1; }

.edit-btn:hover,
.delete-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.card-body { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }

.card-title { font-size: 0.97rem; font-weight: 600; line-height: 1.4; }

.card-title a { color: var(--text); text-decoration: none; transition: color var(--t); }

.card-title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.card-url {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-note {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
  margin-top: 0.3rem;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* All tag color variants → unified lime on dark */
.tag,
.tag-violet,
.tag-pink,
.tag-cyan,
.tag-amber,
.tag-green,
.tag-orange,
.tag-indigo,
.tag-teal {
  font-size: 0.74rem;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-weight: 500;
  background: var(--accent-dim);
  border: 1px solid rgba(209, 254, 23, 0.25);
  color: var(--accent);
}

.card-date { font-size: 0.71rem; color: var(--text-muted); margin-top: auto; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 6rem 1rem;
  color: var(--text-muted);
  animation: emptyFadeIn 0.4s ease both;
}

.empty-state.hiding {
  animation: emptyFadeOut 0.3s ease forwards;
}

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

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

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
  display: block;
  animation: emptyIconFloat 3s ease-in-out infinite;
}

@keyframes emptyIconFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.empty-state h2 {
  font-size: 1.4rem;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state p { font-size: 0.92rem; margin-bottom: 1.75rem; }
.empty-state strong { color: var(--accent); }

.empty-state-add {
  font-size: 0.9rem;
  padding: 0.6rem 1.5rem;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-panel {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(56px) saturate(160%);
  -webkit-backdrop-filter: blur(56px) saturate(160%);
  border: 1px solid rgba(209, 254, 23, 0.18);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 40px rgba(209, 254, 23, 0.03),
    0 0 0 1px rgba(209, 254, 23, 0.08);
  transform: scale(0.94) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal-panel { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h2 { font-size: 1.2rem; font-weight: 700; color: var(--text); }

.modal-close {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t), box-shadow var(--t), color var(--t);
}

.modal-close:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 4px var(--accent-ring);
  color: var(--text);
}

/* ── Form fields ── */
.field { margin-bottom: 1.1rem; position: relative; }

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.required { color: var(--accent); }

.field input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text);
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}

.field input::placeholder { color: rgba(255, 255, 255, 0.4); }

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(209, 254, 23, 0.12);
}

.field input.invalid { border-color: #ef4444; }

.field-error { display: none; font-size: 0.76rem; color: #ef4444; margin-top: 0.3rem; }
.field-error.visible { display: block; }
.field-hint { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.35rem; display: block; }

/* ── Tag input wrapper ── */
.tag-input-wrapper {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  min-height: 48px;
  cursor: text;
  transition: border-color var(--t), box-shadow var(--t);
}

.tag-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(209, 254, 23, 0.12);
}

.tag-pills-input { display: flex; flex-wrap: wrap; gap: 0.4rem; }

#inputTag {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  color: var(--text) !important;
  padding: 0 !important;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  min-width: 80px;
  flex: 1;
  width: auto !important;
}

#inputTag::placeholder { color: rgba(255, 255, 255, 0.4) !important; }

.modal-tag-pill {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(209, 254, 23, 0.25);
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 500;
  padding: 0.18rem 0.5rem 0.18rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.modal-tag-pill button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.68rem;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: opacity var(--t);
}

.modal-tag-pill button:hover { opacity: 1; }

/* ── Buttons ── */
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.75rem;
}

.btn-primary {
  background: var(--accent);
  border: none;
  color: #0a0a0a;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--t), filter var(--t);
}

.btn-primary:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.btn-primary:active { transform: scale(0.99); }

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.28);
}

/* ── Settings dropdown ── */
.settings-menu {
  position: relative;
}

.settings-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(48px) saturate(180%);
  -webkit-backdrop-filter: blur(48px) saturate(180%);
  border: 1px solid rgba(209, 254, 23, 0.22);
  border-radius: 12px;
  padding: 6px;
  min-width: 140px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px rgba(209, 254, 23, 0.06);
  z-index: 200;
  animation: dropdownIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.settings-dropdown[hidden] { display: none; }

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

.settings-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.86rem;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  text-align: left;
}

.settings-item svg { color: var(--accent); flex-shrink: 0; }

.settings-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(209, 254, 23, 0.2);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.88rem;
  padding: 10px 18px;
  z-index: 9000;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.22s ease both;
  pointer-events: none;
}

.toast.toast-error { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

/* ── Link counter badge ── */
.link-counter {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9500;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(209, 254, 23, 0.22);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(209, 254, 23, 0.06);
  pointer-events: none;
  user-select: none;
}

#linkCountNum {
  display: inline-block;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#linkCountNum.bump {
  animation: counterBump 0.2s ease both;
}

@keyframes counterBump {
  0%   { transform: scale(1);    opacity: 1; }
  40%  { transform: scale(1.35); opacity: 0.7; }
  100% { transform: scale(1);    opacity: 1; }
}

/* ── Auth overlay ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
  animation: authFadeIn 0.3s ease both;
}

.auth-overlay[hidden] { display: none; }

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

.auth-panel {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(56px) saturate(160%);
  -webkit-backdrop-filter: blur(56px) saturate(160%);
  border: 1px solid rgba(209, 254, 23, 0.22);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 40px rgba(209, 254, 23, 0.04),
    0 0 0 1px rgba(209, 254, 23, 0.08);
  animation: authPanelIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

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

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.auth-logo {
  height: 32px;
  width: auto;
}

.auth-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.auth-panel h2 {
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.4rem;
}

.auth-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-error {
  font-size: 0.8rem;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  margin-bottom: 1rem;
}

.auth-error[hidden] { display: none; }

.auth-submit {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-toggle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
}

.auth-toggle button {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 0 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-toggle button:hover { filter: brightness(1.15); }

/* ── Loading state ── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 1rem;
  gap: 1rem;
  color: var(--text-muted);
}

.loading-state[hidden] { display: none; }

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(209, 254, 23, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  body { padding: 12px; }
  .app-card { padding: 16px 0 32px; }
  .navbar { min-width: 0; width: calc(100% - 32px); border-radius: 16px; }
  .links-grid { grid-template-columns: 1fr; }
  .main-content { padding: 0 16px; }
  .search-wrapper { padding: 0 16px; }
  .modal-panel { padding: 1.5rem; border-radius: 16px; }
  .auth-panel { padding: 1.75rem 1.25rem; border-radius: 16px; }
}
