/* ══════════════════════════════════════════════════════════
   WRENKIT — AI TOOLS SHARED STYLES
   Shared CSS for ai-shots.html and ai-create.html.
   Uses design tokens from global.css.
   ══════════════════════════════════════════════════════════ */

body { display: flex; flex-direction: column; }


/* ── PAGE CONTAINER ─────────────────────────────────────── */

.ai-wrap {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  width: 100%;
}

.ai-header {
  margin-bottom: 40px;
}

.ai-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 6px;
}

.ai-sub {
  font-size: 0.82rem;
  color: var(--drift);
  font-weight: 300;
}


/* ── BETA BANNER ────────────────────────────────────────── */

.ai-beta-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f0eaf4;
  border: 1px solid #d8cfe0;
  border-radius: 4px;
  font-size: 0.72rem;
  color: #5a3a6e;
  margin-bottom: 32px;
}

.ai-beta-banner strong {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.6rem;
}


/* ── STEP PROGRESS ──────────────────────────────────────── */

.ai-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}

.ai-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ai-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--stone);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--stone);
  font-weight: 400;
  transition: all 0.2s;
}

.ai-step.active .ai-step-circle {
  border-color: var(--tide);
  color: var(--cream);
  background: var(--tide);
}

.ai-step.completed .ai-step-circle {
  border-color: var(--tide);
  color: var(--cream);
  background: var(--tide);
}

.ai-step-label {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
}

.ai-step.active .ai-step-label,
.ai-step.completed .ai-step-label {
  color: var(--tide);
}

.ai-step-line {
  width: 60px;
  height: 1px;
  background: var(--stone);
  margin: 0 12px;
  margin-bottom: 20px;
  transition: background 0.2s;
}

.ai-step-line.completed {
  background: var(--tide);
}


/* ── DROP ZONE ──────────────────────────────────────────── */

.ai-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  border: 1.5px dashed var(--stone);
  border-radius: 6px;
  background: var(--sand);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.ai-dropzone:hover,
.ai-dropzone.dragging {
  border-color: var(--tide);
  background: var(--tide-l);
}

.ai-dropzone-icon {
  font-size: 2rem;
  opacity: 0.6;
}

.ai-dropzone-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ink);
}

.ai-dropzone-sub {
  font-size: 0.7rem;
  color: var(--drift);
  font-weight: 300;
}

.ai-dropzone input[type="file"] {
  display: none;
}


/* ── IMAGE PREVIEW ──────────────────────────────────────── */

.ai-preview {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.ai-preview img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}

.ai-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(44,41,37,0.7);
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.ai-preview-remove:hover {
  background: rgba(44,41,37,0.9);
}


/* ── CONTROLS BAR ───────────────────────────────────────── */

.ai-controls {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ai-control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-control-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--drift);
  min-width: 80px;
  font-weight: 400;
}


/* ── PILL TOGGLE (aspect, mode, count) ──────────────────── */

.ai-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-pill {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 40px;
  background: transparent;
  color: var(--drift);
  font-family: 'Jost', sans-serif;
  font-size: 0.68rem;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.04em;
}

.ai-pill:hover {
  border-color: var(--tide);
  color: var(--ink);
}

.ai-pill.active {
  background: var(--tide);
  border-color: var(--tide);
  color: var(--cream);
}


/* ── RANGE SLIDER ───────────────────────────────────────── */

.ai-range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.ai-range {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 3px;
  background: var(--stone);
  border-radius: 2px;
  outline: none;
}

.ai-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tide);
  cursor: pointer;
  border: 2px solid var(--cream);
  box-shadow: 0 1px 4px var(--shadow);
}

.ai-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tide);
  cursor: pointer;
  border: 2px solid var(--cream);
  box-shadow: 0 1px 4px var(--shadow);
}

.ai-range-val {
  font-size: 0.68rem;
  color: var(--drift);
  min-width: 28px;
  text-align: center;
}


/* ── PRIMARY BUTTON ─────────────────────────────────────── */

.ai-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 4px;
  background: var(--tide);
  color: var(--cream);
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.ai-btn:hover {
  opacity: 0.9;
}

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

.ai-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

.ai-btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--drift);
}

.ai-btn-secondary:hover {
  border-color: var(--tide);
  color: var(--ink);
  opacity: 1;
}


/* ── ACTION BAR ─────────────────────────────────────────── */

.ai-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}


/* ── LOADING STATE ──────────────────────────────────────── */

.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 24px;
  text-align: center;
}

.ai-spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--border);
  border-top-color: var(--tide);
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
}

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

.ai-loading-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ink);
}

.ai-loading-sub {
  font-size: 0.7rem;
  color: var(--stone);
  font-weight: 300;
}

.ai-progress-bar {
  width: 240px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.ai-progress-fill {
  height: 100%;
  background: var(--tide);
  border-radius: 2px;
  width: 0%;
  transition: width 0.4s ease;
}


/* ── RESULT GRID ────────────────────────────────────────── */

.ai-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.ai-grid-2x2 {
  grid-template-columns: repeat(2, 1fr);
}

.ai-grid-2x1 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 600px;
}

.ai-grid-card {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--sand);
}

.ai-grid-card:hover {
  border-color: var(--tide);
  box-shadow: 0 2px 12px var(--shadow);
}

.ai-grid-card.selected {
  border-color: var(--tide);
  box-shadow: 0 0 0 2px var(--tide);
}

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

.ai-grid-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--stone);
  background: var(--sand);
}


/* ── SELECT CHECK OVERLAY ───────────────────────────────── */

.ai-grid-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--stone);
  background: rgba(250,247,242,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: transparent;
  transition: all 0.15s;
}

.ai-grid-card.selected .ai-grid-check {
  background: var(--tide);
  border-color: var(--tide);
  color: #fff;
}


/* ── DOWNLOAD OVERLAY ───────────────────────────────────── */

.ai-grid-download {
  position: absolute;
  inset: 0;
  background: rgba(44,41,37,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.ai-grid-card:hover .ai-grid-download {
  opacity: 1;
}

.ai-grid-download-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Jost', sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  cursor: pointer;
  letter-spacing: 0.04em;
}


/* ── SELECTION INFO ─────────────────────────────────────── */

.ai-selection-info {
  text-align: center;
  font-size: 0.72rem;
  color: var(--drift);
  margin-top: 16px;
  font-weight: 300;
}


/* ── BACK BUTTON ────────────────────────────────────────── */

.ai-back {
  background: none;
  border: none;
  color: var(--drift);
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  transition: color 0.15s;
}

.ai-back:hover {
  color: var(--ink);
}


/* ── PROMPT AREA (AI Creator) ───────────────────────────── */

.ai-field-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--drift);
  font-weight: 400;
  margin-bottom: 8px;
}

.ai-textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--sand);
  color: var(--ink);
  font-family: 'Jost', sans-serif;
  font-size: 0.82rem;
  font-weight: 300;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  line-height: 1.6;
}

.ai-textarea:focus {
  border-color: var(--tide);
}

.ai-textarea::placeholder {
  color: var(--stone);
}


/* ── REFERENCE IMAGE (small drop zone) ──────────────────── */

.ai-ref-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1.5px dashed var(--stone);
  border-radius: 6px;
  background: var(--sand);
  cursor: pointer;
  transition: border-color 0.2s;
}

.ai-ref-zone:hover {
  border-color: var(--tide);
}

.ai-ref-zone input[type="file"] {
  display: none;
}

.ai-ref-icon {
  font-size: 1.4rem;
  opacity: 0.5;
}

.ai-ref-title {
  font-size: 0.78rem;
  color: var(--ink);
  font-weight: 400;
}

.ai-ref-desc {
  font-size: 0.65rem;
  color: var(--drift);
  font-weight: 300;
}

.ai-ref-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--sand);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.ai-ref-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.ai-ref-name {
  flex: 1;
  font-size: 0.72rem;
  color: var(--drift);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-ref-remove {
  background: none;
  border: none;
  color: var(--stone);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}

.ai-ref-remove:hover {
  color: var(--ink);
}


/* ── STYLE TAGS ─────────────────────────────────────────── */

.ai-style-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


/* ── SECTION SPACING ────────────────────────────────────── */

.ai-section {
  margin-bottom: 28px;
}


/* ── FADE IN ANIMATION ──────────────────────────────────── */

.ai-fade-in {
  animation: aiFadeIn 0.3s ease;
}

@keyframes aiFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── HIDDEN ─────────────────────────────────────────────── */

.ai-hidden {
  display: none !important;
}


/* ── RESPONSIVE ─────────────────────────────────────────── */

@media (max-width: 768px) {
  .ai-wrap { padding: 32px 16px 60px; }
  .ai-heading { font-size: 1.6rem; }
  .ai-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ai-grid-2x2 { grid-template-columns: repeat(2, 1fr); }
  .ai-steps { gap: 0; }
  .ai-step-line { width: 32px; margin: 0 6px; }
  .ai-control-row { flex-direction: column; align-items: flex-start; }
  .ai-actions { flex-direction: column; }
  .ai-actions .ai-btn { width: 100%; text-align: center; }
}

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

/* ── AUTO-SAVED NOTICE ─────────────────────────────────── */

.ai-auto-saved {
  text-align: center; font-size: 0.78rem; color: var(--tide);
  margin: 12px 0 0;
}
.ai-auto-saved a { color: var(--tide); text-decoration: underline; }

/* ── MULTI-REFERENCE IMAGE LIST ──────────────────────────── */

.ai-ref-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 8px;
}
.ai-ref-list .ai-ref-preview {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--r); background: var(--sand);
}
.ai-ref-list .ai-ref-thumb {
  width: 36px; height: 36px; object-fit: cover; border-radius: 4px;
}
.ai-ref-list .ai-ref-name {
  font-size: 0.72rem; color: var(--ink);
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-ref-list .ai-ref-remove {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--drift); padding: 0 2px;
  line-height: 1;
}
.ai-ref-list .ai-ref-remove:hover { color: var(--ink); }

.ai-ref-add-more {
  display: inline-block; padding: 6px 14px;
  border: 1px dashed var(--border); border-radius: var(--r);
  background: transparent; cursor: pointer;
  font-family: 'Jost', sans-serif; font-size: 0.72rem;
  color: var(--drift); transition: all 0.15s;
}
.ai-ref-add-more:hover {
  border-color: var(--tide); color: var(--tide);
}

/* ══════════════════════════════════════════════════════════
   HISTORY SIDEBAR
   ══════════════════════════════════════════════════════════ */

/* ── LAYOUT WRAPPER ────────────────────────────────────── */

.ai-layout {
  display: flex; max-width: 1200px; margin: 0 auto; width: 100%;
  padding: 0 24px;
}

.ai-layout .ai-wrap {
  flex: 1; max-width: 900px; margin: 0; padding-right: 24px;
}

/* ── HISTORY PANEL ─────────────────────────────────────── */

.ai-history {
  width: 280px; flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding: 48px 0 48px 20px;
  position: sticky; top: 60px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.ai-history-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

.ai-history-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem; font-weight: 400; color: var(--ink);
}

.ai-history-toggle {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; color: var(--drift); padding: 4px 8px;
  transition: transform 0.2s;
}
.ai-history.collapsed .ai-history-toggle { transform: rotate(180deg); }
.ai-history.collapsed .ai-history-list { display: none; }

/* ── HISTORY CARD ──────────────────────────────────────── */

.ai-history-card {
  padding: 12px; border: 1px solid var(--border);
  border-radius: var(--r); margin-bottom: 8px;
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--sand);
}
.ai-history-card:hover {
  border-color: var(--tide);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ai-history-card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}

.ai-history-prompt {
  font-size: 0.68rem; color: var(--ink); line-height: 1.35;
  margin-bottom: 4px; font-style: italic;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.ai-history-summary {
  font-size: 0.72rem; color: var(--drift); line-height: 1.4;
}

.ai-history-time {
  font-size: 0.62rem; color: var(--drift); margin-top: 4px;
}

.ai-history-actions {
  display: flex; gap: 6px; margin-top: 8px;
}

.ai-history-action-btn {
  padding: 4px 10px; background: transparent;
  border: 1px solid var(--border); border-radius: var(--r);
  font-family: 'Jost', sans-serif; font-size: 0.56rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--drift); cursor: pointer; transition: all 0.15s;
}
.ai-history-action-btn:hover {
  border-color: var(--tide); color: var(--tide);
}

/* ── STATUS BADGES ─────────────────────────────────────── */

.ai-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.56rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 40px; font-weight: 400;
}

.ai-status-generating {
  background: rgba(59, 130, 246, 0.12); color: #3b82f6;
}
.ai-status-generating::before {
  content: ''; display: inline-block;
  width: 8px; height: 8px; border: 1.5px solid #3b82f6;
  border-top-color: transparent; border-radius: 50%;
  animation: ai-spin 0.6s linear infinite;
}

.ai-status-completed {
  background: rgba(34, 197, 94, 0.12); color: #16a34a;
}

.ai-status-failed {
  background: rgba(239, 68, 68, 0.12); color: #dc2626;
}

.ai-status-pending {
  background: rgba(158, 158, 158, 0.12); color: #6e6a62;
}

/* ── HISTORY EMPTY STATE ───────────────────────────────── */

.ai-history-empty {
  text-align: center; padding: 32px 8px;
  font-size: 0.72rem; color: var(--drift);
}

/* ══════════════════════════════════════════════════════════
   DETAIL OVERLAY
   ══════════════════════════════════════════════════════════ */

.ai-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
}
.ai-overlay.open { display: flex; justify-content: center; align-items: flex-start; }

.ai-overlay-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.ai-overlay-panel {
  position: relative; z-index: 1;
  background: var(--sand, #faf7f2); border-radius: 12px;
  max-width: 820px; width: 92%; max-height: 90vh;
  margin-top: 5vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.ai-overlay-close {
  position: sticky; top: 0; float: right;
  background: var(--sand, #faf7f2); border: none;
  font-size: 1.5rem; cursor: pointer; color: var(--drift);
  padding: 12px 16px; z-index: 2; line-height: 1;
}
.ai-overlay-close:hover { color: var(--ink); }

.ai-overlay-body { padding: 24px 32px 32px; clear: both; }

.ai-overlay-loading { text-align: center; padding: 60px 0; }
.ai-overlay-error {
  text-align: center; padding: 40px 20px;
  color: #dc2626; font-size: 0.85rem;
}

/* ── Overlay header ──────────────────────────────────────── */

.ai-overlay-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.ai-overlay-date {
  font-size: 0.72rem; color: var(--drift);
}

/* ── Overlay images ──────────────────────────────────────── */

.ai-overlay-images {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.ai-overlay-images.single { grid-template-columns: 1fr; max-width: 560px; }

.ai-overlay-img-wrap {
  position: relative; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
}
.ai-overlay-img-wrap img {
  width: 100%; display: block; object-fit: cover;
}
.ai-overlay-dl {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.6); color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 1.1rem; font-weight: bold;
  opacity: 0; transition: opacity 0.15s;
}
.ai-overlay-img-wrap:hover .ai-overlay-dl { opacity: 1; }

/* ── Overlay info section ────────────────────────────────── */

.ai-overlay-info {
  border-top: 1px solid var(--border); padding-top: 20px;
}

.ai-overlay-section { margin-bottom: 16px; }

.ai-overlay-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--drift);
  margin-bottom: 6px;
}

.ai-overlay-value {
  font-size: 0.82rem; color: var(--ink); line-height: 1.5;
}

.ai-overlay-refs {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.ai-overlay-ref-thumb {
  width: 60px; height: 60px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
}

.ai-overlay-settings {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.ai-overlay-tag {
  padding: 4px 12px; border: 1px solid var(--border);
  border-radius: var(--r); font-size: 0.72rem; color: var(--ink);
  background: rgba(0,0,0,0.02);
}

/* ── Overlay responsive ──────────────────────────────────── */

@media (max-width: 600px) {
  .ai-overlay-panel { width: 100%; margin-top: 0; border-radius: 0; max-height: 100vh; }
  .ai-overlay-body { padding: 16px 20px 24px; }
  .ai-overlay-images { grid-template-columns: 1fr; }
}

/* ── RESPONSIVE ────────────────────────────────────────── */

@media (max-width: 768px) {
  .ai-layout { flex-direction: column; padding: 0 16px; }
  .ai-layout .ai-wrap { max-width: 100%; padding-right: 0; }
  .ai-history {
    width: 100%; border-left: none;
    border-top: 1px solid var(--border);
    position: static; max-height: none;
    padding: 24px 0 24px 0;
  }
}
