/* Matches extension/options/options.css lens field styling */

.lens-form,
.lens-form section {
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  color: #1f2933;
}

.lens-form section {
  background: #fff;
  border: 1px solid #e5e0d8;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.lens-form h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.lens-form label {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
}

.lens-form input,
.lens-form textarea,
.lens-form select,
.lens-form button {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: inherit;
  box-sizing: border-box;
}

.lens-form input,
.lens-form textarea,
.lens-form select {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.lens-form input::placeholder,
.lens-form textarea::placeholder {
  color: #98a2b3;
  opacity: 1;
}

.lens-form .note,
.lens-form .meta {
  color: #667085;
  font-size: 14px;
}

.lens-form .field-group {
  margin-bottom: 12px;
}

.lens-form .publisher-profile-group {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #e5e0d8;
}

.lens-form .field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 4px;
}

.lens-form .lens-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 8px;
}

.lens-form .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.lens-form .checkbox-row input {
  width: auto;
  margin: 0;
}

.lens-form .question-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lens-form .question-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e5e0d8;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  min-width: 0;
  color: var(--ink);
}

.lens-form .question-list-number {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 6px;
}

.lens-form .question-list-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.lens-form .question-list button {
  width: auto;
  margin: 0;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  color: #175cd3;
  border: 1px solid #175cd3;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.lens-form .question-list button:hover {
  background: #eff8ff;
  border-color: #175cd3;
}

.lens-form .lens-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.lens-form .lens-form-row button {
  width: auto;
  margin-top: 0;
}

.lens-form #publisherVerifyStatus {
  margin: 0;
}

.lens-form #publisherVerifyStatus.is-error {
  color: #b42318;
}

.lens-form #publisherVerifyStatus.is-success {
  color: #027a48;
}

.builder-page .status-bar.success-banner {
  background: #027a48;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
}

.lens-form .add-row input {
  flex: 1;
  margin-top: 0;
}

.lens-form .add-row {
  margin-top: 8px;
}

.lens-form .prefs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.lens-form .prefs-row label {
  margin-bottom: 0;
}

.lens-form .persona-preset-controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.lens-form .persona-preset-thumbnail-wrap {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 auto;
  align-self: stretch;
  aspect-ratio: 1 / 1;
  height: auto;
}

.lens-form .persona-preset-thumbnail {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lens-form .prefs-row .persona-preset-controls {
  grid-column: 1 / -1;
}

.lens-form .persona-preset-controls label {
  flex: 1 1 100%;
  margin-bottom: 0;
}

@media (min-width: 681px) {
  .lens-form .persona-preset-controls label {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

.lens-form .persona-preset-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
  padding-top: calc(1em + 6px);
}

.lens-form .persona-preset-action-btn {
  width: auto;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: inherit;
  font-weight: 600;
  padding: 10px 12px;
  line-height: 1.2;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.lens-form a.persona-preset-action-btn.secondary {
  border: 1px solid #175cd3;
  background: #fff;
  color: #175cd3;
  border-radius: 8px;
}

.lens-form a.persona-preset-action-btn.secondary:hover {
  background: #eff8ff;
}

.lens-form .persona-advanced-toggle-btn {
  width: auto;
  margin: 0 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lens-form .persona-advanced-toggle-btn::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms ease;
  margin-top: -2px;
}

.lens-form .persona-advanced-toggle-btn[aria-expanded="true"]::after {
  transform: rotate(225deg);
  margin-top: 2px;
}

.lens-form .persona-advanced-fields {
  overflow: hidden;
  opacity: 0;
  max-height: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    max-height 260ms ease;
}

.lens-form .persona-advanced-fields.is-open {
  opacity: 1;
  max-height: 1200px;
  transform: translateY(0);
  pointer-events: auto;
}

.persona-catalog-modal-dialog {
  width: min(960px, 100%);
}

.persona-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.persona-catalog-card {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid #e5e0d8;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.persona-catalog-card:hover {
  border-color: #175cd3;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.1);
}

.persona-catalog-card-body {
  padding: 12px;
}

.persona-catalog-card-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}

.persona-catalog-card-description {
  margin: 0;
  color: #475467;
  font-size: 0.9rem;
  line-height: 1.4;
}

.lens-form button {
  border: 1px solid #175cd3;
  background: #175cd3;
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.lens-form button:hover {
  background: #1849a9;
  border-color: #1849a9;
}

.lens-form button.secondary {
  background: #fff;
  color: #175cd3;
  border-color: #175cd3;
}

.lens-form button.secondary:hover {
  background: #eff8ff;
}

.lens-form .actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.lens-form .actions button {
  width: auto;
}

.lens-form .meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.lens-form .meta-row label {
  margin-bottom: 0;
}

.lens-form .tag-picker-group {
  margin-top: 12px;
}

.lens-form .tag-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.lens-form .tag-picker-header .field-label {
  margin: 16px 0 0;
}

.lens-form .tag-picker-show-btn {
  width: auto;
  margin: 0;
  padding: 6px 12px;
  font-size: 14px;
}

.lens-form .tag-picker {
  position: relative;
  margin-top: 8px;
  overflow: visible;
}

.lens-form .selected-tags-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.lens-form .selected-tags-empty {
  color: #98a2b3;
  font-size: 13px;
  padding: 4px 0;
}

.lens-form .selected-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.2;
}

.lens-form .selected-tags-list li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.lens-form .selected-tag-remove {
  width: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #98a2b3;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.lens-form .selected-tag-remove:hover {
  color: #4b5563;
  background: transparent;
  border: none;
}

.lens-form #tagSearch {
  margin-top: 0;
}

.lens-form .tag-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.12);
  padding: 6px;
  display: grid;
  gap: 4px;
}

.lens-form .tag-suggestions[hidden] {
  display: none !important;
}

.lens-form .tag-suggestion {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.lens-form .tag-suggestion:hover,
.lens-form .tag-suggestion:focus-visible {
  background: #f3f4f6;
  outline: none;
}

.lens-form .tag-suggestion-create {
  color: #175cd3;
  border-top: 1px solid #eaecf0;
  margin-top: 2px;
  padding-top: 10px;
}

.lens-form .tag-suggestions-hint {
  margin: 4px 2px 0;
  padding: 6px 8px 2px;
  color: #667085;
  font-size: 12px;
}

body.tags-modal-open {
  overflow: hidden;
}

.tags-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.tags-modal[hidden] {
  display: none !important;
}

.tags-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
}

.tags-modal-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e0d8;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(16, 24, 40, 0.18);
  overflow: hidden;
}

.tags-modal-header,
.tags-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: #fff;
}

.tags-modal-header {
  border-bottom: 1px solid #e5e0d8;
}

.tags-modal-footer {
  border-top: 1px solid #e5e0d8;
  justify-content: stretch;
  gap: 10px;
  padding: 14px 18px 16px;
  background: #f8fafc;
}

.tags-modal-footer .btn {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 0.625rem 1rem;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
}

.tags-modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.tags-modal-close {
  width: auto;
  margin: 0;
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: #667085;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.tags-modal-close:hover {
  color: #344054;
  background: transparent;
  border: none;
}

.tags-modal-body {
  padding: 16px 18px;
  overflow: auto;
}

.tags-modal-body input {
  width: 100%;
  margin: 0 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  box-sizing: border-box;
}

.tags-modal-meta {
  margin-bottom: 12px !important;
}

.tags-modal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags-modal-tag {
  width: auto;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.tags-modal-tag:hover,
.tags-modal-tag:focus-visible {
  background: #eff8ff;
  border-color: #84caff;
  outline: none;
}

.tags-modal-tag.is-selected {
  background: #eff8ff;
  border-color: #175cd3;
  color: #175cd3;
}

.tags-modal-empty {
  margin: 0;
  color: #667085;
  font-size: 14px;
}

.lens-image-upload-group .field-label {
  margin-bottom: 0.35rem;
}

.lens-image-upload {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.lens-image-preview-wrap {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.lens-image-upload.has-preview .lens-image-preview-wrap {
  display: flex;
}

.lens-image-upload.has-preview .lens-image-dropzone {
  display: none;
}

.lens-image-upload.has-preview .lens-detail-image {
  width: 100%;
  max-height: 280px;
}

.lens-image-remove-btn {
  width: auto;
  margin: 0;
}

.lens-image-dropzone {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  padding: 8px 12px;
  border: 1px dashed #b9c0d0;
  border-radius: 10px;
  background: #fff;
  color: #475467;
  cursor: pointer;
  text-align: center;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.lens-image-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lens-image-dropzone:hover,
.lens-image-dropzone.is-dragover {
  border-color: #175cd3;
  background: #eff8ff;
}

.lens-image-dropzone.is-uploading {
  opacity: 0.7;
  pointer-events: none;
}

.lens-image-dropzone.has-image {
  padding: 6px 10px;
}

.lens-image-dropzone.has-image .lens-image-dropzone-icon {
  display: none;
}

.lens-image-dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #eff8ff;
  color: #175cd3;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}

.lens-image-dropzone-text {
  font-size: 13px;
  font-weight: 600;
}

.lens-image-upload-status.is-error {
  background: #b42318;
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}

@media (max-width: 680px) {
  .lens-form .prefs-row,
  .lens-form .meta-row,
  .lens-form .lens-access-grid {
    grid-template-columns: 1fr;
  }

  .lens-form .persona-preset-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .lens-form .persona-preset-actions {
    padding-top: 0;
  }
}
