/* Shopify-parity studio tokens */
.aanya-studio {
  --studio-blue: #6d7ec9;
  --studio-blue-deep: #4a5fad;
  --studio-blue-light: #eef1fa;
  --studio-blue-mist: #f5f7fc;
  --studio-orange: #e8a07f;
  --studio-orange-deep: #d4866a;
  --studio-orange-light: #fdf3ed;
  --studio-navy: #3d3860;
  --studio-muted: #6b7280;
  --studio-border: #dce3f2;
  --studio-card: #ffffff;
  --studio-bg: #f7f9fc;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--studio-navy);
  background: var(--studio-card);
  border: 1px solid var(--studio-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(74, 95, 173, 0.1);
  overflow: hidden;
}

.aanya-studio__toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--studio-border);
  background: linear-gradient(180deg, #fff 0%, var(--studio-blue-mist) 100%);
}

.aanya-studio__title {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--studio-navy);
}

.aanya-studio__meta {
  margin: 4px 0 0;
  color: var(--studio-muted);
  font-size: 12px;
}

.aanya-studio__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.aanya-studio__plan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--studio-blue-light);
  color: var(--studio-navy);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(109, 126, 201, 0.28);
}

.aanya-studio__plan-days {
  opacity: 0.75;
  font-weight: 400;
}

.aanya-studio__plan-btn[hidden] {
  display: none !important;
}

/* Dashboard tip — dotted note under toolbar */
.aanya-dash-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 12px 18px 12px 16px;
  border-top: 1px dashed rgba(109, 126, 201, 0.45);
  border-bottom: 1px dashed rgba(109, 126, 201, 0.45);
  background:
    linear-gradient(90deg, rgba(253, 243, 237, 0.9) 0%, rgba(238, 241, 250, 0.95) 55%, rgba(255, 255, 255, 0.9) 100%);
  box-shadow: inset 0 0 0 1px rgba(109, 126, 201, 0.08);
}

.aanya-dash-note__badge {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px dashed rgba(212, 134, 106, 0.55);
  background: #fff;
  color: var(--studio-orange-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.aanya-dash-note__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--studio-navy);
}

.aanya-dash-note__link {
  text-decoration: none;
  color: inherit;
}

.aanya-dash-note__link mark {
  padding: 0 0.15em;
  background: linear-gradient(180deg, rgba(232, 160, 127, 0.35), rgba(232, 160, 127, 0.18));
  color: var(--studio-navy);
  font-weight: 750;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.aanya-dash-note__link:hover mark {
  background: linear-gradient(180deg, rgba(109, 126, 201, 0.28), rgba(109, 126, 201, 0.14));
  color: var(--studio-blue-deep);
}

/* Piano tabs (Shopify studio) */
.aanya-piano {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 4px;
  margin: 0;
  padding: 12px 12px 0;
  list-style: none;
  border: none;
  overflow-x: auto;
  background: linear-gradient(180deg, var(--studio-blue-mist) 0%, #e9edf8 100%);
  border-bottom: 1px solid var(--studio-border);
}

.aanya-piano__key {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  flex: 1 1 0;
  min-width: 132px;
  min-height: 58px;
  box-sizing: border-box;
  padding: 10px 14px 12px;
  margin: 0;
  border: 1px solid var(--studio-border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #fff 0%, #f9fafd 100%);
  box-shadow: 0 1px 0 #fff inset, 0 3px 10px rgba(74, 95, 173, 0.07);
  color: var(--studio-muted);
  text-decoration: none !important;
  line-height: 1.2;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  position: relative;
}

.aanya-piano__key::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}

.aanya-piano__key:hover,
.aanya-piano__key:focus {
  color: var(--studio-blue-deep);
  background: linear-gradient(180deg, #fff 0%, var(--studio-blue-light) 100%);
  outline: none;
}

.aanya-piano__key.is-active {
  color: var(--studio-navy);
  background: #fff;
  box-shadow: 0 1px 0 #fff inset, 0 -1px 0 #fff, 0 3px 12px rgba(74, 95, 173, 0.12);
  z-index: 1;
}

.aanya-piano__key.is-active::after {
  background: linear-gradient(90deg, var(--studio-blue), var(--studio-orange));
}

.aanya-piano__cat {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
}

.aanya-piano__key.is-active .aanya-piano__cat {
  color: var(--studio-blue-deep);
  opacity: 1;
}

.aanya-piano__label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: inherit;
}

/* Buttons */
.aanya-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

.aanya-btn--primary {
  color: #fff !important;
  background: linear-gradient(135deg, var(--studio-blue) 0%, var(--studio-blue-deep) 100%);
  border-color: var(--studio-blue-deep);
  box-shadow: 0 4px 14px rgba(74, 95, 173, 0.28);
}

.aanya-btn--primary:hover,
.aanya-btn--primary:focus {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(74, 95, 173, 0.34);
  color: #fff !important;
}

.aanya-btn--ghost {
  color: var(--studio-blue-deep) !important;
  background: #fff;
  border-color: rgba(109, 126, 201, 0.35);
  box-shadow: 0 2px 8px rgba(74, 95, 173, 0.08);
}

.aanya-btn--ghost:hover,
.aanya-btn--ghost:focus {
  background: var(--studio-blue-light);
  color: var(--studio-blue-deep) !important;
}

.aanya-btn--danger {
  color: #b91c1c !important;
  background: #fff;
  border-color: rgba(220, 38, 38, 0.28);
}

.aanya-btn--danger:hover,
.aanya-btn--danger:focus {
  color: #fff !important;
  background: linear-gradient(135deg, #f87171, #dc2626);
  border-color: #dc2626;
}

.aanya-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.aanya-studio__status {
  padding: 12px 18px;
  color: var(--studio-muted);
  font-size: 13px;
  border-bottom: 1px solid #eef1f6;
  background: #fff;
}

.aanya-studio__status.is-error {
  color: #b32d2e;
  background: #fcf0f1;
}

.aanya-studio__status.is-ok {
  display: none;
}

.aanya-studio__panel {
  padding: 18px;
}

.aanya-studio__panel[hidden] {
  display: none !important;
}

.aanya-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.aanya-stat {
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 12px 14px;
}

.aanya-stat__label {
  display: block;
  color: #646970;
  font-size: 12px;
  margin-bottom: 4px;
}

.aanya-stat__value {
  font-size: 22px;
  font-weight: 600;
  color: #1d2327;
}

.aanya-card {
  border: 1px solid var(--studio-border, #dcdcde);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(74, 95, 173, 0.04);
}

.aanya-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 750;
  color: var(--studio-navy, #1d2327);
}

.aanya-card__head {
  margin-bottom: 12px;
}

.aanya-card__head p {
  margin: 0;
}

.aanya-crawl-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.aanya-crawl-mode {
  margin: 0;
  cursor: pointer;
}

.aanya-crawl-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.aanya-crawl-mode__card {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--studio-border, #dcdcde);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.aanya-crawl-mode__card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--studio-navy, #1d2327);
}

.aanya-crawl-mode__card small {
  display: block;
  font-size: 12px;
  color: var(--studio-muted, #646970);
  line-height: 1.35;
}

.aanya-crawl-mode.is-selected .aanya-crawl-mode__card,
.aanya-crawl-mode input:checked + .aanya-crawl-mode__card {
  border-color: var(--studio-blue, #6d7ec9);
  background: var(--studio-blue-light, #eef1fa);
  box-shadow: 0 0 0 3px rgba(109, 126, 201, 0.16);
}

.aanya-url-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.aanya-url-row input[type="url"] {
  flex: 1;
  min-width: 220px;
}

.aanya-kf-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aanya-kf-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #eef2f7;
}

.aanya-kf-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.aanya-kf-item__body {
  flex: 1;
  min-width: 0;
}

.aanya-kf-item__type {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  background: #e0e7ff;
  color: #3730a3;
}

.aanya-kf-item__type--document {
  background: #ede9fe;
  color: #5b21b6;
}

.aanya-kf-item__type--url {
  background: #dbeafe;
  color: #1d4ed8;
}

.aanya-kf-item__type--qa {
  background: #dcfce7;
  color: #166534;
}

.aanya-kf-item__type--manual {
  background: #ffedd5;
  color: #c2410c;
}

.aanya-kf-item__title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--studio-navy, #1d2327);
  line-height: 1.35;
  word-break: break-word;
}

.aanya-kf-item__meta {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--studio-muted, #646970);
}

.aanya-kf-item__snippet {
  margin: 8px 0 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

.aanya-kf-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.aanya-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.aanya-action-btn--view {
  color: var(--studio-blue-deep, #4a5fad);
  background: linear-gradient(135deg, rgba(109, 126, 201, 0.12), rgba(238, 241, 250, 0.98));
  border-color: rgba(109, 126, 201, 0.3);
  box-shadow: 0 2px 8px rgba(74, 95, 173, 0.1);
}

.aanya-action-btn--view:hover,
.aanya-action-btn--view:focus {
  color: #fff;
  background: linear-gradient(135deg, var(--studio-blue, #6d7ec9), var(--studio-blue-deep, #4a5fad));
  border-color: var(--studio-blue-deep, #4a5fad);
  box-shadow: 0 4px 14px rgba(74, 95, 173, 0.28);
  transform: translateY(-1px);
  outline: none;
}

.aanya-action-btn--remove {
  color: #b45309;
  background: linear-gradient(135deg, var(--studio-orange-light, #fdf3ed), #fff7ed);
  border-color: rgba(232, 160, 127, 0.45);
  box-shadow: 0 2px 8px rgba(212, 134, 106, 0.12);
}

.aanya-action-btn--remove:hover,
.aanya-action-btn--remove:focus {
  color: #fff;
  background: linear-gradient(135deg, #f87171, #dc2626);
  border-color: #dc2626;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.26);
  transform: translateY(-1px);
  outline: none;
}

@media screen and (max-width: 782px) {
  .aanya-crawl-modes {
    grid-template-columns: 1fr;
  }

  .aanya-kf-item {
    flex-direction: column;
  }
}

.aanya-form-row {
  margin: 0 0 12px;
}

.aanya-form-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

.aanya-form-row input[type="text"],
.aanya-form-row input[type="email"],
.aanya-form-row input[type="url"],
.aanya-form-row input[type="color"],
.aanya-form-row select,
.aanya-form-row textarea {
  width: 100%;
  max-width: 520px;
}

.aanya-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 14px;
}

.aanya-table {
  width: 100%;
  border-collapse: collapse;
}

.aanya-table th,
.aanya-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #dcdcde;
  font-size: 13px;
  vertical-align: top;
}

.aanya-table th {
  background: #f6f7f7;
  font-weight: 600;
}

.aanya-muted {
  color: #646970;
  font-size: 13px;
}

/* ── Widget settings (Shopify-parity layout) ── */
.aanya-settings {
  margin: 0;
}

.aanya-settings__section {
  border: 1px solid #dcdcde;
  border-radius: 10px;
  background: #fff;
  padding: 16px 18px 18px;
  margin-bottom: 16px;
}

.aanya-settings__section-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
  color: #1d2327;
}

.aanya-settings__section-head p {
  margin: 0 0 14px;
  color: #646970;
  font-size: 13px;
  line-height: 1.45;
  max-width: 62ch;
}

.aanya-settings__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}

.aanya-settings__aside .aanya-live-card {
  border: 1px solid #dcdcde;
  border-radius: 10px;
  background: #f8fafc;
  padding: 16px;
}

.aanya-settings__aside h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.aanya-settings__aside p {
  margin: 0 0 10px;
  font-size: 13px;
  color: #50575e;
  line-height: 1.45;
}

.aanya-settings__hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: #646970;
}

.aanya-settings__actions {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f1;
}

.aanya-wt-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.aanya-wt-card {
  margin: 0;
  cursor: pointer;
  height: 100%;
  position: relative;
}

.aanya-wt-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.aanya-wt-card__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 210px;
  border: 2px solid #dcdcde;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aanya-wt-card.is-selected .aanya-wt-card__inner,
.aanya-wt-card input:checked + .aanya-wt-card__inner {
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.18);
}

.aanya-wt-card__preview {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 128px;
  max-height: 140px;
  padding: 8px;
  background: var(--studio-bg, #f7f9fc);
  border-bottom: 1px solid var(--studio-border, #e2e4e7);
  overflow: hidden;
}

/* Live CSS mock (Shopify-style) — no remote images */
.aanya-mock {
  --aanya-brand: #6d7ec9;
  width: 100%;
  height: 100%;
}

.aanya-mock__scene {
  height: 100%;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 6px;
  padding: 4px;
}

.aanya-mock__panel {
  width: 92%;
  max-width: 150px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(74, 95, 173, 0.18);
  display: flex;
  flex-direction: column;
  background: #fff;
}

.aanya-mock[data-theme="dark"]:not(.aanya-mock--glass):not(.aanya-mock--meridian) .aanya-mock__panel {
  background: #0f172a;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.aanya-mock__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--aanya-brand), #3d3860);
  font-size: 9px;
}

.aanya-mock[data-header="solid"] .aanya-mock__header {
  background: var(--aanya-brand);
}

.aanya-mock[data-color-family="orange"] .aanya-mock__header,
.aanya-mock--flare .aanya-mock__header {
  background: linear-gradient(135deg, #f15c22, #c94a12);
}

.aanya-mock[data-header="corporate"] .aanya-mock__header,
.aanya-mock--atlas .aanya-mock__header {
  background: #1f1e21;
  border-bottom: 2px solid var(--aanya-brand, #f15c22);
}

.aanya-mock[data-header="meridian"] .aanya-mock__header,
.aanya-mock--meridian .aanya-mock__header {
  background: #fff;
  color: #1f1e21;
  border-bottom: 2px solid var(--aanya-brand, #f15c22);
}

.aanya-mock--glass .aanya-mock__panel {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
}

.aanya-mock--glass .aanya-mock__header {
  background: linear-gradient(135deg, rgba(50, 182, 179, 0.85), rgba(61, 56, 96, 0.75));
}

.aanya-mock__logo {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #eef1fb, #fdf3ed);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.aanya-mock__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.aanya-mock__close {
  opacity: 0.8;
  font-size: 11px;
  line-height: 1;
}

.aanya-mock__messages {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 42px;
}

.aanya-mock__msg {
  max-width: 88%;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 8px;
  line-height: 1.3;
}

.aanya-mock__msg--bot {
  align-self: flex-start;
  background: #eef2ff;
  color: #312e81;
}

.aanya-mock[data-theme="dark"] .aanya-mock__msg--bot {
  background: #1e293b;
  color: #e2e8f0;
}

.aanya-mock__msg--user {
  align-self: flex-end;
  background: var(--aanya-brand);
  color: #fff;
}

.aanya-mock__footer {
  display: flex;
  gap: 4px;
  padding: 5px 6px 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.aanya-mock__input {
  flex: 1;
  font-size: 7px;
  color: #94a3b8;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
}

.aanya-mock__send {
  font-size: 7px;
  font-weight: 700;
  color: #fff;
  background: var(--aanya-brand);
  border-radius: 999px;
  padding: 4px 7px;
}

.aanya-mock__launcher {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--aanya-brand), #3d3860);
  box-shadow: 0 6px 16px rgba(74, 95, 173, 0.28);
  border: 2px solid #fff;
}

.aanya-mock--minimal .aanya-mock__launcher {
  border-radius: 8px;
}

.aanya-mock--atlas .aanya-mock__launcher {
  background: #1f1e21;
  box-shadow: 0 0 0 2px var(--aanya-brand);
}

.aanya-mock--meridian .aanya-mock__launcher {
  background: #fff;
  box-shadow: 0 0 0 2px var(--aanya-brand), 0 6px 16px rgba(0, 0, 0, 0.12);
}

.aanya-wt-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 12px;
}

.aanya-wt-card__family {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}

.aanya-wt-card__family--teal {
  background: #ccfbf1;
  color: #0f766e;
}

.aanya-wt-card__family--orange {
  background: #ffedd5;
  color: #c2410c;
}

.aanya-wt-card__family--black {
  background: #e5e7eb;
  color: #111827;
}

.aanya-wt-card__family--white {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.aanya-wt-card__name {
  font-size: 13px;
  font-weight: 700;
  color: #1d2327;
  line-height: 1.25;
}

.aanya-wt-card__desc {
  font-size: 12px;
  color: #646970;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}

.aanya-field {
  margin: 0 0 14px;
}

.aanya-field > label,
.aanya-field__label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: #1d2327;
  margin-bottom: 6px;
}

.aanya-field input[type="text"],
.aanya-field input[type="email"],
.aanya-field input[type="url"],
.aanya-field textarea,
.aanya-field select {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.aanya-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.aanya-color {
  display: flex;
  align-items: center;
  gap: 10px;
}

.aanya-color input[type="color"] {
  width: 48px;
  height: 40px;
  padding: 2px;
  border: 1px solid #c3c4c7;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.aanya-color input[type="text"] {
  width: 110px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

.aanya-theme {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.aanya-theme__opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #c3c4c7;
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
}

.aanya-theme__opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.aanya-theme__opt.is-selected {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
  background: #f0f6fc;
}

.aanya-lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.aanya-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.aanya-lang.is-selected {
  border-color: #2271b1;
  background: #f0f6fc;
}

.aanya-lang input {
  margin: 0;
}

.aanya-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.aanya-logo-preview {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #dcdcde;
}

@media screen and (max-width: 1100px) {
  .aanya-settings__grid {
    grid-template-columns: 1fr;
  }

  .aanya-wt-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 600px) {
  .aanya-wt-picker,
  .aanya-field-row {
    grid-template-columns: 1fr;
  }
}

.aanya-modal[hidden] {
  display: none !important;
}

.aanya-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.aanya-modal__dialog {
  background: #fff;
  border-radius: 8px;
  width: min(720px, 100%);
  max-height: 85vh;
  overflow: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.aanya-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #dcdcde;
}

.aanya-modal__head h2 {
  margin: 0;
  font-size: 16px;
}

.aanya-modal__close {
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  color: #1d2327;
}

.aanya-modal__body {
  padding: 16px;
}

.aanya-msg {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f6f7f7;
  font-size: 13px;
}

.aanya-msg--user {
  background: #e7f2fb;
}

.aanya-msg--assistant {
  background: #f0f0f1;
}

/* ── Knowledge crawl loader (Shopify-parity) ── */
.aanya-inline-form.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

.aanya-crawl-panel {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid #dbe3f0;
  background: linear-gradient(135deg, #f8fafc 0%, #fff 100%);
}

.aanya-crawl-panel[hidden] {
  display: none !important;
}

.aanya-crawl-panel.is-done {
  border-color: #bbf7d0;
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}

.aanya-crawl-panel.is-error {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
}

.aanya-crawl-loader {
  display: flex;
  gap: 16px;
  align-items: center;
}

.aanya-crawl-loader[hidden] {
  display: none !important;
}

.aanya-crawl-loader__orbit {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.aanya-crawl-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(34, 113, 177, 0.18);
  border-top-color: #2271b1;
  border-right-color: #f15c22;
  animation: aanya-crawl-spin 1.1s linear infinite;
}

.aanya-crawl-loader__core {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2271b1;
  font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(34, 113, 177, 0.12);
  animation: aanya-crawl-pulse 1.8s ease-in-out infinite;
}

.aanya-crawl-loader__copy {
  flex: 1;
  min-width: 0;
}

.aanya-crawl-loader__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #1d2327;
}

.aanya-crawl-loader__text {
  margin: 0 0 10px;
  font-size: 13px;
  color: #50575e;
  min-height: 1.4em;
}

.aanya-crawl-loader__hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #8c8f94;
}

.aanya-crawl-bar {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.aanya-crawl-bar__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2271b1, #f15c22);
  transition: width 0.35s ease;
}

.aanya-crawl-alert {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.aanya-crawl-alert[hidden] {
  display: none !important;
}

.aanya-crawl-alert strong {
  display: block;
  margin-bottom: 4px;
}

.aanya-crawl-alert p {
  margin: 0;
  line-height: 1.45;
}

.aanya-crawl-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.aanya-crawl-alert--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.aanya-crawl-results {
  margin-top: 12px;
  max-height: 180px;
  overflow: auto;
  font-size: 12px;
}

.aanya-crawl-result {
  margin: 0 0 4px;
}

.aanya-crawl-result--ok {
  color: #166534;
}

.aanya-crawl-result--fail {
  color: #b91c1c;
}

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

@keyframes aanya-crawl-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.94);
    opacity: 0.85;
  }
}

@media screen and (max-width: 782px) {
  .aanya-studio__toolbar {
    align-items: flex-start;
  }

  .aanya-dash-note {
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
  }

  .aanya-crawl-loader {
    align-items: flex-start;
  }
}
