/* ── Font converter page layout ──────────────────────────── */

body.fonts-page .tool-wrap {
  display: block;
  max-width: 1280px;
  margin: 0 auto;
  padding: 52px 0 80px;
}

/* Outer 2-col grid: [left] [settings] / [actions full-width] */
body.fonts-page .fc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  grid-template-areas:
    "left     settings"
    "actions  actions"
    "preview  preview";
  gap: 24px 28px;
  align-items: stretch;
  margin-top: 32px;
}

/* Left column: flex column so fc-extra fills remaining height */
body.fonts-page .fc-left {
  grid-area: left;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

body.fonts-page .fc-picker {
  flex-shrink: 0;
}

body.fonts-page .fc-extra {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Right column */
body.fonts-page .fc-settings {
  grid-area: settings;
}

/* Shared panel border */
body.fonts-page .fc-panel {
  border: 1px solid var(--line);
  padding: 20px;
  box-sizing: border-box;
}

/* Log box inside fc-extra: fixed height, scrollable */
body.fonts-page .fc-extra .log-box {
  max-height: 160px;
  overflow-y: auto;
  margin-top: 6px;
}

/* Preview text inside fc-extra */
body.fonts-page .fc-extra .preview-text {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  resize: vertical;
}

/* Canvas preview grows to fill fc-extra's remaining space */
body.fonts-page #device-preview-grid {
  display: flex !important;
  flex-direction: column;
  gap: 24px;
  margin-top: 12px;
}

body.fonts-page .preview-size-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

body.fonts-page .preview-size-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Each style stacks vertically, fills full left-column width */
body.fonts-page .preview-style-strip {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 16px;
}

body.fonts-page .preview-swatch {
  width: 100%;
}

body.fonts-page .preview-viewport {
  display: block !important;
  width: 100%;
  margin-top: 4px;
  overflow: hidden;
}

body.fonts-page .preview-viewport canvas {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Full-width live preview */
body.fonts-page .fc-preview {
  grid-area: preview;
}

/* Actions row: full width below both columns */
body.fonts-page .fc-actions-row {
  grid-area: actions;
  border: 1px solid var(--line);
  padding: 16px 20px;
}

body.fonts-page .fc-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

body.fonts-page .fc-actions-row .progress-wrap {
  flex: 1;
  min-width: 80px;
  margin-top: 0;
}

body.fonts-page .fc-actions-row .status-bar {
  margin-top: 10px;
}

body.fonts-page .fc-actions-row .progress-label {
  margin-top: 4px;
}

/* ── Responsive ── */
@media (max-width: 820px) {
  body.fonts-page .fc-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "settings"
      "actions"
      "preview";
  }

  body.fonts-page .tool-wrap {
    padding: 36px 0 60px;
  }
}
