    :root {
      --bg: #06060C;
      --bg-grad: radial-gradient(ellipse at 50% -20%, #1a1a2e 0%, #06060C 65%);
      --surface: rgba(18, 18, 30, 0.6);
      --surface-solid: #0e0e1a;
      --border: rgba(255, 255, 255, 0.07);
      --border-hi: rgba(255, 255, 255, 0.14);
      --gold: #e8b430;
      --gold-glow: rgba(232, 180, 48, 0.35);
      --gold-dim: #b88a1e;
      --cyan: #00e5ff;
      --cyan-glow: rgba(0, 229, 255, 0.25);
      --green: #34d399;
      --red: #fb7185;
      --text: #f0f0f2;
      --text-mid: #a1a1aa;
      --text-dim: #52525b;
      --radius: 14px;
    }

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

    body {
      background: var(--bg);
      color: var(--text);
      font-family: 'Barlow Condensed', sans-serif;
      min-height: 100vh;
      overflow-x: hidden;
    }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background: var(--bg-grad);
      z-index: -2;
    }

    body::after {
      content: '';
      position: fixed;
      inset: 0;
      background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
      background-size: 60px 60px;
      z-index: -1;
      pointer-events: none;
    }

    ::selection {
      background: var(--gold-glow);
      color: #fff;
    }

    ::-webkit-scrollbar {
      width: 6px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 3px;
    }

    /* ── VIEWS ── */
    .view {
      display: none;
    }

    .view.active {
      display: flex;
    }

    /* ── LOGIN VIEW ── */
    #view-login {
      min-height: 100vh;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 48px;
      padding: 24px;
    }

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

    .login-brand h1 {
      font-family: 'Bebas Neue', sans-serif;
      font-size: clamp(3.5rem, 8vw, 6rem);
      letter-spacing: 8px;
      line-height: 1;
    }

    .login-brand h1 span {
      color: var(--gold);
    }

    .login-brand p {
      font-size: 1rem;
      letter-spacing: 4px;
      text-transform: uppercase;
      color: var(--text-mid);
      margin-top: 8px;
    }

    .login-card {
      background: var(--surface);
      backdrop-filter: blur(24px);
      border: 1px solid var(--border);
      border-top-color: var(--border-hi);
      border-radius: var(--radius);
      padding: 48px 40px;
      width: 100%;
      max-width: 440px;
      text-align: center;
      box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    }

    .login-card p {
      font-size: 0.95rem;
      color: var(--text-mid);
      line-height: 1.6;
      margin-bottom: 32px;
    }

    .login-card p strong {
      color: var(--text);
      font-weight: 600;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      border: none;
      border-radius: 8px;
      padding: 0 32px;
      height: 56px;
      font-family: 'Barlow Condensed', sans-serif;
      font-size: 1rem;
      font-weight: 700;
      letter-spacing: 2px;
      text-transform: uppercase;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .btn:hover {
      transform: translateY(-1px);
    }

    .btn:active {
      transform: translateY(0);
    }

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

    .btn-gold {
      background: var(--gold);
      color: #000;
    }

    .btn-gold:hover {
      background: var(--gold-dim);
      box-shadow: 0 8px 24px var(--gold-glow);
    }

    .btn-cyan {
      background: var(--cyan);
      color: #000;
    }

    .btn-cyan:hover {
      box-shadow: 0 8px 24px var(--cyan-glow);
    }

    .btn-outline {
      background: transparent;
      border: 1px solid var(--border-hi);
      color: var(--text-mid);
    }

    .btn-outline:hover {
      border-color: var(--text);
      color: var(--text);
      background: rgba(255, 255, 255, 0.03);
    }

    .btn-red {
      background: rgba(251, 113, 133, 0.15);
      border: 1px solid rgba(251, 113, 133, 0.3);
      color: var(--red);
    }

    .btn-red:hover {
      background: rgba(251, 113, 133, 0.25);
    }

    .btn-full {
      width: 100%;
    }

    .btn-large {
      height: 56px;
      padding: 0 36px;
      font-size: 1.05rem;
    }

    .google-icon {
      width: 20px;
      height: 20px;
      background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%2334A853' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%23FBBC05' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E") no-repeat center;
      background-size: contain;
    }

    .login-footer {
      font-size: 0.8rem;
      color: var(--text-dim);
      margin-top: 24px;
      line-height: 1.5;
    }

    /* ── SETUP VIEW (API Keys) ── */
    #view-setup {
      min-height: 100vh;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      padding: 24px;
    }

    .setup-card {
      background: var(--surface);
      backdrop-filter: blur(24px);
      border: 1px solid var(--border);
      border-top-color: var(--border-hi);
      border-radius: var(--radius);
      padding: 48px 40px;
      width: 100%;
      max-width: 560px;
      box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    }

    .setup-card h2 {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 2.2rem;
      letter-spacing: 4px;
      margin-bottom: 8px;
    }

    .setup-card .subtitle {
      font-size: 0.9rem;
      color: var(--text-mid);
      margin-bottom: 36px;
      line-height: 1.5;
    }

    .field-group {
      margin-bottom: 24px;
    }

    .field-label {
      display: block;
      font-size: 0.8rem;
      font-weight: 600;
      letter-spacing: 2px;
      text-transform: uppercase;
      color: var(--text-mid);
      margin-bottom: 8px;
    }

    .field-input {
      width: 100%;
      background: rgba(0, 0, 0, 0.4);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 14px 16px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.85rem;
      color: var(--text);
      outline: none;
      transition: border-color 0.2s;
    }

    .field-input:focus {
      border-color: var(--cyan);
    }

    .field-input::placeholder {
      color: var(--text-dim);
    }

    .field-hint {
      font-size: 0.75rem;
      color: var(--text-dim);
      margin-top: 6px;
    }

    .setup-actions {
      display: flex;
      gap: 12px;
      margin-top: 36px;
    }

    .field-status {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.75rem;
      font-weight: 600;
      letter-spacing: 1px;
      text-transform: uppercase;
      margin-left: 12px;
      vertical-align: middle;
    }

    .field-status.testing {
      color: var(--cyan);
    }

    .field-status.valid {
      color: var(--green);
    }

    .field-status.invalid {
      color: var(--red);
    }

    .field-status.skipped {
      color: var(--text-dim);
    }

    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: currentColor;
    }

    .field-status.testing .status-dot {
      animation: pulse-status 0.8s ease infinite alternate;
    }

    @keyframes pulse-status {
      from {
        opacity: 0.3;
      }

      to {
        opacity: 1;
      }
    }

    .field-input.valid {
      border-color: var(--green);
    }

    .field-input.invalid {
      border-color: var(--red);
    }

    .field-error-detail {
      font-size: 0.75rem;
      color: var(--red);
      margin-top: 4px;
    }

    /* ── DASHBOARD VIEW ── */
    #view-dashboard {
      flex-direction: column;
      min-height: 100vh;
    }

    .topbar {
      width: 100%;
      height: 64px;
      display: flex;
      align-items: center;
      padding: 0 32px;
      background: rgba(6, 6, 12, 0.8);
      backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 100;
    }

    .topbar-logo {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 1.5rem;
      letter-spacing: 4px;
    }

    .topbar-logo span {
      color: var(--gold);
    }

    .topbar-sep {
      width: 1px;
      height: 20px;
      background: var(--border);
      margin: 0 16px;
    }

    .topbar-user {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .topbar-user img {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      border: 2px solid var(--border);
    }

    .topbar-user-name {
      font-size: 0.85rem;
      color: var(--text-mid);
    }

    .dashboard-content {
      flex: 1;
      max-width: 960px;
      width: 100%;
      margin: 0 auto;
      padding: 48px 24px;
    }

    .dash-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 40px;
    }

    .dash-header h2 {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 2.5rem;
      letter-spacing: 4px;
    }

    .project-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 20px;
    }

    .project-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 28px 24px;
      cursor: pointer;
      transition: all 0.25s ease;
      position: relative;
    }

    .project-card:hover {
      border-color: var(--border-hi);
      transform: translateY(-2px);
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    }

    .project-card-brand {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 1.6rem;
      letter-spacing: 3px;
      margin-bottom: 8px;
    }

    .project-card-stage {
      font-size: 0.8rem;
      letter-spacing: 2px;
      text-transform: uppercase;
      color: var(--cyan);
      margin-bottom: 12px;
    }

    .project-card-date {
      font-size: 0.8rem;
      color: var(--text-dim);
    }

    .project-card-delete {
      position: absolute;
      top: 12px;
      right: 12px;
      background: none;
      border: none;
      color: var(--text-dim);
      cursor: pointer;
      font-size: 1.1rem;
      padding: 4px 8px;
      border-radius: 4px;
      transition: all 0.2s;
    }

    .project-card-delete:hover {
      color: var(--red);
      background: rgba(251, 113, 133, 0.1);
    }

    .new-project-card {
      background: transparent;
      border: 2px dashed var(--border);
      border-radius: var(--radius);
      padding: 28px 24px;
      cursor: pointer;
      transition: all 0.25s ease;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      min-height: 150px;
    }

    .new-project-card:hover {
      border-color: var(--gold);
      background: rgba(232, 180, 48, 0.03);
    }

    .new-project-card .plus {
      font-size: 2.5rem;
      color: var(--text-dim);
      font-weight: 300;
      line-height: 1;
      transition: color 0.2s;
    }

    .new-project-card:hover .plus {
      color: var(--gold);
    }

    .new-project-card .label {
      font-size: 0.85rem;
      letter-spacing: 2px;
      text-transform: uppercase;
      color: var(--text-dim);
    }

    .empty-state {
      text-align: center;
      padding: 80px 24px;
      color: var(--text-dim);
    }

    .empty-state p {
      font-size: 1rem;
      margin-bottom: 24px;
    }

    /* ── PIPELINE VIEW ── */
    #view-pipeline {
      flex-direction: column;
      min-height: 100vh;
    }

    .pipeline-content {
      flex: 1;
      max-width: 1100px;
      width: 100%;
      margin: 0 auto;
      padding: 40px 24px 80px;
    }

    .topbar-brand-pill {
      background: rgba(232, 180, 48, 0.1);
      border: 1px solid var(--gold);
      border-radius: 6px;
      padding: 4px 14px;
      font-size: 0.85rem;
      letter-spacing: 2px;
      color: var(--gold);
      box-shadow: 0 0 12px var(--gold-glow);
    }

    .glass-card {
      background: var(--surface);
      backdrop-filter: blur(24px);
      border: 1px solid var(--border);
      border-top-color: var(--border-hi);
      border-radius: var(--radius);
      padding: 40px;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    }

    .pipeline-placeholder {
      text-align: center;
      padding: 80px 24px;
      color: var(--text-mid);
    }

    .pipeline-placeholder h3 {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 2rem;
      letter-spacing: 4px;
      margin-bottom: 12px;
    }

    /* ── PIPELINE STEPPER ── */
    .pipeline-stepper {
      max-width: 960px;
      margin: 32px auto 28px;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      position: relative;
      padding: 0 16px;
    }

    .stepper-track {
      position: absolute;
      top: 20px;
      left: 6%;
      right: 6%;
      height: 2px;
      background: rgba(255, 255, 255, 0.05);
      z-index: 0;
    }

    .stepper-fill {
      height: 100%;
      width: 0%;
      background: var(--cyan);
      box-shadow: 0 0 10px var(--cyan-glow);
      transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .stepper-node {
      position: relative;
      z-index: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      flex: 1;
    }

    .stepper-dot {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--bg);
      border: 2px solid var(--text-dim);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.15rem;
      line-height: 1;
      transition: all 0.3s ease;
    }

    .stepper-label {
      font-size: 0.65rem;
      letter-spacing: 1.5px;
      text-transform: uppercase;
      color: var(--text-dim);
      transition: all 0.3s ease;
      white-space: nowrap;
      text-align: center;
    }

    .stepper-node.completed .stepper-dot {
      border-color: var(--cyan);
      background: rgba(0, 229, 255, 0.1);
      box-shadow: 0 0 8px var(--cyan-glow);
    }

    .stepper-node.completed .stepper-label {
      color: var(--cyan);
    }

    .stepper-node.active .stepper-dot {
      border-color: var(--gold);
      background: rgba(232, 180, 48, 0.15);
      box-shadow: 0 0 16px var(--gold-glow);
      transform: scale(1.12);
    }

    .stepper-node.active .stepper-label {
      color: var(--gold);
      font-weight: 700;
    }

    .stepper-node {
      cursor: pointer;
    }

    .stepper-node:hover .stepper-dot {
      box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    }

    /* ── PIPELINE STAGES ── */
    .pipeline-stage {
      display: none;
      opacity: 0;
      transform: translateY(16px);
    }

    .pipeline-stage.active {
      display: block;
      animation: stageReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes stageReveal {
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .stage-header {
      display: flex;
      align-items: center;
      gap: 16px;
      margin-bottom: 20px;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--border);
    }

    .stage-title {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 2.2rem;
      letter-spacing: 4px;
    }

    .stage-tag {
      font-size: 0.8rem;
      letter-spacing: 2px;
      text-transform: uppercase;
      border: 1px solid var(--gold);
      color: var(--gold);
      padding: 3px 12px;
      border-radius: 4px;
      background: rgba(232, 180, 48, 0.08);
    }

    .stage-desc {
      font-size: 0.95rem;
      color: var(--text-mid);
      line-height: 1.6;
      margin-bottom: 8px;
    }

    .stage-actions {
      display: flex;
      align-items: center;
      gap: 16px;
      margin-top: 28px;
      padding-top: 28px;
      border-top: 1px solid var(--border);
    }

    .or-divider {
      display: flex;
      align-items: center;
      gap: 20px;
      margin: 28px 0 20px;
    }

    .or-divider::before,
    .or-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border);
    }

    .or-divider span {
      font-size: 0.75rem;
      letter-spacing: 3px;
      text-transform: uppercase;
      color: var(--text-dim);
    }

    .paste-area-wrap {
      display: none;
    }

    .paste-area-wrap.open {
      display: block;
      animation: stageReveal 0.3s ease forwards;
    }

    .code-area {
      width: 100%;
      background: rgba(0, 0, 0, 0.5);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 20px;
      font-family: 'Courier Prime', monospace;
      font-size: 0.9rem;
      line-height: 1.7;
      color: var(--text);
      resize: vertical;
      outline: none;
      transition: border-color 0.2s;
    }

    .code-area:focus {
      border-color: var(--cyan);
    }

    .word-count {
      text-align: right;
      font-size: 0.8rem;
      color: var(--text-dim);
      margin-top: 8px;
    }

    /* ── RESEARCH LOADING ── */
    .research-loading {
      display: none;
    }

    .research-loading.active {
      display: block;
      animation: stageReveal 0.4s ease forwards;
    }

    .spinner-large {
      width: 56px;
      height: 56px;
      border: 3px solid rgba(255, 255, 255, 0.05);
      border-top-color: var(--cyan);
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin: 0 auto 28px;
    }

    .loading-title {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 1.8rem;
      letter-spacing: 4px;
      margin-bottom: 8px;
    }

    .loading-sub {
      font-size: 0.9rem;
      color: var(--text-mid);
      font-weight: 300;
    }

    .agent-console {
      background: rgba(0, 0, 0, 0.5);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 16px;
      margin-top: 32px;
      max-height: 200px;
      overflow-y: auto;
      text-align: left;
    }

    .console-label {
      color: var(--cyan);
      font-size: 0.75rem;
      letter-spacing: 3px;
      text-transform: uppercase;
      margin-bottom: 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid rgba(0, 229, 255, 0.15);
    }

    .console-line {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.8rem;
      color: var(--text-mid);
      margin-bottom: 6px;
    }

    .console-line::before {
      content: '›';
      color: var(--cyan);
      margin-right: 8px;
    }

    /* ── PASS STEPS (3-pass loading) ── */
    .pass-steps {
      display: flex;
      gap: 12px;
      justify-content: center;
      margin-top: 28px;
      flex-wrap: wrap;
    }

    .pass-step {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 18px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 0.8rem;
      font-weight: 600;
      letter-spacing: 1px;
      color: var(--text-dim);
      background: var(--surface);
      transition: all 0.3s ease;
    }

    .pass-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--text-dim);
      transition: all 0.3s;
    }

    .pass-step.active {
      border-color: var(--cyan);
      color: var(--cyan);
      background: rgba(0, 229, 255, 0.05);
    }

    .pass-step.active .pass-dot {
      background: var(--cyan);
      box-shadow: 0 0 8px var(--cyan);
      animation: pulse-status 0.8s ease infinite alternate;
    }

    .pass-step.done {
      border-color: var(--green);
      color: var(--green);
    }

    .pass-step.done .pass-dot {
      background: var(--green);
    }

    /* ── SHOT CARDS ── */
    .shot-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 20px;
      margin-bottom: 16px;
      transition: border-color 0.2s;
    }

    .shot-card:hover {
      border-color: var(--border-hi);
    }

    .shot-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 14px;
    }

    .shot-number {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 1.1rem;
      letter-spacing: 2px;
      color: var(--gold);
      min-width: 60px;
    }

    .shot-desc {
      font-size: 0.85rem;
      color: var(--text-mid);
      flex: 1;
    }

    .shot-comp-select {
      background: rgba(0, 0, 0, 0.4);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 5px 10px;
      font-family: 'Barlow Condensed', sans-serif;
      font-size: 0.8rem;
      color: var(--text-mid);
      outline: none;
    }

    .shot-comp-select:focus {
      border-color: var(--cyan);
    }

    .shot-field-label {
      font-size: 0.7rem;
      font-weight: 600;
      letter-spacing: 1.5px;
      text-transform: uppercase;
      color: var(--text-dim);
      margin-bottom: 4px;
      margin-top: 10px;
    }

    .shot-input {
      width: 100%;
      background: rgba(0, 0, 0, 0.3);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 8px 12px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.8rem;
      color: var(--text);
      outline: none;
      transition: border-color 0.2s;
    }

    .shot-input:focus {
      border-color: var(--cyan);
    }

    .shot-prompt-area {
      width: 100%;
      background: rgba(0, 0, 0, 0.3);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 10px 12px;
      font-family: 'Courier Prime', monospace;
      font-size: 0.8rem;
      line-height: 1.5;
      color: var(--text);
      outline: none;
      resize: vertical;
      transition: border-color 0.2s;
    }

    .shot-prompt-area:focus {
      border-color: var(--cyan);
    }

    /* ── THUMBNAIL SECTION IN GALLERY ── */
    .thumbnail-section {
      margin-top: 40px;
      padding-top: 32px;
      border-top: 1px solid var(--border);
    }

    .thumbnail-section-header {
      display: flex;
      align-items: center;
      gap: 16px;
      margin-bottom: 16px;
    }

    .thumbnail-section-title {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 1.6rem;
      letter-spacing: 4px;
    }

    .thumbnail-section-sub {
      font-size: 0.85rem;
      color: var(--text-mid);
      margin-bottom: 20px;
      line-height: 1.5;
    }

    .thumbnail-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
    }

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

    .thumbnail-grid-item {
      position: relative;
      border-radius: 10px;
      overflow: hidden;
      border: 1px solid var(--border);
      cursor: pointer;
      transition: all 0.2s;
      aspect-ratio: 16/9;
      background: rgba(0, 0, 0, 0.4);
    }

    .thumbnail-grid-item:hover {
      border-color: var(--gold);
      transform: scale(1.02);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    }

    .thumbnail-grid-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .thumbnail-grid-item.placeholder {
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: default;
    }

    .thumbnail-grid-item.placeholder:hover {
      transform: none;
      border-color: var(--border);
      box-shadow: none;
    }

    .thumbnail-grid-label {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 6px 10px;
      background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
      font-size: 0.7rem;
      font-weight: 700;
      letter-spacing: 1px;
      color: var(--gold);
      text-transform: uppercase;
    }

    /* ── IMAGE GRID / GALLERY ── */
    .image-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 12px;
    }

    .image-grid-item {
      position: relative;
      border-radius: 10px;
      overflow: hidden;
      border: 1px solid var(--border);
      cursor: pointer;
      transition: all 0.2s;
      aspect-ratio: 16/9;
      background: rgba(0, 0, 0, 0.4);
    }

    .image-grid-item:hover {
      border-color: var(--cyan);
      transform: scale(1.02);
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    }

    .image-grid-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .image-grid-item.placeholder {
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: default;
    }

    .image-grid-item.placeholder:hover {
      transform: none;
      border-color: var(--border);
      box-shadow: none;
    }

    .image-grid-item .slot-spinner {
      width: 20px;
      height: 20px;
      border: 2px solid rgba(255, 255, 255, 0.08);
      border-top-color: var(--cyan);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    .image-grid-item .slot-number {
      position: absolute;
      top: 6px;
      left: 8px;
      font-size: 0.65rem;
      font-weight: 700;
      color: var(--text-dim);
      letter-spacing: 1px;
    }

    .image-grid-item.done {
      animation: imgPop 0.3s ease;
    }

    .regen-btn {
      position: absolute;
      top: 6px;
      right: 6px;
      background: rgba(0, 0, 0, 0.6);
      color: rgba(255, 255, 255, 0.8);
      width: 28px;
      height: 28px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      z-index: 10;
      cursor: pointer;
      backdrop-filter: blur(4px);
      transition: all 0.2s;
      opacity: 0;
      border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .image-grid-item:hover .regen-btn {
      opacity: 1;
    }

    .regen-btn:hover {
      background: rgba(0, 0, 0, 0.8);
      color: var(--cyan);
      transform: scale(1.1);
      border-color: var(--cyan);
    }

    @keyframes imgPop {
      0% {
        transform: scale(0.9);
        opacity: 0.5;
      }

      100% {
        transform: scale(1);
        opacity: 1;
      }
    }

    .image-grid-label {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      padding: 6px 10px;
      background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
      font-size: 0.7rem;
      font-weight: 600;
      letter-spacing: 1px;
      color: var(--text);
    }

    /* ── LIGHTBOX ── */
    .lightbox {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.92);
      z-index: 600;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }

    .lightbox.active {
      display: flex;
    }

    .lightbox img {
      max-width: 90vw;
      max-height: 90vh;
      border-radius: 8px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    }

    /* ── PROGRESS BAR ── */
    .progress-track {
      width: 100%;
      height: 6px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 3px;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      background: var(--cyan);
      width: 0%;
      transition: width 0.3s ease;
      box-shadow: 0 0 8px var(--cyan);
    }

    /* ── STATUS TOAST ── */
    .toast {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%) translateY(100px);
      background: var(--surface-solid);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 14px 24px;
      font-size: 0.9rem;
      color: var(--text);
      z-index: 9999;
      transition: transform 0.3s ease;
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    }

    .toast.visible {
      transform: translateX(-50%) translateY(0);
    }

    .toast.error {
      border-color: rgba(251, 113, 133, 0.4);
      color: var(--red);
    }

    .toast.success {
      border-color: rgba(52, 211, 153, 0.4);
      color: var(--green);
    }

    /* ── LOADING SPINNER ── */
    .spinner-inline {
      width: 18px;
      height: 18px;
      border: 2px solid rgba(255, 255, 255, 0.1);
      border-top-color: var(--cyan);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      display: inline-block;
    }

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

    /* ── MODAL ── */
    .modal-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.8);
      backdrop-filter: blur(8px);
      z-index: 500;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }

    .modal-backdrop.active {
      display: flex;
    }

    .modal-box {
      background: var(--surface-solid);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 36px;
      width: 100%;
      max-width: 460px;
      box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    }

    .modal-box h3 {
      font-family: 'Bebas Neue', sans-serif;
      font-size: 1.6rem;
      letter-spacing: 3px;
      margin-bottom: 16px;
    }

    .modal-box p {
      font-size: 0.9rem;
      color: var(--text-mid);
      margin-bottom: 24px;
      line-height: 1.5;
    }

    .modal-actions {
      display: flex;
      gap: 12px;
      justify-content: flex-end;
    }
