* {
  box-sizing: border-box;
}

:root {
  --bg-a: #fff8ef;
  --bg-b: #eef8ff;
  --bg-c: #f4ffef;
  --text: #1f2433;
  --muted: #5b647d;
  --line: #d9e1f0;
  --card: #ffffff;
  --primary: #0f62fe;
  --primary-dark: #0746b7;
  --success: #0a9a5b;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 188, 76, 0.17), transparent 35%),
    radial-gradient(circle at 85% 15%, rgba(36, 123, 255, 0.16), transparent 30%),
    radial-gradient(circle at 70% 80%, rgba(19, 180, 110, 0.14), transparent 35%),
    linear-gradient(145deg, var(--bg-a), var(--bg-b) 48%, var(--bg-c));
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: cover, cover, cover, cover;
  background-attachment: fixed, fixed, fixed, fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 16px 16px;
  width: 100%;
  position: relative;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.lang-switch {
  position: absolute;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.flag-link {
  text-decoration: none;
  border: 1px solid #d6def2;
  background: #ffffffcc;
  border-radius: 10px;
  width: 44px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(16, 38, 84, 0.12);
}

.flag-link img {
  width: 28px;
  height: 21px;
  display: block;
  border-radius: 2px;
}

.flag-link:hover {
  transform: translateY(-1px);
}

.flag-link.active {
  border-color: #2f6fe0;
  box-shadow: 0 8px 18px rgba(47, 111, 224, 0.28);
}

.hero h1 {
  margin: 0 0 6px;
  line-height: 1.1;
  font-size: clamp(30px, 4vw, 46px);
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-home-link {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(18, 62, 148, 0.18);
}

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

.top-menu {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.top-menu a {
  text-decoration: none;
  background: linear-gradient(180deg, #fbfdff 0%, #eef4ff 100%);
  border: 1px solid #cfdaf2;
  color: #1e325f;
  border-radius: 12px;
  padding: 9px 13px;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(32, 61, 122, 0.09);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.top-menu a:hover {
  transform: translateY(-1px);
  border-color: #9db6ea;
  box-shadow: 0 10px 18px rgba(29, 56, 116, 0.14);
  background: linear-gradient(180deg, #f8fbff 0%, #e7efff 100%);
}

.admin-tabs a.active {
  background: linear-gradient(180deg, #dfeaff 0%, #cfe0ff 100%);
  border-color: #7ea2ea;
  color: #0f2e66;
  box-shadow: 0 10px 20px rgba(37, 84, 174, 0.2);
}

a {
  color: var(--primary-dark);
}

.layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.layout.pre-verify {
  grid-template-columns: 1fr;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.layout.pre-verify #convert-form {
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(29, 35, 57, 0.06);
}

.card-title {
  margin: 0 0 8px;
}

.verify-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.verify-block label,
.verify-block input {
  width: 100%;
}

#verify-url-btn {
  width: min(280px, 100%);
}

#verify-msg {
  margin-top: 6px;
}

#conversion-options {
  margin-top: 10px;
  border-top: 1px dashed #d8e0ef;
  padding-top: 12px;
}

#scope-options {
  margin-top: 10px;
  border-top: 1px dashed #d8e0ef;
  padding-top: 10px;
}

#scope-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  font-weight: 600;
}

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  font-weight: 700;
}

input,
select,
button,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #c8d2e6;
  padding: 11px 12px;
  font-size: 15px;
  background: #fff;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  margin: 0 8px 0 0;
  accent-color: var(--primary);
  vertical-align: middle;
}

label input[type="checkbox"],
label input[type="radio"] {
  position: relative;
  top: -1px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 98, 254, 0.2);
  border-color: var(--primary);
}

button,
.btn {
  margin-top: 14px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  border-radius: 12px;
  padding: 11px 14px;
}

.btn.small {
  width: auto;
  padding: 8px 12px;
  margin-top: 0;
  font-size: 13px;
}

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

.btn.secondary {
  background: #166534;
}

.preview-title {
  margin: 10px 0 8px;
  font-size: 17px;
  font-weight: 700;
}

.preview-note {
  margin: 0;
  color: var(--muted);
}

.services-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chips {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.chip {
  padding: 7px 10px;
  border: 1px solid #d3ddf1;
  border-radius: 999px;
  background: #f7fbff;
  font-size: 13px;
  color: #2c3c64;
  white-space: nowrap;
}

.chip-broken {
  border-color: #f1b4b7;
  background: #fff5f5;
  color: #8a1c24;
}

.chip-broken-note {
  color: #b42318;
  font-weight: 700;
}

.status-row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.thumb {
  width: 230px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #d4ddf1;
}

.status-text h2 {
  margin: 0 0 4px;
}

.status-text p {
  margin: 0;
  color: var(--muted);
}

.download-card {
  padding: 20px;
}

.expiry-alert {
  margin-top: 12px;
  border: 1px solid #f3c9a6;
  background: linear-gradient(180deg, #fff7ef 0%, #fff3e6 100%);
}

.expiry-alert-title {
  margin: 0 0 6px;
  color: #9a3412;
  font-weight: 800;
}

.expiry-alert-text {
  margin: 0;
  color: #7c2d12;
}

.download-head {
  align-items: flex-start;
}

.pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #1f335f;
  border: 1px solid #cfdaf2;
  background: #f2f6ff;
}

.actions-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions-row .btn {
  width: auto;
  margin-top: 0;
}

.content-split-card {
  margin-top: 16px;
}

.donation-card {
  margin-top: 14px;
  border: 1px solid #e7d2ac;
  background: #fffdf8;
  box-shadow: 0 8px 20px rgba(82, 60, 23, 0.08);
}

.donation-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
}

.donation-copy {
  flex: 1 1 auto;
}

.donation-copy .card-title {
  margin-bottom: 5px;
}

.donation-copy .preview-note {
  color: #5b4c34;
}

.expires-box {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #d9e3f6;
  border-radius: 10px;
  background: #f8fbff;
}

.expires-main {
  margin: 0;
  color: #1f335f;
}

.expires-hint {
  margin: 4px 0 0;
  color: #4c5c82;
  font-size: 13px;
}

.adsense-card {
  margin-top: 14px;
  border: 1px dashed #d9e1f0;
  background: #ffffff;
  min-height: 96px;
}

.adsense-separator {
  margin-top: 16px;
  min-height: 110px;
}

.adsense-before-footer {
  margin-bottom: 6px;
}

.donation-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin-top: 0;
  white-space: nowrap;
  border-radius: 999px;
  padding: 12px 18px;
  background: #b45309;
  border: 1px solid #8a3f05;
  box-shadow: 0 6px 14px rgba(138, 63, 5, 0.2);
}

.donation-btn:hover {
  background: #9a4410;
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(124, 45, 18, 0.24);
}

.faq-card {
  margin-top: 14px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid #d8e1f3;
  border-radius: 12px;
  background: #fbfdff;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 14px;
  color: #243861;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  font-size: 18px;
  line-height: 1;
  color: #1e4db8;
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item p {
  margin: 0;
  padding: 0 14px 12px;
  color: #37496f;
}

.status-warning {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f5c2c7;
  background: #fef2f2;
  color: #b42318;
  font-weight: 700;
}

.phase {
  margin-top: 12px;
}

.phase-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #42527c;
}

.phase-counter {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.progress-wrap {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #edf2fc;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0aa45f, #1584ff);
  transition: width 0.3s ease;
}

#percent-download,
#percent-ffmpeg,
#percent-zip {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.captcha-wrap {
  margin-top: 12px;
}

.error {
  margin-top: 12px;
  color: #b42318;
  font-weight: 700;
}

.ok {
  margin-top: 12px;
  color: #0f766e;
  font-weight: 700;
}

.prose h2 {
  margin-top: 16px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  margin: 8px 0;
  color: #314161;
}

.prose ul,
.prose ol {
  margin: 8px 0 8px 20px;
  color: #314161;
}

.prose li {
  margin: 4px 0;
}

.legal-lead {
  margin-top: 2px;
  color: #465377;
  font-size: 15px;
}

.legal-update {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #bfd0f2;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  border-radius: 999px;
  padding: 7px 12px;
  color: #1d3d7a;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(32, 61, 122, 0.1);
}

.legal-update .label {
  color: #2f4d88;
}

.legal-update .date {
  color: #0f2e66;
}

.toc {
  margin: 14px 0 18px;
  padding: 12px 14px;
  border: 1px solid #d5def2;
  border-radius: 12px;
  background: #f8fbff;
}

.toc h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.toc a {
  display: block;
  margin: 4px 0;
  text-decoration: none;
  font-weight: 600;
}

.legal-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #f4bfc4;
  background: #fff1f2;
  color: #9f1239;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 360px;
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  z-index: 1200;
}

.site-footer {
  margin-top: auto;
  padding: 18px 0 0;
}

.site-footer-inner {
  border: 1px solid #dbe4f5;
  border-radius: 16px;
  padding: 14px 16px;
  background: #ffffffc7;
  backdrop-filter: blur(4px);
  color: #4d5b80;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(26, 52, 104, 0.08);
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.site-footer-inner p {
  margin: 0;
}

.site-footer-inner p:first-child {
  font-weight: 600;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.site-footer-links a {
  text-decoration: none;
  font-weight: 700;
  color: #1f3d76;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d7e2f6;
  background: #f7faff;
}

.site-footer-links a:hover {
  color: #123075;
  border-color: #bfd0f2;
  background: #eef4ff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 12, 21, 0.54);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 1000;
}

.modal-box {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid #d5dff2;
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.2);
}

.modal-link {
  font-weight: 700;
}

.cookie-consent {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  width: min(560px, calc(100vw - 32px));
}

.cookie-consent-box {
  background: #fff;
  border: 1px solid #cdd8ee;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(18, 34, 67, 0.22);
  padding: 14px;
}

.cookie-consent-box h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.cookie-consent-box p {
  margin: 0 0 10px;
  color: #394b73;
}

.cookie-consent-details {
  border: 1px dashed #d6dfef;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  display: grid;
  gap: 6px;
}

.cookie-consent-details label {
  margin: 0;
  font-weight: 600;
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cookie-consent-actions .btn,
.cookie-consent-actions button {
  width: auto;
  margin-top: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-grid.admin-grid-single {
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100%;
}

.admin-wrap {
  width: 96%;
  max-width: 96vw;
}

.admin-wrap .hero,
.admin-wrap .admin-grid {
  width: 100%;
}

.admin-wrap .admin-grid {
  grid-template-columns: minmax(430px, 1.05fr) minmax(620px, 1.35fr);
}

.admin-wrap .admin-grid.admin-grid-single {
  grid-template-columns: minmax(0, 1fr) !important;
}

.admin-grid.admin-grid-single > .card {
  width: 100%;
  max-width: 100%;
}

.admin-quick-card {
  margin-bottom: 12px;
}

.admin-quick-card .actions-row {
  margin-top: 8px;
}

.primary-save-btn {
  margin-top: 16px;
}

.settings-accordion-item {
  border: 1px solid #dbe4f5;
  border-radius: 12px;
  background: #ffffff;
  margin-top: 12px;
  overflow: hidden;
}

.settings-accordion-item > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-weight: 700;
  color: #17356e;
  background: linear-gradient(180deg, #f8fbff 0%, #f0f5ff 100%);
  border-bottom: 1px solid #dbe4f5;
}

.settings-accordion-item > summary::-webkit-details-marker {
  display: none;
}

.settings-accordion-item > summary::after {
  content: "+";
  float: right;
  color: #2853a6;
  font-size: 18px;
  line-height: 1;
}

.settings-accordion-item[open] > summary::after {
  content: "-";
}

.settings-accordion-body {
  padding: 12px 14px 14px;
}

.settings-accordion-body label {
  margin-top: 10px;
}

.admin-grid h2 {
  margin-top: 18px;
}

.admin-grid h2:first-child {
  margin-top: 0;
}

.admin-grid .card form label {
  margin-top: 12px;
}

.inline-controls {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(120px, 220px);
  gap: 10px;
  align-items: center;
}

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}

.bulk-bar select {
  max-width: 320px;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.actions-cell form {
  margin: 0;
}

.actions-cell .btn.small {
  padding: 6px 10px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #d7deec;
  padding: 6px 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #e2e8f5;
  white-space: nowrap;
}

.recent-jobs-table th,
.recent-jobs-table td {
  white-space: normal;
  vertical-align: top !important;
  line-height: 1.3;
  padding-top: 6px;
  padding-bottom: 6px;
}

.recent-jobs-table td:nth-child(2),
.recent-jobs-table th:nth-child(2) {
  width: 120px;
  max-width: 120px;
  min-width: 120px;
}

.recent-jobs-table td:nth-child(2) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  word-break: break-all;
}

.recent-jobs-table td:nth-child(3),
.recent-jobs-table th:nth-child(3) {
  min-width: 320px;
}

.recent-jobs-table td:nth-child(8) {
  min-width: 320px;
}

.recent-jobs-table td a {
  vertical-align: top;
}

@media (min-width: 1200px) {
  .wrap {
    max-width: 1180px;
    padding-left: 22px;
    padding-right: 22px;
  }

  .layout {
    grid-template-columns: 1.25fr 1fr;
    gap: 18px;
  }
}

@media (min-width: 681px) and (max-width: 1024px) {
  .wrap {
    padding-top: 28px;
    padding-left: 18px;
    padding-right: 18px;
  }

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

  .status-row {
    align-items: flex-start;
  }

  .thumb {
    width: min(420px, 100%);
  }

  .admin-wrap .admin-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .top-menu {
    gap: 10px;
  }

  .top-menu a {
    padding: 8px 11px;
  }

  .donation-layout {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .donation-btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 680px) {
  .inline-controls {
    grid-template-columns: 1fr;
  }

  .wrap {
    margin-top: 12px;
    padding: 22px 12px 14px;
  }

  .hero h1 {
    font-size: clamp(26px, 8vw, 34px);
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .top-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .top-menu a {
    text-align: center;
    padding: 8px 10px;
  }

  .lang-switch {
    position: static;
    justify-content: flex-end;
    margin-bottom: 10px;
    padding-right: 0;
  }

  .status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .thumb {
    width: 100%;
  }

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

  .services-head {
    flex-direction: column;
    align-items: flex-start;
  }

  input,
  select,
  button,
  textarea {
    font-size: 16px;
  }

  .chips {
    max-height: 220px;
  }

  .actions-row {
    flex-direction: column;
  }

  .actions-row .btn {
    width: 100%;
  }

  .donation-layout {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }

  .donation-btn {
    width: 100%;
    text-align: center;
  }

  .bulk-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .bulk-bar select {
    max-width: none;
  }

  .site-footer-inner {
    padding: 12px 13px;
  }
}

