:root {
  --bg-oled: #000000;
  --bg-surface: #0b0c10;
  --bg-elevated: #12141b;
  --bg-tonal: #181b24;
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text-primary: #f3f5f8;
  --text-secondary: #9aa0ae;
  --text-muted: #5f6675;

  /* Gemini / Material 3 expressive accents */
  --gemini-blue: #7cacf8;
  --gemini-indigo: #9b8afb;
  --gemini-violet: #c58af9;
  --gemini-gradient: linear-gradient(135deg, #7cacf8 0%, #9b8afb 52%, #c58af9 100%);
  --gemini-glow: rgba(138, 164, 248, 0.22);

  --success: #6dd58c;
  --success-soft: rgba(109, 213, 140, 0.12);
  --danger: #f28b82;
  --danger-solid: #e25c5c;
  --danger-soft: rgba(242, 139, 130, 0.12);

  --radius-pill: 9999px;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --ease-m3: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);

  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html,
body {
  min-height: 100%;
  background-color: var(--bg-oled);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  overflow-x: hidden;
  animation: page-fade-in 0.48s var(--ease-m3) both;
}

/* Ultra-subtle Gemini ambient aurora on pure black IPS canvas */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px circle at 50% -12%, rgba(124, 172, 248, 0.09), transparent 70%),
    radial-gradient(520px circle at 82% 88%, rgba(197, 138, 249, 0.055), transparent 70%);
}

body > * {
  position: relative;
  z-index: 1;
}

@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fullscreen transition curtain */
.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.36s var(--ease-m3);
}

.page-curtain--active {
  opacity: 1;
  pointer-events: all;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* ===========================
   Material 3 Pill Buttons
   =========================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition:
    background-color 0.2s var(--ease-m3),
    border-color 0.2s var(--ease-m3),
    color 0.2s var(--ease-m3),
    transform 0.16s var(--ease-m3),
    box-shadow 0.22s var(--ease-m3),
    opacity 0.2s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--text-primary);
  color: #06070a;
  font-weight: 600;
}

.btn--primary:hover:not(:disabled) {
  background: #ffffff;
  box-shadow: 0 0 24px rgba(155, 138, 251, 0.28);
}

.btn--tonal {
  background: var(--bg-tonal);
  border-color: var(--border-hairline);
  color: var(--text-primary);
}

.btn--tonal:hover:not(:disabled) {
  background: #202430;
  border-color: var(--border-hover);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.btn--outline {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-hairline);
  color: var(--text-secondary);
}

.btn--outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn--danger {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

.btn--danger:hover:not(:disabled) {
  background: var(--danger-solid);
  color: #ffffff;
}

.btn--success {
  background: var(--success-soft) !important;
  border-color: rgba(109, 213, 140, 0.3) !important;
  color: var(--success) !important;
}

.btn--sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

.btn--full {
  width: 100%;
  padding: 13px 20px;
  font-size: 14px;
}

/* ===========================
   Minimal Topbar
   =========================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.topbar--minimal {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  background: transparent;
  backdrop-filter: none;
  border-bottom: none;
}

.topbar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

.brand-mark:hover {
  opacity: 1;
}

.brand-mark__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #b7c8ff;
}

.brand-mark__icon svg {
  width: 17px;
  height: 17px;
}

.topbar__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

/* ===========================
   Login Page (Minimal Material 3)
   =========================== */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: rgba(11, 12, 16, 0.86);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 40px 32px 34px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-orb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.12), rgba(155, 138, 251, 0.06) 65%, rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d6e2ff;
  box-shadow: 0 0 36px rgba(124, 172, 248, 0.14);
}

.auth-orb svg {
  width: 26px;
  height: 26px;
}

.auth-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  background: linear-gradient(180deg, #ffffff 30%, #aeb6c7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.form-group {
  margin-bottom: 14px;
}

.input-wrap {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s var(--ease-m3), background-color 0.2s var(--ease-m3), box-shadow 0.2s var(--ease-m3);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:hover {
  border-color: var(--border-hover);
}

.form-input:focus {
  background: #151822;
  border-color: rgba(155, 138, 251, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 172, 248, 0.12);
}

.form-input--password {
  padding-right: 46px;
}

.input-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.input-toggle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 10px;
}

.alert--visible {
  display: flex;
}

.alert--error {
  background: var(--danger-soft);
  border: 1px solid rgba(242, 139, 130, 0.25);
  color: #f9b8b2;
}

.auth-submit-wrap {
  margin-top: 20px;
}

/* ===========================
   Dashboard — Ultra-Dark Floating Bubbles
   =========================== */

body.page-dashboard {
  background-color: #000000;
}

body.page-dashboard::before {
  background:
    radial-gradient(560px circle at 50% 45%, rgba(124, 172, 248, 0.065), transparent 65%),
    radial-gradient(420px circle at 60% 55%, rgba(197, 138, 249, 0.05), transparent 65%);
}

.bubbles-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 24px 64px;
}

.bubbles-constellation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 44px;
  max-width: 780px;
}

/* Wrapper handles subtle idle float independently from hover transform */
.bubble-orbit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: bubble-float var(--float-duration, 6.2s) ease-in-out var(--float-delay, 0s) infinite;
}

@keyframes bubble-float {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -11px, 0);
  }
}

.tool-bubble {
  --mx: 50%;
  --my: 50%;
  --tx: 0px;
  --ty: 0px;

  position: relative;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(164, 184, 255, 0.16), transparent 58%),
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.025) 55%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.18),
    inset 0 -10px 24px rgba(0, 0, 0, 0.45),
    0 18px 46px rgba(0, 0, 0, 0.65);
  color: rgba(243, 245, 248, 0.9);
  transform: translate3d(var(--tx), var(--ty), 0) scale(1);
  transition:
    transform 0.38s var(--ease-spring),
    border-color 0.28s var(--ease-m3),
    box-shadow 0.34s var(--ease-m3),
    color 0.24s ease;
  outline: none;
  cursor: pointer;
  user-select: none;
}

/* Specular rim glow on hover */
.tool-bubble::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  padding: 1px;
  background: var(--gemini-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.32s var(--ease-m3);
  pointer-events: none;
}

/* Soft outer aura */
.tool-bubble::after {
  content: '';
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(138, 164, 248, 0.16), rgba(197, 138, 249, 0.06) 45%, transparent 72%);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.35s var(--ease-m3), transform 0.4s var(--ease-spring);
  pointer-events: none;
  z-index: -1;
}

.tool-bubble svg {
  width: 36px;
  height: 36px;
  stroke-width: 1.6;
  transition: transform 0.35s var(--ease-spring), filter 0.3s ease;
}

.tool-bubble:hover,
.tool-bubble:focus-visible {
  transform: translate3d(var(--tx), var(--ty), 0) scale(1.09);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.28),
    inset 0 -10px 24px rgba(0, 0, 0, 0.35),
    0 24px 56px rgba(0, 0, 0, 0.8);
}

.tool-bubble:hover::before,
.tool-bubble:focus-visible::before {
  opacity: 0.78;
}

.tool-bubble:hover::after,
.tool-bubble:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

.tool-bubble:hover svg,
.tool-bubble:focus-visible svg {
  transform: scale(1.08);
  filter: drop-shadow(0 0 12px rgba(155, 138, 251, 0.55));
}

.tool-bubble:active {
  transform: translate3d(var(--tx), var(--ty), 0) scale(0.96);
}

/* Launching transition state when clicked */
.tool-bubble--launching {
  transform: scale(1.32) !important;
  opacity: 0 !important;
  transition: transform 0.36s var(--ease-m3), opacity 0.32s var(--ease-m3) !important;
}

/* Subtle floating tooltip revealed only on hover/focus */
.bubble-tooltip {
  position: absolute;
  top: calc(100% + 16px);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(18, 20, 27, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.24s var(--ease-m3), transform 0.24s var(--ease-m3);
  pointer-events: none;
}

.bubble-orbit:hover .bubble-tooltip,
.bubble-orbit:focus-within .bubble-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Dormant / Empty slot bubbles for future tools */
.tool-bubble--empty {
  width: 96px;
  height: 96px;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.008) 70%);
  border: 1px dashed rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.2);
  cursor: default;
}

.tool-bubble--empty svg {
  width: 22px;
  height: 22px;
}

.tool-bubble--empty:hover {
  transform: translate3d(var(--tx), var(--ty), 0) scale(1.03);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.36);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.tool-bubble--empty::before,
.tool-bubble--empty::after {
  display: none;
}

/* ===========================
   ImgHost Tool (Clean Material 3)
   =========================== */

.tool-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tool-hero__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  background: linear-gradient(180deg, #ffffff 25%, #b5bdd0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.upload-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 16px;
  margin-bottom: 24px;
}

.dropzone {
  position: relative;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.015);
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.22s var(--ease-m3), background-color 0.22s var(--ease-m3), box-shadow 0.25s var(--ease-m3);
}

.dropzone:hover {
  border-color: rgba(155, 138, 251, 0.42);
  background: rgba(124, 172, 248, 0.03);
}

.dropzone--dragover {
  border-color: var(--gemini-indigo);
  background: rgba(155, 138, 251, 0.08);
  box-shadow: 0 0 0 4px rgba(155, 138, 251, 0.1);
}

.dropzone__orb {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.1), rgba(155, 138, 251, 0.06) 70%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd8ff;
  display: grid;
  place-items: center;
  transition: transform 0.28s var(--ease-spring), box-shadow 0.28s ease;
}

.dropzone:hover .dropzone__orb {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 28px rgba(124, 172, 248, 0.2);
}

.dropzone__orb svg {
  width: 26px;
  height: 26px;
}

.dropzone__title {
  font-size: 16.5px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.dropzone__hints {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.upload-progress {
  margin-top: 14px;
  padding: 0 6px 4px;
  display: none;
}

.upload-progress--visible {
  display: block;
}

.upload-progress__meta {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.upload-progress__track {
  width: 100%;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  overflow: hidden;
}

.upload-progress__bar {
  width: 0%;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gemini-gradient);
  transition: width 0.14s ease;
}

/* Result Preview Panel */
.result-panel {
  display: none;
  background: var(--bg-surface);
  border: 1px solid rgba(109, 213, 140, 0.24);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 32px;
  gap: 20px;
  align-items: center;
}

.result-panel--visible {
  display: grid;
  grid-template-columns: 184px 1fr;
  animation: page-fade-in 0.3s var(--ease-m3);
}

.result-panel__thumb {
  width: 100%;
  height: 136px;
  border-radius: var(--radius-md);
  background: #050608;
  border: 1px solid var(--border-hairline);
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: zoom-in;
}

.result-panel__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-panel__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--success);
  margin-bottom: 10px;
}

.result-panel__url-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.result-panel__input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12.5px;
  outline: none;
}

.result-panel__input:focus {
  border-color: rgba(155, 138, 251, 0.5);
}

.result-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

.result-panel__actions {
  display: flex;
  gap: 6px;
}

/* Gallery */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.gallery-header__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.count-pill {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.gallery-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s var(--ease-m3), transform 0.22s var(--ease-m3);
}

.gallery-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.gallery-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #050608;
  overflow: hidden;
  cursor: zoom-in;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gallery-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s var(--ease-m3);
}

.gallery-card:hover .gallery-card__media img {
  transform: scale(1.04);
}

.gallery-card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-card__name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

.gallery-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-card__actions .btn:first-child {
  flex: 1;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed var(--border-hairline);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 14px;
}

.gallery-empty p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ===========================
   Modals & Material 3 Snackbar
   =========================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop--open {
  display: flex;
  animation: page-fade-in 0.22s var(--ease-m3);
}

.lightbox {
  max-width: min(92vw, 1060px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 76vh;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-hairline);
  background: #050608;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.8);
}

.lightbox__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(14, 16, 22, 0.92);
  border: 1px solid var(--border-hairline);
  padding: 6px 10px 6px 16px;
  border-radius: var(--radius-pill);
}

.lightbox__name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-right: 4px;
}

.confirm-dialog {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  padding: 26px;
}

.confirm-dialog h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.confirm-dialog p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}

.confirm-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(20, 22, 30, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
  animation: toast-in 0.24s var(--ease-m3);
}

.toast--success {
  border-color: rgba(109, 213, 140, 0.35);
}

.toast--error {
  border-color: rgba(242, 139, 130, 0.4);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===========================
   Responsive & Reduced Motion
   =========================== */

@media (max-width: 720px) {
  .topbar__inner {
    padding: 14px 16px;
  }

  .container {
    padding: 24px 16px 56px;
  }

  .bubbles-constellation {
    gap: 28px;
  }

  .tool-bubble {
    width: 106px;
    height: 106px;
  }

  .tool-bubble svg {
    width: 30px;
    height: 30px;
  }

  .tool-bubble--empty {
    width: 82px;
    height: 82px;
  }

  .result-panel--visible {
    grid-template-columns: 1fr;
  }

  .result-panel__url-row {
    flex-direction: column;
  }

  .dropzone {
    padding: 40px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bubble-orbit {
    animation: none;
  }
  body {
    animation: none;
  }
}
