:root {
  --bg: #0f1117;
  --bg-card: #181b24;
  --bg-elevated: #1e2230;
  --border: #2a3042;
  --text: #e8eaef;
  --text-muted: #8b93a7;
  --primary: #5b8def;
  --primary-hover: #7aa3f5;
  --success: #3ecf8e;
  --warning: #f5a623;
  --error: #ef5b5b;
  --info: #5b8def;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.header__top .header__brand {
  margin-bottom: 0;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-link-badge {
  display: inline-flex;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--warning);
  color: #1a1306;
  font-size: 0.7rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.header__logo {
  height: 42px;
  width: auto;
  min-width: 150px;
  max-width: 200px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.header h1 { font-size: 1.25rem; font-weight: 700; }
.header p { font-size: 0.8rem; color: var(--text-muted); }

.steps-nav { display: flex; gap: 0.5rem; overflow-x: auto; }

.step-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: all 0.2s;
}

.step-btn:hover { border-color: var(--primary); color: var(--text); }
.step-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.step-num {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.main { flex: 1; padding: 1.5rem; }
.panel { display: none; animation: fadeIn 0.3s ease; }
.panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel__header { margin-bottom: 1.5rem; }
.panel__header--actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.panel__header--actions > div { flex: 1; min-width: 0; }
.panel__header h2 { font-size: 1.35rem; margin-bottom: 0.25rem; }
.panel__header p { color: var(--text-muted); font-size: 0.9rem; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card--full { margin-bottom: 1.25rem; }
.card__title { font-size: 0.95rem; font-weight: 600; margin-bottom: 1rem; }

.intent-card {
  border-color: rgba(91, 141, 239, 0.55);
  background: linear-gradient(180deg, rgba(91, 141, 239, 0.12), var(--bg-card) 42%);
}

.intent-card__title {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.intent-card__hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 0.9rem;
}

.intent-card input {
  font-size: 1.05rem;
}
.card__title { font-size: 0.95rem; font-weight: 600; margin-bottom: 1rem; }
.mt-lg { margin-top: 1.25rem; }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }

.keywords-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.kw-count {
  float: right;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.kw-count.has-matches { color: var(--success); }
.kw-count.no-matches { color: var(--error); }

.article-editor {
  position: relative;
  min-height: 280px;
}

.article-editor__highlight,
.article-editor__input {
  width: 100%;
  min-height: 280px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.article-editor__highlight {
  position: absolute;
  inset: 0;
  overflow: auto;
  pointer-events: none;
  color: transparent;
  background: var(--bg);
}

.article-editor__input {
  position: relative;
  z-index: 1;
  resize: vertical;
  background: transparent;
  color: var(--text);
}

.article-editor__input:focus {
  outline: none;
  border-color: var(--primary);
}

.article-editor__highlight mark {
  border-radius: 3px;
  color: transparent;
}

.kw-highlight--1 { background: rgba(91, 141, 239, 0.35); }
.kw-highlight--2 { background: rgba(62, 207, 142, 0.35); }
.kw-highlight--3 { background: rgba(245, 166, 35, 0.4); }

@media (max-width: 700px) { .keywords-row { grid-template-columns: 1fr; } }

.input-row { display: flex; gap: 0.5rem; }
.input-row input { flex: 1; }

.char-count { float: right; font-weight: 400; font-size: 0.75rem; }
.char-count.ok { color: var(--success); }
.char-count.warn { color: var(--warning); }
.char-count.bad { color: var(--error); }

.slug-input {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.slug-prefix {
  padding: 0.65rem 0.5rem 0.65rem 0.85rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.slug-input input { border: none; background: transparent; flex: 1; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn {
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--secondary { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }
.btn--ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn--ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn--sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  text-decoration: underline;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(91, 141, 239, 0.05);
}

.dropzone__icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.dropzone__hint { font-size: 0.75rem; color: var(--text-muted); }
.dropzone__preview { max-width: 100%; max-height: 280px; object-fit: contain; border-radius: var(--radius-sm); }
.dropzone--multi {
  min-height: 140px;
  margin-bottom: 0.75rem;
}

.images-summary {
  font-size: 0.85rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.image-thumb {
  position: relative;
  width: 100px;
  height: 100px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.2s, transform 0.15s;
}

.image-thumb:hover { border-color: var(--primary); transform: scale(1.03); }
.image-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(91, 141, 239, 0.3); }

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-thumb__score {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
}

.image-thumb__score.ok { background: var(--success); }
.image-thumb__score.warn { background: var(--warning); }
.image-thumb__score.fail { background: var(--error); }

.image-thumb__star {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 0.85rem;
  color: var(--warning);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.image-thumb__label {
  position: absolute;
  bottom: 4px;
  left: 4px;
  font-size: 0.65rem;
  background: rgba(0,0,0,0.65);
  color: #fff;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.image-detail-preview-wrap {
  position: relative;
  margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  max-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-detail-preview {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.image-role-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
}

.image-role-badge--featured {
  background: var(--warning);
  color: #000;
}

.image-detail-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.checklist-note {
  padding: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.btn--danger:hover {
  border-color: var(--error);
  color: var(--error);
}

.export-block--wide { grid-column: 1 / -1; }

.hidden,
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


.score-ring { position: relative; width: 120px; height: 120px; margin: 0 auto 1rem; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring__bg { fill: none; stroke: var(--border); stroke-width: 8; }
.score-ring__fill {
  fill: none;
  stroke: var(--success);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.6s ease, stroke 0.3s;
}

.score-ring__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring__text span { font-size: 1.75rem; font-weight: 700; }
.score-ring__text small { font-size: 0.75rem; color: var(--text-muted); }

.checklist { list-style: none; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.checklist li:last-child { border-bottom: none; }

.check-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.check-icon--pass { background: rgba(62, 207, 142, 0.15); color: var(--success); }
.check-icon--fail { background: rgba(239, 91, 91, 0.15); color: var(--error); }
.check-icon--warn { background: rgba(245, 166, 35, 0.15); color: var(--warning); }
.check-icon--info { background: rgba(91, 141, 239, 0.15); color: var(--info); }
.check-text { flex: 1; }
.check-detail { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }

.kw-ranking {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.45rem;
}

.kw-ranking__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--bg);
}

.kw-ranking__term { color: var(--text); font-weight: 500; }
.kw-ranking__count {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.platform-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.platform-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.platform-badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.platform-badge--ok { background: rgba(62, 207, 142, 0.15); color: var(--success); }
.platform-badge--warn { background: rgba(245, 166, 35, 0.15); color: var(--warning); }
.platform-badge--fail { background: rgba(239, 91, 91, 0.15); color: var(--error); }
.platform-specs { font-size: 0.75rem; color: var(--text-muted); line-height: 1.6; }

.platform-notice {
  grid-column: 1 / -1;
  background: rgba(91, 141, 239, 0.08);
  border: 1px solid rgba(91, 141, 239, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.25rem;
}

.platform-notice p {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.platform-notice p:last-of-type { margin-bottom: 0.65rem; }

.platform-notice--warn {
  background: rgba(245, 166, 35, 0.08);
  border-color: rgba(245, 166, 35, 0.35);
}

.crop-warning { color: var(--warning); }

.trends-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.trends-embed {
  min-height: 400px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.trends-embed iframe { width: 100%; height: 450px; border: none; }

.trends-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.trends-placeholder small { margin-top: 0.5rem; font-size: 0.75rem; max-width: 400px; }

#articleContent {
  min-height: 280px;
  resize: vertical;
}

.serp-preview {
  margin-top: 0.75rem;
  padding: 1rem;
  background: #fff;
  border-radius: var(--radius-sm);
}

.serp-preview__title {
  font-size: 1.1rem;
  color: #1a0dab;
  margin-bottom: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serp-preview__url { font-size: 0.8rem; color: #006621; margin-bottom: 0.25rem; }
.serp-preview__desc {
  font-size: 0.8rem;
  color: #545454;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.social-preview { display: flex; flex-direction: column; gap: 1rem; }
.social-card { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }

.social-card__image {
  height: 160px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  background-size: cover;
  background-position: center;
}

.social-card__body { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.15rem; }
.social-card__domain { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }
.social-card__title { font-size: 0.85rem; font-weight: 600; }
.social-card__desc { font-size: 0.75rem; color: var(--text-muted); }

.tips-list { list-style: none; }
.tips-list li { padding: 0.5rem 0; font-size: 0.85rem; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.tips-list li::before { content: '💡 '; }

.rankmath-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.overall-score { display: flex; align-items: baseline; gap: 0.15rem; }
.overall-score__value { font-size: 2.5rem; font-weight: 700; color: var(--success); }
.overall-score__label { font-size: 1rem; color: var(--text-muted); }

.rankmath-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.rankmath-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  user-select: none;
}

.rankmath-section__header:hover { background: var(--bg-elevated); }
.rankmath-section__title { font-weight: 600; font-size: 0.9rem; }

.rankmath-section__status {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
}

.status--ok { background: rgba(62, 207, 142, 0.15); color: var(--success); }
.status--warn { background: rgba(245, 166, 35, 0.15); color: var(--warning); }
.status--fail { background: rgba(239, 91, 91, 0.15); color: var(--error); }

.rankmath-section__body { padding: 0 1.25rem 1rem; display: none; }
.rankmath-section.open .rankmath-section__body { display: block; }
.rankmath-section__chevron { transition: transform 0.2s; color: var(--text-muted); margin-right: 0.5rem; }
.rankmath-section.open .rankmath-section__chevron { transform: rotate(90deg); }

.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.export-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.export-block label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.export-block code {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  word-break: break-all;
  margin-bottom: 0.5rem;
}

.export-images-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.export-images-header label {
  margin-bottom: 0;
}

.export-images-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.export-images-empty {
  margin: 0;
  grid-column: 1 / -1;
}

.export-image-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.export-image-card--featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.15);
}

.export-image-card__title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

.export-image-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.5rem;
  align-items: start;
  margin-bottom: 0.65rem;
}

.export-image-field:last-child {
  margin-bottom: 0;
}

.export-image-field__label {
  grid-column: 1 / -1;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.export-image-field code {
  margin-bottom: 0;
  min-height: 2.4rem;
}

.text-muted { color: var(--text-muted); font-size: 0.85rem; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  bottom: 0;
}

.footer__progress { font-size: 0.85rem; color: var(--text-muted); }

.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
  box-shadow: var(--shadow);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal__dialog {
  position: relative;
  width: min(1100px, 100%);
  max-height: calc(100vh - 3rem);
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal__dialog--wide {
  width: min(1200px, 100%);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal__body {
  padding: 1.25rem;
}

.crop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
}

.crop-stage {
  min-height: 420px;
  background: #0a0c12;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.crop-stage img {
  display: block;
  max-width: 100%;
}

.crop-sidebar {
  display: flex;
  flex-direction: column;
}

@media (max-width: 860px) {
  .crop-layout {
    grid-template-columns: 1fr;
  }

  .crop-stage {
    min-height: 320px;
  }
}
