/* ==========================================================================
   Images Studio (Генерация изображений Tokvian)
   ========================================================================== */

.app-content[data-page=images] {
  padding-top: 14px;
  padding-bottom: 20px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

[data-page=images] .page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 52px;
  height: 52px;
  padding: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  gap: 16px;
  box-sizing: border-box;
}

[data-page=images] .page-header h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f4f4f6;
  margin: 0;
  height: 36px;
  line-height: 36px;
  display: inline-flex;
  align-items: center;
}

[data-page=images] .page-header .btn {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 14px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e2e8;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-page=images] .page-header .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: translateY(-1px);
}

/* Workspace Grid */
.image-workspace {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  width: 100%;
  overflow-x: hidden;
}

/* Left Panel: Settings */
.image-settings {
  background: linear-gradient(165deg, rgba(26, 27, 34, 0.75) 0%, rgba(16, 17, 22, 0.85) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 18px !important;
  padding: 20px !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(24px) !important;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.image-settings::-webkit-scrollbar,
.image-settings form#image-form::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.image-settings .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 2px;
}

.image-settings .panel-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #f4f4f6;
  margin: 0;
}

.image-settings .panel-head svg {
  width: 18px;
  height: 18px;
  color: var(--accent, #9aefd2);
  filter: drop-shadow(0 0 8px rgba(154, 239, 210, 0.45));
}

.image-settings .field {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.image-settings .field label {
  font-size: 12px;
  font-weight: 550;
  color: #a4a4b2;
  letter-spacing: 0.01em;
}

/* Custom Model Select */
#image-model {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.035) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a4a4b2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 9.5px 38px 9.5px 13px;
  color: #f2f2f5;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

#image-model:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.055);
}

#image-model:focus {
  outline: none;
  border-color: var(--accent, #9aefd2);
  box-shadow: 0 0 0 3px rgba(154, 239, 210, 0.15);
  background-color: rgba(255, 255, 255, 0.06);
}

#image-model option {
  background: #18191f;
  color: #f4f4f6;
  padding: 10px;
}

/* Reference Photo Upload */
.image-reference-label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  font-weight: 550;
  color: #a4a4b2;
  margin-bottom: 2px;
}

.image-reference-label small {
  font-size: 11px;
  color: #727282;
  font-weight: 400;
}

.image-upload-button,
.field label.image-upload-button,
.image-settings .field label.image-upload-button {
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 38px;
  padding: 0 14px !important;
  border: 1.5px dashed rgba(154, 239, 210, 0.35) !important;
  border-radius: 11px;
  cursor: pointer;
  color: var(--accent, #9aefd2) !important;
  background: rgba(154, 239, 210, 0.03);
  font-size: 12.5px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  overflow: hidden;
  box-sizing: border-box !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-upload-button svg,
.image-upload-button .icon {
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0 !important;
}

.image-upload-button span {
  display: inline !important;
  white-space: nowrap !important;
}

.image-upload-button:hover:not(.is-disabled) {
  background: rgba(154, 239, 210, 0.065);
  border-color: rgba(154, 239, 210, 0.5);
  transform: translateY(-1px);
}

.image-upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.image-upload-button.is-disabled {
  opacity: 0.5;
  cursor: wait;
}

.image-upload-note {
  font-size: 11px;
  color: #727282;
  margin: 5px 0 0 2px;
  line-height: 1.4;
}

.image-reference-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 6px;
  min-width: 0;
}

.image-reference-preview > img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
  flex-shrink: 0;
}

.image-reference-preview > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.image-reference-preview strong {
  font-size: 12px;
  font-weight: 600;
  color: #f2f2f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-reference-preview small {
  font-size: 11px;
  color: #848494;
}

.image-reference-preview .btn {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  align-self: flex-start;
  margin-top: 2px;
}

/* Prompt Textarea */
#image-prompt {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 10px 13px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  color: #f2f2f5;
  resize: vertical;
  min-height: 84px;
  max-height: 160px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

#image-prompt:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.18);
}

#image-prompt:focus {
  outline: none;
  border-color: var(--accent, #9aefd2);
  box-shadow: 0 0 0 3px rgba(154, 239, 210, 0.15);
  background: rgba(255, 255, 255, 0.05);
}

/* Quick prompt suggestion chips */
.image-prompt-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.prompt-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 3.5px 9.5px;
  font-size: 11px;
  font-weight: 500;
  color: #9c9cae;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.prompt-chip:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: translateY(-1px);
}

/* Specs Row */
.image-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 0;
  border: none;
}

.image-specs > span {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 11px;
  padding: 8px 12px;
  font-size: 10.5px;
  color: #828292;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
}

.image-specs strong {
  display: block;
  font-family: var(--mono, monospace);
  font-size: 14px;
  font-weight: 600;
  color: #f4f4f6;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: -0.01em;
}

/* Create Button */
.image-settings .btn.primary.wide {
  min-height: 44px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  background: var(--accent, #9aefd2);
  color: #082119;
  border: 1px solid #bbf8e2;
  box-shadow: 0 4px 18px rgba(154, 239, 210, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-settings .btn.primary.wide:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 26px rgba(154, 239, 210, 0.45);
  background: #bbf8e2;
}

.image-settings .btn.primary.wide:disabled {
  opacity: 0.35;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.image-form-note {
  font-size: 11px;
  color: #727282;
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

.image-settings .form-error {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  color: #fca5a5;
}

.image-settings .form-error:empty {
  display: none;
}

/* Right Panel: Result Viewport */
.image-result {
  background: linear-gradient(165deg, rgba(20, 21, 27, 0.6) 0%, rgba(13, 14, 18, 0.75) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 18px !important;
  padding: 24px !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(24px) !important;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.image-result .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 2px;
  flex-shrink: 0;
}

.image-result .panel-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #f4f4f6;
  margin: 0;
}

.image-result .panel-head .pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #8e8e9e;
  padding: 4px 10px;
  border-radius: 14px;
}

.image-result .panel-head .btn.small {
  background: rgba(154, 239, 210, 0.1);
  border: 1px solid rgba(154, 239, 210, 0.28);
  color: var(--accent, #9aefd2);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
}

.image-result .panel-head .btn.small:hover {
  background: rgba(154, 239, 210, 0.2);
  border-color: rgba(154, 239, 210, 0.5);
  transform: translateY(-1px);
}

/* Empty State Canvas */
.image-empty {
  flex: 1;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  background: radial-gradient(circle at 50% 45%, rgba(154, 239, 210, 0.035) 0%, rgba(255, 255, 255, 0.003) 60%, transparent 80%);
  border: none !important;
  border-radius: 16px;
}

.image-empty-icon,
.image-empty-loader {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(154, 239, 210, 0.06);
  border: 1px solid rgba(154, 239, 210, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #9aefd2);
  box-shadow: 0 0 30px rgba(154, 239, 210, 0.12);
  margin-bottom: 18px;
}

.image-empty-icon svg {
  width: 26px;
  height: 26px;
}

.image-empty h3 {
  font-size: 17px;
  font-weight: 600;
  color: #f2f2f6;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.image-empty p {
  font-size: 13px;
  color: #828290;
  max-width: 320px;
  line-height: 1.6;
  margin: 0;
}

/* Progress State */
.image-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent, #9aefd2);
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(154, 239, 210, 0.25);
  border-radius: 11px;
  background: rgba(154, 239, 210, 0.06);
}

.image-progress .loader {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Result Image */
.image-result > img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 280px);
  object-fit: contain;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}

.image-result-note {
  font-size: 12px;
  color: #828290;
  text-align: center;
  margin-top: 14px;
  flex-shrink: 0;
}

/* API Snippets & Prices */
.image-prices {
  padding: 18px 20px;
  margin-top: 18px;
}

.image-prices > summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.image-prices > summary > span {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 12px;
}

tbody.image-price-list {
  display: table-row-group !important;
}

/* Responsive */
@media (min-width: 901px) and (min-height: 550px) {
  .app-content[data-page=images] {
    height: calc(100dvh - var(--topbar-height, 64px));
    max-height: calc(100dvh - var(--topbar-height, 64px));
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 10px;
    padding-bottom: 12px;
    box-sizing: border-box;
  }

  [data-page=images] .page-header {
    flex-shrink: 0;
    margin-bottom: 8px;
    min-height: 38px;
    height: 38px;
  }

  .image-workspace {
    flex: 1;
    min-height: 0;
    height: 100%;
    align-items: stretch;
  }

  .image-settings {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding: 14px 18px !important;
  }

  .image-settings::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .image-settings .panel-head {
    flex-shrink: 0;
    margin-bottom: 6px;
  }

  .image-settings form#image-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding-right: 0 !important;
  }

  .image-settings form#image-form::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .image-billing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    box-sizing: border-box;
  }

  .image-billing-row .chat-usage {
    font-size: 11.5px;
    color: #9aefd2;
    font-weight: 550;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .image-billing-row .btn {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    border-radius: 7px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .image-settings form#image-form .field {
    margin-bottom: 6px;
  }

  .image-settings .image-reference-label {
    margin-bottom: 2px;
  }

  .image-settings .image-upload-button,
  .image-settings .field label.image-upload-button {
    min-height: 32px !important;
    padding: 0 12px !important;
  }

  .image-settings .image-ratio-grid {
    gap: 5px;
  }

  .image-settings .image-ratio-btn {
    padding: 4px 7px;
    font-size: 11px;
  }

  .image-settings #image-prompt {
    min-height: 48px;
    max-height: 95px;
    padding: 7px 11px;
  }

  .image-settings .image-prompt-suggestions {
    margin-top: 4px;
    gap: 4px;
  }

  .image-settings .prompt-chip {
    padding: 2px 7px;
    font-size: 10.5px;
  }

  .image-settings .image-specs {
    margin: 6px 0 8px;
    gap: 6px;
  }

  .image-settings .image-specs span {
    padding: 5px 8px;
  }

  .image-settings .image-form-note {
    margin-top: 6px;
  }

  .image-result {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px 20px !important;
  }

  .image-result .panel-head {
    flex-shrink: 0;
    margin-bottom: 10px;
  }

  .image-empty {
    flex: 1;
    min-height: 0;
    height: 100%;
  }

  .image-result > img {
    flex: 1;
    min-height: 0;
    max-height: calc(100% - 38px);
    width: 100%;
    object-fit: contain;
  }
}

@media (max-width: 900px) {
  .image-workspace {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .image-result {
    min-height: 400px;
  }
}

/* Format & Aspect Ratio Selector */
.image-size-field {
  margin-bottom: 12px;
}

.image-size-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8e8e9e;
  margin-bottom: 6px;
}

.image-ratio-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.ratio-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5.5px 6px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #c8c8d0;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  user-select: none;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.ratio-chip:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

.ratio-chip.is-active {
  background: rgba(154, 239, 210, 0.08);
  border-color: rgba(154, 239, 210, 0.45);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(154, 239, 210, 0.25), inset 0 0 12px rgba(154, 239, 210, 0.06);
}

.ratio-chip.is-active .ratio-icon {
  stroke: #9aefd2;
  color: #9aefd2;
}

.ratio-chip .ratio-icon {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  stroke: currentColor;
  stroke-width: 2;
  transition: stroke 0.18s ease;
}

.ratio-chip span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  line-height: 1.15;
}

.ratio-chip strong {
  font-size: 10.5px;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ratio-chip small {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.45);
  font-family: inherit;
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.ratio-chip.is-active small {
  color: rgba(154, 239, 210, 0.85);
}

.ratio-chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Result Actions & Lightbox */
.image-result-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-result-head-actions .btn.small.secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e2e8;
}

.image-result-head-actions .btn.small.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  transform: translateY(-1px);
}

#generated-image[data-action="image-fullscreen"] {
  cursor: zoom-in;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

#generated-image[data-action="image-fullscreen"]:hover {
  transform: scale(1.008);
  border-color: rgba(154, 239, 210, 0.35);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75), 0 0 24px rgba(154, 239, 210, 0.15);
}

/* Lightbox Modal Dialog */
dialog.image-lightbox-dialog {
  width: min(1200px, 94vw) !important;
  max-width: 94vw !important;
  max-height: 94vh !important;
  height: min(880px, 94vh);
  padding: 16px 20px 20px !important;
  display: flex;
  flex-direction: column;
  background: rgba(13, 14, 18, 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(32px) !important;
  overflow: hidden;
  box-sizing: border-box;
}

.image-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  gap: 12px;
}

.image-lightbox-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.image-lightbox-title-wrap h2 {
  font-size: 17px;
  font-weight: 700;
  color: #f4f4f6;
  margin: 0;
}

.image-lightbox-title-wrap .pill {
  font-size: 11px;
  font-family: var(--mono, monospace);
  font-weight: 600;
  background: rgba(154, 239, 210, 0.08);
  border: 1px solid rgba(154, 239, 210, 0.25);
  color: #9aefd2;
  padding: 3px 8px;
  border-radius: 10px;
}

.image-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-lightbox-viewport {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin-top: 14px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0.5) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  overflow: auto;
}

.image-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.7);
  user-select: none;
}

@media (max-width: 600px) {
  .image-ratio-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
}
@media (max-width: 360px) {
  .image-ratio-chips {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
@media (max-width: 600px) {
  dialog.image-lightbox-dialog {
    width: 98vw !important;
    max-width: 98vw !important;
    max-height: 96vh !important;
    padding: 12px 14px 14px !important;
    border-radius: 16px !important;
  }
  .image-lightbox-viewport {
    padding: 8px;
  }
}

