/*
Theme Name: ToolsInstant
Theme URI: https://toolsinstant.com/
Author: Devansh Thakkar
Author URI: https://devanshthakkar.com/
Description: Custom theme for ToolsInstant: free, browser-based schema, AI search, and technical SEO tools.
Version: 2.0.0
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: toolsinstant
*/

/* =====================================================
   0) Fonts: Titillium Web, self-hosted (SIL OFL 1.1, see assets/fonts/OFL.txt).
   The family has no 500 weight; "medium" text renders at 400.
   ===================================================== */

@font-face {
  font-family: "Titillium Web";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/titillium-web-400.woff2") format("woff2");
}

@font-face {
  font-family: "Titillium Web";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/titillium-web-600.woff2") format("woff2");
}

@font-face {
  font-family: "Titillium Web";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/titillium-web-700.woff2") format("woff2");
}


/* =====================================================
   1) Design tokens (the only place colors/sizes are defined)
   ===================================================== */

:root {
  /* Typography */
  --ti-font: "Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ti-text: clamp(16px, 0.25vw + 15px, 18px);
  --ti-small: 16px; /* site rule: nothing below 16px */
  --ti-h1: clamp(34px, 2.2vw + 18px, 46px);
  --ti-h2: clamp(26px, 1.5vw + 16px, 34px);
  --ti-h3: clamp(20px, 1vw + 14px, 26px);
  --ti-h4: clamp(18px, 0.6vw + 14px, 20px);
  --ti-lh-body: 1.6;
  --ti-lh-heading: 1.25;
  --ti-fw-regular: 400;
  --ti-fw-medium: 500;
  --ti-fw-semi: 600;
  --ti-fw-bold: 700;

  /* Brand */
  --ti-primary: #4F46E5;
  --ti-accent: #1AFFD1;
  --ti-dark: #0F172A;

  /* Neutrals */
  --ti-text-color: var(--ti-dark);
  --ti-muted-color: #475569;
  --ti-white: #FFFFFF;
  --ti-bg: #F8FAFC;
  --ti-border: rgba(15, 23, 42, 0.08);
  --ti-border-strong: rgba(15, 23, 42, 0.14);

  /* Tints */
  --ti-primary-tint: rgba(79, 70, 229, 0.08);
  --ti-accent-tint: rgba(26, 255, 209, 0.16);

  /* Radius */
  --ti-radius-sm: 10px;
  --ti-radius-md: 14px;
  --ti-radius-lg: 16px;
  --ti-radius-xl: 18px;

  /* Shadows */
  --ti-shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.04);
  --ti-shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);
  --ti-shadow-lg: 0 26px 70px rgba(15, 23, 42, 0.18);
  --ti-focus: 0 0 0 3px rgba(79, 70, 229, 0.25);

  /* Layout */
  --ti-header-h: 74px;
  --ti-mega-w: min(1280px, calc(100vw - 32px));
}

/* =====================================================
   2) Reset & base
   ===================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ti-white);
}

img,
svg,
video,
iframe {
  max-width: 100%;
  height: auto;
}

img {
  vertical-align: middle;
}

button,
input,
select,
textarea {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ti-primary);
  outline-offset: 2px;
}

/* =====================================================
   2b) Base typography
   ===================================================== */

html,
body {
  font-family: var(--ti-font);
  font-size: var(--ti-text);
  line-height: var(--ti-lh-body);
  color: var(--ti-text-color);
  font-weight: var(--ti-fw-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p,
li,
dd,
dt,
blockquote {
  font-size: var(--ti-text);
  line-height: var(--ti-lh-body);
}

.ti-muted,
small {
  color: var(--ti-muted-color);
}

small {
  font-size: var(--ti-small);
  line-height: 1.45;
}

a {
  color: var(--ti-primary);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color 0.2s ease, background-color 0.2s ease;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ti-font);
  color: var(--ti-text-color);
  line-height: var(--ti-lh-heading);
  margin: 0 0 0.55em;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--ti-h1); font-weight: var(--ti-fw-bold); }
h2 { font-size: var(--ti-h2); font-weight: var(--ti-fw-bold); }
h3 { font-size: var(--ti-h3); font-weight: var(--ti-fw-semi); }
h4 { font-size: var(--ti-h4); font-weight: var(--ti-fw-semi); }

strong,
b {
  font-weight: var(--ti-fw-semi);
}

input,
select,
textarea {
  font-family: var(--ti-font);
  font-size: var(--ti-text);
  line-height: 1.35;
}

/* =====================================================
   3) Layout & accessibility helpers
   ===================================================== */

.ti-container {
  width: min(1280px, calc(100% - 48px));
  margin-inline: auto;
}

.ti-skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  z-index: 1000001;
  padding: 10px 14px;
  border-radius: var(--ti-radius-sm);
  background: var(--ti-white);
  box-shadow: var(--ti-shadow-md);
}

.ti-skip-link:focus {
  left: 12px;
}

.ti-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ti-lock {
  overflow: hidden !important;
}

/* =====================================================
   4) Buttons
   ===================================================== */

.ti-btn,
.wp-element-button,
.wp-block-button__link,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: var(--ti-radius-md);
  font-family: var(--ti-font);
  font-size: var(--ti-text);
  font-weight: var(--ti-fw-semi);
  line-height: 1.2;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: var(--ti-shadow-md);
  transition: transform 0.14s ease, box-shadow 0.16s ease, filter 0.16s ease, background-color 0.16s ease;
}

.ti-btn--primary,
.wp-element-button,
.wp-block-button__link,
input[type="submit"] {
  background: var(--ti-primary);
  color: var(--ti-white);
}

.ti-btn--primary:hover,
.wp-element-button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover {
  color: var(--ti-white);
  transform: translateY(-1px);
  box-shadow: var(--ti-shadow-lg);
  filter: brightness(1.03);
}

.ti-btn--accent {
  background: var(--ti-accent);
  color: var(--ti-dark);
  font-weight: var(--ti-fw-bold);
  box-shadow: 0 12px 30px rgba(26, 255, 209, 0.18);
}

.ti-btn--accent:hover {
  color: var(--ti-dark);
  box-shadow: 0 18px 44px rgba(26, 255, 209, 0.26);
  filter: brightness(1.02);
}

.ti-btn--ghost {
  background: transparent;
  color: var(--ti-text-color);
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: none;
}

.ti-btn--ghost:hover {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.18);
  transform: translateY(-1px);
}

.ti-btn--sm {
  padding: 10px 14px;
  font-size: var(--ti-small);
}

.ti-btn--lg {
  padding: 14px 22px;
  font-size: clamp(16px, 0.5vw + 14px, 18px);
}

.ti-btn:disabled,
input[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ti-btn:focus-visible,
input[type="submit"]:focus-visible,
.ti-header button:focus-visible {
  outline: none;
  box-shadow: var(--ti-focus);
}

/* Shared icon button (search, burger, close) */
.ti-search-toggle,
.ti-nav-toggle,
.ti-nav-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: var(--ti-radius-md);
  background: var(--ti-white);
  color: var(--ti-text-color);
  font-family: var(--ti-font);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ti-search-toggle:hover,
.ti-nav-toggle:hover,
.ti-nav-close:hover {
  background: var(--ti-primary-tint);
  border-color: rgba(79, 70, 229, 0.20);
  color: var(--ti-primary);
}

.ti-search-toggle svg {
  display: block;
}

/* =====================================================
   5) Header
   ===================================================== */

.ti-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Admin bar offset */
.admin-bar .ti-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .ti-header {
    top: 46px;
  }
}

.ti-header-bar {
  background: rgba(248, 250, 252, 0.92);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px); /* also makes the bar the containing block for .ti-mega */
  border-bottom: 1px solid var(--ti-border);
}

.ti-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: var(--ti-header-h);
  padding: 12px 0;
}

.ti-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ti-logo {
  display: inline-flex;
  align-items: center;
  border-radius: var(--ti-radius-md);
  text-decoration: none;
}

.ti-logo img {
  display: block;
  height: 50px;
  width: auto;
}

/* Desktop nav */
.ti-topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ti-topnav > li {
  position: relative;
  margin: 0;
}

.ti-topnav > li > a {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--ti-radius-md);
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  color: rgba(15, 23, 42, 0.86);
  text-decoration: none;
  white-space: nowrap;
}

.ti-topnav > li > a:hover,
.ti-has-mega:hover > a,
.ti-has-mega.is-open > a {
  background: var(--ti-primary-tint);
  border-color: rgba(79, 70, 229, 0.10);
  color: var(--ti-primary);
}

/* Current section only (was: always the first item) */
.ti-topnav > li.is-current > a,
.ti-topnav > li > a[aria-current="page"] {
  background: var(--ti-accent-tint);
  border-color: rgba(26, 255, 209, 0.35);
  color: var(--ti-dark);
}

.ti-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ti-nav-toggle {
  display: none;
}

.ti-burger,
.ti-burger::before,
.ti-burger::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 10px;
  background: currentColor;
}

.ti-burger {
  position: relative;
}

.ti-burger::before,
.ti-burger::after {
  content: "";
  position: absolute;
  left: 0;
}

.ti-burger::before { top: -6px; }
.ti-burger::after { top: 6px; }

/* =====================================================
   6) Mega menu
   ===================================================== */

/* Invisible bridge so the menu stays open while the cursor moves down to it */
.ti-has-mega::after {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  top: 100%;
  height: 28px;
}

.ti-mega {
  position: fixed; /* relative to .ti-header-bar (backdrop-filter) */
  left: 50%;
  top: var(--ti-header-h);
  z-index: 999999;
  width: var(--ti-mega-w);
  padding: 14px;
  background: var(--ti-white);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: var(--ti-radius-xl);
  box-shadow: var(--ti-shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
}

.ti-has-mega:hover .ti-mega,
.ti-has-mega:focus-within .ti-mega,
.ti-has-mega.is-open .ti-mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(6px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0s;
}

.ti-mega-inner {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 14px;
}

.ti-mega-featured {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-lg);
  background:
    radial-gradient(500px 220px at 15% 0%, rgba(79, 70, 229, 0.12), transparent 60%),
    radial-gradient(500px 220px at 85% 0%, rgba(26, 255, 209, 0.10), transparent 55%),
    var(--ti-bg);
}

.ti-mega-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: var(--ti-fw-bold);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ti-text-color);
}

.ti-mega-featured .ti-muted {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.55;
}

.ti-mega-cta {
  margin-top: auto;
}

.ti-mega-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ti-mega-col {
  padding: 10px;
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-lg);
  background: var(--ti-bg);
}

.ti-mega-col ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ti-mega-col li {
  margin: 0;
}

.ti-mega-col a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--ti-radius-sm);
  font-size: 16px;
  font-weight: var(--ti-fw-medium);
  line-height: 1.35;
  color: var(--ti-text-color);
  text-decoration: none;
}

.ti-mega-col a:hover,
.ti-mega-col a:focus-visible {
  background: var(--ti-white);
  color: var(--ti-primary);
  outline: none;
  box-shadow: var(--ti-shadow-sm);
}

@media (max-width: 1180px) {
  .ti-mega-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =====================================================
   7) Mobile navigation drawer
   ===================================================== */

.ti-nav-panel {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  background: rgba(15, 23, 42, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.ti-nav-panel.is-open {
  display: block;
}

.ti-nav-panel-inner {
  position: absolute;
  top: 14px;
  right: 14px;
  width: min(420px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  padding: 14px;
  background: var(--ti-white);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: var(--ti-radius-xl);
  box-shadow: var(--ti-shadow-lg);
}

.ti-nav-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 4px 10px;
}

.ti-nav-title {
  margin: 0;
  font-size: 16px;
  font-weight: var(--ti-fw-bold);
  letter-spacing: -0.02em;
}

.ti-nav-close {
  font-size: 24px;
  line-height: 1;
}

.ti-nav-mobile {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ti-nav-mobile .ti-mobile-link {
  display: block;
  padding: 12px 14px;
  border-radius: var(--ti-radius-md);
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  color: var(--ti-text-color);
  text-decoration: none;
}

.ti-nav-mobile .ti-mobile-link:hover,
.ti-nav-mobile .ti-mobile-link:focus-visible {
  background: var(--ti-primary-tint);
  color: var(--ti-primary);
  outline: none;
}

/* =====================================================
   8) Search popup
   ===================================================== */

.ti-search-popup {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: none;
}

.ti-search-popup.ti-is-open {
  display: block;
}

.ti-search-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: ti-fade-in 0.18s ease;
}

.ti-search-popup-panel {
  position: relative;
  width: min(680px, calc(100vw - 32px));
  margin: 8vh auto 0;
  overflow: hidden;
  background: var(--ti-white);
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-xl);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
  animation: ti-pop-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ti-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ti-pop-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ti-search-popup-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ti-border);
  background: var(--ti-bg);
}

.ti-search-popup-icon {
  flex-shrink: 0;
  color: var(--ti-muted-color);
}

.ti-search-popup-input {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--ti-font);
  font-size: 16px; /* 16px prevents iOS zoom on focus */
  color: var(--ti-text-color);
  -webkit-appearance: none;
  appearance: none;
}

.ti-search-popup-input::placeholder {
  color: rgba(15, 23, 42, 0.45);
}

.ti-search-popup-input::-webkit-search-cancel-button,
.ti-search-popup-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.ti-search-popup-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-sm);
  background: rgba(15, 23, 42, 0.05);
  color: var(--ti-muted-color);
  cursor: pointer;
}

.ti-search-popup-close:hover {
  background: rgba(15, 23, 42, 0.08);
  color: var(--ti-text-color);
}

.ti-search-popup-close svg {
  display: block;
}

.ti-search-popup-body {
  display: flex;
  flex-direction: column;
  max-height: calc(80vh - 70px);
}

.ti-search-popup-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.ti-search-empty,
.ti-search-loading {
  padding: 32px 18px;
  text-align: center;
  font-size: 16px;
  color: var(--ti-muted-color);
}

.ti-search-loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  vertical-align: -3px;
  border: 2px solid rgba(79, 70, 229, 0.2);
  border-top-color: var(--ti-primary);
  border-radius: 50%;
  animation: ti-search-spin 0.7s linear infinite;
}

@keyframes ti-search-spin {
  to { transform: rotate(360deg); }
}

.ti-search-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ti-search-list li {
  margin: 0;
}

.ti-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--ti-radius-md);
  color: var(--ti-text-color);
  text-decoration: none;
}

.ti-search-result:hover,
.ti-search-result.is-active,
.ti-search-result:focus-visible {
  background: var(--ti-primary-tint);
  outline: none;
}

.ti-search-result-title {
  overflow: hidden;
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ti-search-result-type {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.1);
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  color: var(--ti-primary);
}

.ti-search-popup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--ti-border);
  background: var(--ti-bg);
  font-size: 16px;
  color: var(--ti-muted-color);
}

.ti-search-hint kbd {
  padding: 1px 6px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--ti-white);
  font-family: var(--ti-font);
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  color: var(--ti-text-color);
}

.ti-search-all-link {
  font-weight: var(--ti-fw-semi);
  text-decoration: none;
}

.ti-search-all-link:hover {
  text-decoration: underline;
}

.ti-search-popup-results::-webkit-scrollbar { width: 8px; }
.ti-search-popup-results::-webkit-scrollbar-track { background: transparent; }
.ti-search-popup-results::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.15); border-radius: 10px; }

@media (max-width: 640px) {
  .ti-search-popup-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .ti-search-popup-body {
    max-height: calc(100dvh - 70px);
  }
}

/* =====================================================
   9) Footer
   ===================================================== */

.ti-footer {
  margin-top: 80px;
  background: var(--ti-white);
  border-top: 1px solid var(--ti-border);
}

.ti-footer-top {
  padding: 64px 0 48px;
  background:
    radial-gradient(ellipse 1000px 300px at 20% 0%, rgba(79, 70, 229, 0.04), transparent 60%),
    radial-gradient(ellipse 1000px 300px at 80% 0%, rgba(26, 255, 209, 0.03), transparent 55%),
    var(--ti-bg);
}

.ti-footer-top-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: start;
}

.ti-footer-brand {
  max-width: 520px;
}

.ti-footer-logo {
  display: inline-flex;
  margin-bottom: 20px;
  text-decoration: none;
}

.ti-footer-logo img {
  display: block;
  height: 50px;
  width: auto;
}

.ti-footer-tagline {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ti-muted-color);
}

.ti-footer-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Author card (replaces the old newsletter card) */
.ti-footer-author {
  display: flex;
  justify-content: flex-end;
}

.ti-footer-author-card {
  position: relative;
  max-width: 460px;
  padding: 28px;
  background: var(--ti-white);
  border: 1px solid var(--ti-border);
  border-left: 4px solid var(--ti-primary);
  border-radius: var(--ti-radius-xl);
  box-shadow: var(--ti-shadow-md);
}

.ti-footer-author-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: var(--ti-fw-bold);
  letter-spacing: -0.01em;
  color: var(--ti-text-color);
}

.ti-footer-author-desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ti-muted-color);
}

.ti-footer-author-desc a {
  font-weight: var(--ti-fw-semi);
}

.ti-footer-links {
  padding: 56px 0;
  background: var(--ti-white);
}

.ti-footer-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 40px 32px;
}

.ti-footer-links-col {
  min-width: 0;
}

.ti-footer-links-title {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: var(--ti-fw-bold);
  letter-spacing: -0.01em;
  color: var(--ti-text-color);
}

.ti-footer-links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ti-footer-links-title a {
  color: inherit;
  text-decoration: none;
}

.ti-footer-links-title a:hover {
  color: var(--ti-primary);
}

.ti-footer-links-list li {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.ti-footer-links-list a {
  display: inline-block;
  padding: 2px 0;
  font-size: 16px;
  color: var(--ti-muted-color);
  text-decoration: none;
}

.ti-footer-links-list a:hover {
  color: var(--ti-primary);
}

.ti-footer-links-list .ti-footer-links-more {
  display: inline-block;
  margin-top: 4px;
  font-weight: var(--ti-fw-semi);
  color: var(--ti-primary);
}

.ti-footer-bottom {
  padding: 24px 0;
  background: var(--ti-bg);
  border-top: 1px solid var(--ti-border);
}

.ti-footer-bottom-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.ti-footer-copyright p {
  margin: 0;
  font-size: 16px;
  color: var(--ti-muted-color);
}

.ti-footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.ti-footer-bottom-links a {
  font-size: 16px;
  font-weight: var(--ti-fw-medium);
  color: var(--ti-muted-color);
  text-decoration: none;
}

.ti-footer-bottom-links a:hover {
  color: var(--ti-primary);
}

/* =====================================================
   11) Page sections (shared by homepage, hubs, tool pages)
   ===================================================== */

.ti-container--narrow {
  width: min(860px, calc(100% - 48px));
}

.ti-section {
  padding: clamp(56px, 6vw, 88px) 0;
  background: var(--ti-white);
}

.ti-section--alt {
  background: var(--ti-bg);
}

.ti-section-head {
  max-width: 760px;
  margin: 0 auto 40px;
  text-align: center;
}

.ti-section-head--left {
  margin-left: 0;
  text-align: left;
}

.ti-section-head p {
  margin: 0;
  color: var(--ti-muted-color);
}

.ti-eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ti-primary-tint);
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  color: var(--ti-primary);
}

.ti-check-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ti-check-list li {
  position: relative;
  margin: 0;
  padding-left: 32px;
}

.ti-check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F172A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 13px no-repeat,
    var(--ti-accent);
}

/* ---------- Homepage hero ---------- */

.ti-home-hero {
  padding: clamp(48px, 7vw, 96px) 0;
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(79, 70, 229, 0.10), transparent 60%),
    radial-gradient(800px 420px at 95% 20%, rgba(26, 255, 209, 0.12), transparent 55%),
    var(--ti-bg);
}

.ti-home-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.ti-home-hero h1 {
  margin-bottom: 20px;
}

.ti-home-lead {
  margin: 0 0 28px;
  font-size: clamp(17px, 0.4vw + 16px, 19px);
  color: var(--ti-muted-color);
}

.ti-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.ti-home-hero__media img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Hub cards ---------- */

.ti-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.ti-hub-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--ti-white);
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-xl);
  box-shadow: var(--ti-shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ti-hub-card:hover {
  border-color: rgba(79, 70, 229, 0.25);
  box-shadow: var(--ti-shadow-md);
  transform: translateY(-2px);
}

.ti-hub-card__title {
  margin-bottom: 10px;
  font-size: 22px;
}

.ti-hub-card__title a {
  color: var(--ti-text-color);
  text-decoration: none;
}

.ti-hub-card__title a:hover {
  color: var(--ti-primary);
}

.ti-hub-card__desc {
  margin: 0 0 18px;
  color: var(--ti-muted-color);
}

.ti-hub-card__tools {
  display: grid;
  gap: 6px;
  margin: 0 0 20px;
  padding: 16px 0 0;
  border-top: 1px solid var(--ti-border);
  list-style: none;
}

.ti-hub-card__tools li {
  margin: 0;
}

.ti-hub-card__tools a {
  color: var(--ti-text-color);
  text-decoration: none;
}

.ti-hub-card__tools a:hover {
  color: var(--ti-primary);
  text-decoration: underline;
}

.ti-hub-card__more {
  margin-top: auto;
  font-weight: var(--ti-fw-semi);
  text-decoration: none;
}

/* ---------- Feature cards ---------- */

.ti-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.ti-feature-card {
  padding: 28px;
  background: var(--ti-white);
  border: 1px solid var(--ti-border);
  border-top: 4px solid var(--ti-accent);
  border-radius: var(--ti-radius-xl);
}

.ti-feature-card h3 {
  font-size: 20px;
}

.ti-feature-card p {
  margin: 0;
  color: var(--ti-muted-color);
}

/* ---------- How it works ---------- */

.ti-how__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.ti-steps {
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: ti-step;
}

.ti-steps li {
  position: relative;
  margin: 0;
  padding-left: 60px;
  counter-increment: ti-step;
}

.ti-steps li::before {
  content: counter(ti-step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--ti-radius-md);
  background: var(--ti-primary);
  font-size: 18px;
  font-weight: var(--ti-fw-bold);
  color: var(--ti-white);
}

.ti-steps h3 {
  margin-bottom: 4px;
  font-size: 20px;
}

.ti-steps p {
  margin: 0;
  color: var(--ti-muted-color);
}

.ti-code-card {
  margin: 0;
  overflow: hidden;
  background: var(--ti-dark);
  border-radius: var(--ti-radius-xl);
  box-shadow: var(--ti-shadow-lg);
}

.ti-code-card__caption {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 16px;
  color: rgba(255, 255, 255, 0.75);
}

.ti-code-card pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  background: transparent;
}

.ti-code-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ti-accent);
  white-space: pre;
}

/* ---------- Author block ---------- */

.ti-author-block {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px);
  background: var(--ti-white);
  border: 1px solid var(--ti-border);
  border-left: 4px solid var(--ti-primary);
  border-radius: var(--ti-radius-xl);
  box-shadow: var(--ti-shadow-sm);
}

.ti-author-block p {
  color: var(--ti-muted-color);
}

.ti-author-block .ti-btn {
  margin-top: 8px;
}

/* ---------- FAQ ---------- */

.ti-faq {
  display: grid;
  gap: 12px;
}

.ti-faq__item {
  background: var(--ti-white);
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-lg);
}

.ti-faq__item[open] {
  border-color: rgba(79, 70, 229, 0.25);
  box-shadow: var(--ti-shadow-sm);
}

.ti-faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}

.ti-faq__item summary::-webkit-details-marker {
  display: none;
}

.ti-faq__item summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 24px;
  font-weight: var(--ti-fw-semi);
  line-height: 1;
  color: var(--ti-primary);
}

.ti-faq__item[open] summary::after {
  content: "−";
}

.ti-faq__item summary:focus-visible {
  outline: none;
  box-shadow: var(--ti-focus);
  border-radius: var(--ti-radius-lg);
}

.ti-faq__q {
  margin: 0;
  font-size: 18px;
  font-weight: var(--ti-fw-semi);
}

.ti-faq__a {
  padding: 0 22px 20px;
}

.ti-faq__a p {
  margin: 0;
  color: var(--ti-muted-color);
}

/* ---------- CTA band ---------- */

.ti-cta-band {
  padding: clamp(48px, 6vw, 72px) 0;
  background:
    radial-gradient(700px 300px at 90% 0%, rgba(26, 255, 209, 0.14), transparent 60%),
    var(--ti-dark);
}

.ti-cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.ti-cta-band h2 {
  margin-bottom: 8px;
  color: var(--ti-white);
}

.ti-cta-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.ti-cta-band + .ti-footer,
.ti-main:has(> .ti-cta-band:last-child) + .ti-footer {
  margin-top: 0;
}

.ti-footer-credit {
  margin-top: 4px !important;
}

@media (max-width: 900px) {
  .ti-home-hero__grid,
  .ti-how__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ti-home-hero__media {
    max-width: 520px;
  }
}

@media (max-width: 560px) {
  .ti-home-actions .ti-btn {
    width: 100%;
  }
}

/* ---------- Mega menu: Escape closes even while focused inside ---------- */

.ti-has-mega.is-suppressed .ti-mega {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Generic helpers ---------- */

.ti-center {
  text-align: center;
}

.ti-section--compact {
  padding: 40px 0;
}

.ti-section--compact + .ti-section--compact {
  padding-top: 0;
}

.ti-section-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  max-width: none;
  margin-bottom: 24px;
}

.ti-section-head--row h2 {
  margin: 0;
}

.ti-link-arrow {
  font-weight: var(--ti-fw-semi);
  text-decoration: none;
}

.ti-link-arrow:hover {
  text-decoration: underline;
}

/* ---------- Page hero (pages, posts, archives) ---------- */

.ti-page-hero {
  padding: clamp(40px, 5vw, 72px) 0 clamp(32px, 4vw, 48px);
  background:
    radial-gradient(800px 320px at 10% 0%, rgba(79, 70, 229, 0.08), transparent 60%),
    radial-gradient(700px 320px at 95% 10%, rgba(26, 255, 209, 0.10), transparent 55%),
    var(--ti-bg);
  border-bottom: 1px solid var(--ti-border);
}

.ti-page-hero--center {
  text-align: center;
}

.ti-page-hero h1 {
  margin-bottom: 12px;
}

.ti-page-lead {
  max-width: 760px;
  margin: 0 0 12px;
  font-size: clamp(17px, 0.4vw + 16px, 19px);
  color: var(--ti-muted-color);
}

.ti-page-hero--center .ti-page-lead {
  margin-inline: auto;
}

.ti-post-meta {
  margin: 0;
  font-size: 16px;
  color: var(--ti-muted-color);
}

/* ---------- Rank Math breadcrumbs ---------- */

.rank-math-breadcrumb {
  margin-bottom: 16px;
  font-size: 16px;
  color: var(--ti-muted-color);
}

.rank-math-breadcrumb p {
  margin: 0;
  font-size: 16px;
}

.rank-math-breadcrumb a {
  color: var(--ti-muted-color);
  text-decoration: none;
}

.rank-math-breadcrumb a:hover {
  color: var(--ti-primary);
  text-decoration: underline;
}

.rank-math-breadcrumb .separator {
  margin: 0 6px;
  opacity: 0.6;
}

/* ---------- Tool cards ---------- */

.ti-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ti-tool-card {
  position: relative;
  margin: 0;
  padding: 22px 24px;
  background: var(--ti-white);
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-lg);
  box-shadow: var(--ti-shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ti-tool-card:hover,
.ti-tool-card:focus-within {
  border-color: rgba(79, 70, 229, 0.3);
  box-shadow: var(--ti-shadow-md);
  transform: translateY(-2px);
}

.ti-tool-card__title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: var(--ti-fw-semi);
}

.ti-tool-card__title a {
  color: var(--ti-text-color);
  text-decoration: none;
}

/* Whole card clickable, one link in the DOM */
.ti-tool-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.ti-tool-card__title a:focus-visible {
  outline: none;
}

.ti-tool-card:focus-within {
  box-shadow: var(--ti-focus), var(--ti-shadow-md);
}

.ti-tool-card__desc {
  margin: 0;
  font-size: 16px;
  color: var(--ti-muted-color);
}

/* ---------- Post lists & pagination ---------- */

.ti-post-list {
  display: grid;
  gap: 28px;
}

.ti-post-item {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--ti-border);
}

.ti-post-item__title {
  margin-bottom: 6px;
  font-size: var(--ti-h3);
}

.ti-post-item__title a {
  color: var(--ti-text-color);
  text-decoration: none;
}

.ti-post-item__title a:hover {
  color: var(--ti-primary);
}

.ti-post-item p {
  margin: 0;
  color: var(--ti-muted-color);
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ti-border-strong);
  border-radius: var(--ti-radius-md);
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  text-decoration: none;
}

.pagination .page-numbers.current {
  background: var(--ti-primary);
  border-color: var(--ti-primary);
  color: var(--ti-white);
}

/* ---------- Prose (block editor content) ---------- */

.ti-prose > * + * {
  margin-top: 1.1em;
}

.ti-prose > :first-child {
  margin-top: 0;
}

.ti-prose h2 {
  margin-top: 1.8em;
}

.ti-prose h3 {
  margin-top: 1.5em;
}

.ti-prose p,
.ti-prose ul,
.ti-prose ol {
  margin-bottom: 0;
}

.ti-prose ul,
.ti-prose ol {
  padding-left: 1.4em;
}

.ti-prose li + li {
  margin-top: 0.4em;
}

.ti-prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 16px 20px;
  border-left: 4px solid var(--ti-primary);
  border-radius: 0 var(--ti-radius-sm) var(--ti-radius-sm) 0;
  background: var(--ti-bg);
}

.ti-prose blockquote p {
  margin: 0;
}

.ti-prose code {
  overflow-wrap: anywhere;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--ti-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
}

.ti-prose pre {
  padding: 18px 20px;
  overflow-x: auto;
  border-radius: var(--ti-radius-md);
  background: var(--ti-dark);
  color: var(--ti-accent);
}

.ti-prose pre code {
  overflow-wrap: normal;
  padding: 0;
  background: none;
  color: inherit;
}

.ti-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.ti-prose th,
.ti-prose td {
  padding: 10px 12px;
  border: 1px solid var(--ti-border-strong);
  text-align: left;
  vertical-align: top;
}

.ti-prose th {
  background: var(--ti-bg);
  font-weight: var(--ti-fw-semi);
}

.ti-prose .wp-block-table {
  overflow-x: auto;
}

.ti-prose img {
  border-radius: var(--ti-radius-md);
}

.ti-prose figcaption {
  margin-top: 8px;
  font-size: 16px;
  color: var(--ti-muted-color);
}

.ti-prose hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--ti-border-strong);
}

/* =====================================================
   12) Tool pages
   ===================================================== */

.ti-tool-hero {
  padding: clamp(28px, 4vw, 48px) 0 clamp(20px, 3vw, 32px);
  background:
    radial-gradient(800px 320px at 10% 0%, rgba(79, 70, 229, 0.08), transparent 60%),
    radial-gradient(700px 320px at 95% 10%, rgba(26, 255, 209, 0.10), transparent 55%),
    var(--ti-bg);
}

.ti-tool-hero h1 {
  margin-bottom: 10px;
}

.ti-tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.ti-tool-badges li {
  margin: 0;
  padding: 4px 12px;
  border: 1px solid var(--ti-border-strong);
  border-radius: 999px;
  background: var(--ti-white);
  font-size: 16px;
  color: var(--ti-muted-color);
}

.ti-tool-section {
  padding: 0 0 clamp(48px, 6vw, 72px);
  background: linear-gradient(var(--ti-bg) 0, var(--ti-bg) 48px, var(--ti-white) 48px);
}

.ti-app {
  padding: clamp(18px, 3vw, 28px);
  background: var(--ti-white);
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-xl);
  box-shadow: var(--ti-shadow-md);
}

.ti-app-placeholder {
  padding: 32px;
  border: 2px dashed var(--ti-border-strong);
  border-radius: var(--ti-radius-lg);
  text-align: center;
}

.ti-app-placeholder p {
  margin: 0;
}

/* Notices (also used by TI.status) */
.ti-notice {
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 1px solid;
  border-left-width: 4px;
  border-radius: var(--ti-radius-sm);
  font-size: 16px;
}

.ti-notice--info  { background: rgba(79, 70, 229, 0.06); border-color: rgba(79, 70, 229, 0.35); }
.ti-notice--ok    { background: rgba(22, 163, 74, 0.07); border-color: rgba(22, 163, 74, 0.45); }
.ti-notice--warn  { background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.5); }
.ti-notice--error { background: rgba(220, 38, 38, 0.07); border-color: rgba(220, 38, 38, 0.5); }

/* ---------- Tool UI kit ---------- */

.ti-app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 28px);
  align-items: start;
}

.ti-app-layout--wide-input {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.ti-app-panel {
  min-width: 0;
}

.ti-app-panel--output {
  position: sticky;
  top: calc(var(--ti-header-h) + 16px);
  max-height: calc(100vh - var(--ti-header-h) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.admin-bar .ti-app-panel--output {
  top: calc(var(--ti-header-h) + 48px);
  max-height: calc(100vh - var(--ti-header-h) - 64px);
}

.ti-app-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.ti-app-panel__title {
  margin: 0;
  font-size: 20px;
  font-weight: var(--ti-fw-bold);
}

.ti-fieldset {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.ti-legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 17px;
  font-weight: var(--ti-fw-bold);
}

.ti-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}

.ti-row--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ti-field {
  margin-bottom: 16px;
}

.ti-label {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
}

.ti-req {
  color: #DC2626;
}

.ti-input,
.ti-select,
.ti-textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--ti-border-strong);
  border-radius: var(--ti-radius-sm);
  background: var(--ti-white);
  font-family: var(--ti-font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ti-text-color);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ti-textarea {
  min-height: 160px;
  resize: vertical;
}

.ti-textarea--code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.ti-input:focus,
.ti-select:focus,
.ti-textarea:focus {
  outline: none;
  border-color: var(--ti-primary);
  box-shadow: var(--ti-focus);
}

.ti-input::placeholder,
.ti-textarea::placeholder {
  color: #64748B;
}

.ti-help {
  margin: 6px 0 0;
  font-size: 16px;
  color: var(--ti-muted-color);
}

.ti-field--error .ti-input,
.ti-field--error .ti-select,
.ti-field--error .ti-textarea {
  border-color: #DC2626;
}

.ti-error-text {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  color: #B91C1C;
}

.ti-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 16px;
  cursor: pointer;
}

.ti-check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--ti-primary);
  flex-shrink: 0;
}

.ti-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ti-btn.is-done {
  background: var(--ti-accent);
  color: var(--ti-dark);
}

.ti-output {
  margin: 0;
  max-height: 560px;
  padding: 18px 20px;
  overflow: auto;
  border-radius: var(--ti-radius-md);
  background: var(--ti-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ti-accent);
  white-space: pre;
}

.ti-output:empty::before {
  content: attr(data-empty);
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--ti-font);
  white-space: normal;
}

/* Tabs (role="tablist") */
.ti-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: var(--ti-radius-md);
  background: var(--ti-bg);
}

.ti-tab {
  padding: 8px 14px;
  border: 0;
  border-radius: var(--ti-radius-sm);
  background: transparent;
  font-family: var(--ti-font);
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  color: var(--ti-muted-color);
  cursor: pointer;
}

.ti-tab[aria-selected="true"] {
  background: var(--ti-white);
  color: var(--ti-primary);
  box-shadow: var(--ti-shadow-sm);
}

/* Check results */
.ti-issues {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ti-issue {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-sm);
  background: var(--ti-white);
}

.ti-issue__head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: var(--ti-fw-semi);
}

.ti-issue p {
  margin: 6px 0 0;
  color: var(--ti-muted-color);
}

.ti-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  white-space: nowrap;
}

.ti-badge--ok    { background: rgba(22, 163, 74, 0.12); color: #166534; }
.ti-badge--warn  { background: rgba(217, 119, 6, 0.14); color: #92400E; }
.ti-badge--error { background: rgba(220, 38, 38, 0.12); color: #991B1B; }
.ti-badge--info  { background: var(--ti-primary-tint); color: var(--ti-primary); }

.ti-score {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.ti-score__value {
  font-size: 40px;
  font-weight: var(--ti-fw-bold);
  line-height: 1;
}

.ti-score__bar {
  flex: 1;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ti-bg);
}

.ti-score__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--ti-primary);
  transition: width 0.3s ease;
}

.ti-table-wrap {
  overflow-x: auto;
}

.ti-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.ti-table th,
.ti-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ti-border);
  text-align: left;
  vertical-align: top;
}

.ti-table th {
  background: var(--ti-bg);
  font-weight: var(--ti-fw-semi);
}

/* ---------- Worked example ---------- */

.ti-example {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}

.ti-example__block {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-lg);
}

.ti-example__block figcaption {
  padding: 10px 16px;
  border-bottom: 1px solid var(--ti-border);
  background: var(--ti-bg);
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
}

.ti-example__code {
  margin: 0;
  max-height: 480px;
  padding: 16px 18px;
  overflow: auto;
  background: var(--ti-dark);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ti-accent);
}

.ti-example__code--input {
  background: var(--ti-white);
  color: var(--ti-text-color);
}

.ti-example__code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  white-space: pre;
}

.ti-example__notes {
  color: var(--ti-muted-color);
}

/* ---------- Guide + table of contents ---------- */

.ti-guide {
  max-width: 860px;
}

.ti-guide--has-toc {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  max-width: 1180px;
}

.ti-toc {
  position: sticky;
  top: calc(var(--ti-header-h) + 24px);
  padding: 20px;
  background: var(--ti-white);
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-lg);
}

.ti-toc__title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: var(--ti-fw-bold);
  text-transform: none;
}

.ti-toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: ti-toc;
}

.ti-toc li {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.ti-toc a {
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--ti-muted-color);
  text-decoration: none;
}

.ti-toc a:hover,
.ti-toc a:focus-visible {
  background: var(--ti-primary-tint);
  color: var(--ti-primary);
}

.ti-guide__content h2,
.ti-guide__content h3 {
  scroll-margin-top: calc(var(--ti-header-h) + 24px);
}

/* ---------- Author box ---------- */

.ti-author-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: clamp(20px, 3vw, 32px);
  background: var(--ti-white);
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-xl);
}

.ti-author-box__avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ti-primary);
  font-size: 22px;
  font-weight: var(--ti-fw-bold);
  color: var(--ti-white);
}

.ti-author-box__title {
  margin-bottom: 8px;
  font-size: 20px;
}

.ti-author-box p {
  margin: 0 0 10px;
  color: var(--ti-muted-color);
}

@media (max-width: 980px) {
  .ti-app-layout,
  .ti-app-layout--wide-input,
  .ti-guide--has-toc {
    grid-template-columns: minmax(0, 1fr);
  }

  .ti-app-panel--output,
  .admin-bar .ti-app-panel--output,
  .ti-toc {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .ti-app {
    padding: 14px;
  }

  .ti-row,
  .ti-row--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .ti-author-box {
    flex-direction: column;
  }
}

/* ---------- Tool rating ---------- */

.ti-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 16px;
  padding: 14px 20px;
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-lg);
  background: var(--ti-white);
}

.ti-rating__label {
  margin: 0;
  font-weight: var(--ti-fw-semi);
}

.ti-rating__stars {
  display: flex;
  gap: 2px;
}

.ti-rating__star {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--ti-radius-sm);
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: #CBD5E1;
  cursor: pointer;
  transition: color 0.12s ease, transform 0.12s ease;
}

.ti-rating__star.is-on {
  color: #F59E0B;
}

.ti-rating__star:hover:not(:disabled) {
  transform: scale(1.1);
}

.ti-rating__star:disabled {
  cursor: default;
}

.ti-rating__summary {
  margin: 0;
  color: var(--ti-muted-color);
}

/* =====================================================
   13) Contact form
   ===================================================== */

.ti-contact-form {
  padding: clamp(20px, 3vw, 32px);
  background: var(--ti-white);
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-xl);
  box-shadow: var(--ti-shadow-md);
}

.ti-optional {
  font-weight: var(--ti-fw-regular);
  color: var(--ti-muted-color);
}

.ti-textarea--message {
  min-height: 260px;
}

.ti-field__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
}

.ti-field__meta .ti-help {
  margin-top: 6px;
}

.ti-counter {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ti-counter.is-near {
  font-weight: var(--ti-fw-semi);
  color: #B45309;
}

.ti-contact-form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 8px;
}

.ti-contact-form__footer .ti-help {
  flex: 1 1 260px;
  margin: 0;
}

.ti-contact-form__status:not(:empty) {
  margin-top: 16px;
}

.ti-contact-form__status .ti-notice {
  margin: 0;
}

.ti-contact-form button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

/* Honeypot: off-screen for humans, still in the form for bots */
.ti-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* =====================================================
   10) Responsive
   ===================================================== */

@media (max-width: 980px) {
  .ti-nav-desktop,
  .ti-mega {
    display: none;
  }

  .ti-nav-toggle {
    display: inline-flex;
  }
}

@media (min-width: 981px) {
  .ti-nav-panel {
    display: none !important;
  }
}

@media (max-width: 860px) {
  .ti-footer-top-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .ti-footer-author {
    justify-content: flex-start;
  }

  .ti-footer-author-card {
    max-width: none;
  }

  .ti-footer-links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
  }

  .ti-footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 767px) {
  .ti-container {
    width: min(1280px, calc(100% - 32px));
  }
}

@media (max-width: 560px) {
  .ti-footer-links-grid {
    grid-template-columns: 1fr;
  }

  .ti-footer-cta-row .ti-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}