:root {
  --yellow: #f7c325;
  --yellow-dark: #e6ae00;
  --black: #111111;
  --text: #171717;
  --text-soft: #666666;
  --bg: #ffffff;
  --bg-soft: #f6f6f6;
  --border: #dcdcdc;
  --border-soft: #eeeeee;
  --green-bg: #eef9eb;
  --green-border: #bfe4b7;
  --green-text: #236b10;
  --red: #d94124;
  --red-dark: #b8321c;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
  --container: 1080px;
}

* { box-sizing: border-box; }

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background: #fafafa;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

body.consent-open { overflow: hidden; }

a {
  color: inherit;
  text-decoration: none;
}

img, iframe, video { max-width: 100%; }

.page-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
}

.site-header-inner {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: block;
  flex: 0 0 54px;
  object-fit: contain;
  background: transparent;
  box-shadow: 0 8px 24px rgba(17,24,39,.10);
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 52px;
  background: var(--yellow);
  color: #000;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.brand-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.brand-name {
  font-size: 24px;
  line-height: 1.05;
  font-weight: 900;
  color: #111;
  overflow-wrap: anywhere;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.menu-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.menu-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  font-weight: 800;
  white-space: nowrap;
}

.menu-row a:hover {
  background: var(--yellow);
  color: #000;
}

main {
  flex: 1;
  width: 100%;
}

.content-shell {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero-card,
.download-card,
.card,
.login-box,
.article-card,
.seo-section,
.feature-card,
.faq-card {
  width: 100%;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 22px;
  overflow: hidden;
}

.hero-card {
  background:
    radial-gradient(circle at top left, rgba(247,195,37,.28), transparent 34%),
    linear-gradient(135deg, #fff, #fffaf0);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff6d7;
  border: 1px solid #f0d777;
  font-size: 13px;
  font-weight: 900;
  color: #4f3900;
  margin-bottom: 12px;
}

h1, h2, h3 {
  margin: 0 0 14px;
  color: #000;
  line-height: 1.12;
}

h1 { font-size: 38px; font-weight: 900; }
h2 { font-size: 26px; font-weight: 900; }
h3 { font-size: 20px; font-weight: 900; }

p { margin: 0 0 14px; }

.small {
  font-size: 13px;
  color: var(--text-soft);
}

form { margin: 0; }

.download-form,
.admin-form {
  display: grid;
  gap: 12px;
}

label {
  display: block;
  font-weight: 900;
  color: #000;
  margin: 0;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
  font-family: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--yellow-dark);
  box-shadow: 0 0 0 3px rgba(247, 195, 37, 0.22);
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 20px;
  box-shadow: none;
  cursor: pointer;
}

.inline-check {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: auto;
  min-height: 42px;
  font-weight: 900;
  cursor: pointer;
}

.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mode-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 62px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.mode-pill:hover {
  border-color: var(--yellow-dark);
  background: #fffaf0;
}

.btn,
button {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  color: #111;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  width: auto;
}

.btn:hover,
button:hover { filter: brightness(0.98); }

.btn-primary {
  background: var(--yellow) !important;
  color: #000 !important;
}

.btn-primary:hover { background: var(--yellow-dark) !important; }

.btn-danger {
  background: var(--red) !important;
  color: #fff !important;
}

.btn-danger:hover {
  background: var(--red-dark) !important;
  color: #fff !important;
}

.inline-btn {
  width: auto !important;
  display: inline-flex !important;
  justify-self: start;
}

.status-box {
  width: 100%;
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  overflow: hidden;
}

.status-box.ok,
.download-ready,
.result-box {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green-text);
}

.status-title,
.result-label {
  display: block;
  font-weight: 900;
  margin-bottom: 6px;
}

.download-title,
.result-title,
.file-title,
.ready-title {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 6px 0 16px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 800;
  color: #222;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.result-actions,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ok,
.err {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin: 0 0 16px;
  font-weight: 800;
}

.ok {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green-text);
}

.err,
.err-text {
  background: #fff1ee;
  border: 1px solid #f1b6a9;
  color: var(--red-dark);
}

.err-text {
  display: block;
  padding: 8px 10px;
  margin-top: 8px;
  border-radius: 8px;
  max-width: 520px;
  overflow-wrap: anywhere;
}

/* Admin */

.admin-page { padding-top: 28px; }

.admin-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.admin-head h1 {
  margin: 0 0 6px;
  font-size: 34px;
}

.admin-head p,
.section-head p {
  margin: 0;
  color: var(--text-soft);
}

.admin-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-actions form {
  display: inline-flex;
}

.admin-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
}

.admin-tab-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: #222;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-weight: 900;
  cursor: pointer;
  width: auto;
}

.admin-tab-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat-number {
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
  color: #000;
}

.stat-label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 800;
}

.card h2 { margin-bottom: 18px; }

.card hr,
hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 24px 0;
}

.ad-slot {
  width: 100%;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  border-spacing: 0;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}

th {
  font-weight: 900;
  color: #555;
  background: #fff;
}

td strong { font-weight: 900; }

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
}

.status-done {
  background: #edf8e9;
  color: #1b6500;
  border-color: #b9dfad;
}

.status-error {
  background: #fff1ee;
  color: #9e2614;
  border-color: #f0b3a6;
}

.status-running,
.status-queued {
  background: #fff8df;
  color: #5f4300;
  border-color: #f1cf67;
}

/* Login */

.login-box {
  width: min(460px, calc(100% - 32px));
  margin: 42px auto;
}

.login-box form {
  display: grid;
  gap: 12px;
}

/* SEO content */

.seo-grid,
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  text-align: center;
  margin-bottom: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span,
.tag-row a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff6d7;
  border: 1px solid #f0d777;
  font-size: 13px;
  font-weight: 800;
}

details.faq-card {
  padding: 0;
}

details.faq-card summary {
  cursor: pointer;
  padding: 18px;
  font-weight: 900;
}

details.faq-card p {
  padding: 0 18px 18px;
  color: #444;
}

/* Professional Consent Popup */

.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.consent-overlay[hidden] { display: none !important; }

.consent-modal {
  width: min(100%, 640px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.30);
  padding: 24px 28px;
}

.consent-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  justify-content: center;
}

.consent-logo {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(180deg,#1ed0bf,#1677d9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
}

.consent-logo-img {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  flex: 0 0 68px;
  object-fit: contain;
  box-shadow: 0 10px 28px rgba(17,24,39,.12);
}

.consent-brand {
  font-size: 30px;
  font-weight: 900;
  color: #2d415b;
  letter-spacing: .2px;
}

.consent-title {
  font-size: 19px;
  line-height: 1.35;
  margin: 8px 0 18px;
  text-align: center;
}

.consent-list {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.consent-item,
.consent-learn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  color: #3b3b3b;
  min-height: auto;
  font-size: 14px;
  width: 100%;
  white-space: normal;
}

.consent-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef4ff;
  color: #2b70d7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex: 0 0 30px;
}

.consent-icon.small {
  background: #f3f3f3;
  color: #666;
}

.consent-copy {
  color: #626262;
  font-size: 14px;
  line-height: 1.55;
}

.consent-copy p {
  margin: 0 0 12px;
}

.consent-options {
  border-top: 1px solid #e6e6e6;
  padding-top: 14px;
  margin-top: 8px;
  display: grid;
  gap: 10px;
}

.consent-options[hidden] { display: none !important; }

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.consent-actions {
  display: flex;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid #e7e7e7;
  margin-top: 18px;
}

.consent-btn-secondary,
.consent-btn-primary {
  min-width: 190px;
  min-height: 46px;
  border-radius: 999px;
  font-weight: 900;
  background: #2563eb !important;
  color: #fff !important;
}

/* Popup */

.popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.popup-card {
  width: min(100%, 520px);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  padding: 22px;
  position: relative;
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: #f1f1f1;
  padding: 0;
}

/* Footer */

.site-footer {
  width: 100%;
  border-top: 1px solid var(--border-soft);
  background: #fff;
  margin-top: auto;
}

.site-footer-inner {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-soft);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-weight: 900;
}

.footer-links a:hover { color: #000; }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .seo-grid, .features-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }

  .site-header-inner {
    width: min(100%, calc(100% - 24px));
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .brand { width: 100%; }

  .brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .brand-name { font-size: 20px; }
  .brand-subtitle { font-size: 13px; }

  .menu-row {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .menu-row a {
    min-height: 38px;
    padding: 0 12px;
    font-size: 14px;
  }

  .content-shell {
    width: min(100%, calc(100% - 24px));
    padding: 18px 0 38px;
  }

  .hero-card,
  .download-card,
  .card,
  .article-card,
  .seo-section,
  .feature-card,
  .faq-card {
    padding: 18px;
    border-radius: 14px;
    margin-bottom: 18px;
  }

  h1 { font-size: 28px; }
  h2 { font-size: 23px; }

  .mode-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mode-pill { min-height: 54px; }

  .btn,
  button {
    width: auto;
    min-height: 44px;
  }

  .download-form .btn,
  .result-actions .btn,
  .download-actions .btn {
    width: 100%;
  }

  .result-actions,
  .download-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .download-title,
  .result-title,
  .file-title,
  .ready-title { font-size: 14px; }

  .admin-head,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-head-actions,
  .admin-actions {
    width: 100%;
    justify-content: flex-start;
    display: flex;
  }

  .admin-tabs-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .admin-tab-btn {
    min-height: 40px;
    padding: 0 8px;
    font-size: 13px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-box { padding: 14px; }
  .stat-number { font-size: 26px; }

  th, td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .site-footer-inner {
    width: min(100%, calc(100% - 24px));
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .consent-modal {
    padding: 18px;
  }

  .consent-head {
    justify-content: flex-start;
  }

  .consent-logo {
    width: 52px;
    height: 52px;
  }

  .consent-logo-img {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  flex: 0 0 68px;
  object-fit: contain;
  box-shadow: 0 10px 28px rgba(17,24,39,.12);
}

.consent-brand {
    font-size: 24px;
  }

  .consent-title {
    text-align: left;
    font-size: 17px;
  }

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

  .consent-btn-secondary,
  .consent-btn-primary {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-tabs-bar { grid-template-columns: 1fr; }

  .hero-card,
  .download-card,
  .card,
  .article-card,
  .seo-section,
  .feature-card,
  .faq-card {
    padding: 16px;
  }
}

/* Patch: centered download buttons on desktop, tablet and mobile */
.download-form > button[type="submit"].btn,
.download-form > .btn-primary {
  justify-self: center !important;
  align-self: center !important;
  width: min(100%, 320px) !important;
  max-width: 320px !important;
  min-width: 220px;
  margin-left: auto;
  margin-right: auto;
}

.result-actions,
.download-actions {
  justify-content: center !important;
  align-items: center !important;
}

.result-actions .btn,
.download-actions .btn,
.status-box .btn {
  width: min(100%, 320px) !important;
  max-width: 320px !important;
  min-width: 220px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 760px) {
  .download-form > button[type="submit"].btn,
  .download-form > .btn-primary,
  .result-actions .btn,
  .download-actions .btn,
  .status-box .btn {
    width: min(100%, 300px) !important;
    max-width: 300px !important;
    min-width: 0;
    justify-self: center !important;
  }

  .result-actions,
  .download-actions {
    justify-items: center !important;
  }
}
