 :root {
  --bg: #0b0f14;
  --panel: #111820;
  --panel-2: #151e28;
  --border: #24303c;
  --text: #f4f7fa;
  --muted: #8d9aa8;
  --accent: #7c5cff;
  --accent-hover: #8c70ff;
  --danger: #ff5f6d;
  --success: #36d399;

  --radius: 14px;
  --sidebar-width: 230px;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

body,
button,
input {
  font-family: inherit;
}

button,
input {
  font-size: inherit;
}

button {
  cursor: pointer;
}


/* ========================================
   APP LAYOUT
======================================== */

#appView {
  min-height: 100vh;
  display: flex;
}

aside {
  width: var(--sidebar-width);
  min-height: 100vh;

  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;

  padding: 28px 20px;

  background: #0d131a;
  border-right: 1px solid var(--border);

  z-index: 20;
}

main {
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);

  min-height: 100vh;

  padding: 34px 42px 0;
}


/* ========================================
   BRAND
======================================== */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;

  font-size: 17px;
  font-weight: 700;

  margin-bottom: 42px;
}

.brand span {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  border-radius: 9px;

  background: var(--accent);
  color: white;

  font-size: 12px;
  font-weight: 800;
}


/* ========================================
   SIDEBAR NAV
======================================== */

aside nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

aside nav a {
  display: block;

  padding: 11px 13px;

  border-radius: 9px;

  color: var(--muted);
  text-decoration: none;

  font-size: 14px;
  font-weight: 600;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

aside nav a:hover {
  background: #151d27;
  color: var(--text);
}

aside nav a.active {
  background: rgba(124, 92, 255, 0.14);
  color: #b9aaff;
}


/* ========================================
   HEADER
======================================== */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 28px;
}

.eyebrow {
  margin-bottom: 7px;

  color: var(--accent);

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.12em;
}

header h2 {
  margin: 0;

  font-size: 27px;
  line-height: 1.2;
}


/* ========================================
   ADVERTISEMENT SLOTS
======================================== */

.ad-slot {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px dashed #303b47;

  background: #0d1319;

  color: #596674;

  font-size: 10px;
  font-weight: 700;

  letter-spacing: 0.14em;

  overflow: hidden;
}

.ad-slot span {
  opacity: 0.8;
}

.ad-top {
  min-height: 90px;
  margin-bottom: 24px;
}

.ad-middle {
  min-height: 120px;
  margin: 28px 0;
}


/* ========================================
   HERO / CONVERTER
======================================== */

.hero {
  padding: 26px;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background:
    linear-gradient(
      145deg,
      rgba(124, 92, 255, 0.035),
      transparent 50%
    ),
    var(--panel);
}


/* ========================================
   DROPZONE
======================================== */

.dropzone {
  min-height: 220px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 28px;

  border: 1px dashed #344252;
  border-radius: 12px;

  background: #0e151d;

  text-align: center;

  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.15s ease;
}

.dropzone:hover {
  border-color: #4b5b6e;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.08);
  transform: scale(1.005);
}

.upload-icon {
  width: 48px;
  height: 48px;

  display: grid;
  place-items: center;

  margin-bottom: 14px;

  border-radius: 50%;

  background: rgba(124, 92, 255, 0.12);
  color: #b9aaff;

  font-size: 24px;
  font-weight: 700;
}

.dropzone h3 {
  margin: 0 0 6px;

  font-size: 18px;
}

.dropzone p {
  margin: 0 0 18px;

  color: var(--muted);

  font-size: 13px;
}

.dropzone button {
  padding: 10px 17px;

  border: 0;
  border-radius: 8px;

  background: var(--accent);
  color: white;

  font-weight: 700;

  transition: background 0.15s ease;
}

.dropzone button:hover {
  background: var(--accent-hover);
}

#fileName {
  margin-top: 14px;

  max-width: 90%;

  color: #b9c4cf;

  font-size: 12px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ========================================
   DIVIDER
======================================== */

.divider {
  display: flex;
  align-items: center;
  gap: 14px;

  margin: 24px 0;

  color: #65717e;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.divider::before,
.divider::after {
  content: "";

  height: 1px;
  flex: 1;

  background: var(--border);
}


/* ========================================
   URL FORM
======================================== */

.urlbox label {
  display: block;

  margin-bottom: 9px;

  color: #c6d0da;

  font-size: 13px;
  font-weight: 700;
}

.urlbox > div {
  display: flex;
  gap: 10px;
}

.urlbox input {
  flex: 1;

  min-width: 0;

  padding: 12px 13px;

  border: 1px solid var(--border);
  border-radius: 9px;

  outline: none;

  background: #0c1218;
  color: var(--text);

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.urlbox input::placeholder {
  color: #5f6c79;
}

.urlbox input:focus {
  border-color: var(--accent);

  box-shadow:
    0 0 0 3px rgba(124, 92, 255, 0.12);
}

.urlbox button {
  flex: 0 0 auto;

  padding: 0 18px;

  border: 0;
  border-radius: 9px;

  background: var(--accent);
  color: white;

  font-weight: 700;

  transition: background 0.15s ease;
}

.urlbox button:hover {
  background: var(--accent-hover);
}

.urlbox small {
  display: block;

  margin-top: 9px;

  color: #687583;

  font-size: 11px;
  line-height: 1.5;
}


/* ========================================
   INFORMATION SECTION
======================================== */

.info-content {
  padding: 8px 2px 4px;
}

.info-content h3 {
  margin: 0 0 12px;

  font-size: 21px;
}

.info-content > p {
  max-width: 850px;

  margin: 0;

  color: var(--muted);

  font-size: 14px;
  line-height: 1.7;
}

.info-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 14px;

  margin-top: 22px;
}

.info-grid article {
  padding: 18px;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: var(--panel);
}

.info-grid h4 {
  margin: 0 0 8px;

  font-size: 14px;
}

.info-grid p {
  margin: 0;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.6;
}

.notice {
  margin-top: 18px !important;

  padding: 13px 15px;

  border-left: 3px solid var(--accent);

  background: rgba(124, 92, 255, 0.055);

  color: #84909c !important;

  font-size: 12px !important;
  line-height: 1.6 !important;
}


/* ========================================
   HISTORY
======================================== */

.history {
  margin-top: 34px;

  scroll-margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 15px;
}

.section-head h3 {
  margin: 0;

  font-size: 19px;
}

.history-actions {
  display: flex;
  gap: 8px;
}

button.ghost {
  padding: 8px 12px;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: transparent;
  color: #a9b4bf;

  font-size: 12px;
  font-weight: 700;
}

button.ghost:hover {
  background: #151d26;
  color: var(--text);
}


/* ========================================
   JOB LIST
======================================== */

.jobs {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.job {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  padding: 15px 16px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: var(--panel);
}

.job-info {
  min-width: 0;
}

.job-name {
  margin-bottom: 4px;

  color: var(--text);

  font-size: 13px;
  font-weight: 700;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-meta {
  color: var(--muted);

  font-size: 11px;
}

.job-status {
  flex: 0 0 auto;

  font-size: 11px;
  font-weight: 700;
}

.job-status.ready {
  color: var(--success);
}

.job-status.error {
  color: var(--danger);
}


/* ========================================
   FOOTER
======================================== */

.site-footer {
  margin-top: 60px;
  padding: 30px 0 34px;

  border-top: 1px solid var(--border);

  display: grid;

  grid-template-columns:
    1fr auto;

  column-gap: 40px;
  row-gap: 18px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-brand strong {
  font-size: 13px;
}

.footer-brand span {
  color: #697684;

  font-size: 11px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;

  gap: 10px 18px;
}

.footer-nav a {
  color: #82909d;

  font-size: 11px;
  font-weight: 600;

  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--text);
}

.copyright {
  grid-column: 1 / -1;

  margin: 0;

  color: #56626e;

  font-size: 10px;
}


/* ========================================
   COOKIE NOTICE
======================================== */

.cookie-notice {
  position: fixed;

  left: 22px;
  right: 22px;
  bottom: 22px;

  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  padding: 16px 18px;

  border: 1px solid #303b47;
  border-radius: 12px;

  background: #111820;

  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45);
}

.cookie-notice strong {
  display: block;

  margin-bottom: 4px;

  font-size: 12px;
}

.cookie-notice p {
  max-width: 800px;

  margin: 0;

  color: #82909d;

  font-size: 11px;
  line-height: 1.55;
}

.cookie-notice a {
  color: #aa9cff;
  text-decoration: none;
}

.cookie-notice a:hover {
  text-decoration: underline;
}

.cookie-notice button {
  flex: 0 0 auto;

  padding: 9px 16px;

  border: 0;
  border-radius: 8px;

  background: var(--accent);
  color: white;

  font-size: 12px;
  font-weight: 700;
}

.cookie-notice button:hover {
  background: var(--accent-hover);
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 900px) {

  aside {
    position: static;

    width: 100%;
    min-height: auto;

    padding: 15px 18px;

    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  #appView {
    display: block;
  }

  aside .brand {
    margin-bottom: 12px;
  }

  aside nav {
    flex-direction: row;
  }

  aside nav a {
    padding: 8px 11px;
  }

  main {
    width: 100%;
    margin-left: 0;

    padding: 25px 20px 0;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-nav {
    justify-content: flex-start;
  }

  .copyright {
    grid-column: auto;
  }
}


@media (max-width: 650px) {

  main {
    padding: 20px 14px 0;
  }

  header {
    margin-bottom: 20px;
  }

  header h2 {
    font-size: 23px;
  }

  .hero {
    padding: 15px;
  }

  .dropzone {
    min-height: 190px;
    padding: 20px;
  }

  .urlbox > div {
    flex-direction: column;
  }

  .urlbox button {
    min-height: 44px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-actions {
    width: 100%;
  }

  .history-actions button {
    flex: 1;
  }

  .job {
    align-items: flex-start;
    flex-direction: column;
  }

  .cookie-notice {
    left: 12px;
    right: 12px;
    bottom: 12px;

    align-items: stretch;
    flex-direction: column;
  }

  .cookie-notice button {
    width: 100%;
  }

  .ad-top {
    min-height: 70px;
  }

  .ad-middle {
    min-height: 90px;
  }
}


/* ========================================
   ACCESSIBILITY
======================================== */

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ========================================
   HIDDEN ATTRIBUTE
======================================== */

[hidden] {
  display: none !important;
}