:root {
  --bg: #4d6178;
  --panel: #59708a;
  --panel-dark: #43566c;
  --panel-line: #324154;
  --text: #f5f1e7;
  --muted: #bdcad8;
  --field: #c7d3de;
  --field-text: #5f7389;
  --button-text: #f4f4ef;
  --convert: #03cb2d;
  --convert-bright: #12e338;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  background: radial-gradient(circle at top, #6a819c 0%, var(--bg) 55%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.05rem 2.25rem 0.95rem;
  border-bottom: 2px solid var(--panel-line);
  background: rgba(58, 74, 92, 0.2);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.topbar img {
  max-height: 82px;
  width: auto;
}

.panel {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 1.6rem;
  padding: 1.05rem 2.15rem 0.9rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  align-content: start;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  min-width: 0;
}

.title-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.title-group {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

#sequence-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

#sequence-year,
#sequence-meta {
  color: var(--muted);
}

#sequence-year {
  font-size: 1.6rem;
}

#sequence-meta {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.drop-zone {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--field);
  border: 3px solid transparent;
  cursor: pointer;
  border-radius: 10px;
  transition: border-color 120ms ease, transform 120ms ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  transform: translateY(-1px);
}

.drop-zone.drag-over {
  border-color: var(--convert);
}

.drop-copy h3 {
  margin: 0;
  color: var(--field-text);
  font-size: 1.2rem;
  font-weight: 500;
}

.field-block label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1.02rem;
  font-weight: 600;
}

.field-block p {
  margin: 0 0 0.38rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.compact-field p {
  margin-bottom: 0;
}

.field-block input,
.field-block select {
  width: 100%;
  border: 0;
  background: var(--field);
  color: var(--field-text);
  font: 0.98rem "Helvetica Neue", sans-serif;
  padding: 0.68rem 0.9rem;
  outline: none;
  border-radius: 10px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
}

.checkbox-row input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--convert);
}

.checkbox-row span {
  font-size: 0.94rem;
  font-weight: 600;
}

.web-status {
  margin: 0;
  color: rgba(245, 241, 231, 0.8);
  font-size: 0.88rem;
  line-height: 1.45;
}

.metadata-field {
  padding-top: 0.1rem;
}

.convert-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.6rem;
}

.support-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding-top: 0.35rem;
}

.support-link {
  color: rgba(245, 241, 231, 0.78);
  text-decoration: none;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}

.support-link:hover {
  color: var(--text);
}

.support-link-donate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 241, 231, 0.16);
  background: rgba(255, 248, 232, 0.08);
  color: var(--text);
  font-weight: 600;
}

.support-link-donate:hover {
  background: rgba(255, 248, 232, 0.14);
}

.support-link-convert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--convert-bright), var(--convert));
  color: var(--button-text);
  font-weight: 700;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 2px 0 rgba(1, 109, 23, 0.42);
}

.support-link-convert:hover {
  background: linear-gradient(180deg, #12d936, #02b928);
  color: var(--button-text);
  filter: brightness(0.96);
}

.convert-button {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--convert-bright), var(--convert));
  color: var(--button-text);
  font: 700 1.08rem/1 "Avenir Next", "Helvetica Neue", sans-serif;
  letter-spacing: 0.03em;
  padding: 0.9rem 1.7rem;
  min-width: 208px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 2px 0 rgba(1, 109, 23, 0.42);
  transition: filter 120ms ease, transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.convert-button:hover {
  background: linear-gradient(180deg, #12d936, #02b928);
  filter: brightness(0.94);
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 1px 0 rgba(39, 39, 39, 0.22);
}

.convert-button:disabled,
.drop-zone:disabled,
.reference-zone:disabled {
  opacity: 0.6;
  cursor: default;
}

.credit {
  padding: 0 2.15rem 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 0.84rem;
  color: rgba(245, 241, 231, 0.8);
}

.footer-link {
  margin-left: 0.65rem;
  color: rgba(245, 241, 231, 0.9);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--text);
}

.ad-strip {
  display: none;
  padding: 0 2.15rem 1rem;
}

.ad-strip.has-fill {
  display: block;
}

.ad-strip-inner {
  max-width: 920px;
  margin-left: clamp(88px, 11vw, 212px);
}

.page-ad-shell {
  display: none;
}

.page-ad-shell.has-fill {
  display: block;
}

.page-ad-label {
  margin-bottom: 0.55rem;
  color: rgba(245, 241, 231, 0.5);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-ad-slot {
  min-height: 0;
  overflow: hidden;
}

.ad-mounts {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.seo-copy {
  padding: 0 2.15rem 1.6rem;
}

.seo-inner {
  max-width: 920px;
  margin-left: clamp(88px, 11vw, 212px);
  padding: 1.4rem 1.6rem 1.5rem;
  border-top: 1px solid rgba(245, 241, 231, 0.12);
  color: rgba(245, 241, 231, 0.92);
}

.seo-inner h2,
.seo-inner h3,
.seo-inner h4 {
  margin: 0;
  color: var(--text);
}

.seo-inner h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 0.9rem;
}

.seo-inner h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: 1.2rem;
  margin-bottom: 0.45rem;
}

.seo-inner h4 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-top: 0.95rem;
  margin-bottom: 0.28rem;
}

.seo-inner p,
.seo-inner li {
  color: rgba(245, 241, 231, 0.84);
  font-size: 0.95rem;
  line-height: 1.65;
}

.seo-inner p {
  margin: 0 0 0.72rem;
}

.seo-inner ul {
  margin: 0.15rem 0 0.9rem 1.2rem;
  padding: 0;
}

.seo-inner li + li {
  margin-top: 0.18rem;
}

.progress-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(25, 35, 48, 0.48);
  backdrop-filter: blur(8px);
  z-index: 30;
}

.progress-overlay.visible {
  display: grid;
}

.progress-card {
  width: min(90vw, 420px);
  padding: 1.4rem 1.5rem 1.25rem;
  background: rgba(35, 48, 63, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.progress-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.18rem;
}

.progress-card p {
  margin: 0 0 1rem;
  color: rgba(245, 241, 231, 0.78);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.progress-bar {
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #96f771, #22d14f);
  animation: progressLoop 1.1s ease-in-out infinite;
}

@keyframes progressLoop {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(260%);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  transform: translate(-50%, 18px);
  min-width: 220px;
  max-width: calc(100vw - 2rem);
  padding: 0.85rem 1rem;
  border-radius: 999px;
  background: rgba(27, 38, 49, 0.96);
  color: var(--text);
  font-size: 0.92rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 40;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .panel,
  .panel-no-poster {
    grid-template-columns: 1fr;
  }

  .panel-no-poster .content {
    grid-column: 1;
    max-width: 100%;
  }

  .convert-row {
    justify-content: stretch;
  }

  .convert-button {
    width: 100%;
  }

  .support-row {
    justify-content: flex-start;
  }

  .seo-copy {
    padding: 0 1rem 1.2rem;
  }

  .ad-strip {
    padding: 0 1rem 1rem;
  }

  .ad-strip-inner {
    margin-left: 0;
  }

  .seo-inner {
    margin-left: 0;
    padding: 1.2rem 0 0;
  }
}

.panel-no-poster {
  grid-template-columns: clamp(88px, 11vw, 212px) minmax(640px, 960px) 1fr;
  gap: 1.9rem;
}

.panel-no-poster .content {
  grid-column: 2;
  max-width: 960px;
}

.web-status[hidden] {
  display: none;
}
