/* ==========================================================================
   Ai Image Browser — Download Site Stylesheet
   ========================================================================== */

:root {
  /* Unified Dark Theme (matches the app) */
  --bg-page: #0b0f17;
  --bg-card: #151d2a;
  --bg-code: #0d131f;
  --bg-badge: rgba(91, 43, 181, 0.3);
  --bg-alert: #1f1b0a;

  --border-subtle: #1e293b;
  --border-card: #273549;
  --border-code: #1e293b;
  --border-alert: #42350a;
  --border-badge: rgba(147, 51, 234, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-badge: #e9d5ff;
  --text-alert: #fef08a;

  --accent-primary: #5b2bb5;
  --accent-hover: #6d35c8;
  --accent-active: #4a2196;
  --accent-focus-ring: rgba(109, 53, 200, 0.45);

  --success-color: #22c55e;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--bg-page);
  color: var(--text-primary);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main Container: Centered, max 720px */
.page-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1.25rem 4rem;
}

.content-container {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Typography Defaults */
h1, h2, h3 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* Visually Hidden (Accessible screen reader announcements) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

/* 1. Hero Section */
.hero-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-icon {
  width: 96px;
  height: 96px;
  max-width: 100%;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

h1#app-name {
  font-size: 2.25rem;
  letter-spacing: -0.025em;
}

.hero-tagline {
  font-size: 1.125rem;
  max-width: 540px;
  line-height: 1.5;
}

.badge-wrapper {
  margin-top: 0.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-badge);
  background-color: var(--bg-badge);
  border: 1px solid var(--border-badge);
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

/* 2. Download Button Section */
.download-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.primary-btn.download-btn {
  width: 100%;
  max-width: 440px;
  padding: 1rem 1.75rem;
  font-size: 1.125rem;
  background-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px 0 var(--accent-focus-ring);
  gap: 0.75rem;
}

.primary-btn.download-btn:hover {
  background-color: var(--accent-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

.primary-btn.download-btn:active {
  background-color: var(--accent-active);
  transform: translateY(0);
}

.btn-icon {
  flex-shrink: 0;
}

/* Cards & Generic Panels */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.section-heading {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
}

.section-note {
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Secondary Button (Copy) */
.secondary-btn.copy-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.secondary-btn.copy-btn:hover {
  background-color: var(--border-subtle);
}

.secondary-btn.copy-btn.copied {
  color: var(--success-color);
  border-color: var(--success-color);
}

/* Code Container & Monospace Elements */
.code-container {
  width: 100%;
}

.hash-code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  background-color: var(--bg-code);
  color: var(--text-primary);
  border: 1px solid var(--border-code);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.direct-link-wrapper {
  margin-top: 0.25rem;
}

.direct-link {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.direct-link:hover {
  color: var(--accent-primary);
}

/* 5. Features Section */
.features-section {
  display: flex;
  flex-direction: column;
}

.feature-groups {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.35rem 1.5rem;
}

.feature-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.feature-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.feature-list > li {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.feature-list > li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.55rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--accent-primary);
}

.feature-list > li strong {
  color: var(--text-primary);
}

.sub-feature-list {
  list-style: disc;
  margin: 0.4rem 0 0.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sub-feature-list li {
  padding-left: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.sub-feature-list li::before {
  display: none;
}

/* 6. First Run on Windows Alert Card */
.alert-card {
  display: flex;
  gap: 1rem;
  background-color: var(--bg-alert);
  border: 1px solid var(--border-alert);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.alert-icon {
  color: var(--text-alert);
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.alert-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.alert-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-alert);
}

.alert-content p {
  font-size: 0.9375rem;
  color: var(--text-alert);
  opacity: 0.95;
  line-height: 1.5;
}

.alert-content strong {
  font-weight: 700;
}

/* 7. System Requirements */
.requirements-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.requirements-box svg {
  color: var(--text-muted);
}

/* 8. Changelog */
.changelog-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.changelog-paragraph {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.changelog-list {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.changelog-list li {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* 9. Site Footer */
.site-footer {
  margin-top: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links {
  font-size: 0.875rem;
}

.dot-separator {
  margin: 0 0.5rem;
  color: var(--text-muted);
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Responsive Breakpoints */
@media (max-width: 480px) {
  .page-wrapper {
    padding: 2rem 1rem 3rem;
  }

  h1#app-name {
    font-size: 1.85rem;
  }

  .primary-btn.download-btn {
    width: 100%;
    font-size: 1rem;
    padding: 0.875rem 1.25rem;
  }

  .card {
    padding: 1rem;
  }

  .alert-card {
    padding: 1rem;
  }
}

/* ==========================================================================
   Shared Site Navigation
   ========================================================================== */
.site-header {
  width: 100%;
  max-width: 720px;
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  text-decoration: none;
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-link[aria-current="page"] {
  color: var(--text-primary);
  font-weight: 600;
  background-color: var(--bg-badge);
  border: 1px solid var(--border-badge);
}

/* ==========================================================================
   Download Page: Compact 'What's new' & subtle support line
   ========================================================================== */
.download-subtext,
.support-cta {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.download-subtext a,
.support-cta-link {
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}

.download-subtext a:hover,
.support-cta-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--accent-hover);
}

.download-subtext a:focus-visible,
.support-cta-link:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.compact-whats-new-section {
  text-align: center;
  padding: 0.75rem 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
}

.compact-whats-new {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
}

.compact-whats-new a {
  font-weight: 600;
  color: var(--accent-primary);
  margin-left: 0.25rem;
}

/* ==========================================================================
   General Page Headers
   ========================================================================== */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page-header.text-center {
  text-align: center;
  align-items: center;
}

.page-title {
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 580px;
}

.text-center {
  text-align: center;
}

/* Status / Alert Messages */
.status-box {
  padding: 1rem 1.25rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-align: center;
}

.error-box {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* ==========================================================================
   Changelog Page Styles
   ========================================================================== */
.releases-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.release-card {
  padding: 1.5rem;
}

.release-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.release-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.release-version {
  font-size: 1.35rem;
  font-weight: 700;
}

.release-anchor {
  color: var(--text-primary);
  text-decoration: none;
}

.release-anchor:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.latest-badge {
  background-color: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
}

.release-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.release-notes-body {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.changelog-subheading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0.5rem;
}

/* ==========================================================================
   Support Page Styles
   ========================================================================== */
.support-card {
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.support-card-title {
  font-size: 1.35rem;
}

.support-card-text {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 540px;
}

.kofi-button-wrapper {
  margin-top: 0.5rem;
}

.kofi-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background-color: #a220d9;
  color: #ffffff;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(162, 32, 217, 0.4);
  transition: all 0.15s ease-in-out;
}

.kofi-button:hover {
  background-color: #8c19bd;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(162, 32, 217, 0.5);
}

.kofi-button:active {
  transform: translateY(0);
}

.kofi-button:focus-visible {
  outline: 2px solid #a220d9;
  outline-offset: 3px;
}

.kofi-icon {
  flex-shrink: 0;
}

.support-ways-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.support-way-card {
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.support-way-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.support-way-icon {
  font-size: 1.15rem;
}

.support-way-card p {
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .support-ways-grid {
    grid-template-columns: 1fr;
  }
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  padding: 0.45rem 0.9rem;
  color: var(--text-primary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.share-btn:hover {
  background-color: var(--bg-code);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  text-decoration: none;
}

.share-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.share-btn svg {
  flex-shrink: 0;
}

.share-status {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
  min-height: 1.25rem;
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   Feedback Page Form Styles
   ========================================================================== */
.feedback-card {
  padding: 1.75rem;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.required-indicator {
  color: #ef4444;
}

.optional-indicator {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.char-count {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-code);
  color: var(--text-primary);
  border: 1px solid var(--border-code);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-focus-ring);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

select.form-control {
  cursor: pointer;
}

.turnstile-wrapper {
  margin-top: 0.25rem;
  min-height: 65px;
}

.form-actions {
  margin-top: 0.5rem;
}

.submit-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  background-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px 0 var(--accent-focus-ring);
}

.submit-btn:hover:not(:disabled) {
  background-color: var(--accent-hover);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.form-status {
  padding: 0.85rem 1.15rem;
  border-radius: 8px;
  font-size: 0.925rem;
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.form-status.success {
  background-color: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.form-status.error {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.form-status.warning {
  background-color: var(--bg-alert);
  border: 1px solid var(--border-alert);
  color: var(--text-alert);
}

.form-status.info {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
}

/* ==========================================================================
   Share Widget (Floating Pill & Popover / Post-Download Prompt)
   ========================================================================== */
.share-fab {
  position: fixed;
  right: 1.25rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: 9999px;
  border: none;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #3b147d 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(91, 43, 181, 0.45);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 200ms ease, transform 200ms ease, box-shadow 150ms ease;
}

.share-fab.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.share-fab[data-prompt-open="true"] {
  opacity: 0;
  pointer-events: none;
}

.share-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(91, 43, 181, 0.6);
}

.share-fab:active {
  transform: translateY(0);
}

.share-fab:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

.share-fab-icon {
  display: inline-block;
  transform-origin: bottom center;
  animation: fab-wiggle 8s ease-in-out infinite;
}

@keyframes fab-wiggle {
  0%, 82%, 100% {
    transform: rotate(0deg);
  }
  84% {
    transform: rotate(-12deg);
  }
  88% {
    transform: rotate(12deg);
  }
  92% {
    transform: rotate(-12deg);
  }
  96% {
    transform: rotate(6deg);
  }
}

.share-popover,
.share-prompt {
  position: fixed;
  right: 1.25rem;
  bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  width: min(340px, calc(100vw - 2rem));
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.share-prompt {
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
}

.share-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.share-widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.share-widget-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.share-widget-close:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

.share-widget-close:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.share-widget-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.share-btn-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 0.3rem;
  background-color: var(--bg-code);
  border: 1px solid var(--border-code);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  min-height: 58px;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.share-btn-tile:hover {
  background-color: var(--bg-card);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

.share-btn-tile:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.share-tile-label {
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  color: var(--text-secondary);
}

.share-btn-tile:hover .share-tile-label {
  color: var(--text-primary);
}

.share-popover .share-status,
.share-prompt .share-status {
  font-size: 0.78rem;
  min-height: 1.1rem;
  text-align: center;
  justify-content: center;
  margin-top: 0.25rem;
}

@media (max-width: 480px) {
  .share-fab-text {
    display: none;
  }

  .share-fab::after {
    content: "Share";
  }

  .share-fab {
    padding: 0.6rem 0.95rem;
  }
}

@media (max-width: 380px) {
  .share-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-fab {
    transition: none !important;
  }
  .share-fab.visible {
    transform: none !important;
  }
  .share-fab-icon {
    animation: none !important;
  }
  .share-btn-tile:hover {
    transform: none !important;
  }
}

/* ==========================================================================
   Light Mode Theme Adaptation (prefers-color-scheme: light)
   ========================================================================== */
@media (prefers-color-scheme: light) {
  :root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-code: #f1f5f9;
    --bg-badge: rgba(91, 43, 181, 0.1);
    --bg-alert: #fefce8;

    --border-subtle: #e2e8f0;
    --border-card: #e2e8f0;
    --border-code: #cbd5e1;
    --border-alert: #fef08a;
    --border-badge: rgba(147, 51, 234, 0.25);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-badge: #6b21a8;
    --text-alert: #854d0e;

    --accent-primary: #6d28d9;
    --accent-hover: #5b21b6;
    --accent-active: #4c1d95;
    --accent-focus-ring: rgba(109, 40, 217, 0.25);

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }

  .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
  }

  .kofi-button {
    background-color: #a220d9;
    color: #ffffff;
  }

  .secondary-btn.copy-btn {
    background-color: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
  }

  .secondary-btn.copy-btn:hover {
    background-color: #cbd5e1;
  }

  .latest-badge {
    background-color: rgba(34, 197, 94, 0.12);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.3);
  }

  .form-status.success {
    background-color: #dcfce7;
    border-color: #86efac;
    color: #166534;
  }

  .form-status.error {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
  }
}
