/* ============================================================
   AI Import — "Recreate from a document" modal flow
   Uses Hostinger design tokens from colors_and_type.css
   ============================================================ */

/* ---------- Dropdown entry ---------- */
.dropdown__item--ai {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 10px;
  margin-bottom: 2px;
}
.dropdown__item--ai .dropdown__item-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--h-gradient-ai);
  color: #fff;
  margin-top: 1px;
}
.dropdown__item--ai .dropdown__item-icon svg { width: 14px; height: 14px; }
.dropdown__item--ai .dropdown__item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dropdown__item--ai .dropdown__item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--h-fg-neutral-default);
}
.dropdown__item--ai .dropdown__item-sub {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--h-fg-neutral-secondary);
  white-space: normal;
}
.dropdown__item--ai:hover .dropdown__item-title { color: var(--h-primary-700); }
.dropdown__item--ai:hover .dropdown__item-sub  { color: var(--h-primary-700); opacity: 0.8; }

/* ---------- Modal shell ---------- */
.modal--ai {
  background: rgba(24, 24, 26, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 32px;
  align-items: flex-start;
}
.modal--ai .modal__sheet--ai {
  width: min(960px, 100%);
  max-width: 960px;
  max-height: calc(100vh - 64px);
  padding: 0;
  border-radius: 16px;
  box-shadow: var(--h-shadow-5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 5vh;
  animation: aiModalIn .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes aiModalIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* ---------- Header ---------- */
.ai-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--h-stroke-default);
}
.ai-modal__heading { min-width: 0; flex: 1; }
.ai-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--h-primary-500);
  background: var(--h-primary-100);
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.ai-modal__sparkle {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  background: var(--h-gradient-ai);
  color: #fff;
  border-radius: 5px;
}
.ai-modal__sparkle svg { width: 11px; height: 11px; }

.ai-modal__title {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--h-fg-neutral-default);
  margin: 0 0 6px;
}
.ai-modal__sub {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--h-fg-neutral-secondary);
  margin: 0;
  max-width: 620px;
}
.ai-modal__close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--h-fg-neutral-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.ai-modal__close:hover { background: var(--h-bg-neutral-surface); color: var(--h-fg-neutral-default); }

/* ---------- Stepper ---------- */
.ai-stepper {
  list-style: none;
  margin: 0;
  padding: 14px 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--h-bg-neutral-secondary);
  border-bottom: 1px solid var(--h-stroke-default);
  font-size: 12.5px;
  color: var(--h-fg-neutral-tertiary);
}
.ai-stepper__step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  position: relative;
}
.ai-stepper__step + .ai-stepper__step::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--h-neutral-200);
  margin-right: 4px;
}
.ai-stepper__dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--h-neutral-100);
  color: var(--h-fg-neutral-tertiary);
  font-weight: 700;
  font-size: 11px;
}
.ai-stepper__step.is-active {
  color: var(--h-fg-neutral-default);
  font-weight: 600;
}
.ai-stepper__step.is-active .ai-stepper__dot {
  background: var(--h-primary-500);
  color: #fff;
}
.ai-stepper__step.is-done .ai-stepper__dot {
  background: var(--h-primary-100);
  color: var(--h-primary-700);
}
.ai-stepper__step.is-done {
  color: var(--h-fg-neutral-secondary);
}

/* ---------- Body / states ---------- */
.ai-modal__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  position: relative;
}
.ai-state {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  animation: aiStateIn .22s ease-out;
}
.ai-state.is-active { display: flex; }
@keyframes aiStateIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- STATE 1: Upload ---------- */
.ai-drop {
  display: block;
  border: 1.5px dashed var(--h-neutral-200);
  border-radius: 14px;
  background: var(--h-bg-neutral-secondary);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.ai-drop:hover, .ai-drop.is-dragover {
  border-color: var(--h-primary-500);
  background: var(--h-primary-50);
}
.ai-drop.is-dragover { transform: scale(1.005); }
.ai-drop__icon {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: #fff;
  color: var(--h-primary-500);
  box-shadow: var(--h-shadow-1);
}
.ai-drop__icon svg { width: 30px; height: 30px; }
.ai-drop__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--h-fg-neutral-default);
  margin-bottom: 4px;
}
.ai-drop__sub {
  font-size: 13px;
  color: var(--h-fg-neutral-secondary);
  margin-bottom: 12px;
}
.ai-drop__link {
  color: var(--h-primary-500);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ai-drop__formats {
  display: inline-block;
  font-family: var(--h-font-mono);
  font-size: 11px;
  color: var(--h-fg-neutral-tertiary);
  background: var(--h-neutral-100);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.ai-or {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--h-fg-neutral-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 4px 0;
}
.ai-or::before, .ai-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--h-stroke-default);
}

.ai-paste {
  width: 100%;
  border: 1px solid var(--h-stroke-default);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--h-font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--h-fg-neutral-default);
  background: #fff;
  resize: vertical;
  min-height: 84px;
}
.ai-paste:focus {
  outline: none;
  border-color: var(--h-primary-500);
  box-shadow: var(--h-shadow-focus);
}

.ai-samples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-samples__label {
  font-size: 12.5px;
  color: var(--h-fg-neutral-tertiary);
}
.ai-chip {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--h-fg-neutral-default);
  background: var(--h-neutral-100);
  border: 1px solid transparent;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.ai-chip:hover {
  background: var(--h-primary-50);
  color: var(--h-primary-700);
  border-color: var(--h-primary-200);
}

.ai-state__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
  border-top: 1px dashed transparent;
}
.ai-state__footer--review {
  border-top: 1px solid var(--h-stroke-default);
  padding-top: 16px;
  margin-top: 4px;
}
.ai-state__hint {
  font-size: 11.5px;
  color: var(--h-fg-neutral-tertiary);
  margin: 0;
  max-width: 460px;
  line-height: 1.45;
}

#aiUploadGo[disabled] {
  background: var(--h-neutral-200);
  color: var(--h-neutral-500);
  cursor: not-allowed;
}

/* ---------- STATE 2: Analyzing ---------- */
.ai-analyze {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: center;
  padding: 16px 8px;
}
.ai-analyze__doc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ai-analyze__doc-frame {
  width: 200px;
  height: 260px;
  background: #fff;
  border: 1px solid var(--h-stroke-default);
  border-radius: 8px;
  box-shadow: var(--h-shadow-3);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
  overflow: hidden;
}
.ai-analyze__doc-line {
  height: 7px;
  background: var(--h-neutral-100);
  border-radius: 3px;
}
.ai-analyze__doc-line--gap { background: transparent; height: 6px; }
.ai-analyze__doc-scan {
  position: absolute;
  left: 0; right: 0;
  height: 32px;
  background: linear-gradient(180deg, transparent 0%, rgba(103,61,230,0.10) 35%, rgba(103,61,230,0.30) 50%, rgba(103,61,230,0.10) 65%, transparent 100%);
  animation: aiScan 2.4s cubic-bezier(.4,0,.2,1) infinite;
  pointer-events: none;
}
.ai-analyze__doc-scan::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: var(--h-primary-500);
  box-shadow: 0 0 8px rgba(103,61,230,0.6);
}
@keyframes aiScan {
  0%   { transform: translateY(-32px); }
  100% { transform: translateY(260px); }
}
.ai-analyze__filename {
  font-family: var(--h-font-mono);
  font-size: 11.5px;
  color: var(--h-fg-neutral-secondary);
  background: var(--h-neutral-100);
  padding: 3px 8px;
  border-radius: 6px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-analyze__steps { min-width: 0; }
.ai-analyze__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--h-fg-neutral-default);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-tasklist {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-tasklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--h-fg-neutral-tertiary);
  transition: color .25s;
}
.ai-tasklist__bullet {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--h-neutral-200);
  background: #fff;
  flex: 0 0 auto;
  position: relative;
  transition: all .25s;
}
.ai-tasklist li.is-active { color: var(--h-fg-neutral-default); font-weight: 500; }
.ai-tasklist li.is-active .ai-tasklist__bullet {
  border-color: var(--h-primary-500);
  background: var(--h-primary-500);
  box-shadow: 0 0 0 4px rgba(103,61,230,0.15);
  animation: aiBulletPulse 1.2s ease-in-out infinite;
}
@keyframes aiBulletPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(103,61,230,0.15); }
  50%      { box-shadow: 0 0 0 7px rgba(103,61,230,0.05); }
}
.ai-tasklist li.is-done { color: var(--h-fg-neutral-secondary); }
.ai-tasklist li.is-done .ai-tasklist__bullet {
  border-color: var(--h-primary-500);
  background: var(--h-primary-500);
}
.ai-tasklist li.is-done .ai-tasklist__bullet::after {
  content: '';
  position: absolute;
  top: 1px; left: 4px;
  width: 4px; height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.ai-analyze__pulse {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.ai-analyze__pulse span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--h-primary-300);
  animation: aiDot 1.2s ease-in-out infinite;
}
.ai-analyze__pulse span:nth-child(2) { animation-delay: .2s; }
.ai-analyze__pulse span:nth-child(3) { animation-delay: .4s; }
@keyframes aiDot {
  0%, 100% { transform: translateY(0); opacity: .4; }
  50%      { transform: translateY(-4px); opacity: 1; }
}

/* ---------- STATE 3: Review ---------- */
.ai-state--review { padding: 0; }
.ai-state--review.is-active { display: flex; flex: 1; min-height: 0; }
.ai-state--review > * { flex-shrink: 0; }
.ai-state--review > .ai-review__split { flex: 1; min-height: 0; }

.ai-review__topbar {
  padding: 14px 24px;
  border-bottom: 1px solid var(--h-stroke-default);
  background: var(--h-bg-neutral-secondary);
}
.ai-review__summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--h-fg-neutral-secondary);
  flex-wrap: wrap;
}
.ai-review__summary-row b { color: var(--h-fg-neutral-default); font-weight: 600; }
.ai-review__summary-row strong {
  color: var(--h-fg-neutral-default);
  font-weight: 600;
  font-family: var(--h-font-mono);
  font-size: 12.5px;
}
.ai-review__dot { color: var(--h-neutral-300); }
.ai-review__summary-confidence {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.ai-confidence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
}
.ai-confidence--high { background: #E3F6ED; color: var(--h-success-700); }
.ai-confidence--med  { background: #FEF6D6; color: var(--h-warning-700); }
.ai-confidence--low  { background: #FCE6E9; color: var(--h-danger-700); }
.ai-confidence__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}
.ai-confidence__dot--high { background: var(--h-success-500); }
.ai-confidence__dot--med  { background: var(--h-warning-500); }
.ai-confidence__dot--low  { background: var(--h-danger-500); }

.ai-link {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--h-primary-500);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ai-link:hover { color: var(--h-primary-700); }

.ai-review__split {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
}

.ai-review__sidebar {
  background: #fafafb;
  border-right: 1px solid var(--h-stroke-default);
  padding: 16px 14px;
  overflow-y: auto;
  max-height: 480px;
}
.ai-review__sidebar-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--h-fg-neutral-tertiary);
  font-weight: 600;
  margin-bottom: 8px;
  padding: 0 6px;
}
.ai-outline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  counter-reset: ai-outline-counter;
}
.ai-outline li {
  counter-increment: ai-outline-counter;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--h-fg-neutral-default);
  transition: background .12s;
}
.ai-outline li::before {
  content: counter(ai-outline-counter);
  font-family: var(--h-font-mono);
  font-size: 10.5px;
  color: var(--h-fg-neutral-tertiary);
  width: 16px;
  flex: 0 0 auto;
}
.ai-outline li:hover { background: var(--h-bg-neutral-hover); }
.ai-outline li.is-current { background: var(--h-primary-50); color: var(--h-primary-700); font-weight: 500; }
.ai-outline li .ai-outline__type {
  font-size: 10.5px;
  color: var(--h-fg-neutral-tertiary);
  margin-left: auto;
  font-family: var(--h-font-mono);
  white-space: nowrap;
}
.ai-outline li.is-current .ai-outline__type { color: var(--h-primary-700); }

/* Detected tags strip in the review sidebar */
.ai-tagstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 6px 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--h-stroke-default);
}
.ai-tagstrip__empty {
  font-size: 11.5px;
  color: var(--h-fg-neutral-tertiary);
  font-style: italic;
  padding: 2px 0;
}
.ai-tagstrip__hint {
  flex-basis: 100%;
  font-size: 10.5px;
  color: var(--h-fg-neutral-tertiary);
  margin-top: 2px;
}
.ai-tagchip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
  letter-spacing: 0.01em;
}
.ai-tagchip--purple { background: #673DE6; }
.ai-tagchip--green  { background: #009E5B; }
.ai-tagchip--orange { background: #F08528; }
.ai-tagchip--red    { background: #D62B3F; }
.ai-tagchip--yellow { background: #F4C422; color: #2A2200; }
.ai-tagchip--blue   { background: #2D8DEF; }
.ai-tagchip--pink   { background: #E64BA0; }
.ai-tagchip--slate  { background: #5C6068; }

.ai-review__sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
  padding: 10px 6px 0;
  border-top: 1px solid var(--h-stroke-default);
  font-size: 11px;
  color: var(--h-fg-neutral-tertiary);
}
.ai-review__legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-review__main {
  overflow-y: auto;
  max-height: 480px;
  padding: 16px 20px;
  background: var(--h-bg-neutral-secondary);
}

.ai-mapping {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Mapping cards ---------- */
.ai-card {
  background: #fff;
  border: 1px solid var(--h-stroke-default);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  align-items: start;
  transition: box-shadow .12s, border-color .12s;
  scroll-margin-top: 12px;
}
.ai-card:hover { box-shadow: var(--h-shadow-1); }
.ai-card.is-current { border-color: var(--h-primary-300); box-shadow: var(--h-shadow-focus); }

.ai-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ai-card__index {
  font-family: var(--h-font-mono);
  font-size: 11px;
  color: var(--h-fg-neutral-tertiary);
  background: var(--h-neutral-100);
  padding: 2px 6px;
  border-radius: 4px;
}
.ai-card__source {
  font-size: 12.5px;
  color: var(--h-fg-neutral-secondary);
  font-style: italic;
  flex: 1;
  min-width: 120px;
}
.ai-card__arrow {
  color: var(--h-fg-neutral-tertiary);
  font-size: 14px;
  margin: 0 2px;
}

.ai-card__match {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 6px;
  border-radius: 6px;
  background: var(--h-primary-50);
  color: var(--h-primary-700);
  font-size: 12px;
  font-weight: 600;
}
.ai-card__match svg { width: 12px; height: 12px; }

.ai-card__preview {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--h-stroke-default);
  padding-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--h-fg-neutral-default);
}
.ai-card__preview-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--h-fg-neutral-tertiary);
  font-weight: 600;
  margin-bottom: 6px;
}
.ai-card__preview-content {
  font-size: 13px;
  line-height: 1.5;
  color: var(--h-fg-neutral-default);
}
.ai-card__preview-content ul {
  margin: 4px 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ai-card__preview-content ol { margin: 4px 0; padding-left: 22px; }
.ai-card__preview-content code {
  font-family: var(--h-font-mono);
  font-size: 12px;
  background: var(--h-neutral-100);
  padding: 1px 5px;
  border-radius: 4px;
}
.ai-card__preview-content em {
  color: var(--h-primary-700);
  font-style: normal;
  font-weight: 600;
  background: var(--h-primary-50);
  padding: 1px 4px;
  border-radius: 3px;
}

.ai-card__actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--h-stroke-default);
}
.ai-card__action {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--h-fg-neutral-secondary);
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.ai-card__action:hover { background: var(--h-bg-neutral-hover); color: var(--h-fg-neutral-default); }
.ai-card__action--danger:hover { color: var(--h-danger-500); }
.ai-card__action--swap { color: var(--h-primary-500); }
.ai-card__action--swap:hover { background: var(--h-primary-50); color: var(--h-primary-700); }

.ai-card.is-skipped { opacity: 0.55; }
.ai-card.is-skipped .ai-card__preview { text-decoration: line-through; text-decoration-color: var(--h-neutral-300); }
.ai-card.is-skipped .ai-card__match { background: var(--h-neutral-100); color: var(--h-fg-neutral-tertiary); }

/* Confidence variants on cards */
.ai-card--med .ai-card__match { background: #FEF6D6; color: var(--h-warning-700); }
.ai-card--low .ai-card__match { background: #FCE6E9; color: var(--h-danger-700); }
.ai-card--med { border-left: 3px solid var(--h-warning-500); }
.ai-card--low { border-left: 3px solid var(--h-danger-500); }

/* ---------- Apply footer ---------- */
.ai-state__footer--review {
  padding: 14px 24px;
  background: #fff;
  border-top: 1px solid var(--h-stroke-default);
}
.ai-review__apply {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ai-review__merge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--h-fg-neutral-secondary);
  cursor: pointer;
  user-select: none;
}
.ai-review__merge input[type=radio] {
  accent-color: var(--h-primary-500);
}

/* ---------- STATE 4: Done ---------- */
.ai-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 16px 12px;
  gap: 10px;
}
.ai-done__check {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--h-success-500);
  color: #fff;
  display: grid; place-items: center;
  margin-bottom: 6px;
  animation: aiPop .35s cubic-bezier(.2,1.4,.4,1);
}
.ai-done__check svg { width: 28px; height: 28px; }
@keyframes aiPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.ai-done h4 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--h-fg-neutral-default);
}
.ai-done p {
  font-size: 13.5px;
  color: var(--h-fg-neutral-secondary);
  max-width: 460px;
  line-height: 1.5;
  margin: 0;
}
.ai-done__actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* Responsive niceties */
@media (max-width: 760px) {
  .ai-analyze { grid-template-columns: 1fr; gap: 20px; }
  .ai-review__split { grid-template-columns: 1fr; }
  .ai-review__sidebar { max-height: 160px; border-right: 0; border-bottom: 1px solid var(--h-stroke-default); }
}

/* ---------- Error state ---------- */
.ai-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px;
  gap: 10px;
}
.ai-error__icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--h-danger-500);
  color: #fff;
  display: grid; place-items: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}
.ai-error h4 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--h-fg-neutral-default);
}
.ai-error p {
  font-size: 13.5px;
  color: var(--h-fg-neutral-secondary);
  max-width: 520px;
  line-height: 1.5;
  margin: 0;
}
.ai-error__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
