.ai-color-advisor {
  display: grid;
  grid-template-columns: minmax(250px, .82fr) minmax(340px, 1.18fr);
  gap: 22px 34px;
  margin: 0 0 16px;
  padding: 24px 28px;
  border: 1px solid #dbe6f2;
  border-radius: 10px;
  background: linear-gradient(115deg, #eef6ff 0%, #f7fbff 40%, #fff 68%);
}

.ai-color-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0865be;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .06em;
}

.ai-color-signal {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #037df3;
  box-shadow: 0 0 0 4px #d6eaff;
}

.ai-color-intro h2 {
  margin: 10px 0 8px;
  color: #203854;
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.35;
  letter-spacing: -.025em;
}

.ai-color-intro p {
  max-width: 470px;
  margin: 0;
  color: #53677e;
  font-size: 13px;
  line-height: 1.7;
}

.ai-free-trial-notice {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: -4px;
  padding: 7px 10px;
  border: 1px solid #b9dfca;
  border-radius: 6px;
  background: #edf8f3;
  color: #287a56;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.ai-free-trial-notice[data-state="empty"] {
  border-color: #f0c7bd;
  background: #fff8f6;
  color: #ad5c4d;
}

.ai-color-form {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.ai-demo-example {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #cfe0f2;
  border-radius: 7px;
  background: #f5faff;
}

.ai-demo-example-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ai-demo-example-label {
  color: #0870ca;
  font-size: 11px;
  font-weight: 750;
}

.ai-demo-example-copy strong { color: #294660; font-size: 13px; }
.ai-demo-example-copy p { margin: 0; color: #647b92; font-size: 11px; line-height: 1.45; }

.ai-demo-example img {
  width: 82px;
  height: 58px;
  border: 1px solid #c8d8ea;
  border-radius: 5px;
  object-fit: cover;
}

.ai-demo-example-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #1474c9;
  border-radius: 5px;
  background: #fff;
  color: #1267ad;
  font: inherit;
  font-size: 12px;
  font-weight: 740;
  white-space: nowrap;
  cursor: pointer;
}

.ai-demo-example-button:hover { background: #eaf4ff; }
.ai-demo-example-button:disabled { cursor: wait; opacity: .6; }

.ai-color-form label {
  display: block;
  color: #344b63;
  font-size: 12px;
  font-weight: 700;
}

.ai-color-form label span {
  margin-left: 4px;
  color: #8a98a8;
  font-weight: 500;
}

.ai-color-form textarea,
.ai-color-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid #cfdaea;
  border-radius: 6px;
  background: #fff;
  color: #25384d;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
}

.ai-color-form textarea {
  min-height: 76px;
  padding: 10px 12px;
  resize: vertical;
}

.ai-color-form input {
  height: 36px;
  padding: 0 10px;
}

.ai-color-form textarea:focus,
.ai-color-form input:focus {
  border-color: #037df3;
  box-shadow: 0 0 0 3px #dcecff;
}

.ai-reference-image-field {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed #c8d8e9;
  border-radius: 7px;
  background: rgba(255, 255, 255, .56);
}

.ai-reference-image-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-reference-image-heading label { margin: 0; }

.ai-image-upload-button,
.ai-image-preview-meta button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #b9cde2;
  border-radius: 5px;
  background: #fff;
  color: #1768ad;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ai-image-upload-button:hover,
.ai-image-preview-meta button:hover { border-color: #037df3; background: #f3f8ff; }

.ai-image-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ai-image-preview img {
  width: 62px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid #d4dfed;
  border-radius: 5px;
  object-fit: cover;
  background: #f1f5f9;
}

.ai-image-preview-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}

.ai-image-preview-meta strong,
.ai-image-preview-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-image-preview-meta strong { color: #2d435a; font-size: 12px; }
.ai-image-preview-meta span { color: #72849a; font-size: 11px; }
.ai-image-preview-meta button { grid-row: 1 / span 2; grid-column: 2; }

.ai-extracted-colors {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-extracted-colors-label {
  color: #75879b;
  font-size: 11px;
  font-weight: 650;
}

.ai-extracted-color {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 7px 0 5px;
  border: 1px solid #d3deeb;
  border-radius: 5px;
  background: #fff;
  color: #40546b;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.ai-extracted-color:hover,
.ai-extracted-color[aria-pressed="true"] { border-color: #037df3; box-shadow: 0 0 0 2px #dcecff; }
.ai-extracted-color-swatch { width: 15px; height: 15px; border: 1px solid rgba(0, 0, 0, .12); border-radius: 3px; }

.ai-image-analysis {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #d6e4f1;
  border-radius: 7px;
  background: #fafdff;
}

.ai-image-analysis-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ai-image-analysis-heading strong { color: #1f3853; font-size: 14px; }
.ai-image-analysis-heading span { color: #60738a; font-size: 12px; }
.ai-image-analysis-summary { margin: 0; color: #344d66; font-size: 14px; line-height: 1.6; }
.ai-image-analysis-keywords { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-image-analysis-keywords span { padding: 3px 7px; border-radius: 4px; background: #e8f2fb; color: #356181; font-size: 11px; }
.ai-image-palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ai-image-palette-item { min-width: 0; padding: 8px; border: 1px solid #dce7f1; border-radius: 5px; background: #fff; }
.ai-image-palette-swatch { width: 100%; height: 22px; margin-bottom: 6px; border-radius: 3px; }
.ai-image-palette-title { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.ai-image-palette-title strong { overflow: hidden; color: #30475e; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ai-image-palette-title code { color: #60748a; font-size: 11px; }
.ai-image-palette-item p { margin: 4px 0 0; color: #64788c; font-size: 11px; line-height: 1.45; }
.ai-image-palette-item.is-excluded { border-color: #e6cfc8; background: #fffaf8; }
.ai-image-palette-item.is-excluded p { color: #9b6653; }

.ai-color-extras {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ai-color-action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.ai-color-submit {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--colorflow-seed-color);
  border-radius: 6px;
  background: var(--colorflow-seed-color);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 740;
  cursor: pointer;
}

.ai-color-submit:hover { background: var(--colorflow-seed-color); filter: brightness(.92); }
.ai-color-submit:disabled { cursor: wait; opacity: .65; }

#aiColorStatus {
  color: #718094;
  font-size: 13px;
}

.ai-color-results,
.ai-color-applied { grid-column: 1 / -1; }

.ai-color-results {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.ai-color-analysis {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid #dce7f3;
  border-radius: 7px;
  background: rgba(255, 255, 255, .78);
}

.ai-color-analysis-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 11px;
}

.ai-color-analysis-heading strong { color: #1f3853; font-size: 14px; }
.ai-color-analysis-heading span { color: #60738a; font-size: 12px; }

.ai-color-analysis-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.ai-color-analysis-item span {
  display: block;
  color: #52667d;
  font-size: 12px;
  font-weight: 700;
}

.ai-color-analysis-item p {
  margin: 4px 0 0;
  color: #263d56;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
}

.ai-color-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ai-color-option {
  overflow: hidden;
  border: 1px solid #d9e1eb;
  border-radius: 8px;
  background: #fff;
}

.ai-color-option-art {
  display: grid;
  gap: 10px;
  min-height: 91px;
  padding: 12px;
  background: var(--ai-surface);
}

.ai-color-option-art-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ai-color-option-art-top i {
  width: 32px;
  height: 7px;
  border-radius: 10px;
  background: #c4cedc;
}

.ai-color-option-art-top i:first-child { background: var(--ai-primary); }

.ai-color-option-art-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.ai-color-option-art-main b {
  display: block;
  width: 65px;
  height: 25px;
  border-radius: 4px;
  background: var(--ai-primary);
}

.ai-color-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 34px;
}

.ai-color-chart i { width: 13px; border-radius: 2px 2px 0 0; }
.ai-color-chart i:nth-child(1) { height: 64%; }
.ai-color-chart i:nth-child(2) { height: 95%; }
.ai-color-chart i:nth-child(3) { height: 55%; }
.ai-color-chart i:nth-child(4) { height: 76%; }
.ai-color-chart i:nth-child(5) { height: 43%; }

.ai-color-option-content { padding: 12px; }
.ai-color-option-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ai-color-option-title strong { color: #24364a; font-size: 15px; }
.ai-color-option-title code { color: #62748b; font-size: 13px; }
.ai-color-option-content > p { min-height: 38px; margin: 6px 0 10px; color: #455a70; font-size: 13px; line-height: 1.6; }
.ai-color-option-details { display: grid; gap: 7px; min-height: 111px; margin-bottom: 11px; padding-top: 8px; border-top: 1px solid #edf1f5; }
.ai-color-option-detail { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 7px; align-items: start; }
.ai-color-option-detail span { display: block; color: #586c82; font-size: 12px; font-weight: 700; }
.ai-color-option-detail p { margin: 0; color: #3d5369; font-size: 12px; line-height: 1.55; }
.ai-color-option-detail:last-child p { color: #8b634d; }
.ai-color-option-content button {
  width: 100%;
  height: 32px;
  border: 1px solid var(--ai-primary);
  border-radius: 5px;
  background: #fff;
  color: var(--ai-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ai-color-option-content button:hover { background: var(--ai-surface); }

.ai-color-applied {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: #21577f;
  font-size: 12px;
}
.ai-color-applied button {
  padding: 5px 10px;
  border: 1px solid #b9cee3;
  border-radius: 5px;
  background: #fff;
  color: #0865be;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ai-color-advisor [hidden] { display: none !important; }

body[data-display-mode="dark"] .ai-color-advisor {
  border-color: #334860;
  background: linear-gradient(115deg, #1d344e, #1e2c3d 68%);
}
body[data-display-mode="dark"] .ai-color-intro h2,
body[data-display-mode="dark"] .ai-color-form label { color: #e7f1fc; }
body[data-display-mode="dark"] .ai-color-form label span { color: #91a8bd; }
body[data-display-mode="dark"] .ai-color-intro p,
body[data-display-mode="dark"] #aiColorStatus { color: #afc1d4; }
body[data-display-mode="dark"] .ai-free-trial-notice {
  border-color: #3a6b55;
  background: #1f3b31;
  color: #a8e0c1;
}
body[data-display-mode="dark"] .ai-free-trial-notice[data-state="empty"] {
  border-color: #76524c;
  background: #3a2928;
  color: #efb2a3;
}
body[data-display-mode="dark"] .ai-color-form textarea,
body[data-display-mode="dark"] .ai-color-form input {
  border-color: #49627b;
  background: #111b29;
  color: #e7f1fc;
}
body[data-display-mode="dark"] .ai-color-form textarea::placeholder,
body[data-display-mode="dark"] .ai-color-form input::placeholder { color: #8298ad; }
body[data-display-mode="dark"] .ai-color-form textarea:focus,
body[data-display-mode="dark"] .ai-color-form input:focus {
  border-color: #6ea8ff;
  background: #101a28;
  box-shadow: 0 0 0 3px rgba(110, 168, 255, .18);
}
body[data-display-mode="dark"] .ai-color-analysis { border-color: #3a5068; background: rgba(24, 42, 61, .78); }
body[data-display-mode="dark"] .ai-color-analysis-heading strong,
body[data-display-mode="dark"] .ai-color-analysis-heading span,
body[data-display-mode="dark"] .ai-color-analysis-item span,
body[data-display-mode="dark"] .ai-color-analysis-item p,
body[data-display-mode="dark"] .ai-color-option-detail span,
body[data-display-mode="dark"] .ai-color-option-detail p { color: #c5d5e6; }
body[data-display-mode="dark"] .ai-demo-example { border-color: #46617b; background: #1d344e; }
body[data-display-mode="dark"] .ai-demo-example-copy strong { color: #e2edf8; }
body[data-display-mode="dark"] .ai-demo-example-copy p { color: #b9cada; }
body[data-display-mode="dark"] .ai-demo-example-button { border-color: #527898; background: #243e5a; color: #d1e6fa; }
body[data-display-mode="dark"] .ai-reference-image-field { border-color: #46617b; background: rgba(21, 40, 58, .55); }
body[data-display-mode="dark"] .ai-image-upload-button,
body[data-display-mode="dark"] .ai-image-preview-meta button,
body[data-display-mode="dark"] .ai-extracted-color { border-color: #49627b; background: #1d344e; color: #d1dfed; }
body[data-display-mode="dark"] .ai-extracted-colors-label,
body[data-display-mode="dark"] .ai-image-analysis-heading span,
body[data-display-mode="dark"] .ai-image-analysis-summary,
body[data-display-mode="dark"] .ai-image-palette-item p { color: #b9cada; }
body[data-display-mode="dark"] .ai-image-analysis { border-color: #3a5068; background: rgba(24, 42, 61, .78); }
body[data-display-mode="dark"] .ai-image-analysis-heading strong,
body[data-display-mode="dark"] .ai-image-palette-title strong { color: #e2edf8; }
body[data-display-mode="dark"] .ai-image-palette-item { border-color: #425b73; background: #1d344e; }
body[data-display-mode="dark"] .ai-color-option {
  border-color: #3a5068;
  background: #1b2938;
}
body[data-display-mode="dark"] .ai-color-option-title strong { color: #e7f1fc; }
body[data-display-mode="dark"] .ai-color-option-title code { color: #b7c9da; }
body[data-display-mode="dark"] .ai-color-option-content > p { color: #c2d2e1; }
body[data-display-mode="dark"] .ai-color-option-details { border-color: #3a5068; }
body[data-display-mode="dark"] .ai-color-option-detail span,
body[data-display-mode="dark"] .ai-color-option-detail p { color: #b8cadb; }
body[data-display-mode="dark"] .ai-color-option-detail:last-child p { color: #d3a28b; }
body[data-display-mode="dark"] .ai-color-option-content button {
  background: #172536;
  color: var(--ai-primary);
}
body[data-display-mode="dark"] .ai-color-option-content button:hover { background: #22364d; }
body[data-display-mode="dark"] .ai-color-applied { color: #b8d7ef; }
body[data-display-mode="dark"] .ai-color-applied button {
  border-color: #49627b;
  background: #1d344e;
  color: #b9dcff;
}

@media (max-width: 880px) {
  .ai-color-advisor { grid-template-columns: 1fr; padding: 20px; }
  .ai-color-analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-color-option-grid { grid-template-columns: 1fr; }
  .ai-image-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .ai-demo-example { grid-template-columns: 1fr 68px; }
  .ai-demo-example-button { grid-column: 1 / -1; justify-self: start; }
  .ai-demo-example img { width: 68px; height: 52px; }
  .ai-color-extras { grid-template-columns: 1fr; }
  .ai-color-analysis-grid { grid-template-columns: 1fr; }
}
