:root {
  --ink: #111827;
  --muted: #5d6675;
  --line: #d8dee8;
  --line-strong: #b8c2d1;
  --surface: #ffffff;
  --soft: #f6f8fb;
  --accent: #0f7ad7;
  --accent-dark: #075eb0;
  --green: #17833b;
  --green-soft: #dff7e7;
  --amber: #b76b05;
  --amber-soft: #fff7e6;
  --danger: #a43a35;
  --radius: 8px;
  --shadow: 0 18px 40px rgba(24, 34, 54, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0, #f7f9fc 760px, #ffffff 1200px);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1840px, calc(100vw - 56px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(42px, 4.2vw, 60px);
  line-height: 1.04;
}

.hero p {
  max-width: 900px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.converter-frame {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(520px, 2fr) minmax(280px, 0.78fr);
  min-height: 720px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-column,
.preview-column,
.queue-column {
  min-width: 0;
}

.control-column,
.queue-column {
  background: #fbfcfe;
}

.control-column {
  border-right: 1px solid var(--line);
}

.queue-column {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto auto;
  gap: 18px;
  border-left: 1px solid var(--line);
  padding: 34px 26px;
}

.panel-block {
  padding: 26px;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin: 0 0 18px;
  font-size: 20px;
  line-height: 1.2;
}

.dropzone {
  display: grid;
  min-height: 280px;
  place-items: center;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
}

.dropzone.is-dragging {
  border-color: var(--accent);
  background: #eef7ff;
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-icon {
  display: grid;
  width: 56px;
  height: 70px;
  place-items: center;
  border: 3px solid #657083;
  border-radius: 8px;
  color: #384252;
  font-size: 15px;
  font-weight: 800;
}

.dropzone p {
  margin: 12px 0 4px;
  color: #303848;
}

.dropzone span,
.dropzone small {
  color: var(--muted);
}

.primary-button,
.secondary-button,
.small-button,
.link-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  padding: 0 20px;
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button,
.small-button {
  padding: 0 16px;
  border-color: var(--line-strong);
  background: #fff;
  color: #273142;
}

.link-button {
  min-height: auto;
  padding: 6px 0 0;
  background: transparent;
  color: var(--accent);
}

.options-block {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.range-field > span:first-child,
.range-scale,
.color-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

output {
  color: var(--muted);
  font-weight: 600;
}

input[type="range"] {
  accent-color: var(--accent);
}

select,
input[type="text"] {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #273142;
  padding: 0 12px;
}

input[type="color"] {
  width: 54px;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
}

.color-control input[type="text"] {
  flex: 1;
  min-width: 0;
}

.check-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.preview-column {
  padding: 28px 30px 22px;
}

.preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.preview-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.card-heading,
.queue-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-heading h2,
.queue-heading h2 {
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.card-heading h2 span {
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-grid;
  min-height: 30px;
  place-items: center;
  padding: 0 12px;
  border-radius: 6px;
  background: #eef2f7;
  color: #4c5667;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.loaded,
.status-pill.ready {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.preview-box {
  display: grid;
  min-height: 360px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, #f7f9fc 25%, transparent 25%),
    linear-gradient(-45deg, #f7f9fc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f7f9fc 75%),
    linear-gradient(-45deg, transparent 75%, #f7f9fc 75%);
  background-color: #fff;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
}

.result-preview {
  background: #fff;
}

.preview-box img,
.preview-box canvas {
  display: block;
  max-width: 88%;
  max-height: 310px;
  object-fit: contain;
}

.empty-preview {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.details-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.details-box strong,
.details-box p {
  display: block;
  margin: 0;
}

.details-box p {
  margin-top: 8px;
  color: #303848;
}

.arrow {
  color: #697384;
  font-size: 48px;
  font-weight: 800;
  text-align: center;
}

.warning-note {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #eccd8f;
  border-radius: var(--radius);
  background: var(--amber-soft);
}

.warning-note span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  font-weight: 900;
}

.warning-note p,
.status-line {
  margin: 0;
  color: #4f3b13;
  line-height: 1.45;
}

.file-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.queue-empty {
  margin: 0;
  color: var(--muted);
}

.file-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.file-mini {
  display: grid;
  width: 38px;
  height: 48px;
  place-items: center;
  border: 2px solid #667085;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
}

.file-row strong,
.file-row span {
  display: block;
  overflow-wrap: anywhere;
}

.file-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.file-check {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.action-stack {
  display: grid;
  gap: 14px;
}

.convert-button {
  min-height: 60px;
  font-size: 18px;
}

.download-button {
  display: grid;
  min-height: 58px;
  place-items: center;
  text-decoration: none;
}

.is-disabled {
  pointer-events: none;
  color: #8b96a6;
  background: #f1f4f8;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.info-panel,
.content-panel,
.privacy-strip {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.info-panel {
  padding: 18px 22px;
}

.info-panel p {
  color: #394356;
  line-height: 1.55;
}

.step-list,
.check-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.step-list span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.step-list p,
.check-list li {
  margin: 0;
  color: #394356;
  line-height: 1.45;
}

.check-list li::before {
  content: "✓";
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  margin-right: 8px;
  border-radius: 50%;
  color: var(--green);
  font-weight: 900;
}

.faq-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item {
  display: flex;
  width: 100%;
  justify-content: space-between;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0 14px;
  color: #273142;
  text-align: left;
}

.faq-item::after {
  content: "⌄";
}

.faq-item[aria-expanded="true"]::after {
  content: "⌃";
}

.faq-list p {
  display: none;
  margin: 0;
  padding: 12px 14px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.faq-list p.is-open {
  display: block;
}

.content-panel {
  margin-top: 18px;
  padding: 22px 26px;
}

.content-panel p {
  color: #394356;
  line-height: 1.65;
}

.privacy-strip {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 14px 24px;
  border-color: #9cc7f2;
  background: #f1f7ff;
  color: #174477;
}

.privacy-strip span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #9cc7f2;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
}

.privacy-strip p {
  margin: 0;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(340px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #111827;
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .converter-frame {
    grid-template-columns: 1fr;
  }

  .control-column,
  .queue-column {
    border: 0;
  }

  .queue-column {
    border-top: 1px solid var(--line);
  }

  .support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 28px, 720px);
    padding-top: 22px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .preview-grid {
    grid-template-columns: 1fr;
  }

  .arrow {
    transform: rotate(90deg);
  }

  .support-grid {
    grid-template-columns: 1fr;
  }

  .panel-block,
  .preview-column,
  .queue-column {
    padding: 18px;
  }
}
