:root {
  --ink: #14273d;
  --muted: #617084;
  --navy: #102c48;
  --teal: #0f7a78;
  --teal-dark: #075b5d;
  --teal-soft: #e7f6f3;
  --gold: #d6a94d;
  --paper: #ffffff;
  --bg: #eef2f5;
  --line: #dce4e9;
  --danger: #b8463b;
  --success: #176d51;
  --shadow: 0 22px 65px rgba(16, 44, 72, 0.12);
  --font: Arial, "Segoe UI", Tahoma, "DejaVu Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(15, 122, 120, 0.10), transparent 29rem),
    radial-gradient(circle at 90% 16%, rgba(214, 169, 77, 0.11), transparent 28rem),
    var(--bg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 56px;
  padding: 9px max(20px, calc((100vw - 1180px) / 2));
  color: #fff;
  background: rgba(16, 44, 72, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.topbar .tabs {
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.topbar .tab-button {
  color: #c9d8de;
}

.topbar .tab-button:hover {
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--navy);
  background: #fff;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  color: #bcd1d8;
  font-size: 11px;
}

.health {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #c9d8de;
  font-size: 12px;
}

.health-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d6a94d;
  box-shadow: 0 0 0 5px rgba(214, 169, 77, 0.14);
}

.health.is-ok .health-dot {
  background: #55d39a;
  box-shadow: 0 0 0 5px rgba(85, 211, 154, 0.14);
}

.health.is-error .health-dot {
  background: #f28073;
  box-shadow: 0 0 0 5px rgba(242, 128, 115, 0.14);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 46px;
}

.hero {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  column-gap: 60px;
  align-items: end;
  margin-bottom: 36px;
}

.hero .eyebrow {
  grid-column: 1;
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  grid-column: 1;
  margin: 0;
  font-size: clamp(42px, 5.2vw, 70px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero > p:not(.eyebrow) {
  grid-column: 2;
  grid-row: 1 / span 2;
  max-width: 600px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 17px;
}

.flow {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.flow span {
  padding: 7px 11px;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.flow i {
  color: var(--teal);
  font-style: normal;
  font-weight: 800;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 22px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(16, 44, 72, 0.06);
}

.tab-button {
  padding: 8px 20px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  transition: 160ms ease;
}

.tab-button:hover {
  color: var(--navy);
}

.tab-button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  box-shadow: 0 10px 22px rgba(15, 122, 120, 0.24);
}

.preview-panel {
  padding: 20px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: #f4f7f8;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.zoom-control button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  transition: 120ms ease;
}

.zoom-control button:hover:not(:disabled) {
  color: var(--teal-dark);
  border-color: var(--teal);
}

.zoom-control button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.zoom-control span {
  min-width: 38px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.preview-frame-wrap {
  height: min(78vh, 900px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.preview-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

#convert-form {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(220, 228, 233, 0.96);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.step {
  display: block;
  margin-bottom: 3px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.text-button {
  padding: 7px 10px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.dropzone {
  display: flex;
  min-height: 120px;
  padding: 24px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--muted);
  background: #f5f8f9;
  border: 1.5px dashed #aec7cc;
  border-radius: 20px;
  cursor: pointer;
  text-align: center;
  transition: 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  background: var(--teal-soft);
  border-color: var(--teal);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.upload-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 11px;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 14px;
  font-size: 21px;
  font-weight: 800;
}

.dropzone strong {
  color: var(--navy);
  font-size: 14px;
}

.dropzone small {
  margin-top: 4px;
  font-size: 11px;
}

.dropzone em {
  margin-top: 12px;
  padding: 5px 9px;
  color: var(--teal-dark);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 17px 0;
  color: #8390a0;
  font-size: 10px;
  text-transform: uppercase;
}

.or::before,
.or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.field {
  display: block;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  color: #42546a;
  font-size: 11px;
  font-weight: 750;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid #ccd8df;
  border-radius: 12px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input,
.field select {
  height: 44px;
  padding: 0 12px;
}

.field textarea {
  height: 90px;
  padding: 12px;
  resize: none;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(15, 122, 120, 0.10);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.field.wide {
  grid-column: 1 / -1;
}

.safe-badge {
  padding: 6px 9px;
  color: var(--success);
  background: #e9f6ef;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.checks {
  display: none;
  gap: 8px;
  margin: 17px 0;
  padding: 13px 14px;
  background: #f4f7f8;
  border-radius: 14px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #4f6074;
  cursor: pointer;
  font-size: 11px;
}

.checks input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
}

code {
  padding: 2px 5px;
  color: #2d5268;
  background: #e8eef1;
  border-radius: 5px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
}

details {
  margin: 24px 0 26px;
  color: var(--muted);
  font-size: 11px;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

.detail-field {
  margin-top: 10px;
}

.primary-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border: 0;
  border-radius: 15px;
  box-shadow: 0 13px 28px rgba(15, 122, 120, 0.22);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-loader {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.primary-button.is-loading .button-loader {
  display: inline-block;
}

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

.status {
  display: none;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  margin-top: 14px;
  padding: 12px 13px;
  color: #58697d;
  background: #f5f7f8;
  border-left: 3px solid #98a8b7;
  border-radius: 0 12px 12px 0;
  font-size: 11px;
}

.status strong {
  color: var(--navy);
}

.status.is-success {
  background: #ecf8f2;
  border-color: var(--success);
}

.status.is-error {
  background: #fff0ee;
  border-color: var(--danger);
}

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

.notes article {
  position: relative;
  min-height: 160px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.notes article > span {
  display: inline-grid;
  width: 29px;
  height: 29px;
  margin-bottom: 12px;
  place-items: center;
  color: #fff;
  background: var(--navy);
  border-radius: 9px;
  font-size: 9px;
  font-weight: 800;
}

.notes h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.notes p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 35px;
  color: #728094;
  border-top: 1px solid #d7e0e5;
  font-size: 11px;
}

footer a {
  color: var(--teal-dark);
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 880px) {
  .shell {
    padding-top: 19px;
  }

  .hero,
  #convert-form,
  .notes {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 14px;
  }

  .hero .eyebrow,
  .hero h1,
  .hero > p:not(.eyebrow),
  .flow {
    grid-column: 1;
    grid-row: auto;
  }

  .hero > p:not(.eyebrow) {
    margin-top: 4px;
  }

  .workspace {
    margin-top: 26px;
  }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 50px;
    padding-inline: 14px;
  }

  .health span:last-child {
    display: none;
  }

  .shell,
  footer {
    width: min(100% - 20px, 1180px);
  }

  .shell {
    padding-top: 14px;
  }

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

  .flow {
    flex-wrap: wrap;
  }

  .panel {
    padding: 18px;
    border-radius: 18px;
  }

  .panel-heading {
    align-items: center;
  }

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

  .field.wide {
    grid-column: auto;
  }

  .safe-badge {
    display: none;
  }

  .topbar {
    gap: 8px;
  }

  .brand small {
    display: none;
  }

  .tabs {
    padding: 3px;
  }

  .tab-button {
    padding: 8px 12px;
    font-size: 11px;
  }

  .preview-frame-wrap {
    height: 65vh;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
