:root {
  --tf-bg: #f4fbfa;
  --tf-surface: #ffffff;
  --tf-surface-muted: #f0fdfa;
  --tf-ink: #0f172a;
  --tf-muted: #475569;
  --tf-line: #d4e4e2;
  --tf-teal: #0d9488;
  --tf-teal-dark: #0f766e;
  --tf-teal-deep: #134e4a;
  --tf-teal-soft: #ccfbf1;
  --tf-amber: #d97706;
  --tf-amber-soft: #fef3c7;
  --tf-radius-lg: 18px;
  --tf-radius-md: 12px;
  --tf-shadow: 0 12px 30px rgba(15, 118, 110, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--tf-bg);
  color: var(--tf-ink);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
.tf-brand-name {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--tf-ink);
  line-height: 1.2;
  margin: 0 0 0.6rem;
}

a {
  color: var(--tf-teal-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--tf-teal);
  outline-offset: 2px;
}

.tf-container {
  width: min(1140px, 100% - 32px);
  margin: 0 auto;
}

/* Header */
.tf-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--tf-line);
}

.tf-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
}

.tf-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--tf-ink);
  font-weight: 700;
  font-size: 1.08rem;
}

.tf-brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.tf-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tf-nav a {
  text-decoration: none;
  color: var(--tf-muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 7px 12px;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.tf-nav a:hover,
.tf-nav a.is-active {
  background: var(--tf-teal-soft);
  color: var(--tf-teal-deep);
}

.tf-menu-btn {
  display: none;
  border: 1px solid var(--tf-line);
  background: var(--tf-surface);
  color: var(--tf-ink);
  border-radius: 10px;
  padding: 7px 11px;
  font-weight: 600;
  cursor: pointer;
}

/* Hero & Breadcrumbs */
.tf-main {
  padding: 28px 0 56px;
}

.tf-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--tf-muted);
  margin-bottom: 14px;
}

.tf-breadcrumb a {
  text-decoration: none;
  font-weight: 500;
}

.tf-page-head {
  background: linear-gradient(135deg, #ffffff 0%, #e6fffa 100%);
  border: 1px solid var(--tf-line);
  border-radius: var(--tf-radius-lg);
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: var(--tf-shadow);
}

.tf-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tf-teal-deep);
  background: var(--tf-teal-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 10px;
}

.tf-page-head h1 {
  font-size: clamp(1.65rem, 3vw, 2.3rem);
}

.tf-lead {
  color: var(--tf-muted);
  margin: 0;
  max-width: 70ch;
}

/* Bento & Workbench */
.tf-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}

.tf-card {
  background: var(--tf-surface);
  border: 1px solid var(--tf-line);
  border-radius: var(--tf-radius-lg);
  padding: 22px;
  box-shadow: var(--tf-shadow);
  margin-bottom: 22px;
}

.tf-card-title {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.tf-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.tf-field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--tf-teal-deep);
  margin-bottom: 6px;
}

.tf-input,
.tf-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--tf-line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--tf-ink);
  font-size: 0.96rem;
  font-family: inherit;
}

.tf-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.tf-btn:active {
  transform: translateY(1px);
}

.tf-btn-primary {
  background: var(--tf-teal);
  color: #ffffff;
}

.tf-btn-primary:hover {
  background: var(--tf-teal-dark);
}

.tf-btn-secondary {
  background: var(--tf-surface-muted);
  color: var(--tf-teal-deep);
  border-color: var(--tf-line);
}

.tf-btn-secondary:hover {
  background: var(--tf-teal-soft);
}

.tf-btn-sm {
  padding: 6px 11px;
  font-size: 0.84rem;
  border-radius: 8px;
}

/* Output Pills & Lists */
.tf-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.tf-name-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 10px 13px;
  background: var(--tf-surface-muted);
  border: 1px solid var(--tf-line);
  border-radius: 11px;
  color: var(--tf-ink);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tf-name-pill:hover {
  border-color: var(--tf-teal);
  background: var(--tf-teal-soft);
}

.tf-name-meta {
  font-size: 0.78rem;
  color: var(--tf-muted);
  font-weight: 500;
  white-space: nowrap;
}

.tf-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.tf-stat {
  background: var(--tf-surface-muted);
  border: 1px solid var(--tf-line);
  border-radius: 12px;
  padding: 13px;
}

.tf-stat-label {
  font-size: 0.8rem;
  color: var(--tf-muted);
  font-weight: 600;
}

.tf-stat-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--tf-teal-deep);
}

/* Answer-first box */
.tf-answer-box {
  background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
  border: 1px solid #99f6e4;
  border-left: 5px solid var(--tf-teal);
  border-radius: var(--tf-radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.tf-answer-box h2 {
  font-size: 1.08rem;
  color: var(--tf-teal-deep);
  margin-bottom: 6px;
}

.tf-answer-box p {
  margin: 0;
  color: var(--tf-ink);
}

/* Badges & Checks */
.tf-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--tf-teal-soft);
  color: var(--tf-teal-deep);
}

.tf-badge-amber {
  background: var(--tf-amber-soft);
  color: #92400e;
}

.tf-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--tf-surface-muted);
  border: 1px solid var(--tf-line);
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* Responsive Tables */
.tf-table-wrap {
  overflow-x: auto;
}

.tf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.tf-table th {
  text-align: left;
  padding: 11px 12px;
  background: var(--tf-surface-muted);
  color: var(--tf-teal-deep);
  border-bottom: 2px solid var(--tf-line);
  font-family: "Space Grotesk", sans-serif;
}

.tf-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--tf-line);
  vertical-align: top;
}

/* Guide Grid & Internal Links */
.tf-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.tf-link-tile {
  display: block;
  text-decoration: none;
  background: var(--tf-surface-muted);
  border: 1px solid var(--tf-line);
  border-radius: 12px;
  padding: 14px;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.tf-link-tile:hover {
  border-color: var(--tf-teal);
  transform: translateY(-1px);
}

.tf-link-tile strong {
  display: block;
  color: var(--tf-teal-deep);
  margin-bottom: 4px;
}

.tf-link-tile span {
  display: block;
  font-size: 0.86rem;
  color: var(--tf-muted);
}

/* FAQ */
.tf-faq-item {
  border-top: 1px solid var(--tf-line);
  padding: 14px 0;
}

.tf-faq-item:first-of-type {
  border-top: 0;
  padding-top: 4px;
}

.tf-faq-item h3 {
  font-size: 1.04rem;
  margin-bottom: 5px;
}

.tf-faq-item p {
  margin: 0;
  color: var(--tf-muted);
}

/* Factory Slot Cards */
.tf-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 11px;
}

.tf-slot-card {
  background: var(--tf-surface-muted);
  border: 1px solid var(--tf-line);
  border-radius: 12px;
  padding: 12px;
}

.tf-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--tf-teal-deep);
}

/* Toast */
.tf-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--tf-teal-deep);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.tf-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.tf-footer {
  background: #ffffff;
  border-top: 1px solid var(--tf-line);
  padding: 32px 0;
  color: var(--tf-muted);
  font-size: 0.9rem;
}

.tf-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.tf-footer h3 {
  font-size: 0.96rem;
  color: var(--tf-ink);
  margin-bottom: 8px;
}

.tf-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.tf-footer a {
  text-decoration: none;
  color: var(--tf-muted);
}

.tf-footer a:hover {
  color: var(--tf-teal-dark);
}

.tf-footer-bottom {
  border-top: 1px solid var(--tf-line);
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 880px) {
  .tf-workbench {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tf-menu-btn {
    display: inline-flex;
    align-items: center;
  }

  .tf-nav {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    background: #ffffff;
    border: 1px solid var(--tf-line);
    border-radius: 14px;
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--tf-shadow);
  }

  .tf-nav.is-open {
    display: flex;
  }

  .tf-table thead {
    display: none;
  }

  .tf-table tr {
    display: block;
    border: 1px solid var(--tf-line);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--tf-surface-muted);
  }

  .tf-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e2efed;
    padding: 7px 0;
    text-align: right;
  }

  .tf-table td:last-child {
    border-bottom: 0;
  }

  .tf-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--tf-teal-deep);
    text-align: left;
  }
}

/* ── Adsterra Native Banner & Mobile 2x2 Grid ── */
.tf-ad-banner {
  display: block;
  width: 100%;
  margin: 0 auto 24px;
  text-align: center;
  box-sizing: border-box;
  clear: both;
}

.tf-ad-banner > div,
#container-8320f36a05f5cd09d83e57bf66d48f9b {
  width: 100% !important;
  box-sizing: border-box !important;
}

@media (min-width: 769px) {
  .tf-ad-banner,
  .tf-ad-banner > div,
  #container-8320f36a05f5cd09d83e57bf66d48f9b {
    min-height: 90px;
  }
}

@media (max-width: 768px) {
  .tf-ad-banner,
  .tf-ad-banner > div,
  #container-8320f36a05f5cd09d83e57bf66d48f9b {
    min-height: 250px;
  }

  .tf-ad-banner {
    margin: 0 auto 20px;
    padding: 0 4px;
  }

  .container-8320f36a05f5cd09d83e57bf66d48f9b__stand {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    float: none !important;
  }

  #container-8320f36a05f5cd09d83e57bf66d48f9b {
    max-width: 100% !important;
    display: block !important;
  }

  .container-8320f36a05f5cd09d83e57bf66d48f9b__bn-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    float: none !important;
    display: block !important;
  }

  .container-8320f36a05f5cd09d83e57bf66d48f9b__bn {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 4px !important;
    box-sizing: border-box !important;
  }

  .container-8320f36a05f5cd09d83e57bf66d48f9b__img-container {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 1.1 / 1 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    display: block !important;
    margin: 0 auto 8px !important;
    box-sizing: border-box !important;
    position: relative !important;
  }

  .container-8320f36a05f5cd09d83e57bf66d48f9b__img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    background-size: cover !important;
    background-position: center !important;
  }

  .container-8320f36a05f5cd09d83e57bf66d48f9b__title {
    text-align: center !important;
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
    color: var(--tf-ink) !important;
    white-space: normal !important;
    word-break: break-word !important;
    margin: 4px auto 0 !important;
    display: block !important;
    width: 100% !important;
    padding: 0 4px !important;
    box-sizing: border-box !important;
  }

  .container-8320f36a05f5cd09d83e57bf66d48f9b__link {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 5 !important;
    display: block !important;
  }
}
