/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; cursor: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input  { font-family: inherit; }

/* ─── ShiftTools Custom Cursor ─── */
#shift-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 2000001;
  width: 20px;
  height: 20px;
  left: -50px;
  top: -50px;
  transition: width 0.13s, height 0.13s;
}
#shift-cursor svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.55));
  transition: filter 0.13s, transform 0.12s;
}
#shift-cursor.hover {
  width: 24px;
  height: 24px;
}
#shift-cursor.hover svg {
  filter: drop-shadow(0 0 9px rgba(96, 165, 250, 0.85));
}
#shift-cursor.click svg {
  transform: scale(0.85);
  filter: drop-shadow(0 0 12px rgba(147, 197, 253, 0.95));
}

#shift-trail {
  position: fixed;
  pointer-events: none;
  z-index: 2000000;
  width: 14px;
  height: 14px;
  opacity: 0.3;
  left: -50px;
  top: -50px;
  transition: left 0.2s ease-out, top 0.2s ease-out;
}
#shift-trail svg {
  width: 100%;
  height: 100%;
}

@media (hover: none), (pointer: coarse) {
  *, ::before, ::after {
    cursor: auto !important;
  }
  #shift-cursor, #shift-trail {
    display: none !important;
  }
}

/* Body */
body {
  background: #f0f0f0;
  font-family: "Inter", sans-serif;
  min-height: 100vh;
  padding: 40px 20px 60px;
}

/* Tool card wrapper */
.page-card {
  max-width: 960px;
  margin: 0 auto 48px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 0 0 1px #e0e0e0, 0 4px 6px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* App shell */
.app {
  display: flex;
  flex-direction: column;
  min-height: 560px;
}

/* ── HEADER ─────────────────────────────────────────── */
.app-header {
  padding: 36px 44px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f2f0ff;
  padding: 4px 11px;
  border-radius: 99px;
  margin-bottom: 14px;
}

.header-badge-dot {
  width: 6px;
  height: 6px;
  background: #7c5cfc;
  border-radius: 50%;
  animation: blink 2.5s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.35
  }
}

.header-badge span {
  font-size: 11px;
  font-weight: 500;
  color: #7c5cfc;
  letter-spacing: 0.03em;
}

.app-header h1 {
  font-size: 25px;
  font-weight: 300;
  color: #111;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.app-header h1 strong {
  font-weight: 600;
}

.app-header p {
  font-size: 13px;
  color: #aaa;
  font-weight: 300;
}

/* ── UPLOAD ZONE ────────────────────────────────────── */
.upload-wrap {
  padding: 24px 44px 0;
}

.upload-zone {
  border: 1.5px dashed #e2e2e2;
  border-radius: 14px;
  padding: 36px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}

.upload-zone:hover {
  border-color: #bbb;
  background: #f6f6f6;
}

.upload-zone.dragging {
  border-color: #7c5cfc;
  background: #faf8ff;
}

.upload-icon-wrap {
  width: 56px;
  height: 56px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ebebeb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.upload-text h3 {
  font-size: 14px;
  font-weight: 500;
  color: #111;
  margin-bottom: 4px;
}

.upload-text p {
  font-size: 12px;
  color: #bbb;
  line-height: 1.5;
}

.upload-text em {
  font-style: normal;
  color: #7c5cfc;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: #c4b5fd;
}

.upload-meta {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.upload-meta-badge {
  background: #f5f5f5;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  color: #999;
}

#file-input-pdf {
  display: none;
}

/* ── ERROR BANNER ───────────────────────────────────── */
.error-banner-wrap {
  padding: 8px 44px 0;
}

.error-banner {
  display: none;
  align-items: center;
  gap: 10px;
  background: #fff2f2;
  border: 1px solid #ffd0d0;
  border-radius: 10px;
  padding: 10px 16px;
}

.error-banner span {
  font-size: 12px;
  color: #cc3333;
  flex: 1;
}

.error-banner button {
  font-size: 14px;
  color: #cc3333;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.error-banner button:hover {
  background: #ffe0e0;
}

/* ── SECTION DIVIDER ────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 44px 0;
}

.sd-line {
  flex: 1;
  height: 1px;
  background: #f0f0f0;
}

.sd-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ccc;
}

/* ── PAGE GRID ──────────────────────────────────────── */
.pages-wrap {
  padding: 14px 44px 0;
}

.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.page-card-item {
  position: relative;
  user-select: none;
}

.page-thumb {
  aspect-ratio: 3/4;
  border-radius: 8px;
  border: 1.5px solid #ebebeb;
  overflow: hidden;
  transition: border-color 0.18s;
  position: relative;
  background: #fafafa;
  display: flex;
  align-items: stretch;
}

.page-thumb canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

.page-card-item:hover .page-thumb {
  border-color: #d0d0d0;
}

.page-num-tag {
  position: absolute;
  top: 5px;
  left: 6px;
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  background: rgba(0, 0, 0, 0.28);
  padding: 2px 5px;
  border-radius: 4px;
}

.page-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  color: #bbb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.15s;
  z-index: 2;
}

.page-remove:hover {
  background: #ff4444;
  border-color: #ff4444;
  color: #fff;
}

.page-label {
  font-size: 10px;
  color: #bbb;
  text-align: center;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── SETTINGS ───────────────────────────────────────── */
.settings-wrap {
  padding: 20px 44px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.setting-group {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 3px;
}

.setting-sep {
  width: 1px;
  height: 18px;
  background: #e0e0e0;
  margin: 0 4px;
}

.opt-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #888;
  transition: all 0.15s;
  white-space: nowrap;
}

.opt-btn:hover {
  color: #111;
}

.opt-btn.active {
  background: #111;
  color: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

/* ── SCOPE TOGGLE ───────────────────────────────────── */
.scope-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #f5f5f5;
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}

.scope-btn {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #999;
  transition: all 0.15s;
  white-space: nowrap;
}

.scope-btn.active {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── CUSTOM RANGE INPUT ─────────────────────────────── */
.custom-range-wrap {
  display: none;
  align-items: center;
}

.custom-range-wrap.visible {
  display: flex;
}

.custom-range-input {
  height: 34px;
  padding: 0 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 12px;
  color: #111;
  outline: none;
  width: 180px;
  transition: border-color 0.15s;
  background: #fff;
}

.custom-range-input::placeholder {
  color: #c0c0c0;
}

.custom-range-input:focus {
  border-color: #7c5cfc;
}

.custom-range-input.error {
  border-color: #ff4444;
}

/* ── EMPTY STATE ────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  text-align: center;
}

.empty-state p {
  font-size: 13px;
  color: #ccc;
  font-weight: 400;
}

.empty-state.loading p {
  color: #999;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid #e0e0e0;
  border-top-color: #7c5cfc;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  display: none;
}

.empty-state.loading .spinner {
  display: block;
}

.empty-state.loading .empty-icon {
  display: none;
}

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

/* ── FOOTER ─────────────────────────────────────────── */
.app-footer {
  margin-top: auto;
  padding: 20px 44px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-summary-main {
  font-size: 13px;
  font-weight: 500;
  color: #111;
}

.footer-summary-sub {
  font-size: 11px;
  color: #bbb;
}

.extract-btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 26px;
  background: #111;
  color: #fff;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}

.extract-btn:hover:not(:disabled) {
  background: #2d2d2d;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.extract-btn:active:not(:disabled) {
  transform: translateY(0);
}

.extract-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── SIDEBAR (desktop only) ─────────────────────────── */
.app-sidebar {
  display: none;
}

.sb-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ccc;
  margin-bottom: 22px;
}

.sb-stat-num {
  font-size: 36px;
  font-weight: 300;
  color: #111;
  letter-spacing: -0.04em;
  line-height: 1;
}

.sb-stat-label {
  font-size: 10px;
  color: #bbb;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
  margin-bottom: 6px;
}

.sb-progress-bar {
  height: 3px;
  background: #eee;
  border-radius: 2px;
  margin-bottom: 6px;
  overflow: hidden;
}

.sb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c5cfc, #a78bfa);
  border-radius: 2px;
  width: 0%;
  transition: width 0.4s;
}

.sb-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #bbb;
}

.sb-hr {
  border: none;
  border-top: 1px solid #ebebeb;
  margin: 18px 0;
}

.sb-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.sb-mini-card {
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  padding: 12px;
}

.sb-mini-val {
  font-size: 15px;
  font-weight: 500;
  color: #111;
  margin-bottom: 2px;
}

.sb-mini-lbl {
  font-size: 10px;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.sb-format-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ccc;
  margin-bottom: 10px;
}

.sb-format-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sb-format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #ebebeb;
}

.sb-format-name {
  font-size: 12px;
  font-weight: 500;
  color: #555;
}

.sb-format-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.04em;
}

.sb-format-badge.on {
  background: #f2f0ff;
  color: #7c5cfc;
}

.sb-format-badge.off {
  background: #f5f5f5;
  color: #ccc;
}

.sb-spacer {
  flex: 1;
}

/* ── FAQ SECTION ────────────────────────────────────── */
.faq-section {
  max-width: 960px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

.faq-section h2 {
  font-size: 20px;
  font-weight: 600;
  color: #111;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.faq-item {
  border-bottom: 1px solid #ebebeb;
  padding: 22px 0;
}

.faq-item:first-of-type {
  border-top: 1px solid #ebebeb;
}

.faq-item h3 {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  line-height: 1.45;
}

.faq-item p {
  font-size: 13px;
  color: #666;
  line-height: 1.75;
  font-weight: 400;
}

.faq-item p strong {
  color: #333;
  font-weight: 600;
}

.faq-item p code {
  background: #f5f5f5;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #555;
}

/* ── RESPONSIVE BREAKPOINTS ─────────────────────────── */

/* Mobile (<=480px) */
@media (max-width: 480px) {
  body {
    padding: 0 0 60px;
  }

  .page-card {
    border-radius: 0;
    margin: 0 0 40px;
  }

  .faq-section {
    padding: 0 16px;
    margin-top: 24px;
  }

  .app-header {
    padding: 22px 20px 0;
    flex-direction: column;
    gap: 12px;
  }

  .app-header h1 {
    font-size: 19px;
  }

  .app-header p {
    font-size: 12px;
  }

  .upload-wrap {
    padding: 16px 20px 0;
  }

  .upload-zone {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 20px;
    gap: 14px;
  }

  .upload-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }

  .upload-text h3 {
    font-size: 13px;
  }

  .upload-meta {
    margin-left: 0;
  }

  .error-banner-wrap {
    padding: 8px 20px 0;
  }

  .section-divider {
    padding: 16px 20px 0;
  }

  .pages-wrap {
    padding: 10px 20px 0;
  }

  .pages-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
  }

  .settings-wrap {
    padding: 16px 20px 0;
    gap: 5px;
  }

  .opt-btn {
    font-size: 11px;
    padding: 5px 12px;
  }

  .setting-sep {
    display: none;
  }

  .app-footer {
    padding: 14px 20px 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .extract-btn {
    width: 100%;
    justify-content: center;
    height: 50px;
    border-radius: 14px;
    font-size: 15px;
  }

  .app-sidebar {
    display: none !important;
  }
}

/* Tablet (481px–800px) */
@media (min-width: 481px) and (max-width: 800px) {
  .page-card {
    margin: 0 auto 40px;
    border-radius: 20px;
  }

  .app-header {
    padding: 30px 36px 0;
  }

  .app-header h1 {
    font-size: 22px;
  }

  .upload-wrap {
    padding: 20px 36px 0;
  }

  .error-banner-wrap {
    padding: 8px 36px 0;
  }

  .section-divider {
    padding: 18px 36px 0;
  }

  .pages-wrap {
    padding: 12px 36px 0;
  }

  .settings-wrap {
    padding: 18px 36px 0;
  }

  .app-footer {
    padding: 18px 36px 30px;
  }

  .app-sidebar {
    display: none !important;
  }
}

/* Desktop (>=801px) — two-column grid with sidebar */
@media (min-width: 801px) {
  .app {
    display: grid;
    grid-template-columns: 1fr 240px;
    grid-template-rows: auto auto auto auto auto auto 1fr auto;
    min-height: 560px;
  }

  .app-header {
    grid-column: 1;
    grid-row: 1;
  }

  .upload-wrap {
    grid-column: 1;
    grid-row: 2;
  }

  .error-banner-wrap {
    grid-column: 1;
    grid-row: 3;
  }

  .section-divider {
    grid-column: 1;
    grid-row: 4;
  }

  .pages-wrap {
    grid-column: 1;
    grid-row: 5;
  }

  .empty-state {
    grid-column: 1;
    grid-row: 6;
  }

  .settings-wrap {
    grid-column: 1;
    grid-row: 7;
  }

  .app-footer {
    grid-column: 1;
    grid-row: 8;
  }

  .app-sidebar {
    display: flex;
    flex-direction: column;
    grid-column: 2;
    grid-row: 1/-1;
    border-left: 1px solid #f0f0f0;
    padding: 30px 26px;
    background: #fafafa;
  }
}

/* ── SEO CONTENT ── */
.seo-section {
  max-width: 860px;
  margin: 48px auto 0;
  padding: 0 24px 80px;
  font-family: 'Inter', system-ui, sans-serif;
  color: #18181b;
}

.seo-divider {
  width: 48px;
  height: 3px;
  background: #3b82f6;
  border-radius: 99px;
  margin: 0 auto 56px;
}

.seo-block {
  margin-bottom: 52px;
}

.seo-block h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #18181b;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.seo-block p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: #71717a;
  margin-bottom: 12px;
}

.seo-steps {
  list-style: none;
  padding: 0;
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seo-steps li {
  counter-increment: steps;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.9375rem;
  color: #71717a;
  line-height: 1.6;
}

.seo-steps li::before {
  content: counter(steps);
  min-width: 26px;
  height: 26px;
  background: #3b82f6;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.seo-faq {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  overflow: hidden;
}

.seo-faq-item {
  border-bottom: 1px solid #e4e4e7;
}

.seo-faq-item:last-child {
  border-bottom: none;
}

.seo-faq-q {
  width: 100%;
  background: #fff;
  border: none;
  padding: 18px 20px;
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #18181b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.15s;
  font-family: 'Inter', system-ui, sans-serif;
}

.seo-faq-q:hover {
  background: #f4f4f5;
}

.seo-faq-q svg {
  flex-shrink: 0;
  transition: transform 0.2s;
  color: #71717a;
}

.seo-faq-q[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.seo-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fafafb;
  border-top: 1px solid transparent;
}

.seo-faq-item.open .seo-faq-a {
  border-top: 1px solid #f4f4f5;
}

.seo-faq-a-inner {
  font-family: 'Inter', system-ui, sans-serif;
  padding: 20px 24px;
  font-size: 0.875rem;
  line-height: 1.8;
  color: #52525b;
}

.seo-faq-a-inner strong {
  color: #18181b;
  font-weight: 600;
}

.seo-faq-a-inner code {
  background: #f4f4f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: #0f172a;
}


/* ── BACK TO TOOLS BUTTON ── */
.back-to-tools-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #71717a;
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.15s;
}

.back-to-tools-btn:hover {
  color: #111;
}

.back-to-tools-btn svg {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.back-to-tools-btn:hover svg {
  transform: translateX(-3px);
}

/* ── PREVIEW MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f4f4f5;
  color: #71717a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
  background: #e4e4e7;
  color: #111;
}

.modal-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  max-height: 70vh;
  overflow: hidden;
  position: relative;
  background: #fafafa;
  border-radius: 10px;
  border: 1px solid #eee;
  padding: 12px;
}

.modal-body canvas {
  max-width: 100%;
  max-height: calc(70vh - 24px);
  width: auto !important;
  height: auto !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: block;
}

.modal-body .spinner {
  position: absolute;
}