:root {
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --text-main: #111827;
    --text-sub: #6b7280;

    /* Pink accent requested */
    --accent: #ff4fad;
    --accent-soft: #ffe5f2;

    --success: #16a34a;
    --success-soft: #ecfdf3;
    --error: #dc2626;
    --error-soft: #fef2f2;
    --radius-lg: 16px;
    --radius-full: 16px;
    --shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.08);
}
  
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  html,
  body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text-main);
    overflow: hidden;
  }
  
  body {
    display: flex;
    flex-direction: column;
  }
  
  .bg-image {
    position: fixed;
    inset: 0;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    filter: blur(18px);
    transform: scale(1.05);
    opacity: 0;
    z-index: 0;
    transition:
      filter 0.1s ease-out,
      transform 0.2s ease-out;
  }
  
  .bg-image.bg-ready {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
  
  .page,
  .site-footer,
  .photo-info {
    position: relative;
    z-index: 1;
  }

  .page {
    flex: 1;
    width: 100%;
    padding: clamp(1rem, 3vw, 1.6rem);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .card {
    width: 100%;
    max-width: 520px;
    background: var(--card-bg);
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 1.6rem 1.8rem 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
  }
  
  .card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
  }
  
  .title-block h1 {
    margin: 0 0 0.3rem;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
  }
  
  .title-block p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-sub);
  }
  
  .badge {
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    background: #f9fafb;
    border: 1px solid var(--border);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-sub);
  }
  
  .upload-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
  }
  
  .dropzone {
    position: relative;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-strong);
    background: #f9fafb;
    padding: 1.2rem 1.1rem;
    cursor: pointer;
    overflow: hidden;
    display: block;
  }
  
  .dropzone:hover {
    border-color: #9ca3af;
    background: #f3f4f6;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }
  
  .dropzone.drag-over {
    border-style: solid;
    border-color: var(--accent);
    background: #eef2ff;
  }
  
  .dropzone input[type="file"] {
    display: none;
  }
  
  .dropzone-inner {
    display: flex;
    align-items: center;
    gap: 0.9rem;
  }
  
  .drop-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--accent);
    position: relative;
  }
  
  .drop-icon::before {
    content: "⬆";
    font-size: 1rem;
  }
  
  .drop-text-main {
    font-size: 0.95rem;
  }
  
  .drop-text-sub {
    font-size: 0.8rem;
    color: var(--text-sub);
  }
  
  .primary-button {
    width: 100%;
    border-radius: var(--radius-full);
    border: 1px solid var(--accent);
    padding: 0.65rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 500;
    background: var(--accent);
    color: #f9fafb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
  }
  
  .primary-button:disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
  }
  
  .primary-button:not(:disabled):hover {
    background: var(--accent-soft);
    color: #ff4fad;
    border-color: #ff4fad;
  }
  
  .btn-spinner {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.14s ease-out, transform 0.14s ease-out;
    display: inline-block;
    box-sizing: border-box;
  }
  
  /* make it visible when button is in loading state */
  .primary-button.loading .btn-spinner {
    opacity: 1;
    transform: scale(1);
  }
  
  /* only spin while loading */
  .btn-spinner.spinning {
    animation: spin 0.6s linear infinite;
  }
  
  .status-area {
    min-height: 52px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #f9fafb;
    padding: 0.6rem 0.8rem;
    font-size: 0.82rem;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    transition: background 0.14s ease-out, border-color 0.14s ease-out, color 0.14s ease-out;
  }
  
  .status-area.info {
    background: #f9fafb;
    border-color: var(--border);
    color: var(--text-sub);
  }
  
  .status-area.success {
    background: var(--success-soft);
    border-color: var(--success);
    color: var(--success);
  }
  
  .status-area.error {
    background: var(--error-soft);
    border-color: var(--error);
    color: var(--error);
  }
  
  .status-placeholder {
    width: 100%;
  }
  
  .status-line {
    height: 9px;
    border-radius: var(--radius-full);
    background: #e5e7eb;
    margin-bottom: 0.3rem;
  }
  
  .status-line.short {
    width: 40%;
  }
  
  .skeleton {
    position: relative;
    overflow: hidden;
  }
  
  .skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(209, 213, 219, 0.9), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.2s infinite;
  }
  
  .result {
    padding: 0.7rem 0.1rem 0 0.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  
  .result.hidden {
    display: none;
  }
  
  .result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
  }
  
  .result-pill {
    padding: 0.18rem 0.7rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    background: #e5f0ff;
    color: #1d4ed8;
  }
  
  .result-size {
    font-size: 0.82rem;
    color: var(--text-sub);
    text-align: right;
  }
  
  .download-link {
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--accent);
  }
  
  .download-link::after {
    content: "↘";
    font-size: 0.9rem;
  }
  
  .download-link:hover {
    text-decoration: underline;
  }
  
  .corner-loader {
    position: fixed;
    bottom: 4rem;
    right: 1.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-full);
    background: #333;
    border: 1px solid rgba(31, 41, 55, 0.4);
    font-size: 0.8rem;
    color: #e5e7eb;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.16s ease-out, transform 0.16s ease-out;
  }
  
  .corner-loader.active {
    opacity: 1;
    transform: translateY(0);
  }
  
  .spinner-ring {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(249, 250, 251, 0.3);
    border-top-color: #ffffff;
    animation: spin 0.7s linear infinite;
  }
  
  .status-area.hidden {
    display: none;
  }
  
  .site-footer {
    width: 100%;
    padding: 1rem clamp(1rem, 4vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    background: rgba(255, 255, 255, 0.9); /* footer fill */
    backdrop-filter: blur(8px);

    border-top: 1px solid #d1d5db;
    color: var(--text-sub);
    font-size: 0.82rem;
    flex-shrink: 0;
  }
  
  .footer-center {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
  }
  
  .site-footer .divider {
    margin: 0 0.2rem;
    opacity: 0.6;
  }
  
  .visitor-count {
    color: var(--text-sub);
    font-weight: 500;
  }
  
  .site-footer a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
    }

    .site-footer a:hover {
        opacity: 0.75;
    }

    .github-icon {
        display: flex;
        align-items: center;
        color: var(--accent); /* Pink now */
        transition: opacity 0.2s ease;
    }

    .github-icon:hover {
        opacity: 0.75;
    }
  
  .promo-note {
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-sub);
    line-height: 1.35;
  }

  .photo-info {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .photo-info-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    color: var(--text-sub);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    user-select: none;
  }

  .photo-tooltip {
    position: absolute;
    top: 32px;
    right: 0;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    color: var(--text-sub);
    font-size: 0.78rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
  }

  .photo-info:hover .photo-tooltip {
    opacity: 1;
    transform: translateY(0);
  }

  .download-removed-note {
    margin-top: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    color: var(--accent);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    }

    .download-removed-note::before {
        content: "✖";
        font-size: 0.95rem;
        color: var(--accent);
    }
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  
  @keyframes shimmer {
    100% {
      transform: translateX(100%);
    }
  }
  
  @media (max-width: 640px) {
    .page {
      padding: 0.9rem;
    }
  
    .card {
      padding: 1.3rem 1.2rem 1.4rem;
      border-radius: 16px;
    }
  
    .card-header {
      flex-direction: column;
      align-items: flex-start;
    }
  
    .title-block h1 {
      font-size: 1.18rem;
    }
  
    .site-footer {
      padding: 0.7rem 0.9rem;
      font-size: 0.78rem;
    }
  }