﻿body:has([data-ai-gallery]) .main,
    body:has([data-ai-gallery]) .header-inner,
    body:has([data-ai-gallery]) .footer-inner,
    body:has([data-ai-gallery]) .footer-grid,
    body:has([data-ai-gallery]) .footer-bottom {
      width: min(100% - 32px, 1880px);
    }

    body:has([data-ai-gallery]) .main {
      padding-top: 22px;
    }

    .ai-gallery-titlebar {
      width: 100%;
      margin: 0 auto 18px;
      padding-top: 18px;
    }

    .ai-gallery-titlebar h1 {
      margin: 0;
      color: #111827;
      font-size: clamp(32px, 4vw, 52px);
      font-weight: 900;
      line-height: 1.08;
    }

    .ai-gallery-titlebar p {
      margin: 14px 0 0;
      color: #334155;
      font-size: 17px;
      font-weight: 700;
    }

    .ai-gallery-shell {
      display: grid;
      gap: 24px;
      width: 100%;
      margin-inline: auto;
    }

    .ai-gallery-notice {
      display: grid;
      grid-template-columns: 28px minmax(0, 1fr);
      gap: 14px;
      padding: 18px 20px;
      border: 1px solid;
      border-radius: 8px;
    }

    .ai-gallery-notice-blue {
      border-color: #bfdbfe;
      background: #eff6ff;
      color: #1e40af;
    }

    .ai-gallery-notice-green {
      border-color: #bbf7d0;
      background: #f0fdf4;
      color: #166534;
    }

    .ai-gallery-notice-icon {
      display: grid;
      width: 24px;
      height: 24px;
      place-items: center;
      border-radius: 999px;
      background: rgba(96, 165, 250, 0.18);
      font-size: 14px;
      font-weight: 900;
      line-height: 1;
    }

    .ai-gallery-notice h2 {
      margin: 0 0 8px;
      font-size: 16px;
      font-weight: 900;
      line-height: 1.35;
    }

    .ai-gallery-notice ul {
      display: grid;
      gap: 4px;
      margin: 0;
      padding: 0;
      list-style: none;
      font-size: 15px;
      font-weight: 750;
      line-height: 1.6;
    }

    .ai-gallery-notice a {
      color: inherit;
      font-weight: 900;
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    .ai-gallery-linkline {
      margin: 0;
      color: inherit;
      font-size: 15px;
      font-weight: 800;
      line-height: 1.7;
    }

    .ai-gallery-linkline span {
      margin: 0 4px;
      color: #64748b;
    }

    .cp-subcategory-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 8px 10px;
    }

    .cp-subcategory-pills a {
      display: inline-flex;
      align-items: center;
      padding: 6px 12px;
      border: 1px solid #cbd5e1;
      border-radius: 999px;
      background: #fff;
      color: #0f172a;
      font-size: 14px;
      font-weight: 800;
      text-decoration: none;
    }

    .cp-subcategory-pills a.is-active {
      border-color: #2563eb;
      background: #eff6ff;
      color: #1d4ed8;
    }

    .ai-model-stats-panel,
    .ai-gallery-toolbar {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 20px 22px;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    }

    .ai-model-stats-title {
      flex: 0 0 auto;
      color: #475569;
      font-size: 15px;
      font-weight: 900;
      line-height: 1.35;
    }

    .ai-model-pills {
      display: flex;
      flex: 1 1 auto;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      justify-content: center;
      min-width: 0;
    }

    .ai-model-pill,
    .ai-model-reset,
    .ai-model-refresh {
      display: inline-flex;
      min-height: 44px;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 8px 14px;
      border: 0;
      border-radius: 6px;
      cursor: pointer;
      color: #1f2937;
      font-size: 15px;
      font-weight: 900;
      line-height: 1.15;
      text-align: center;
      white-space: normal;
    }

    .ai-model-pill strong {
      color: inherit;
      font-weight: 950;
    }

    .ai-model-pill.is-active {
      outline: 2px solid #2563eb;
      outline-offset: 2px;
    }

    .ai-model-pill.model-gpt,
    .ai-model-pill.model-google {
      background: #e0e7ff;
      color: #3730a3;
    }

    .ai-model-pill.model-seedream {
      background: #dbeafe;
      color: #2563eb;
    }

    .ai-model-pill.model-nano {
      background: #dcfce7;
      color: #15803d;
    }

    .ai-model-pill.model-wan {
      background: #ffedd5;
      color: #c2410c;
    }

    .ai-model-pill.model-midjourney {
      background: #f3e8ff;
      color: #7e22ce;
    }

    .ai-model-reset {
      background: #f1f5f9;
      color: #64748b;
    }

    .ai-model-refresh {
      background: #dcfce7;
      color: #16a34a;
    }

    .ai-gallery-toolbar {
      position: sticky;
      top: 76px;
      z-index: 20;
      min-height: 68px;
      background: rgba(255, 255, 255, 0.96);
      backdrop-filter: blur(16px);
    }

    .ai-gallery-search {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      flex: 1 1 320px;
      align-items: center;
      gap: 9px;
      min-width: 240px;
    }

    .ai-search-icon {
      color: #64748b;
      font-size: 24px;
      font-weight: 900;
      line-height: 1;
    }

    .ai-gallery-toolbar input,
    .ai-gallery-toolbar select {
      width: 100%;
      min-height: 42px;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #fff;
      color: #0f172a;
      padding: 8px 14px;
      font-size: 15px;
      font-weight: 800;
    }

    .ai-gallery-toolbar select {
      flex: 0 0 122px;
    }

    .ai-gallery-toolbar .ai-gallery-columns-select {
      flex-basis: 76px;
    }

    .ai-gallery-count {
      flex: 0 0 auto;
      color: #64748b;
      font-size: 16px;
      font-weight: 850;
      white-space: nowrap;
    }

    .ai-view-switch {
      display: inline-flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 8px;
    }

    .ai-view-switch button {
      display: inline-flex;
      width: 44px;
      height: 42px;
      align-items: center;
      justify-content: center;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #fff;
      color: #0f172a;
      cursor: pointer;
      font-size: 22px;
      font-weight: 900;
      line-height: 1;
    }

    .ai-view-switch svg,
    .ai-dialog-tools svg,
    .ai-image-row-actions svg,
    .ai-dialog-nav svg {
      width: 18px;
      height: 18px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .ai-view-switch svg {
      fill: currentColor;
      stroke: none;
    }

    .ai-view-switch button span {
      margin-left: 2px;
      font-size: 13px;
    }

    .ai-view-switch button.is-active {
      border-color: #2563eb;
      background: #2563eb;
      color: #fff;
      box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
    }

    .ai-gallery-status {
      min-height: 22px;
      margin: -6px 0 0;
      color: #64748b;
      font-size: 14px;
      font-weight: 800;
    }

    .ai-gallery-status:empty {
      display: none;
    }

    .ai-gallery-masonry,
    .ai-gallery-grid {
      display: flex;
      gap: 20px;
      align-items: start;
    }

    .ai-gallery-column {
      display: grid;
      flex: 1 1 0;
      gap: 20px;
      min-width: 0;
      align-content: start;
    }

    .ai-gallery-list {
      display: grid;
      gap: 12px;
    }

    .ai-image-card {
      position: relative;
      min-width: 0;
      overflow: hidden;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    }

    .ai-image-card.clean {
      border-color: transparent;
      background: transparent;
      box-shadow: none;
    }

    .ai-image-thumb {
      position: relative;
      display: block;
      width: 100%;
      overflow: hidden;
      padding: 0;
      border: 0;
      border-radius: 8px;
      background: #e2e8f0;
      cursor: zoom-in;
    }

    .ai-image-thumb img {
      display: block;
      width: 100%;
      height: auto;
      transition: transform 180ms ease;
    }

    .ai-image-card:hover .ai-image-thumb img {
      transform: scale(1.025);
    }

    .ai-card-model-badge {
      position: absolute;
      left: 12px;
      bottom: 10px;
      max-width: calc(100% - 24px);
      padding: 5px 10px;
      border-radius: 6px;
      background: rgba(15, 23, 42, 0.78);
      color: #fff;
      font-size: 14px;
      font-weight: 800;
      line-height: 1.2;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
    }

    .ai-card-hover {
      position: absolute;
      top: 10px;
      right: 10px;
      z-index: 3;
      display: flex;
      gap: 8px;
      opacity: 0;
      transform: translateY(-4px);
      transition: opacity 160ms ease, transform 160ms ease;
      pointer-events: none;
    }

    .ai-image-card:hover .ai-card-hover,
    .ai-image-card:focus-within .ai-card-hover {
      opacity: 1;
      transform: translateY(0);
      pointer-events: auto;
    }

    .ai-card-hover button,
    .ai-image-row button,
    .ai-dialog-header button,
    .ai-dialog-variants button,
    .ai-dialog-prompt button {
      display: inline-flex;
      min-height: 36px;
      align-items: center;
      justify-content: center;
      padding: 7px 12px;
      border: 1px solid #dbe3ef;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.95);
      color: #0f172a;
      cursor: pointer;
      font-weight: 900;
      line-height: 1.1;
      text-decoration: none;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    }

    .ai-image-info {
      display: grid;
      gap: 5px;
      padding: 10px 12px 12px;
    }

    .ai-image-info strong,
    .ai-image-row strong {
      display: -webkit-box;
      overflow: hidden;
      color: #0f172a;
      font-size: 15px;
      font-weight: 850;
      line-height: 1.35;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
    }

    .ai-image-info p,
    .ai-image-row p {
      margin: 0;
      color: #64748b;
      font-size: 13px;
      font-weight: 800;
      line-height: 1.45;
    }

    .ai-image-info small,
    .ai-image-row small {
      display: -webkit-box;
      overflow: hidden;
      color: #334155;
      font-size: 13px;
      line-height: 1.5;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
    }

    .ai-image-row {
      display: grid;
      grid-template-columns: 72px 96px minmax(0, 1fr) 150px 96px 84px 130px 84px;
      gap: 16px;
      align-items: center;
      padding: 10px;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }

    .ai-image-row img {
      display: block;
      width: 100%;
      height: 64px;
      border-radius: 7px;
      object-fit: cover;
    }

    .ai-image-row-header {
      position: sticky;
      top: 144px;
      z-index: 5;
      background: #f8fafc;
      color: #475569;
      font-size: 12px;
      font-weight: 900;
      box-shadow: none;
    }

    .ai-image-row-actions {
      display: inline-flex;
      gap: 6px;
      justify-content: flex-end;
    }

    .ai-image-row-actions button {
      width: 34px;
      min-height: 34px;
      padding: 0;
    }

    .ai-gallery-actions {
      display: flex;
      justify-content: center;
      min-height: 40px;
    }

    .ai-gallery-sentinel {
      min-height: 1px;
    }

    .ai-gallery-empty {
      padding: 28px;
      border: 1px dashed #cbd5e1;
      border-radius: 8px;
      background: #f8fafc;
      color: #64748b;
      text-align: center;
    }

    .ai-gallery-dialog {
      width: min(100% - 28px, 1280px);
      max-height: min(94vh, 980px);
      padding: 0;
      overflow: auto;
      border: 0;
      border-radius: 8px;
      background: #fff;
      color: #0f172a;
      box-shadow: 0 28px 90px rgba(15, 23, 42, 0.38);
    }

    .ai-gallery-dialog:not([open]) {
      display: none;
    }

    .ai-gallery-dialog::backdrop {
      background: rgba(15, 23, 42, 0.72);
    }

    .ai-dialog-body {
      display: grid;
      gap: 24px;
      padding: 26px;
    }

    .ai-dialog-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }

    .ai-dialog-heading {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }

    .ai-dialog-model {
      color: #6b7280;
      font-size: 13px;
      font-weight: 600;
    }

    .ai-dialog-header strong {
      color: #111827;
      font-size: 22px;
      font-weight: 900;
      line-height: 1.25;
    }

    .ai-dialog-header strong span {
      color: #6b7280;
      font-size: 18px;
    }

    .ai-dialog-tools {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 12px;
      justify-content: flex-end;
    }

    .ai-dialog-header button {
      width: 38px;
      height: 38px;
      min-height: 38px;
      padding: 0;
      border: 0;
      box-shadow: none;
      background: transparent;
      color: #111827;
      font-size: 26px;
    }

    .ai-view-switch button:hover,
    .ai-dialog-header button:hover,
    .ai-image-row-actions button:hover,
    .ai-card-hover button:hover,
    .ai-dialog-variants button:hover,
    .ai-dialog-prompt button:hover {
      border-color: #93c5fd;
      color: #1d4ed8;
      background: #eff6ff;
    }

    .ai-gallery-toolbar input:focus-visible,
    .ai-gallery-toolbar select:focus-visible,
    .ai-view-switch button:focus-visible,
    .ai-model-pill:focus-visible,
    .ai-model-reset:focus-visible,
    .ai-model-refresh:focus-visible,
    .ai-image-thumb:focus-visible,
    .ai-card-hover button:focus-visible,
    .ai-image-row-actions button:focus-visible,
    .ai-dialog-header button:focus-visible,
    .ai-dialog-nav:focus-visible,
    .ai-dialog-variants button:focus-visible,
    .ai-dialog-prompt button:focus-visible {
      outline: 2px solid #2563eb;
      outline-offset: 2px;
    }

    .ai-dialog-header button.is-active {
      color: #2563eb;
    }

    .ai-dialog-stage {
      position: relative;
      display: grid;
      place-items: center;
      overflow: hidden;
      border-radius: 8px;
      background: #f8fafc;
    }

    .ai-dialog-stage img {
      display: block;
      width: 100%;
      max-height: 70vh;
      object-fit: contain;
    }

    .ai-dialog-nav {
      position: absolute;
      top: 50%;
      z-index: 4;
      width: 44px;
      height: 56px;
      border: 0;
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.56);
      color: #fff;
      cursor: pointer;
      font-size: 30px;
      font-weight: 900;
      transform: translateY(-50%);
    }

    .ai-dialog-nav.prev {
      left: 12px;
    }

    .ai-dialog-nav.next {
      right: 12px;
    }

    .ai-dialog-variants {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
      justify-content: center;
      color: #64748b;
      font-size: 16px;
      font-weight: 850;
    }

    .ai-dialog-variants .ai-variant-group {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 4px;
      align-items: center;
    }

    .ai-dialog-variants .ai-variant-format {
      flex: 0 0 auto;
      color: #94a3b8;
      font-size: 12px;
      font-weight: 900;
      line-height: 1;
    }

    .ai-dialog-variants button {
      min-height: 30px;
      padding: 4px 9px;
      border-color: #bfdbfe;
      background: #dbeafe;
      color: #2563eb;
      box-shadow: none;
      font-size: 15px;
    }

    .ai-dialog-variants .avif button {
      border-color: #bbf7d0;
      background: #dcfce7;
      color: #16a34a;
    }

    .ai-dialog-details {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 16px 34px;
    }

    .ai-dialog-details div {
      min-width: 0;
    }

    .ai-dialog-details dt {
      color: #6b7280;
      font-size: 15px;
      font-weight: 850;
      line-height: 1.3;
    }

    .ai-dialog-details dd {
      margin: 3px 0 0;
      color: #111827;
      font-size: 19px;
      font-weight: 800;
      line-height: 1.25;
      overflow-wrap: anywhere;
    }

    .ai-dialog-source dt {
      color: #b45309;
    }

    .ai-dialog-source-link {
      display: inline-flex;
      max-width: 100%;
      align-items: center;
      padding: 5px 10px;
      overflow: hidden;
      border: 1px solid #f59e0b;
      border-radius: 7px;
      background: #fffbeb;
      color: #92400e;
      font-size: 15px;
      font-weight: 900;
      line-height: 1.15;
      text-decoration: none;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .ai-dialog-source-link:hover {
      background: #fef3c7;
      color: #78350f;
    }

    .ai-dialog-prompt {
      display: grid;
      gap: 8px;
    }

    .ai-dialog-prompt header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      color: #111827;
      font-size: 16px;
      font-weight: 900;
    }

    .ai-dialog-prompt pre {
      margin: 0;
      padding: 12px 14px;
      overflow: auto;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #f8fafc;
      color: #0f172a;
      font: inherit;
      font-size: 16px;
      line-height: 1.55;
      white-space: pre-wrap;
    }

    html.theme-dark .ai-gallery-titlebar h1,
    html.theme-dark .ai-dialog-header strong,
    html.theme-dark .ai-dialog-details dd,
    html.theme-dark .ai-dialog-prompt header,
    html.theme-dark .ai-image-info strong,
    html.theme-dark .ai-image-row strong {
      color: #f8fafc;
    }

    html.theme-dark .ai-gallery-titlebar p,
    html.theme-dark .ai-gallery-status,
    html.theme-dark .ai-gallery-count,
    html.theme-dark .ai-model-stats-title,
    html.theme-dark .ai-dialog-details dt,
    html.theme-dark .ai-image-info p,
    html.theme-dark .ai-image-row p,
    html.theme-dark .ai-image-info small,
    html.theme-dark .ai-image-row small,
    html.theme-dark .ai-dialog-header button {
      color: #cbd5e1;
    }

    html.theme-dark .ai-gallery-notice-blue {
      border-color: #1d4ed8;
      background: rgba(30, 64, 175, 0.24);
      color: #dbeafe;
    }

    html.theme-dark .ai-gallery-notice-green {
      border-color: #15803d;
      background: rgba(20, 83, 45, 0.26);
      color: #dcfce7;
    }

    html.theme-dark .ai-gallery-linkline span {
      color: #94a3b8;
    }

    html.theme-dark .ai-model-stats-panel,
    html.theme-dark .ai-gallery-toolbar,
    html.theme-dark .ai-image-card,
    html.theme-dark .ai-image-row,
    html.theme-dark .ai-image-row-header,
    html.theme-dark .ai-gallery-dialog,
    html.theme-dark .ai-dialog-prompt pre {
      border-color: #1e293b;
      background: #0f172a;
      color: #e5e7eb;
    }

    html.theme-dark .ai-gallery-toolbar input,
    html.theme-dark .ai-gallery-toolbar select,
    html.theme-dark .ai-card-hover button,
    html.theme-dark .ai-image-row button,
    html.theme-dark .ai-dialog-prompt button {
      border-color: #334155;
      background: #020617;
      color: #dbeafe;
    }

    html.theme-dark .ai-model-reset {
      background: #1e293b;
      color: #cbd5e1;
    }

    html.theme-dark .ai-model-refresh {
      background: rgba(22, 101, 52, 0.32);
      color: #bbf7d0;
    }

    html.theme-dark .ai-dialog-stage,
    html.theme-dark .ai-gallery-empty {
      background: #020617;
    }

    html.theme-dark .ai-dialog-source dt {
      color: #fcd34d;
    }

    html.theme-dark .ai-dialog-source-link {
      border-color: #92400e;
      background: rgba(120, 53, 15, 0.34);
      color: #fde68a;
    }

    @media (max-width: 1240px) {
      .ai-model-stats-panel,
      .ai-gallery-toolbar {
        flex-wrap: wrap;
      }

      .ai-image-row {
        grid-template-columns: 60px 86px minmax(0, 1fr) 132px 84px 72px 110px 76px;
        gap: 12px;
      }
    }

    @media (max-width: 900px) {
      .ai-dialog-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .ai-gallery-toolbar {
        position: static;
      }

      .ai-image-row-header {
        top: 0;
      }
    }

    @media (max-width: 640px) {
      body:has([data-ai-gallery]) .main,
      body:has([data-ai-gallery]) .header-inner,
      body:has([data-ai-gallery]) .footer-inner,
      body:has([data-ai-gallery]) .footer-grid,
      body:has([data-ai-gallery]) .footer-bottom {
        width: 100%;
        max-width: none;
        margin-inline: 0;
      }

      body:has([data-ai-gallery]) .main {
        padding-top: 8px;
      }

      .ai-gallery-titlebar,
      .ai-gallery-shell {
        width: 100%;
      }

      .ai-gallery-titlebar {
        margin-bottom: 8px;
        padding-top: 4px;
      }

      .ai-gallery-titlebar h1 {
        font-size: 24px;
        line-height: 1.12;
      }

      .ai-gallery-titlebar p {
        display: -webkit-box;
        margin-top: 5px;
        overflow: hidden;
        font-size: 12px;
        line-height: 1.35;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
      }

      .ai-gallery-shell {
        gap: 10px;
      }

      .ai-gallery-notice,
      .ai-image-row {
        grid-template-columns: 1fr;
      }

      .ai-gallery-dialog[open] {
        display: flex;
        flex-direction: column;
        width: min(100% - 18px, 520px);
        max-width: calc(100% - 18px);
        height: auto;
        max-height: min(88dvh, 760px);
        margin: auto;
        overflow: hidden;
        border-radius: 10px;
      }

      .ai-gallery-dialog::backdrop {
        background: rgba(15, 23, 42, 0.82);
      }

      .ai-gallery-notice {
        grid-template-columns: 18px minmax(0, 1fr);
        gap: 7px;
        padding: 8px 10px;
      }

      .ai-gallery-notice-green {
        display: none;
      }

      .ai-gallery-notice-icon {
        width: 18px;
        height: 18px;
        font-size: 11px;
      }

      .ai-gallery-notice h2 {
        margin-bottom: 3px;
        font-size: 12px;
        line-height: 1.25;
      }

      .ai-gallery-notice ul {
        gap: 2px;
        font-size: 11px;
        line-height: 1.35;
      }

      .ai-gallery-notice-blue li:nth-child(n + 2) {
        display: none;
      }

      .ai-model-stats-panel {
        flex-wrap: nowrap;
        gap: 6px;
        padding: 7px 8px;
        overflow-x: auto;
        box-shadow: 0 4px 10px rgba(15, 23, 42, 0.07);
        scrollbar-width: none;
      }

      .ai-model-stats-panel::-webkit-scrollbar {
        display: none;
      }

      .ai-model-stats-title {
        display: none;
      }

      .ai-model-pills {
        flex: 1 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
      }

      .ai-model-pill,
      .ai-model-reset,
      .ai-model-refresh {
        flex: 0 0 auto;
        min-height: 30px;
        padding: 5px 8px;
        font-size: 11px;
        white-space: nowrap;
      }

      .ai-gallery-toolbar {
        position: sticky;
        top: 54px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 72px auto;
        gap: 4px;
        min-height: 0;
        padding: 5px 6px;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
      }

      .ai-gallery-search {
        grid-column: 1 / -1;
        min-width: 0;
        gap: 4px;
      }

      .ai-search-icon {
        font-size: 15px;
      }

      .ai-gallery-toolbar input,
      .ai-gallery-toolbar select {
        min-height: 28px;
        padding: 4px 6px;
        border-radius: 6px;
        font-size: 11px;
      }

      .ai-gallery-toolbar select,
      .ai-gallery-toolbar .ai-gallery-columns-select {
        flex: 1 1 auto;
        min-width: 0;
      }

      .ai-gallery-toolbar .ai-gallery-columns-select {
        flex-basis: 52px;
        max-width: 56px;
        padding-inline: 4px;
      }

      .ai-gallery-count {
        display: inline-flex;
        min-height: 28px;
        align-items: center;
        justify-content: flex-end;
        font-size: 10px;
        white-space: nowrap;
      }

      .ai-view-switch {
        display: none;
      }

      .ai-gallery-status {
        min-height: 0;
        margin: -2px 0 0;
        font-size: 11px;
        line-height: 1.25;
      }

      .ai-gallery-masonry,
      .ai-gallery-grid {
        gap: 10px;
      }

      .ai-gallery-column {
        gap: 10px;
      }

      .ai-image-row-header {
        display: none;
      }

      .ai-card-hover {
        top: 6px;
        right: 6px;
        left: auto;
        gap: 4px;
        justify-content: flex-end;
      }

      .ai-card-hover button {
        min-height: 28px;
        padding: 5px 7px;
        border-radius: 7px;
        font-size: 11px;
      }

      .ai-card-model-badge {
        left: 8px;
        bottom: 8px;
        max-width: calc(100% - 16px);
        padding: 3px 7px;
        font-size: 11px;
      }

      .ai-image-info {
        gap: 3px;
        padding: 7px 8px 8px;
      }

      .ai-image-info strong,
      .ai-image-row strong {
        font-size: 13px;
        line-height: 1.25;
        -webkit-line-clamp: 1;
      }

      .ai-image-info p,
      .ai-image-row p,
      .ai-image-info small,
      .ai-image-row small {
        font-size: 11px;
        line-height: 1.3;
      }

      .ai-image-info small,
      .ai-image-row small {
        -webkit-line-clamp: 2;
      }

      .ai-image-row {
        gap: 7px;
        padding: 8px;
      }

      .ai-image-row img {
        height: auto;
        max-height: 52vh;
      }

      .ai-gallery-actions {
        min-height: 34px;
      }

      .ai-gallery-actions .button {
        min-height: 34px;
        padding: 7px 12px;
        font-size: 12px;
      }

      .ai-dialog-body {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        gap: 5px;
        min-height: 0;
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
      }

      .ai-dialog-header {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        gap: 4px;
      }

      .ai-dialog-header strong {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        font-size: 12px;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .ai-dialog-header strong span {
        font-size: 10px;
        font-weight: 800;
      }

      .ai-dialog-tools {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        gap: 2px;
      }

      .ai-dialog-header button {
        width: 26px;
        height: 26px;
        min-height: 26px;
        font-size: 17px;
      }

      .ai-dialog-tools svg {
        width: 14px;
        height: 14px;
      }

      .ai-dialog-stage {
        flex: 0 0 auto;
        border-radius: 5px;
      }

      .ai-dialog-stage img {
        max-height: min(32dvh, 200px);
      }

      .ai-dialog-nav {
        width: 28px;
        height: 36px;
        font-size: 20px;
      }

      .ai-dialog-nav.prev {
        left: 4px;
      }

      .ai-dialog-nav.next {
        right: 4px;
      }

      .ai-dialog-variants {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        gap: 5px;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1px;
        color: #64748b;
        font-size: 9px;
        font-weight: 800;
        scrollbar-width: none;
      }

      .ai-dialog-variants::-webkit-scrollbar {
        display: none;
      }

      .ai-dialog-variants .ai-variant-group {
        flex-wrap: nowrap;
        gap: 2px;
      }

      .ai-dialog-variants .ai-variant-format {
        width: 10px;
        font-size: 8px;
        text-align: center;
      }

      .ai-dialog-variants button {
        min-height: 22px;
        padding: 2px 5px;
        border-radius: 4px;
        font-size: 9px;
        font-weight: 900;
        line-height: 1.1;
      }

      .ai-dialog-variants .original button {
        padding-inline: 6px;
      }

      .ai-dialog-details {
        flex: 0 0 auto;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px 6px;
      }

      /* ?뚯씪紐낅쭔 ??以??꾩껜 ??湲??대쫫???꾨씫 ?놁씠 ?쒖떆 */
      .ai-dialog-details > div:first-child {
        grid-column: 1 / -1;
      }

      .ai-dialog-details dt {
        font-size: 9px;
        font-weight: 800;
        line-height: 1.15;
      }

      .ai-dialog-details dd {
        margin-top: 0;
        font-size: 10px;
        font-weight: 850;
        line-height: 1.25;
        overflow-wrap: anywhere;
        word-break: break-word;
      }

      .ai-dialog-source-link {
        padding: 3px 6px;
        border-radius: 5px;
        font-size: 10px;
      }

      .ai-dialog-prompt {
        flex: 0 0 auto;
        gap: 3px;
      }

      .ai-dialog-prompt header {
        font-size: 11px;
      }

      .ai-dialog-prompt button {
        min-height: 24px;
        padding: 3px 7px;
        font-size: 10px;
      }

      .ai-dialog-prompt pre {
        max-height: min(18dvh, 88px);
        padding: 6px 7px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
        font-size: 10px;
        line-height: 1.3;
      }
    }

    .cp-ssr-figures {
      display: grid;
      gap: 16px;
      padding: 18px 20px;
      border: 1px solid #dbeafe;
      border-radius: 16px;
      background: #f8fbff;
    }

    .cp-ssr-figures-title {
      margin: 0;
      color: #0f172a;
      font-size: 20px;
      font-weight: 800;
    }

    .cp-ssr-figures-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 12px;
    }

    .cp-ssr-figure {
      margin: 0;
      display: grid;
      gap: 8px;
    }

    .cp-ssr-figure img {
      width: 100%;
      height: auto;
      aspect-ratio: 1;
      object-fit: contain;
      border-radius: 12px;
      background: #fff;
      border: 1px solid #e2e8f0;
    }

    .cp-ssr-figure figcaption {
      color: #475569;
      font-size: 12px;
      font-weight: 600;
      line-height: 1.35;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    @media (max-width: 640px) {
      .cp-ssr-figures-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }
