:root {
  --th-bg: #f8fafc;
  --th-surface: #ffffff;
  --th-bg-subtle: #f1f5f9;
  --th-text: #172033;
  --th-text-muted: #5d687a;
  --th-border: #dde3ea;
  --th-border-strong: #c8d1dc;
  --th-accent: #2457e6;
  --th-accent-hover: #1944c7;
  --th-danger: #b42318;
  --th-disclaimer-bg: #fff9ed;
  --th-accent-soft: #edf2ff;
  --th-radius: 12px;
  --th-radius-lg: 18px;
  --th-shadow-sm: 0 1px 2px rgba(23, 32, 51, 0.04);
  --th-shadow-md: 0 12px 32px rgba(23, 32, 51, 0.08);
  --th-space-label: 8px;
  --th-space-field: 16px;

  /* Aliases for older class rules */
  --th-ink: var(--th-text);
  --th-muted: var(--th-text-muted);
  --th-line: var(--th-border);
  --th-card: var(--th-surface);
  --th-ok-bg: var(--th-bg-subtle);
  --th-fill: var(--th-bg-subtle);
}

body.th-app {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--th-bg);
  color: var(--th-text);
  font-size: 16px;
  line-height: 1.65;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.th-app *,
body.th-app *::before,
body.th-app *::after {
  box-sizing: border-box;
}

body.th-app button,
body.th-app input,
body.th-app select,
body.th-app textarea {
  font-family: inherit;
}

body.th-app a {
  color: var(--th-text);
  text-decoration: none !important;
}

body.th-app .th-tool-app a,
body.th-app .th-faq a,
body.th-app .th-crumb a:hover,
body.th-app .th-foot a:hover {
  text-decoration: underline !important;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

body.th-app .th-tool-app a:hover,
body.th-app .th-faq a:hover {
  color: var(--th-text-muted);
}

.th-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ——— Header ——— */

.th-top {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--th-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.admin-bar .th-top {
  top: 32px;
}

.th-top-inner {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 68px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}

body.th-app .th-top a,
body.th-app .th-top a:hover,
body.th-app .th-top a:focus,
body.th-app .th-top a:visited {
  text-decoration: none !important;
}

.th-brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  color: var(--th-text);
  text-decoration: none;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.035em;
  min-height: 44px;
  padding: 8px 0;
}

.th-brand:hover {
  color: var(--th-text);
  text-decoration: none;
}

.th-brand-name {
  color: var(--th-text);
}

.th-brand-product {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--th-accent-soft);
  color: var(--th-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.th-category-nav {
  min-width: 0;
}

.th-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.th-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 13px;
  border-radius: var(--th-radius);
  color: var(--th-text-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.th-nav a:hover {
  background: var(--th-bg-subtle);
  color: var(--th-text);
  text-decoration: none;
}

.th-nav a.is-on {
  color: var(--th-accent);
  background: var(--th-accent-soft);
}

.th-nav a:focus-visible,
.th-brand:focus-visible {
  outline: 2px solid var(--th-accent);
  outline-offset: 2px;
}

.th-lang {
  margin-left: auto;
}

.th-lang-select {
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--th-border, #e6e6e8);
  border-radius: var(--th-radius, 8px);
  background: var(--th-bg, #fff);
  color: var(--th-text, #1a1a1a);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.th-lang-select:focus-visible {
  outline: 2px solid var(--th-accent);
  outline-offset: 2px;
}

.th-badge-kr {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--th-accent);
  background: var(--th-accent-soft);
  border-radius: 6px;
  padding: 2px 7px;
  line-height: 1.3;
}

/* ——— Layout ——— */

.th-wrap {
  max-width: 1180px;
  width: 100%;
  min-width: 0;
  flex: 1 0 auto;
  margin: 0 auto;
  padding: 52px 24px 88px;
}

.th-tool-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.th-hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
}

.th-hero h1 {
  margin: 0 0 12px;
  max-width: 100%;
  font-size: clamp(28px, 7vw, 48px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.th-hero p {
  max-width: min(680px, 100%);
  margin: 0;
  color: var(--th-text-muted);
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.th-hero .th-eyebrow,
.th-section-kicker {
  margin: 0 0 8px;
  color: var(--th-accent);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

/* ——— Hub ——— */

.th-tool-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 760px;
  min-width: 0;
  min-height: 56px;
  height: auto;
  margin-top: 28px;
  padding: 10px 16px;
  border: 1px solid var(--th-border-strong);
  border-radius: var(--th-radius-lg);
  background: var(--th-surface);
  color: var(--th-text-muted);
  box-shadow: var(--th-shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.th-tool-search svg {
  flex: 0 0 auto;
}

.th-tool-search:focus-within {
  border-color: var(--th-accent);
  box-shadow: 0 0 0 4px rgba(36, 87, 230, 0.1);
}

.th-tool-search input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--th-text);
  font-size: 16px;
}

.th-tool-search input::placeholder {
  color: #8a94a4;
}

.th-tool-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.th-tool-search kbd {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border: 1px solid var(--th-border);
  border-bottom-color: var(--th-border-strong);
  border-radius: 7px;
  background: var(--th-bg-subtle);
  color: var(--th-text-muted);
  font-family: inherit;
  font-size: 12px;
}

.th-search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  max-width: 760px;
  margin-top: 12px;
  color: var(--th-text-muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.th-search-meta span:last-child::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 1px 0;
  border-radius: 50%;
  background: #20a66a;
}

.th-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.th-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid var(--th-border);
  border-radius: 999px;
  background: var(--th-surface);
  color: var(--th-text-muted);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.th-filter span {
  margin-left: 3px;
  color: #8a94a4;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.th-filter:hover {
  border-color: var(--th-border-strong);
  color: var(--th-text);
}

.th-filter.is-on {
  border-color: var(--th-accent);
  background: var(--th-accent);
  color: #fff;
}

.th-filter.is-on span {
  color: rgba(255, 255, 255, 0.78);
}

.th-filter:focus-visible,
.th-show-all:focus-visible {
  outline: 3px solid rgba(36, 87, 230, 0.24);
  outline-offset: 2px;
}

.th-featured {
  margin-top: 54px;
  padding: 26px;
  border: 1px solid #d7e0ff;
  border-radius: 22px;
  background: #f4f7ff;
}

.th-section-head,
.th-category-heading,
.th-catalog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.th-section-head h2,
.th-catalog-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.th-section-head > p {
  margin: 0 0 2px;
  color: var(--th-text-muted);
  font-size: 13px;
}

.th-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.th-catalog-head {
  margin-top: 58px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--th-border);
}

.th-category-block {
  margin-top: 38px;
}

.th-category-heading {
  align-items: center;
  margin-bottom: 14px;
}

.th-sec-title {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--th-text);
  line-height: 1.4;
  scroll-margin-top: 88px;
}

.th-category-heading > span {
  color: var(--th-text-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

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

body.th-app a.th-card,
body.th-app a.th-card:hover,
body.th-app a.th-card:focus,
body.th-app a.th-card:visited {
  color: var(--th-text);
  text-decoration: none !important;
}

.th-card {
  display: flex;
  flex-direction: column;
  background: var(--th-surface);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  padding: 18px;
  color: var(--th-text);
  text-decoration: none;
  min-height: 140px;
  box-shadow: var(--th-shadow-sm);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.th-card:hover {
  color: var(--th-text);
  text-decoration: none;
  border-color: #aebbe2;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.08);
}

.th-card:focus-visible {
  outline: 2px solid var(--th-accent);
  outline-offset: 2px;
}

.th-card-cat {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0;
  padding: 3px 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--th-accent);
}

.th-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  margin-bottom: 12px;
}

.th-card-labels {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.th-card-arrow {
  flex-shrink: 0;
  margin-left: auto;
  color: #98a2b3;
  font-size: 18px;
  line-height: 1;
  transition: color 160ms ease, transform 160ms ease;
}

.th-card:hover .th-card-arrow {
  color: var(--th-accent);
  transform: translateX(2px);
}

.th-card b {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.th-card p {
  margin: 7px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--th-text-muted);
  line-height: 1.55;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.th-card-featured {
  min-height: 134px;
  border-color: #dbe3f7;
}

.th-card-compact {
  min-height: 0;
  padding: 16px;
}

.th-card-compact b {
  font-size: 15px;
}

.th-card-compact p {
  margin-top: 6px;
}

.th-note {
  margin: 48px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--th-border);
  font-size: 13px;
  color: var(--th-text-muted);
}

.th-show-all {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 16px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  background: var(--th-surface);
  color: var(--th-text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.th-show-all:hover {
  border-color: var(--th-border-strong);
  background: var(--th-bg-subtle);
}

.th-show-all span {
  margin-left: 6px;
  color: var(--th-accent);
  font-size: 12px;
}

.th-empty {
  margin-top: 40px;
  padding: 54px 24px;
  border: 1px dashed var(--th-border-strong);
  border-radius: var(--th-radius-lg);
  background: var(--th-surface);
  text-align: center;
}

.th-empty strong {
  display: block;
  font-size: 18px;
}

.th-empty p {
  margin: 6px 0 14px;
  color: var(--th-text-muted);
  font-size: 14px;
}

/* ——— Tool page ——— */

.th-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--th-text-muted);
}

.th-crumb a {
  color: var(--th-text-muted);
  text-decoration: none;
}

.th-crumb a:hover {
  color: var(--th-text);
  text-decoration: underline;
}

.th-tool-h {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.th-lead {
  margin: 0;
  font-size: 17px;
  color: var(--th-text-muted);
  line-height: 1.65;
}

.th-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 16px 0 30px;
  color: var(--th-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.th-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.th-trust-row span + span::before {
  content: "";
  width: 3px;
  height: 3px;
  margin-right: 3px;
  border-radius: 50%;
  background: #a8b1bf;
}

.th-trust-row svg {
  width: 16px;
  height: 16px;
  color: #20a66a;
}

.th-tool-hero-img {
  margin: 28px 0;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-lg);
  overflow: hidden;
  background: var(--th-fill);
}

.th-tool-hero-img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

.th-faq {
  margin: 36px 0 28px;
  padding-top: 8px;
}

.th-faq-h {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.th-faq-lead {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--th-text-muted);
  line-height: 1.55;
}

.th-faq-list {
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  overflow: hidden;
  background: var(--th-surface);
  box-shadow: var(--th-shadow-sm);
}

.th-faq-item {
  border-bottom: 1px solid var(--th-border);
}

.th-faq-item:last-child {
  border-bottom: 0;
}

.th-faq-q {
  cursor: pointer;
  list-style: none;
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--th-text);
}

.th-faq-q::-webkit-details-marker {
  display: none;
}

.th-faq-q::after {
  content: "+";
  float: right;
  color: var(--th-accent);
  font-weight: 700;
}

.th-faq-item[open] > .th-faq-q::after {
  content: "–";
}

.th-faq-a {
  padding: 0 20px 18px;
}

.th-faq-a p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--th-text-muted);
}

.th-panel {
  background: var(--th-surface);
  border: 1px solid var(--th-border-strong);
  border-radius: var(--th-radius-lg);
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: var(--th-shadow-md);
}

.th-panel-label {
  margin: 0 0 22px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--th-border);
  font-size: 17px;
  font-weight: 750;
  color: var(--th-text);
  line-height: 1.4;
}

.th-hint-inline {
  font-weight: 400;
  font-size: 12px;
  color: var(--th-text-muted);
}

/* ——— Form ——— */

.th-field {
  margin-bottom: var(--th-space-field);
}

.th-field:last-child {
  margin-bottom: 0;
}

.th-field > label:not(.th-check),
.th-legend {
  display: block;
  margin: 0 0 var(--th-space-label);
  font-size: 14px;
  font-weight: 650;
  color: var(--th-text);
}

.th-field input[type="text"],
.th-field input[type="number"],
.th-field input[type="date"],
.th-field select,
.th-field textarea {
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  background: #fbfcfe;
  font-size: 16px;
  color: var(--th-text);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.th-field input[type="text"] {
  appearance: none;
  -webkit-appearance: none;
}

.th-field input[type="text"],
.th-field input[type="number"],
.th-field input[type="date"],
.th-field select {
  height: 50px;
  min-height: 50px;
}

.th-field input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

.th-field textarea {
  min-height: 168px;
  padding: 14px;
  resize: vertical;
  line-height: 1.6;
}

.th-field input::placeholder,
.th-field textarea::placeholder {
  color: #8a8a90;
}

.th-field input[type="text"]:focus,
.th-field input[type="number"]:focus,
.th-field input[type="date"]:focus,
.th-field select:focus,
.th-field textarea:focus {
  outline: 3px solid rgba(36, 87, 230, 0.14);
  outline-offset: 0;
  border-color: var(--th-accent);
  background: var(--th-bg);
}

.th-field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: var(--th-space-field);
}

.th-field-row-2 {
  grid-template-columns: repeat(2, 1fr);
}

.th-msg {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--th-text);
}

.th-field-row .th-field {
  margin-bottom: 0;
}

.th-swatch {
  height: 80px;
  margin-bottom: 16px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  background: #1a5cff;
}

.th-field label.th-check,
.th-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}

.th-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--th-accent);
  flex-shrink: 0;
}

.th-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 14px;
}

.th-radios label,
.th-field .th-radios label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
}

.th-radios input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--th-accent);
  flex-shrink: 0;
}

.th-check input:focus-visible,
.th-radios input:focus-visible {
  outline: 2px solid var(--th-accent);
  outline-offset: 2px;
}

.th-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 14px 0 0;
}

.th-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  height: 50px;
  min-width: 156px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--th-radius);
  background: var(--th-accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.th-btn:hover {
  background: var(--th-accent-hover);
}

.th-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  height: 50px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--th-text-muted);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border-radius: var(--th-radius);
}

.th-btn-ghost:hover {
  background: var(--th-bg-subtle);
  color: var(--th-text);
}

.th-btn:disabled,
.th-btn-ghost:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.th-btn:focus-visible,
.th-btn-ghost:focus-visible {
  outline: 2px solid var(--th-accent);
  outline-offset: 2px;
}

/* ——— Results ——— */

.th-result {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--th-border);
}

.th-result[hidden] {
  display: none;
}

.th-panel-empty-hint {
  margin-top: 20px;
  padding: 18px 0 0;
  border-top: 1px solid var(--th-border);
  color: var(--th-text-muted);
  font-size: 13px;
}

.th-panel:has(.th-result:not([hidden])) .th-panel-empty-hint {
  display: none;
}

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

.th-stat {
  background: var(--th-bg-subtle);
  border: 1px solid #e5e9ef;
  border-radius: var(--th-radius);
  min-height: 112px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.th-stat span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--th-text-muted);
}

.th-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
  color: var(--th-text);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.th-hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--th-text-muted);
}

.th-actions + .th-hint {
  margin-top: 16px;
}

.th-badge {
  display: inline-block;
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: var(--th-radius);
  background: var(--th-accent-soft);
  color: var(--th-accent);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.th-badge:empty {
  display: none;
}

.th-tool-ltv .th-field > .th-badge {
  margin-top: 0;
  font-size: 18px;
}

.th-ltv-apply-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.th-ltv-apply-row > .th-badge {
  align-self: center;
}

.th-ltv-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.th-ltv-nav-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  background: var(--th-surface);
  color: var(--th-text);
  text-decoration: none;
  line-height: 1.3;
}

.th-ltv-nav-btn b {
  font-size: 13px;
  font-weight: 700;
}

.th-ltv-nav-btn span {
  font-size: 12px;
  font-weight: 400;
  color: var(--th-text-muted);
}

.th-ltv-nav-btn:hover {
  border-color: var(--th-accent);
  color: var(--th-accent);
}

.th-ltv-nav-btn:hover span {
  color: var(--th-accent);
}

.th-ltv-nav-btn.is-current {
  border-color: var(--th-accent);
  background: var(--th-accent-soft);
  color: var(--th-accent);
}

.th-ltv-nav-btn.is-current span {
  color: var(--th-accent);
}

.th-ltv-nav-btn:focus-visible {
  outline: 2px solid var(--th-accent);
  outline-offset: 2px;
}

.th-ltv-places {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--th-text-muted);
}

.th-table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
}

.th-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.th-panel th,
.th-panel td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--th-border);
  text-align: right;
  white-space: nowrap;
}

.th-panel th:first-child,
.th-panel td:first-child {
  text-align: left;
}

.th-panel th {
  background: var(--th-bg-subtle);
  color: var(--th-text-muted);
  font-weight: 600;
}

.th-panel tbody tr:last-child td {
  border-bottom: 0;
}

.th-error {
  color: var(--th-danger);
  font-size: 14px;
  font-weight: 600;
}

/* ——— Keyboard ——— */

.th-kb-display {
  min-height: 48px;
  padding: 12px;
  background: var(--th-bg-subtle);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  font-size: 15px;
  margin-bottom: 12px;
  word-break: break-all;
}

.th-kb-display:focus {
  outline: 2px solid var(--th-accent);
  outline-offset: 1px;
}

.th-kb-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--th-text-muted);
  margin-bottom: 12px;
}

.th-kb-grid {
  margin-bottom: 4px;
}

.th-kb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.th-kb-key {
  min-width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--th-bg-subtle);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  font-size: 12px;
  font-weight: 600;
  color: var(--th-text-muted);
  user-select: none;
}

.th-kb-key.wide {
  min-width: 56px;
}

.th-kb-key.space {
  min-width: 120px;
  flex: 1 1 120px;
}

.th-kb-key.active {
  background: var(--th-accent-soft);
  border-color: var(--th-accent);
  color: var(--th-accent);
}

/* ——— SEO body ——— */

.th-tool-app .entry-content,
.th-tool-app .th-seo {
  max-width: 720px;
}

.th-tool-app h2,
.th-related-block h2 {
  margin: 44px 0 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.th-tool-app h3 {
  margin: 22px 0 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.th-tool-app p,
.th-tool-app li {
  line-height: 1.7;
}

.th-tool-app ol,
.th-tool-app ul {
  padding-left: 1.2em;
}

.th-tool-app li + li {
  margin-top: 6px;
}

.th-howto {
  margin: 28px 0 12px;
  padding: 20px 20px 12px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-lg);
  background: var(--th-bg-subtle);
}

.th-howto h2 {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--th-border);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.th-howto ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: th-how;
}

.th-howto li {
  position: relative;
  margin: 0;
  padding: 12px 0 12px 40px;
  counter-increment: th-how;
}

.th-howto li + li {
  margin-top: 0;
  border-top: 1px solid var(--th-border);
}

.th-howto li::before {
  content: counter(th-how);
  position: absolute;
  left: 0;
  top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--th-accent-soft);
  color: var(--th-accent);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
}

.th-howto p {
  margin: 0 0 12px;
}

.th-tool-app img {
  max-width: 100%;
  height: auto;
}

.th-related {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

.th-disclaimer {
  margin-top: 40px;
  padding: 16px;
  background: var(--th-disclaimer-bg);
  border: 1px solid #eadfbf;
  border-radius: var(--th-radius);
  font-size: 13px;
  color: var(--th-text-muted);
}

/* Ad slots: no reserved blank band. 8px around the unit, 24px before
   interactive tool controls. Collapse unfilled units (AdSense docs). */
.th-app .code-block {
  padding: 0;
  height: auto !important;
  min-height: 0 !important;
}

.th-app .code-block br {
  display: none;
}

.th-app .code-block iframe {
  display: block;
}

.th-app .adsbygoogle,
.th-app ins.adsbygoogle {
  margin: 0;
}

.th-app ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}

.th-app .code-block:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  display: none !important;
}

.th-app .th-tool-app > .code-block:first-child {
  margin: 8px 0 24px !important;
}

.th-foot {
  border-top: 1px solid var(--th-border);
  background: var(--th-surface);
  padding: 26px 16px 32px;
  text-align: center;
  font-size: 13px;
  color: var(--th-text-muted);
}

.th-foot-brand {
  margin: 0 0 6px;
  color: var(--th-text-muted);
}

.th-foot-brand strong {
  color: var(--th-text);
}

.th-foot-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 10px;
}

.th-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--th-text-muted);
  text-decoration: none;
}

.th-foot a:hover {
  color: var(--th-text);
  text-decoration: underline;
}

.th-foot a:focus-visible {
  outline: 2px solid var(--th-accent);
  outline-offset: 2px;
}

/* ——— Responsive ——— */

@media (min-width: 640px) {
  .th-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .th-related {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .th-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

@media (max-width: 959px) {
  .th-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  body.admin-bar .th-top {
    top: 46px;
  }

  .th-top-inner {
    padding: 6px 16px 8px;
    gap: 0 12px;
  }

  .th-lang {
    margin-left: auto;
  }

  .th-lang-select {
    min-height: 36px;
    font-size: 12px;
  }

  .th-brand {
    flex: 0 0 auto;
    font-size: 17px;
  }

  .th-category-nav {
    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .th-category-nav::-webkit-scrollbar {
    display: none;
  }

  .th-nav {
    width: max-content;
    flex-wrap: nowrap;
    gap: 2px;
  }

  .th-nav a {
    width: auto;
    padding: 8px 11px;
    white-space: nowrap;
  }

  .th-sec-title {
    scroll-margin-top: 82px;
  }

  .th-wrap {
    padding: 28px 20px 68px;
  }

  .th-crumb a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

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

  .th-hero p {
    font-size: 16px;
  }

  .th-tool-search {
    margin-top: 20px;
    padding: 8px 14px;
  }

  .th-tool-search kbd {
    display: none;
  }

  .th-search-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .th-filter-list {
    gap: 8px;
  }

  .th-filter {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    min-width: calc(50% - 8px);
    text-align: center;
  }

  .th-tool-h {
    font-size: 26px;
  }

  .th-panel {
    padding: 22px;
    box-shadow: 0 8px 24px rgba(23, 32, 51, 0.07);
  }

  .th-howto {
    margin-top: 22px;
    padding: 16px 16px 10px;
  }

  .th-stat strong {
    font-size: 28px;
  }

  .th-kb-key {
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0 8px;
    font-size: 13px;
  }

  .th-kb-key.wide {
    min-width: 64px;
  }

  .th-kb-key.space {
    min-width: 100%;
    flex: 1 1 100%;
  }
}

@media (max-width: 520px) {
  .th-top-inner {
    flex-wrap: nowrap;
  }

  .th-brand-product {
    display: none;
  }

  .th-nav a {
    min-height: 40px;
    padding: 6px 9px;
    font-size: 13px;
  }

  .th-hero p,
  .th-lead {
    font-size: 15px;
  }

  .th-hero h1 {
    font-size: clamp(24px, 8vw, 30px);
  }

  .th-tool-search {
    margin-top: 18px;
    padding: 8px 12px;
    border-radius: 14px;
  }

  .th-tool-search input {
    font-size: 16px;
  }

  .th-search-meta span:last-child::before {
    display: none;
  }

  .th-filter-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-right: 0;
    padding-right: 0;
    overflow: visible;
  }

  .th-filter {
    min-width: 0;
    width: 100%;
    flex: none;
  }

  .th-featured {
    margin: 40px -4px 0;
    padding: 22px 18px;
    border-radius: 18px;
  }

  .th-featured-grid {
    grid-template-columns: 1fr;
  }

  .th-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .th-section-head > p {
    display: none;
  }

  .th-catalog-head {
    margin-top: 46px;
  }

  .th-card {
    min-height: 126px;
    padding: 17px;
  }

  .th-tool-h {
    font-size: 30px;
  }

  .th-trust-row {
    gap: 6px 12px;
    margin-bottom: 24px;
  }

  .th-trust-row span + span::before {
    display: none;
  }

  .th-panel {
    margin-right: -4px;
    margin-left: -4px;
    padding: 20px;
    border-radius: 16px;
  }

  .th-actions {
    gap: 8px;
  }

  .th-btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .th-btn-ghost {
    flex: 1 1 100%;
    width: 100%;
  }

  .th-stats {
    grid-template-columns: 1fr;
  }

  .th-stat {
    min-height: 92px;
  }

  .th-foot-links {
    gap: 0 6px;
  }
}

@media (max-width: 360px) {
  .th-field-row {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .th-card,
  .th-btn,
  .th-field input,
  .th-field textarea {
    transition: none;
  }

  .th-card:hover {
    transform: none;
  }
}

.th-quiz-item {
  margin: 0 0 18px;
}

.th-quiz-item p {
  margin: 0 0 8px;
  font-weight: 600;
}

.th-calc-pad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}

.th-calc-pad button {
  min-height: 48px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  background: var(--th-surface);
  color: var(--th-text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.th-calc-pad button:hover {
  background: var(--th-bg-subtle);
}

.th-calc-display {
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--th-border-strong);
  border-radius: var(--th-radius);
  background: var(--th-bg);
  font-size: 22px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.th-react-box {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--th-radius-lg);
  border: 1px solid var(--th-border);
  background: var(--th-bg-subtle);
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  padding: 20px;
  user-select: none;
}

.th-aim-stage {
  position: relative;
  height: 280px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-lg);
  background: var(--th-bg-subtle);
  overflow: hidden;
}

.th-note-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.th-color-plate {
  width: min(280px, 100%);
  aspect-ratio: 1;
  margin: 8px auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  font-weight: 800;
  letter-spacing: 4px;
  user-select: none;
}

.th-pdf-pages {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.th-pdf-page img {
  display: block;
  width: 100%;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  background: var(--th-surface);
}

.th-pdf-page a {
  display: inline-flex;
  margin-top: 8px;
}
